machines: add a rescue machine for live-booting

This commit is contained in:
2022-07-14 16:21:59 -07:00
parent 8f37edb402
commit d4d345ca12
3 changed files with 29 additions and 0 deletions

View File

@@ -72,6 +72,7 @@
machines.desko = decl-bootable-machine { name = "desko"; system = "x86_64-linux"; }; machines.desko = decl-bootable-machine { name = "desko"; system = "x86_64-linux"; };
machines.lappy = decl-bootable-machine { name = "lappy"; system = "x86_64-linux"; }; machines.lappy = decl-bootable-machine { name = "lappy"; system = "x86_64-linux"; };
machines.moby = decl-bootable-machine { name = "moby"; system = "aarch64-linux"; }; machines.moby = decl-bootable-machine { name = "moby"; system = "aarch64-linux"; };
machines.rescue = decl-bootable-machine { name = "rescue"; system = "x86_64-linux"; };
in { in {
nixosConfigurations = builtins.mapAttrs (name: value: value.nixosConfiguration) machines; nixosConfigurations = builtins.mapAttrs (name: value: value.nixosConfiguration) machines;
imgs = builtins.mapAttrs (name: value: value.img) machines; imgs = builtins.mapAttrs (name: value: value.img) machines;

View File

@@ -0,0 +1,15 @@
{ pkgs, ... }:
{
imports = [
./fs.nix
];
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
colinsane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
# TODO: enable root login via ssh
# docs: https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion
system.stateVersion = "21.05";
}

13
machines/rescue/fs.nix Normal file
View File

@@ -0,0 +1,13 @@
{ ... }:
{
# root is a tmpfs so that we have an ephemeral system ("impermanence" handles the state)
fileSystems."/" = {
device = "/dev/disk/by-uuid/44445555-6666-7777-8888-999900001111";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2222-3333";
fsType = "vfat";
};
}