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
- `hosts` host meta declaration
- `pkgs` nixpkgs
- `packages` additional packages
- `secretsConfig` meta configuration for secrets
- `stateVersion` global stateversion used by nixos and home-manager to determine default config
@ -77,8 +78,8 @@
1. Fill `fs.nix`
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`
- This might take multiple minutes(~10)
3. Copy ISO to usb and boot
5. Copy installer from local machine to live systemd
## Deploy

View file

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}: {
# to allow all users to access hm managed persistent folders
@ -39,4 +40,16 @@
"/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>
'';
};
fonts = with pkgs; [
packages = with pkgs; [
(nerdfonts.override {fonts = ["FiraCode"];})
ibm-plex
dejavu_fonts

View file

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

View file

@ -7,7 +7,7 @@
disk = {
m2-ssd = {
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; {
type = "table";
format = "gpt";
@ -20,7 +20,7 @@
};
sata-ssd = {
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; {
type = "table";
format = "gpt";
@ -31,7 +31,7 @@
};
sata-hdd = {
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; {
type = "table";
format = "gpt";

View file

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

View file

@ -1,48 +1,26 @@
{pkgs, ...}: {
fileSystems."/" = {
device = "rpool/local/root";
neededForBoot = true;
fsType = "zfs";
options = ["zfsutil" "X-mount.mkdir"];
};
fileSystems."/nix" = {
device = "rpool/local/nix";
neededForBoot = true;
fsType = "zfs";
options = ["zfsutil" "X-mount.mkdir"];
};
fileSystems."/persist" = {
device = "rpool/safe/persist";
neededForBoot = true;
fsType = "zfs";
options = ["zfsutil" "X-mount.mkdir"];
};
fileSystems."/state" = {
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";
{
config,
lib,
...
}: {
disko.devices = {
disk = {
m2-ssd = {
type = "disk";
device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.m2-ssd}";
content = with lib.disko.gpt; {
type = "table";
format = "gpt";
partitions = [
(partEfiBoot "boot" "0%" "512MiB")
#(partSwap "swap" "1GiB" "17GiB")
(partLuksZfs "rpool" "512MiB" "100%")
];
};
};
};
zpool = with lib.disko.zfs; {
rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
};
};
swapDevices = [];
}