Add auto updates to merlin, mount btcnode disk and minor refactor

This commit is contained in:
Sam 2025-01-20 21:13:01 +00:00
parent 6b44db92ca
commit bc033a9e57
1 changed files with 20 additions and 26 deletions

View File

@ -3,20 +3,14 @@
configVars, configVars,
lib, lib,
config, config,
outputs,
... ...
}: let }: let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/disk/by-id/wwn-0x5001b448b5f7cc7f"; dev = "/dev/disk/by-id/wwn-0x5001b448b5f7cc7f";
encrypted = false; # currrently only applies to btrfs encrypted = false; # currrently only applies to btrfs
btrfsMountDevice = btrfsMountDevice = "/dev/root_vg/root";
if encrypted
then "/dev/mapper/crypted"
else "/dev/root_vg/root";
impermanence = true; impermanence = true;
pubKeys = lib.filesystem.listFilesRecursive ../common/users/keys;
piholeIp = configVars.networking.addresses.pihole.ip; piholeIp = configVars.networking.addresses.pihole.ip;
gatewayIp = configVars.networking.addresses.gateway.ip; gatewayIp = configVars.networking.addresses.gateway.ip;
merlinIp = configVars.networking.addresses.merlin.ip; merlinIp = configVars.networking.addresses.merlin.ip;
@ -47,6 +41,8 @@ in {
# Import optional options # Import optional options
../common/optional/openssh.nix ../common/optional/openssh.nix
outputs.nixosModules.nixosAutoUpgrade
]; ];
boot = { boot = {
@ -57,12 +53,6 @@ in {
}; };
}; };
users.users = {
root = {
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
};
};
networking = { networking = {
hostName = "merlin"; hostName = "merlin";
nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"]; nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"];
@ -102,7 +92,7 @@ in {
]; ];
# Load nvidia driver # Load nvidia driver
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = false; powerManagement.enable = false;
@ -111,21 +101,25 @@ in {
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
# system.services.nixosAutoUpgrade = { system.services.nixosAutoUpgrade = {
# enable = true; enable = true;
# persistent = true; persistent = false;
# reboot = false; reboot = true;
# pushUpdates = false; pushUpdates = false;
# configDir = "/etc/nixos"; configDir = "/etc/nixos";
# onCalendar = "*-*-* 07:00:00"; onCalendar = "*-*-* 07:00:00";
# user = "media"; user = "admin";
# }; };
#
fileSystems."/mnt/btcnode" = {
device = "/dev/disk/by-uuid/1dc56ec7-322f-44be-b6ad-79360fdfef93";
fsType = "btrfs";
};
boot.supportedFilesystems = ["zfs"]; boot.supportedFilesystems = ["zfs"];
boot.zfs.forceImportRoot = false; boot.zfs.forceImportRoot = false;
networking.hostId = "18aec5d7"; networking.hostId = "18aec5d7";
boot.zfs.extraPools = ["deepzfs"]; boot.zfs.extraPools = ["deepzfs" "nvme-zpool"];
services.libinput.enable = true; services.libinput.enable = true;
} }