Compare commits
4 commits
a3436268c8
...
5ec571ecbd
Author | SHA1 | Date | |
---|---|---|---|
Geoffrey Frogeye | 5ec571ecbd | ||
Geoffrey Frogeye | 6f9de6cc4c | ||
Geoffrey Frogeye | d98be4eea5 | ||
Geoffrey Frogeye | 2cea446f49 |
191
curacao/dk.nix
Normal file
191
curacao/dk.nix
Normal file
|
@ -0,0 +1,191 @@
|
||||||
|
{ passwordFile ? "/should_not_be_needed_in_this_context", ... }:
|
||||||
|
# FIXME Subvolumes for backup. If they're not created with the script. Add the script btw.
|
||||||
|
# TODO Not relatime everywhere, thank you
|
||||||
|
# TODO Default options
|
||||||
|
let
|
||||||
|
btrfs_args_hdd = [
|
||||||
|
"rw"
|
||||||
|
"relatime"
|
||||||
|
"compress=zstd:3"
|
||||||
|
"space_cache"
|
||||||
|
];
|
||||||
|
btrfs_args_ssd = btrfs_args_hdd ++ [ "ssd" ];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
razmo = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-ST1000LM048-2E7172_WKP8925H";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
swap = {
|
||||||
|
priority = 10;
|
||||||
|
start = "2048";
|
||||||
|
size = "6G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
randomEncryption = true;
|
||||||
|
# TODO NixOS documentation says not to use this with
|
||||||
|
# hibernation, as it can't set the partition where the
|
||||||
|
# hibernation image is saved. That's what I'm doing with Arch,
|
||||||
|
# but I'm setting resume=, should test if it actually works?
|
||||||
|
# Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256
|
||||||
|
# Untranslated options from /etc/fstab: defaults,pri=100
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nixosboot = {
|
||||||
|
priority = 15;
|
||||||
|
size = "2G";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
esp = {
|
||||||
|
priority = 20;
|
||||||
|
size = "128M";
|
||||||
|
type = "EF00"; # EFI system partition
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/efi";
|
||||||
|
mountOptions = [
|
||||||
|
"rw"
|
||||||
|
"relatime"
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
"codepage=437"
|
||||||
|
"iocharset=iso8859-1"
|
||||||
|
"shortname=mixed"
|
||||||
|
"utf8"
|
||||||
|
"errors=remount-ro"
|
||||||
|
"noauto"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
boot = {
|
||||||
|
priority = 30;
|
||||||
|
size = "128M";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "boot";
|
||||||
|
initrdUnlock = false;
|
||||||
|
extraFormatArgs = [ "--type luks1" ];
|
||||||
|
passwordFile = passwordFile;
|
||||||
|
settings = {
|
||||||
|
keyFile = "/etc/keys/boot";
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext2";
|
||||||
|
mountpoint = "/mnt/old/boot";
|
||||||
|
mountOptions = [
|
||||||
|
"rw"
|
||||||
|
"relatime"
|
||||||
|
"stripe=4"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
main = {
|
||||||
|
priority = 40;
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "razmo";
|
||||||
|
initrdUnlock = false;
|
||||||
|
settings = {
|
||||||
|
keyFile = "/etc/keys/razmo";
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
# extraArgs = [ "-f" ];
|
||||||
|
mountpoint = "/mnt/razmo";
|
||||||
|
mountOptions = btrfs_args_hdd;
|
||||||
|
subvolumes = {
|
||||||
|
"home.razmo" = {
|
||||||
|
mountpoint = "/home.heavy";
|
||||||
|
mountOptions = btrfs_args_hdd;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
rapido = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/nvme-GIGABYTE_GP-GSM2NE3256GNTD_SN204508906665";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
swap = {
|
||||||
|
priority = 10;
|
||||||
|
start = "2048";
|
||||||
|
size = "8G";
|
||||||
|
type = "8200"; # Linux swap
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "rapswap";
|
||||||
|
initrdUnlock = false;
|
||||||
|
settings = {
|
||||||
|
keyFile = "/etc/keys/rapswap";
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
resumeDevice = true;
|
||||||
|
# Untranslated options from /etc/fstab: defaults,pri=100
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
main = {
|
||||||
|
priority = 20;
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "rapido";
|
||||||
|
initrdUnlock = true;
|
||||||
|
passwordFile = passwordFile;
|
||||||
|
settings = {
|
||||||
|
keyFile = "/etc/keys/rapido";
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
# extraArgs = [ "-f" ];
|
||||||
|
mountpoint = "/mnt/rapido";
|
||||||
|
mountOptions = btrfs_args_ssd;
|
||||||
|
subvolumes = {
|
||||||
|
archlinux = {
|
||||||
|
mountpoint = "/mnt/old";
|
||||||
|
mountOptions = btrfs_args_ssd;
|
||||||
|
};
|
||||||
|
# Should be temporary, to make sure we can revert to Arch anytime
|
||||||
|
"home.nixos" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
mountOptions = btrfs_args_ssd;
|
||||||
|
};
|
||||||
|
"home.rapido" = {
|
||||||
|
mountpoint = "/mnt/old/home";
|
||||||
|
mountOptions = btrfs_args_ssd;
|
||||||
|
};
|
||||||
|
nix = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = btrfs_args_ssd;
|
||||||
|
};
|
||||||
|
nixos = {
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -10,6 +10,8 @@
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
|
device = "nodev"; # Don't install on MBR
|
||||||
|
# TODO Maybe we could? In case the HDD doesn't boot anymore?
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,9 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "curacao";
|
networking.hostName = "curacao";
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
efi.efiSysMountPoint = "/efi";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -625,7 +625,6 @@ in
|
||||||
network = {
|
network = {
|
||||||
listenAddress = "0.0.0.0"; # So it can be controlled from home
|
listenAddress = "0.0.0.0"; # So it can be controlled from home
|
||||||
# TODO ... and whoever is the Wi-Fi network I'm using, which, not great
|
# TODO ... and whoever is the Wi-Fi network I'm using, which, not great
|
||||||
port = 8601; # FIXME Chose a different one for testing, should revert
|
|
||||||
startWhenNeeded = true;
|
startWhenNeeded = true;
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
Loading…
Reference in a new issue