From bc033a9e57dc7830780ee8030c8ddcd4e956d588 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 Jan 2025 21:13:01 +0000 Subject: [PATCH] Add auto updates to merlin, mount btcnode disk and minor refactor --- hosts/merlin/default.nix | 46 +++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/hosts/merlin/default.nix b/hosts/merlin/default.nix index 1fa8156..cbfe833 100644 --- a/hosts/merlin/default.nix +++ b/hosts/merlin/default.nix @@ -3,20 +3,14 @@ configVars, lib, config, + outputs, ... }: let - # Disko setup fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence dev = "/dev/disk/by-id/wwn-0x5001b448b5f7cc7f"; encrypted = false; # currrently only applies to btrfs - btrfsMountDevice = - if encrypted - then "/dev/mapper/crypted" - else "/dev/root_vg/root"; - + btrfsMountDevice = "/dev/root_vg/root"; impermanence = true; - - 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; @@ -47,6 +41,8 @@ in { # Import optional options ../common/optional/openssh.nix + + outputs.nixosModules.nixosAutoUpgrade ]; boot = { @@ -57,12 +53,6 @@ in { }; }; - users.users = { - root = { - openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key); - }; - }; - networking = { hostName = "merlin"; nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"]; @@ -102,7 +92,7 @@ in { ]; # Load nvidia driver - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { modesetting.enable = true; powerManagement.enable = false; @@ -111,21 +101,25 @@ in { package = config.boot.kernelPackages.nvidiaPackages.stable; }; - # system.services.nixosAutoUpgrade = { - # enable = true; - # persistent = true; - # reboot = false; - # pushUpdates = false; - # configDir = "/etc/nixos"; - # onCalendar = "*-*-* 07:00:00"; - # user = "media"; - # }; - # + system.services.nixosAutoUpgrade = { + enable = true; + persistent = false; + reboot = true; + pushUpdates = false; + configDir = "/etc/nixos"; + onCalendar = "*-*-* 07:00:00"; + user = "admin"; + }; + + fileSystems."/mnt/btcnode" = { + device = "/dev/disk/by-uuid/1dc56ec7-322f-44be-b6ad-79360fdfef93"; + fsType = "btrfs"; + }; boot.supportedFilesystems = ["zfs"]; boot.zfs.forceImportRoot = false; networking.hostId = "18aec5d7"; - boot.zfs.extraPools = ["deepzfs"]; + boot.zfs.extraPools = ["deepzfs" "nvme-zpool"]; services.libinput.enable = true; }