wip docs for remote deploys
This commit is contained in:
parent
ece48b65b7
commit
827ba897ba
7 changed files with 1422 additions and 146 deletions
1249
flake.lock
generated
1249
flake.lock
generated
File diff suppressed because it is too large
Load diff
28
flake.nix
28
flake.nix
|
|
@ -1,13 +1,17 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
|
|
||||||
|
i001.url = "path:./hosts/i001";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
deploy-rs,
|
||||||
...
|
...
|
||||||
}:
|
}@inputs:
|
||||||
let
|
let
|
||||||
# Utilities
|
# Utilities
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
@ -48,13 +52,31 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
packages = [
|
||||||
deploy_oracle
|
deploy_oracle
|
||||||
deploy_linode
|
deploy_linode
|
||||||
deploy-rs
|
pkgs.deploy-rs
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
deploy = {
|
||||||
|
sshUser = "root";
|
||||||
|
sshOpts = [
|
||||||
|
"-i"
|
||||||
|
"/run/agenix/nix2nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
i001 = {
|
||||||
|
hostname = "10.12.14.119"; # NOTE not stable ip check...
|
||||||
|
profiles.system = {
|
||||||
|
user = "root";
|
||||||
|
path = deploy-rs.lib.x86_64-linux.activate.nixos inputs.i001.nixosConfigurations.i001;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
112
hosts/i001/flake.lock
generated
112
hosts/i001/flake.lock
generated
|
|
@ -3,11 +3,11 @@
|
||||||
"common": {
|
"common": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "flakes/common",
|
"dir": "flakes/common",
|
||||||
"lastModified": 1765991726,
|
"lastModified": 1766010612,
|
||||||
"narHash": "sha256-oblFg2soKB7yi9DDXbzWKn8tnA1aoojKrA3+aVx+wb0=",
|
"narHash": "sha256-3aKy/FcWFSeA/1bJbslAvWDSXLF4yygykt5OpHK6cTQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "75b37cc9ec2014dd8dea941bb3faf9c0b665c6d0",
|
"rev": "ece48b65b79ac2caf6c6be771a9f1809de8bc65b",
|
||||||
"revCount": 941,
|
"revCount": 949,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
},
|
},
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "flakes/de_plasma",
|
"dir": "flakes/de_plasma",
|
||||||
"lastModified": 1765991726,
|
"lastModified": 1766010612,
|
||||||
"narHash": "sha256-oblFg2soKB7yi9DDXbzWKn8tnA1aoojKrA3+aVx+wb0=",
|
"narHash": "sha256-3aKy/FcWFSeA/1bJbslAvWDSXLF4yygykt5OpHK6cTQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "75b37cc9ec2014dd8dea941bb3faf9c0b665c6d0",
|
"rev": "ece48b65b79ac2caf6c6be771a9f1809de8bc65b",
|
||||||
"revCount": 941,
|
"revCount": 949,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
},
|
},
|
||||||
|
|
@ -37,6 +37,42 @@
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"deploy-rs": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1762286984,
|
||||||
|
"narHash": "sha256-9I2H9x5We6Pl+DBYHjR1s3UT8wgwcpAH03kn9CqtdQc=",
|
||||||
|
"owner": "serokell",
|
||||||
|
"repo": "deploy-rs",
|
||||||
|
"rev": "9c870f63e28ec1e83305f7f6cb73c941e699f74f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "serokell",
|
||||||
|
"repo": "deploy-rs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733328505,
|
||||||
|
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -61,7 +97,7 @@
|
||||||
},
|
},
|
||||||
"home-manager_2": {
|
"home-manager_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765979862,
|
"lastModified": 1765979862,
|
||||||
|
|
@ -110,6 +146,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1743014863,
|
||||||
|
"narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765762245,
|
"lastModified": 1765762245,
|
||||||
"narHash": "sha256-3iXM/zTqEskWtmZs3gqNiVtRTsEjYAedIaLL0mSBsrk=",
|
"narHash": "sha256-3iXM/zTqEskWtmZs3gqNiVtRTsEjYAedIaLL0mSBsrk=",
|
||||||
|
|
@ -125,7 +177,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765838191,
|
"lastModified": 1765838191,
|
||||||
"narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
|
"narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
|
||||||
|
|
@ -141,7 +193,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764776358,
|
"lastModified": 1764776358,
|
||||||
"narHash": "sha256-MxXSCRiV7DI5U3Ra1UxVJTTUyKsONAE8+8QdSXsGIhA=",
|
"narHash": "sha256-MxXSCRiV7DI5U3Ra1UxVJTTUyKsONAE8+8QdSXsGIhA=",
|
||||||
|
|
@ -1043,15 +1095,16 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"common": "common",
|
"common": "common",
|
||||||
"de_plasma": "de_plasma",
|
"de_plasma": "de_plasma",
|
||||||
|
"deploy-rs": "deploy-rs",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"ros_neovim": "ros_neovim"
|
"ros_neovim": "ros_neovim"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ros_neovim": {
|
"ros_neovim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_5",
|
||||||
"nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim",
|
"nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim",
|
||||||
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim",
|
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim",
|
||||||
"nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring",
|
"nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
|
@ -1142,6 +1195,39 @@
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim";
|
ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim";
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
# preservation.url = "github:nix-community/preservation";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -36,7 +35,6 @@
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
# inputs.preservation.nixosModules.preservation
|
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
|
|
||||||
inputs.ros_neovim.nixosModules.default
|
inputs.ros_neovim.nixosModules.default
|
||||||
|
|
@ -44,14 +42,14 @@
|
||||||
ringofstorms-nvim.includeAllRuntimeDependencies = true;
|
ringofstorms-nvim.includeAllRuntimeDependencies = true;
|
||||||
})
|
})
|
||||||
|
|
||||||
# inputs.de_plasma.nixosModules.default
|
inputs.de_plasma.nixosModules.default
|
||||||
# ({
|
({
|
||||||
# ringofstorms.dePlasma = {
|
ringofstorms.dePlasma = {
|
||||||
# enable = true;
|
enable = true;
|
||||||
# gpu.intel.enable = true;
|
gpu.intel.enable = true;
|
||||||
# sddm.autologinUser = "luser";
|
sddm.autologinUser = "luser";
|
||||||
# };
|
};
|
||||||
# })
|
})
|
||||||
|
|
||||||
inputs.common.nixosModules.essentials
|
inputs.common.nixosModules.essentials
|
||||||
inputs.common.nixosModules.git
|
inputs.common.nixosModules.git
|
||||||
|
|
@ -69,7 +67,6 @@
|
||||||
./hardware-mounts.nix
|
./hardware-mounts.nix
|
||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
./impermanence-tools.nix
|
./impermanence-tools.nix
|
||||||
# ./preservation.nix
|
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ cmd_diff() {
|
||||||
|
|
||||||
# Build list of bind mounts backed by /persist so we can filter them out.
|
# Build list of bind mounts backed by /persist so we can filter them out.
|
||||||
local persist_mounts
|
local persist_mounts
|
||||||
persist_mounts=$(awk '$2 ~ /^\/persist($|\//) { print $2 }' /proc/self/mounts || true)
|
persist_mounts=$(awk '$2 ~ "^/persist(/|$)" { print $2 }' /proc/self/mounts || true)
|
||||||
|
|
||||||
is_persist_backed() {
|
is_persist_backed() {
|
||||||
local p
|
local p
|
||||||
|
|
@ -590,3 +590,36 @@ cmd_diff() {
|
||||||
browse_diff_tree "$snapshot_name" "$snapshot_dir" "$diff_list" "$initial_prefix"
|
browse_diff_tree "$snapshot_name" "$snapshot_dir" "$diff_list" "$initial_prefix"
|
||||||
rm -f "$diff_list"
|
rm -f "$diff_list"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local cmd
|
||||||
|
cmd="$1"
|
||||||
|
shift || true
|
||||||
|
|
||||||
|
case "$cmd" in
|
||||||
|
gc)
|
||||||
|
cmd_gc "$@"
|
||||||
|
;;
|
||||||
|
ls)
|
||||||
|
cmd_ls "$@"
|
||||||
|
;;
|
||||||
|
diff)
|
||||||
|
cmd_diff "$@"
|
||||||
|
;;
|
||||||
|
--help|-h|help)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown subcommand: $cmd" >&2
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
preservation = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Preserve system-wide directories and files at /persist
|
|
||||||
preserveAt = {
|
|
||||||
"/persist" = {
|
|
||||||
commonMountOptions = [
|
|
||||||
"x-gvfs-hide"
|
|
||||||
"x-gdu.hide"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Directories to persist (bind-mount by default)
|
|
||||||
directories = [
|
|
||||||
"/var/log"
|
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/systemd/coredump"
|
|
||||||
"/var/lib/systemd/timers"
|
|
||||||
|
|
||||||
"/etc/nixos"
|
|
||||||
"/etc/ssh"
|
|
||||||
|
|
||||||
"/etc/NetworkManager/system-connections"
|
|
||||||
"/var/lib/bluetooth"
|
|
||||||
"/var/lib/NetworkManager"
|
|
||||||
"/var/lib/iwd"
|
|
||||||
"/var/lib/fail2ban"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Files to persist
|
|
||||||
files = [
|
|
||||||
# Persist machine-id early (initrd) via symlink for ConditionFirstBoot compatibility
|
|
||||||
{ file = "/etc/machine-id"; inInitrd = true; how = "symlink"; configureParent = true; }
|
|
||||||
|
|
||||||
# SSH host keys: ensure correct handling with symlinks
|
|
||||||
{ file = "/etc/ssh/ssh_host_rsa_key"; how = "symlink"; configureParent = true; }
|
|
||||||
{ file = "/etc/ssh/ssh_host_ed25519_key"; how = "symlink"; configureParent = true; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# Per-user persistence
|
|
||||||
users = {
|
|
||||||
luser = {
|
|
||||||
directories = [
|
|
||||||
".ssh"
|
|
||||||
".gnupg"
|
|
||||||
|
|
||||||
"projects"
|
|
||||||
".config/nixos-config"
|
|
||||||
|
|
||||||
".config/atuin"
|
|
||||||
".local/share/atuin"
|
|
||||||
|
|
||||||
".local/share/zoxide"
|
|
||||||
|
|
||||||
# KDE
|
|
||||||
".config/kdeconnect"
|
|
||||||
|
|
||||||
# Chrome
|
|
||||||
".config/google-chrome"
|
|
||||||
|
|
||||||
# neovim ros_neovim
|
|
||||||
".local/state/nvim_ringofstorms_helium"
|
|
||||||
];
|
|
||||||
files = [ ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Configure intermediate system-wide directories that may need custom modes
|
|
||||||
# (Example: none required beyond defaults here.)
|
|
||||||
|
|
||||||
# Let systemd-machine-id-commit write the transient ID to the persistent volume.
|
|
||||||
# This avoids activation failure when /etc/machine-id is a symlink.
|
|
||||||
systemd.services.systemd-machine-id-commit = {
|
|
||||||
unitConfig.ConditionPathIsMountPoint = [
|
|
||||||
""
|
|
||||||
"/persist/etc/machine-id"
|
|
||||||
];
|
|
||||||
serviceConfig.ExecStart = [
|
|
||||||
""
|
|
||||||
"systemd-machine-id-setup --commit --root /persist"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# If you need custom ownership/modes for parent directories, use tmpfiles:
|
|
||||||
# systemd.tmpfiles.settings.preservation = {
|
|
||||||
# "/foo".d = { user = "foo"; group = "bar"; mode = "0775"; };
|
|
||||||
# "/foo/bar".d = { user = "bar"; group = "bar"; mode = "0755"; };
|
|
||||||
# };
|
|
||||||
}
|
|
||||||
|
|
@ -5,42 +5,30 @@
|
||||||
- custom iso installer
|
- custom iso installer
|
||||||
- `nix build .\#packages.x86_64-linux.iso-minimal-stable`
|
- `nix build .\#packages.x86_64-linux.iso-minimal-stable`
|
||||||
|
|
||||||
## Format main drive with boot partition
|
## Format main drive with boot, bcachefs, & swap
|
||||||
|
|
||||||
### Partition with GPT
|
### Partition with GPT table
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
DEVICE=sda
|
DEVICE=sda
|
||||||
parted /dev/$DEVICE -- mklabel gpt
|
parted /dev/$DEVICE -- mklabel gpt
|
||||||
parted /dev/$DEVICE -- mkpart ESP fat32 1MB 2GB
|
parted /dev/$DEVICE -- mkpart ESP fat32 1MB 2GB
|
||||||
parted /dev/$DEVICE -- set 1 esp on
|
parted /dev/$DEVICE -- set 1 esp on
|
||||||
|
# with swap
|
||||||
parted /dev/$DEVICE -- mkpart PRIMARY 2GB -8GB
|
parted /dev/$DEVICE -- mkpart PRIMARY 2GB -8GB
|
||||||
parted /dev/$DEVICE -- mkpart SWAP linux-swap -8GB 100%
|
parted /dev/$DEVICE -- mkpart SWAP linux-swap -8GB 100%
|
||||||
# OR
|
# OR no swap
|
||||||
parted /dev/$DEVICE -- mkpart PRIMARY 2GB 100%
|
parted /dev/$DEVICE -- mkpart PRIMARY 2GB 100%
|
||||||
```
|
```
|
||||||
|
|
||||||
### Format partitions
|
### Format partitions
|
||||||
|
|
||||||
- boot
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
BOOT=sda1
|
BOOT=sda1
|
||||||
mkfs.fat -F 32 -n BOOT /dev/$BOOT
|
mkfs.fat -F 32 -n BOOT /dev/$BOOT
|
||||||
```
|
|
||||||
|
|
||||||
- primary
|
|
||||||
|
|
||||||
```sh
|
|
||||||
PRIMARY=sda2
|
PRIMARY=sda2
|
||||||
bcachefs format --label=nixos --encrypted /dev/$PRIMARY
|
bcachefs format --label=nixos --encrypted /dev/$PRIMARY
|
||||||
bcachefs unlock /dev/$PRIMARY
|
bcachefs unlock /dev/$PRIMARY
|
||||||
```
|
|
||||||
|
|
||||||
- swap (optional)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
SWAP=sda3
|
SWAP=sda3
|
||||||
mkswap /dev/$SWAP
|
mkswap /dev/$SWAP
|
||||||
swapon /dev/$SWAP
|
swapon /dev/$SWAP
|
||||||
|
|
@ -90,15 +78,15 @@ nixos-generate-config --root /mnt
|
||||||
- Run nixos-install
|
- Run nixos-install
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# If setup remotely we can install remotely as well like this
|
||||||
nixos-install --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#i001"
|
nixos-install --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#i001"
|
||||||
```
|
```
|
||||||
|
|
||||||
After boot
|
- After boot
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
nh os switch "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#nixosConfigurations.i001"
|
nh os switch "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#nixosConfigurations.i001"
|
||||||
```
|
# OR
|
||||||
or
|
|
||||||
```sh
|
|
||||||
cd ~/.config
|
cd ~/.config
|
||||||
git clone https://git.joshuabell.xyz/ringofstorms/dotfiles nixos-config
|
git clone https://git.joshuabell.xyz/ringofstorms/dotfiles nixos-config
|
||||||
cd ~/.config/nixos-config/hosts/i001
|
cd ~/.config/nixos-config/hosts/i001
|
||||||
|
|
@ -107,7 +95,9 @@ cd ~/.config/nixos-config/hosts/i001
|
||||||
or from host machine? TODO haven't tried this fully
|
or from host machine? TODO haven't tried this fully
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
NIX_SSHOPTS="-i /run/agenix/nix2nix" sudo nixos-rebuild switch --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#i001" --target-host luser@10.12.14.157 --build-host localhost
|
NIX_SSHOPTS="-i /run/agenix/nix2nix" sudo nixos-rebuild switch --flake "~/.config/nixos-config/hosts/i001#nixosConfigurations.i001" --target-host luser@10.12.14.119 --build-host localhost
|
||||||
|
NIX_SSHOPTS="-i /run/agenix/nix2nix" sudo nixos-rebuild switch --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#i001" --target-host luser@10.12.14.119 --build-host localhost
|
||||||
|
nh os switch -H i001 --target-host luser@10.12.14.119 --build-host localhost -n ".config/nixos-config/hosts/i001"
|
||||||
```
|
```
|
||||||
|
|
||||||
## USB Key
|
## USB Key
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue