2025-01-19 14:57:00 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
configVars,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-06-25 18:19:47 +01:00
|
|
|
# Disko setup
|
|
|
|
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
|
2025-01-19 14:57:00 +00:00
|
|
|
dev = "/dev/disk/by-id/wwn-0x5001b448b5f7cc7f";
|
2024-06-25 18:19:47 +01:00
|
|
|
encrypted = false; # currrently only applies to btrfs
|
2025-01-19 14:57:00 +00:00
|
|
|
btrfsMountDevice =
|
|
|
|
if encrypted
|
|
|
|
then "/dev/mapper/crypted"
|
|
|
|
else "/dev/root_vg/root";
|
|
|
|
|
|
|
|
impermanence = true;
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
pubKeys = lib.filesystem.listFilesRecursive ../common/users/keys;
|
|
|
|
piholeIp = configVars.networking.addresses.pihole.ip;
|
|
|
|
gatewayIp = configVars.networking.addresses.gateway.ip;
|
|
|
|
merlinIp = configVars.networking.addresses.merlin.ip;
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
# Create users for this host
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
# Disk configuration
|
|
|
|
inputs.disko.nixosModules.disko
|
|
|
|
(import ../common/disks {
|
|
|
|
device = dev;
|
|
|
|
impermanence = impermanence;
|
|
|
|
fsType = fsType;
|
|
|
|
encrypted = encrypted;
|
|
|
|
})
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
# Impermanence
|
|
|
|
(import ../common/disks/btrfs/impermanence.nix {
|
|
|
|
btrfsMountDevice = btrfsMountDevice;
|
|
|
|
lib = lib;
|
|
|
|
})
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
# Import core options
|
|
|
|
./hardware-configuration.nix
|
|
|
|
../common/core
|
|
|
|
|
|
|
|
# Import optional options
|
|
|
|
../common/optional/openssh.nix
|
|
|
|
];
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2024-06-28 18:16:15 +01:00
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
timeout = 3;
|
|
|
|
};
|
|
|
|
};
|
2024-06-25 18:19:47 +01:00
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
users.users = {
|
|
|
|
root = {
|
|
|
|
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-25 18:19:47 +01:00
|
|
|
networking = {
|
2024-10-14 18:54:48 +01:00
|
|
|
hostName = "merlin";
|
2025-01-19 14:57:00 +00:00
|
|
|
nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"];
|
|
|
|
defaultGateway = "${gatewayIp}";
|
|
|
|
useDHCP = false;
|
|
|
|
bridges = {
|
|
|
|
br0 = {
|
|
|
|
interfaces = ["eth0"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
interfaces.br0 = {
|
|
|
|
ipv4.addresses = [
|
|
|
|
{
|
|
|
|
"address" = "${merlinIp}";
|
|
|
|
"prefixLength" = 24;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-06-25 18:19:47 +01:00
|
|
|
};
|
|
|
|
|
2025-01-19 14:57:00 +00:00
|
|
|
boot.supportedFilesystems = ["zfs"];
|
2024-06-28 15:26:16 +01:00
|
|
|
boot.zfs.forceImportRoot = false;
|
2024-06-28 16:05:12 +01:00
|
|
|
networking.hostId = "18aec5d7";
|
2025-01-19 14:57:00 +00:00
|
|
|
boot.zfs.extraPools = ["deepzfs"];
|
2024-06-28 15:26:16 +01:00
|
|
|
|
2024-06-25 18:19:47 +01:00
|
|
|
services.libinput.enable = true;
|
|
|
|
}
|