chore: improve iso

This commit is contained in:
Patrick Großmann 2023-08-30 20:18:26 +02:00
parent 440048e60c
commit 26e8003332
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
9 changed files with 42 additions and 54 deletions

View file

@ -63,6 +63,7 @@
- `formatter` nix code formatter - `formatter` nix code formatter
- `hosts` host meta declaration - `hosts` host meta declaration
- `pkgs` nixpkgs - `pkgs` nixpkgs
- `packages` additional packages
- `secretsConfig` meta configuration for secrets - `secretsConfig` meta configuration for secrets
- `stateVersion` global stateversion used by nixos and home-manager to determine default config - `stateVersion` global stateversion used by nixos and home-manager to determine default config
@ -77,8 +78,8 @@
1. Fill `fs.nix` 1. Fill `fs.nix`
2. Don't forget to add necesarry config for filesystems, etc. 2. Don't forget to add necesarry config for filesystems, etc.
3. Generate ISO image with `nix build --print-out-paths --no-link .#images.<target-system>.live-iso` 3. Generate ISO image with `nix build --print-out-paths --no-link .#images.<target-system>.live-iso`
- This might take multiple minutes(~10)
3. Copy ISO to usb and boot 3. Copy ISO to usb and boot
5. Copy installer from local machine to live systemd
## Deploy ## Deploy

View file

@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: { }: {
# to allow all users to access hm managed persistent folders # to allow all users to access hm managed persistent folders
@ -39,4 +40,16 @@
"/var/lib/bluetooth" "/var/lib/bluetooth"
]; ];
}; };
# After importing the rpool, rollback the root system to be empty.
boot.initrd.systemd.services.impermanence-root = {
wantedBy = ["initrd.target"];
after = ["zfs-import-rpool.service"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
};
};
} }

View file

@ -34,7 +34,7 @@
</fontconfig> </fontconfig>
''; '';
}; };
fonts = with pkgs; [ packages = with pkgs; [
(nerdfonts.override {fonts = ["FiraCode"];}) (nerdfonts.override {fonts = ["FiraCode"];})
ibm-plex ibm-plex
dejavu_fonts dejavu_fonts

View file

@ -18,8 +18,6 @@
../common/hardware/yubikey.nix ../common/hardware/yubikey.nix
../common/hardware/zfs.nix ../common/hardware/zfs.nix
./smb-mounts.nix
./net.nix ./net.nix
./fs.nix ./fs.nix

View file

@ -7,7 +7,7 @@
disk = { disk = {
m2-ssd = { m2-ssd = {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/${config.secrets.secrets.local.disk.m2-ssd}"; device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.m2-ssd}";
content = with lib.disko.gpt; { content = with lib.disko.gpt; {
type = "table"; type = "table";
format = "gpt"; format = "gpt";
@ -20,7 +20,7 @@
}; };
sata-ssd = { sata-ssd = {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/${config.secrets.secrets.local.disk.sata-ssd}"; device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.sata-ssd}";
content = with lib.disko.gpt; { content = with lib.disko.gpt; {
type = "table"; type = "table";
format = "gpt"; format = "gpt";
@ -31,7 +31,7 @@
}; };
sata-hdd = { sata-hdd = {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/${config.secrets.secrets.local.disk.sata-hdd}"; device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.sata-hdd}";
content = with lib.disko.gpt; { content = with lib.disko.gpt; {
type = "table"; type = "table";
format = "gpt"; format = "gpt";

View file

@ -29,6 +29,4 @@
../../users/patrick ../../users/patrick
]; ];
# Set your time zone.
time.timeZone = "Europe/Berlin";
} }

View file

@ -1,48 +1,26 @@
{pkgs, ...}: { {
fileSystems."/" = { config,
device = "rpool/local/root"; lib,
neededForBoot = true; ...
fsType = "zfs"; }: {
options = ["zfsutil" "X-mount.mkdir"]; disko.devices = {
}; disk = {
m2-ssd = {
fileSystems."/nix" = { type = "disk";
device = "rpool/local/nix"; device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.m2-ssd}";
neededForBoot = true; content = with lib.disko.gpt; {
fsType = "zfs"; type = "table";
options = ["zfsutil" "X-mount.mkdir"]; format = "gpt";
}; partitions = [
(partEfiBoot "boot" "0%" "512MiB")
fileSystems."/persist" = { #(partSwap "swap" "1GiB" "17GiB")
device = "rpool/safe/persist"; (partLuksZfs "rpool" "512MiB" "100%")
neededForBoot = true; ];
fsType = "zfs"; };
options = ["zfsutil" "X-mount.mkdir"]; };
}; };
zpool = with lib.disko.zfs; {
fileSystems."/state" = { rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
device = "rpool/local/state";
neededForBoot = true;
fsType = "zfs";
options = ["zfsutil" "X-mount.mkdir"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/BC47-8FB9";
fsType = "vfat";
};
# After importing the rpool, rollback the root system to be empty.
boot.initrd.systemd.services.impermanence-root = {
wantedBy = ["initrd.target"];
after = ["zfs-import-rpool.service"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
}; };
}; };
swapDevices = [];
} }