Almost ready for prime time?

This commit is contained in:
Daniel Flanagan 2023-10-03 14:50:00 -05:00
parent ab4461c26e
commit 3e77b71198
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
8 changed files with 227 additions and 198 deletions

View file

@ -159,21 +159,19 @@
}, },
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": "nixpkgs_4"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1695108154, "lastModified": 1696145345,
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", "narHash": "sha256-3dM7I/d4751SLPJah0to1WBlWiyzIiuCEUwJqwBdmr4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "07682fff75d41f18327a871088d20af2710d4744", "rev": "6f9b5b83ad1f470b3d11b8a9fe1d5ef68c7d0e30",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05", "ref": "master",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -195,6 +193,22 @@
} }
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": {
"lastModified": 1696039360,
"narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "32dcb45f66c0487e92db8303a798ebc548cadedc",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1694908564, "lastModified": 1694908564,
"narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=",
@ -260,16 +274,16 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1696039360, "lastModified": 1696019113,
"narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=", "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "32dcb45f66c0487e92db8303a798ebc548cadedc", "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-23.05", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -297,7 +311,7 @@
"hardware": "hardware", "hardware": "hardware",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
@ -330,7 +344,7 @@
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1695284550, "lastModified": 1695284550,

View file

@ -1,10 +1,9 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-23.05"; home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# TODO: avoid my manual workaround of `nix profile install helix#helix --priority 4` # TODO: avoid my manual workaround of `nix profile install helix#helix --priority 4`
helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b"; helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b";
@ -23,7 +22,7 @@
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs-stable,
nixpkgs-unstable, nixpkgs-unstable,
home-manager, home-manager,
... ...
@ -38,15 +37,15 @@
"x86_64-darwin" "x86_64-darwin"
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs-stable.lib.genAttrs systems;
in { in {
# Your custom packages # Your custom packages
# Acessible through 'nix build', 'nix shell', etc # Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs-stable.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt' # Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt' # Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); formatter = forAllSystems (system: nixpkgs-unstable.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays # Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays {inherit inputs;};
@ -62,43 +61,41 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = let nixosConfigurations = let
mkNixosSystem = system: modules: # mkNixosSystem = system: modules:
nixpkgs.lib.nixosSystem { # nixpkgs-stable.lib.nixosSystem {
system = system;
specialArgs = {
inherit inputs outputs system;
flake = self;
};
modules = [self.nixosModules.common] ++ modules;
};
# mkNixosUnstableSystem = system: modules:
# nixpkgs-unstable.lib.nixosSystem {
# system = system; # system = system;
# specialArgs = { # specialArgs = {
# inherit inputs outputs system; # inherit inputs outputs system;
# flake = self; # flake = self;
# }; # };
# modules = [ self.nixosModules.common ] ++ modules; # modules = [self.nixosModules.common] ++ modules;
# }; # };
mkNixosUnstableSystem = system: modules:
nixpkgs-unstable.lib.nixosSystem {
system = system;
specialArgs = {
inherit inputs outputs system;
flake = self;
};
modules = [ self.nixosModules.common ] ++ modules;
};
in { in {
dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon]; dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon];
thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker]; thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker];
}; };
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = let
"daniel@lyte.dev" = home-manager.lib.homeManagerConfiguration { mkHome = system: modules:
pkgs = nixpkgs.legacyPackages.x86_64-linux; home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {inherit inputs outputs;}; pkgs = nixpkgs-unstable.legacyPackages.${system};
modules = [./home]; extraSpecialArgs = {inherit inputs outputs system;};
}; modules = modules;
};
"daniel.flanagan@hq.bill.com" = home-manager.lib.homeManagerConfiguration { in {
pkgs = nixpkgs.legacyPackages.aarch64-darwin; "daniel" = mkHome "x86_64-linux" [./home ./home/linux.nix];
extraSpecialArgs = {inherit inputs outputs;}; "daniel.flanagan" = mkHome "aarch64-darwin" [./home];
modules = [./home];
};
}; };
# TODO: darwin for work? # TODO: darwin for work?

View file

@ -1,6 +1,8 @@
{ {
pkgs, pkgs,
lib, lib,
system,
inputs,
... ...
}: let }: let
email = "daniel@lyte.dev"; email = "daniel@lyte.dev";
@ -13,12 +15,7 @@ in {
# }; # };
# }; # };
# TODO: fonts? right now I do this: # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module)
# curl -o ~/Downloads/iosevkalyte.tar.zstd https://files.lyte.dev/iosevkalyte/rel/iosevkalyteterm-16.4.0.tar.zstd
# tar --zstd -xvf ~/Downloads/iosevka.tar.zstd
# mkdir -p ~/.local/share/fonts
# cp -r iosevkalyteterm/ttf/* ~/.local/share/fonts
# TODO: I bet I can declare an iosevka font build, too, instead
# TODO: wallpaper? # TODO: wallpaper?
home = { home = {
@ -27,20 +24,18 @@ in {
stateVersion = "23.11"; stateVersion = "23.11";
packages = [ packages = [
# I use rtx for managing the following programs' versions instead of nix: # I use gawk for my fish prompt
# kubectl, aws
pkgs.rtx
# I need gawk for my fish prompt
pkgs.gawk pkgs.gawk
inputs.helix.packages.${system}.helix
pkgs.nil pkgs.nil
pkgs.nixpkgs-fmt pkgs.alejandra
# TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?) # TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?)
(pkgs.buildEnv { (pkgs.buildEnv {
name = "my-scripts-common"; name = "my-scripts-common";
paths = [../scripts/common]; paths = [./scripts/common];
}) })
]; ];
@ -161,7 +156,7 @@ in {
helix = { helix = {
enable = true; enable = true;
package = pkgs.helix; package = inputs.helix.packages.${system}.helix;
languages = { languages = {
language-server = { language-server = {
lexical = { lexical = {
@ -199,8 +194,8 @@ in {
name = "nix"; name = "nix";
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "nixpkgs-fmt"; command = "alejandra";
args = []; args = ["-"];
}; };
} }
{ {
@ -724,8 +719,8 @@ in {
fish = { fish = {
enable = true; enable = true;
# I load long scripts from files for a better editing experience # I load long scripts from files for a better editing experience
shellInit = builtins.readFile ../fish/shellInit.fish; shellInit = builtins.readFile ./fish/shellInit.fish;
interactiveShellInit = builtins.readFile ../fish/interactiveShellInit.fish; interactiveShellInit = builtins.readFile ./fish/interactiveShellInit.fish;
loginShellInit = ""; loginShellInit = "";
functions = { functions = {
# TODO: I think these should be loaded from fish files too for better editor experience? # TODO: I think these should be loaded from fish files too for better editor experience?
@ -808,6 +803,7 @@ in {
eza = { eza = {
enable = true; enable = true;
package = inputs.nixpkgs-unstable.legacyPackages.${system}.eza;
}; };
skim = { skim = {

View file

@ -293,7 +293,7 @@
home.packages = [ home.packages = [
(pkgs.buildEnv { (pkgs.buildEnv {
name = "my-linux-scripts"; name = "my-linux-scripts";
paths = [../scripts/linux]; paths = [./scripts/linux];
}) })
]; ];

View file

@ -2,12 +2,19 @@
config, config,
lib, lib,
inputs, inputs,
# outputs,
system, system,
... ...
}: let }: let
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nixpkgs-stable.legacyPackages.${system};
unstable-pkgs = inputs.nixpkgs-unstable.legacyPackages.${system}; unstable-pkgs = inputs.nixpkgs-unstable.legacyPackages.${system};
in { in {
imports = [
inputs.home-manager.nixosModules.home-manager
];
hardware.enableRedistributableFirmware = true;
services.journald.extraConfig = "SystemMaxUse=1G"; services.journald.extraConfig = "SystemMaxUse=1G";
environment = { environment = {
@ -18,7 +25,7 @@ in {
MANPAGER = "less"; MANPAGER = "less";
}; };
systemPackages = with pkgs; systemPackages = with unstable-pkgs;
[ [
age age
bat bat
@ -30,11 +37,11 @@ in {
curl curl
dog dog
dua dua
eza
fd fd
file file
gnumake gnumake
gron gron
helix
hexyl hexyl
htop htop
iputils iputils
@ -63,8 +70,11 @@ in {
zellij zellij
zstd zstd
] ]
++ (with unstable-pkgs; [ ++ (with inputs.home-manager.packages.${system}; [
eza home-manager
])
++ (with inputs.helix.packages.${system}; [
helix
]); ]);
}; };

View file

@ -1,4 +1,9 @@
{pkgs, inputs, system, ...}: { {
pkgs,
inputs,
system,
...
}: {
# TODO: add a DE and include either plasma or gnome as a fallback? # TODO: add a DE and include either plasma or gnome as a fallback?
imports = [ imports = [
@ -7,131 +12,133 @@
]; ];
# fonts.packages if unstable? # fonts.packages if unstable?
fonts.fonts = with pkgs; [ fonts.packages = with pkgs;
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) [
] ++ (with inputs.nixpkgs-unstable.legacyPackages.${system}; [ (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
(iosevka.override { ]
set = "lyteterm"; ++ (with inputs.nixpkgs-unstable.legacyPackages.${system}; [
privateBuildPlan = '' (iosevka.override {
[buildPlans.iosevka-lyteterm] set = "lyteterm";
family = "IosevkaLyteTerm" privateBuildPlan = ''
spacing = "fontconfig-mono" [buildPlans.iosevka-lyteterm]
serifs = "sans" family = "IosevkaLyteTerm"
export-glyph-names = true spacing = "fontconfig-mono"
serifs = "sans"
export-glyph-names = true
[buildPlans.iosevka-lyteterm.ligations] [buildPlans.iosevka-lyteterm.ligations]
inherits = "dlig" inherits = "dlig"
disables = [ "exeqeqeq", "exeqeq", "exeqeq-dl", "exeq", "ineq", "connected-underscore", "connected-tilde-as-wave" ] disables = [ "exeqeqeq", "exeqeq", "exeqeq-dl", "exeq", "ineq", "connected-underscore", "connected-tilde-as-wave" ]
[buildPlans.iosevka-lyteterm.weights.regular] [buildPlans.iosevka-lyteterm.weights.regular]
shape = 400 shape = 400
menu = 400 menu = 400
css = 400 css = 400
[buildPlans.iosevka-lyteterm.weights.book] [buildPlans.iosevka-lyteterm.weights.book]
shape = 450 shape = 450
menu = 450 menu = 450
css = 450 css = 450
[buildPlans.iosevka-lyteterm.weights.bold] [buildPlans.iosevka-lyteterm.weights.bold]
shape = 700 shape = 700
menu = 700 menu = 700
css = 700 css = 700
[buildPlans.iosevka-lyteterm.weights.black] [buildPlans.iosevka-lyteterm.weights.black]
shape = 900 shape = 900
menu = 900 menu = 900
css = 900 css = 900
# [[buildPlans.iosevka-lyteterm.compatibility-ligatures]] # [[buildPlans.iosevka-lyteterm.compatibility-ligatures]]
# unicode = 57600 # 0xE100 # unicode = 57600 # 0xE100
# featureTag = 'calt' # featureTag = 'calt'
# kequence = '<*>' # kequence = '<*>'
[buildPlans.iosevka-lyteterm.variants] [buildPlans.iosevka-lyteterm.variants]
inherits = "ss01" inherits = "ss01"
[buildPlans.iosevka-lyteterm.variants.design] [buildPlans.iosevka-lyteterm.variants.design]
capital-a = 'curly-serifless' capital-a = 'curly-serifless'
capital-b = 'standard-interrupted-serifless' capital-b = 'standard-interrupted-serifless'
capital-c = 'unilateral-inward-serifed' capital-c = 'unilateral-inward-serifed'
capital-d = 'standard-serifless' capital-d = 'standard-serifless'
capital-g = 'toothless-rounded-inward-serifed-hooked' capital-g = 'toothless-rounded-inward-serifed-hooked'
capital-i = 'serifed' capital-i = 'serifed'
capital-j = 'serifed' capital-j = 'serifed'
capital-k = 'curly-serifless' capital-k = 'curly-serifless'
capital-l = 'motion-serifed' capital-l = 'motion-serifed'
capital-m = 'hanging-serifless' capital-m = 'hanging-serifless'
capital-n = 'asymmetric-serifless' capital-n = 'asymmetric-serifless'
capital-p = 'open-serifless' capital-p = 'open-serifless'
capital-q = 'crossing' capital-q = 'crossing'
capital-r = 'standing-open-serifless' capital-r = 'standing-open-serifless'
capital-s = 'unilateral-inward-serifed' capital-s = 'unilateral-inward-serifed'
capital-t = 'motion-serifed' capital-t = 'motion-serifed'
capital-u = 'toothless-corner-serifless' capital-u = 'toothless-corner-serifless'
capital-v = 'curly-serifless' capital-v = 'curly-serifless'
capital-w = 'curly-serifless' capital-w = 'curly-serifless'
capital-x = 'curly-serifless' capital-x = 'curly-serifless'
capital-y = 'curly-base-serifed' capital-y = 'curly-base-serifed'
capital-z = 'curly-top-serifed-with-crossbar' capital-z = 'curly-top-serifed-with-crossbar'
a = 'double-storey-toothless-corner' a = 'double-storey-toothless-corner'
b = 'toothless-corner-serifless' b = 'toothless-corner-serifless'
c = 'unilateral-inward-serifed' c = 'unilateral-inward-serifed'
d = 'toothless-corner-serifless' d = 'toothless-corner-serifless'
e = 'flat-crossbar' e = 'flat-crossbar'
f = 'tailed' f = 'tailed'
g = 'double-storey-open' g = 'double-storey-open'
# g = 'single-storey-earless-corner-flat-hook' # g = 'single-storey-earless-corner-flat-hook'
h = 'straight-serifless' h = 'straight-serifless'
i = 'tailed-serifed' i = 'tailed-serifed'
j = 'serifed' j = 'serifed'
k = 'curly-serifless' k = 'curly-serifless'
l = 'tailed-serifed' l = 'tailed-serifed'
m = 'earless-corner-double-arch-serifless' m = 'earless-corner-double-arch-serifless'
n = 'earless-corner-straight-serifless' n = 'earless-corner-straight-serifless'
p = 'earless-corner-serifless' p = 'earless-corner-serifless'
q = 'earless-corner-diagonal-tailed-serifless' q = 'earless-corner-diagonal-tailed-serifless'
r = 'earless-corner-serifless' r = 'earless-corner-serifless'
s = 'unilateral-inward-serifed' s = 'unilateral-inward-serifed'
t = 'bent-hook-asymmetric' t = 'bent-hook-asymmetric'
u = 'toothless-corner-serifless' u = 'toothless-corner-serifless'
v = 'curly-serifless' v = 'curly-serifless'
w = 'curly-serifless' w = 'curly-serifless'
x = 'curly-serifless' x = 'curly-serifless'
y = 'curly-turn-serifless' y = 'curly-turn-serifless'
z = 'curly-top-serifed-with-crossbar' z = 'curly-top-serifed-with-crossbar'
# cyrl-capital-ze = 'unilateral-inward-serifed' # cyrl-capital-ze = 'unilateral-inward-serifed'
zero = 'reverse-slashed-split' zero = 'reverse-slashed-split'
one = 'base' one = 'base'
two = 'curly-neck' two = 'curly-neck'
three = 'two-arcs' three = 'two-arcs'
four = 'semi-open-non-crossing' four = 'semi-open-non-crossing'
five = 'upright-arched' five = 'vertical-upper-left-bar'
six = 'straight-bar' six = 'straight-bar'
seven = 'curly-serifed-crossbar' seven = 'curly-serifed-crossbar'
eight = 'two-circles' eight = 'two-circles'
nine = 'straight-bar' nine = 'straight-bar'
tilde = 'low' tilde = 'low'
asterisk = 'penta-low' asterisk = 'penta-low'
underscore = 'above-baseline' underscore = 'above-baseline'
pilcrow = 'low' pilcrow = 'low'
caret = 'low' caret = 'low'
paren = 'flat-arc' paren = 'flat-arc'
brace = 'curly-flat-boundary' brace = 'curly-flat-boundary'
number-sign = 'upright-open' number-sign = 'upright-open'
ampersand = 'upper-open' ampersand = 'upper-open'
at = 'compact' at = 'compact'
dollar = 'interrupted' dollar = 'interrupted'
cent = 'open' cent = 'open'
percent = 'rings-segmented-slash' percent = 'rings-segmented-slash'
bar = 'force-upright' bar = 'force-upright'
ascii-single-quote = 'raised-comma' ascii-single-quote = 'raised-comma'
ascii-grave = 'straight' ascii-grave = 'straight'
question = 'smooth' question = 'smooth'
punctuation-dot = 'round' punctuation-dot = 'round'
''; '';
}) })
]); ]);
hardware = { hardware = {
opengl = { opengl = {

View file

@ -5,12 +5,14 @@
lib, lib,
config, config,
pkgs, pkgs,
modulesPath,
... ...
}: { }: {
networking.hostName = "dragon"; networking.hostName = "dragon";
imports = imports =
[ [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard flake.diskoConfigurations.standard
] ]
@ -76,7 +78,8 @@
# hardware # hardware
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"];
boot.kernelModules = ["kvm-amd"];
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

View file

@ -20,7 +20,7 @@ ln -s $PWD/pre-commit.bash .git/hooks/pre-commit
## NixOS ## NixOS
```shell_session ```shell_session
nixos-rebuild --flake git+https://git.lyte.dev/lytedev/nix switch nixos-rebuild switch --flake git+https://git.lyte.dev/lytedev/nix
``` ```
## Not NixOS ## Not NixOS
@ -36,8 +36,9 @@ $ home-manager switch --flake git+https://git.lyte.dev/lytedev/nix
## Push NixOS Config ## Push NixOS Config
```bash ```bash
nix run nixpkgs#nixos-rebuild -- --flake 'git+https://git.lyte.dev/lytedev/nix#host' \ host=your_host
--target-host root@host --build-host root@host \ nix run nixpkgs#nixos-rebuild -- --flake "git+https://git.lyte.dev/lytedev/nix#$host" \
--target-host "root@$host" --build-host "root@$host" \
switch --show-trace switch --show-trace
``` ```
@ -47,7 +48,8 @@ nix run nixpkgs#nixos-rebuild -- --flake 'git+https://git.lyte.dev/lytedev/nix#h
# initialize a delayed reboot by a process you can kill later if things look good # initialize a delayed reboot by a process you can kill later if things look good
# note that the amount of time you give it probably needs to be enough time to both complete the upgrade # note that the amount of time you give it probably needs to be enough time to both complete the upgrade
# _and_ perform whatever testing you need # _and_ perform whatever testing you need
ssh -t root@host "bash -c ' host=your_host
ssh -t "root@$host" "bash -c '
set -m set -m
(sleep 300; reboot;) & (sleep 300; reboot;) &
jobs -p jobs -p
@ -59,8 +61,8 @@ ssh -t root@host "bash -c '
# we will test things and make sure it works first # we will test things and make sure it works first
# if it fails, the reboot we started previously will automatically kick in once the timeout is reached # if it fails, the reboot we started previously will automatically kick in once the timeout is reached
# and the machine will boot to the now-previous iteration # and the machine will boot to the now-previous iteration
nix run nixpkgs#nixos-rebuild -- --flake 'git+https://git.lyte.dev/lytedev/nix#host' \ nix run nixpkgs#nixos-rebuild -- --flake "git+https://git.lyte.dev/lytedev/nix#$host" \
--target-host root@host --build-host root@host \ --target-host "root@$host" --build-host "root@$host" \
test --show-trace test --show-trace
# however you like, verify the system is running as expected # however you like, verify the system is running as expected
@ -73,7 +75,7 @@ nix run nixpkgs#nixos-rebuild -- --flake 'git+https://git.lyte.dev/lytedev/nix#h
# if we still have ssh access and the machine fails testing, just rollback # if we still have ssh access and the machine fails testing, just rollback
# instead of waiting for the reboot # instead of waiting for the reboot
# TODO: this is not tested yet # TODO: this is not tested yet
ssh root@beefcake nixos-rebuild --rollback switch ssh "root@$host" nixos-rebuild --rollback switch
``` ```
## Provisioning New NixOS Hosts ## Provisioning New NixOS Hosts