hosts: add iso

This makes it possible to build a custom NixOS installer iso with the
tools I want. Ideally I get to a point where I can use the iso like a
live cd with Hyprland and/or dwm installed with everything already
configured.

Build the iso with the following command:

```
nix build .#nixosConfigurations.iso.config.system.build.isoImage
```

Then, use qemu to test the iso:

```
qemu-system-x86_64 -enable-kvm -m 256 -cdrom ./result/iso/nixos-*
```
This commit is contained in:
Donovan Glover 2024-12-15 18:06:15 -05:00
parent 26365c84a2
commit 6009841203
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 19 additions and 0 deletions

View File

@ -84,6 +84,12 @@
specialArgs.nix-config = self; specialArgs.nix-config = self;
modules = listFilesRecursive ./hosts/phone; modules = listFilesRecursive ./hosts/phone;
}; };
iso = nixosSystem {
system = "x86_64-linux";
specialArgs.nix-config = self;
modules = listFilesRecursive ./hosts/iso;
};
}; };
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);

View File

@ -0,0 +1,13 @@
{ pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
];
environment.systemPackages = with pkgs; [
neovim
];
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
}