From 7210c8d8b199786094aa53741c9c51a2cb912ba8 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 27 Jan 2023 14:39:54 -0600 Subject: [PATCH] adding the final touches to a better nixos setup for TFC --- scripts/update-nix | 0 scripts/upgrade-nix | 2 +- system/configuration.nix | 25 ++++++++++++++++++------- system/hardware-configuration.nix | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) mode change 100644 => 100755 scripts/update-nix mode change 100644 => 100755 scripts/upgrade-nix diff --git a/scripts/update-nix b/scripts/update-nix old mode 100644 new mode 100755 diff --git a/scripts/upgrade-nix b/scripts/upgrade-nix old mode 100644 new mode 100755 index 7f1e368..cffefb9 --- a/scripts/upgrade-nix +++ b/scripts/upgrade-nix @@ -1,5 +1,5 @@ #!/bin/sh currentdir=$(pwd) cd ~/conf -nixos-rebuild --use-remote-sudo switch --verbose --impure --flake .# +nixos-rebuild --use-remote-sudo switch --verbose --impure --flake .# cd $currentdir diff --git a/system/configuration.nix b/system/configuration.nix index 50fd5ab..d4126d8 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -13,8 +13,25 @@ nix = { extraOptions = "experimental-features = nix-command flakes"; package = pkgs.nixFlakes; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 20d"; + }; + settings = { + auto-optimise-store = true; + }; }; + system.autoUpgrade = { + enable = true; + dates = "02:00"; + allowReboot = true; + flake = "${config.users.users.chris.home}/conf"; + flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; + }; + + nixpkgs.config.allowUnFree = true; # Use the systemd-boot EFI boot loader. @@ -74,6 +91,7 @@ }; environment.variables.AMD_VULKAN_ICD = lib.mkDefault "RADV"; + environment.homeBinInPath = true; programs.fish.enable = true; @@ -349,13 +367,6 @@ }; }; - system.autoUpgrade = { - enable = true; - dates = "01:00"; - allowReboot = false; - }; - - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix index 3dec09b..f5ce59f 100644 --- a/system/hardware-configuration.nix +++ b/system/hardware-configuration.nix @@ -22,7 +22,7 @@ fileSystems."/storage" = { device = "/dev/disk/by-label/STORAGE"; fsType = "btrfs"; - options = [ "subvol=@" "noatime" "nodiratime" "compress=zstd" ]; + options = [ "noatime" "nodiratime" "compress=zstd" ]; }; fileSystems."/boot" =