From 2e76139dde12d01af42f468feeb02ec4b4abc8fa Mon Sep 17 00:00:00 2001 From: Lulusilly Date: Mon, 8 Sep 2025 19:27:07 -0400 Subject: [PATCH] Started work on refactoring nix config codebase --- .config/nix/flake.lock | 33 +++++++++++++------ .config/nix/hosts/common.nix | 26 +++++++++++++++ .../hosts/syntheticnexus/configuration.nix | 16 --------- 3 files changed, 49 insertions(+), 26 deletions(-) diff --git a/.config/nix/flake.lock b/.config/nix/flake.lock index 78161b5..2de5cb8 100644 --- a/.config/nix/flake.lock +++ b/.config/nix/flake.lock @@ -139,25 +139,38 @@ }, "home-manager": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1756683562, - "narHash": "sha256-3fcIqwm1u+rF3kkgUYYEIcLrs93+Pi+a6AwiEAxdP5g=", + "lastModified": 1757256385, + "narHash": "sha256-WK7tOhWwr15mipcckhDg2no/eSpM1nIh4C9le8HgHhk=", "owner": "nix-community", "repo": "home-manager", - "rev": "fccb44df77266a3891939f35197f538dace3442f", + "rev": "f35703b412c67b48e97beb6e27a6ab96a084cd37", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" + "id": "home-manager", + "type": "indirect" } }, "nixpkgs": { + "locked": { + "lastModified": 1757068644, + "narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1756542300, "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", @@ -201,7 +214,7 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "stylix": "stylix" } }, diff --git a/.config/nix/hosts/common.nix b/.config/nix/hosts/common.nix index e69de29..4df4582 100644 --- a/.config/nix/hosts/common.nix +++ b/.config/nix/hosts/common.nix @@ -0,0 +1,26 @@ +{ config, pkgs, inputs, ... } + +{ + # Enable automatic system updates + system.autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "-L" # print build logs + ]; + dates = "weekly"; + randomizedDelaySec = "45min"; + }; + # Automate Nix garbage collection + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + # Allow non-free software (RMS will be mad at me :<) + nixpkgs.config.allowUnfree = true; + # Enable nix-command and flakes + nix.settings.experimental-features = [ "nix-command" "flakes"]; +} diff --git a/.config/nix/hosts/syntheticnexus/configuration.nix b/.config/nix/hosts/syntheticnexus/configuration.nix index b7647ec..47ff577 100644 --- a/.config/nix/hosts/syntheticnexus/configuration.nix +++ b/.config/nix/hosts/syntheticnexus/configuration.nix @@ -6,22 +6,6 @@ ./hardware-configuration.nix ]; - # Enable automatic system updates - system.autoUpgrade = { - enable = true; - flake = inputs.self.outPath; - flags = [ - "--update-input" - "nixpkgs" - "-L" # print build logs - ]; - dates = "weekly"; - randomizedDelaySec = "45min"; - }; - # Allow non-free software (RMS will be mad at me :<) - nixpkgs.config.allowUnfree = true; - # Enable nix-command and flakes - nix.settings.experimental-features = [ "nix-command" "flakes"]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; systemd.tpm2.enable = false;