created disko config for defiant

This commit is contained in:
Leyla Becker 2024-09-17 09:57:13 -05:00
parent 1ddce31f00
commit f7248ab781
2 changed files with 40 additions and 10 deletions

View file

@ -32,7 +32,10 @@
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "c8985fc5"; # TODO: populate this when I get home boot.zfs.extraPools = [ "zpool" ];
# this might need to match the hostId of the installation medium? `head -c 8 /etc/machine-id` NOPE
networking.hostId = "c51763d6";
networking.hostName = "defiant"; # Define your hostname. networking.hostName = "defiant"; # Define your hostname.
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -46,6 +49,9 @@
services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.enable = true;
services.xserver.desktopManager.xterm.enable = false; services.xserver.desktopManager.xterm.enable = false;
# Get rid of xTerm
services.xserver.excludePackages = [ pkgs.xterm ];
# disable computer sleeping # disable computer sleeping
systemd.targets.sleep.enable = false; systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false; systemd.targets.suspend.enable = false;

View file

@ -33,7 +33,32 @@ let
size = "100%"; size = "100%";
content = { content = {
type = "zfs"; type = "zfs";
pool = "zpool"; pool = "zroot";
};
};
};
};
};
cacheDisk = devicePath: swapSize: {
type = "disk";
device = devicePath;
content = {
type = "gpt";
partitions = {
encryptedSwap = {
size = swapSize;
content = {
type = "swap";
randomEncryption = true;
discardPolicy = "both";
resumeDevice = true;
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
}; };
}; };
}; };
@ -48,10 +73,10 @@ in {
hd_13_tb_b = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC"; hd_13_tb_b = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC";
hd_13_tb_c = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH"; hd_13_tb_c = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH";
# ssd_2_tb_a = zfsDisk "/dev/disk/by-id/XXX"; # ssd_2_tb_a = cacheDisk "64G" "/dev/disk/by-id/XXX";
}; };
zpool = { zpool = {
zpool = { zroot = {
type = "zpool"; type = "zpool";
mode = { mode = {
topology = { topology = {
@ -73,7 +98,7 @@ in {
options = { options = {
ashift = "12"; ashift = "12";
}; };
rootFsOptions = { rootFsOptions = {
encryption = "on"; encryption = "on";
keyformat = "hex"; keyformat = "hex";
@ -83,19 +108,18 @@ in {
acltype = "posixacl"; acltype = "posixacl";
"com.sun:auto-snapshot" = "false"; "com.sun:auto-snapshot" = "false";
}; };
mountpoint = "/";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
datasets = { datasets = {
"root" = {
type = "zfs_fs";
mountpoint = "/";
};
"nix" = { "nix" = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/nix"; mountpoint = "/nix";
}; };
"home" = { "home" = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/home"; mountpoint = "/mnt/home";
options = { options = {
"com.sun:auto-snapshot" = "true"; "com.sun:auto-snapshot" = "true";
}; };