about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--nix-conf/config.nix18
-rw-r--r--nix-conf/flake.lock12
-rw-r--r--nix-conf/flake.nix87
-rw-r--r--nix-conf/home/includes/common.nix9
-rw-r--r--nix-conf/home/includes/scripts/hm-changes-report.nix14
-rw-r--r--nix-conf/home/includes/scripts/system-changes-report.nix14
-rw-r--r--nix-conf/machines/egalmoth/configuration.nix12
7 files changed, 78 insertions, 88 deletions
diff --git a/nix-conf/config.nix b/nix-conf/config.nix
new file mode 100644
index 0000000..09d248e
--- /dev/null
+++ b/nix-conf/config.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, nixpkgs, ... }:
+{
+  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "aspell-dict-en-science" ];
+  nix = {
+    package = pkgs.nix;
+    settings = {
+      experimental-features = "nix-command flakes";
+      substituters = [
+        "https://nix-community.cachix.org"
+        "https://cache.nixos.org/"
+      ];
+      trusted-public-keys = [
+        "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+      ];
+    };
+  };
+}
+
diff --git a/nix-conf/flake.lock b/nix-conf/flake.lock
index 2e9c1e2..a745d87 100644
--- a/nix-conf/flake.lock
+++ b/nix-conf/flake.lock
@@ -93,11 +93,11 @@
     },
     "nixpkgs-stable": {
       "locked": {
-        "lastModified": 1754028485,
-        "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=",
+        "lastModified": 1754292888,
+        "narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "59e69648d345d6e8fef86158c555730fa12af9de",
+        "rev": "ce01daebf8489ba97bd1609d185ea276efdeb121",
         "type": "github"
       },
       "original": {
@@ -125,11 +125,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1752544651,
-        "narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=",
+        "lastModified": 1754328224,
+        "narHash": "sha256-glPK8DF329/dXtosV7YSzRlF4n35WDjaVwdOMEoEXHA=",
         "owner": "Mic92",
         "repo": "sops-nix",
-        "rev": "2c8def626f54708a9c38a5861866660395bb3461",
+        "rev": "49021900e69812ba7ddb9e40f9170218a7eca9f4",
         "type": "github"
       },
       "original": {
diff --git a/nix-conf/flake.nix b/nix-conf/flake.nix
index cea1afe..ad2dee9 100644
--- a/nix-conf/flake.nix
+++ b/nix-conf/flake.nix
@@ -53,22 +53,31 @@
       linux-arm-overlay-unstable = final: prev: {
         unstable = nixpkgs.legacyPackages.${linux-arm-system};
       };
-      nixpkgs-config = {
-        allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "aspell-dict-en-science" ];
-      };
     in
     {
       nixosConfigurations."egalmoth" = nixpkgs-stable.lib.nixosSystem {
         system = linux-system;
         modules = [
-          ({ config, pkgs, ... }: { nixpkgs.overlays = [ linux-overlay-unstable ]; nix.settings.experimental-features = "nix-command flakes"; })
+          (
+            { config, pkgs, ... }:
+            {
+              nixpkgs.overlays = [ linux-overlay-unstable ];
+            }
+          )
+          ./config.nix
           ./machines/egalmoth/configuration.nix
         ];
       };
       nixosConfigurations."edrahil" = nixpkgs-stable.lib.nixosSystem {
         system = linux-system;
         modules = [
-          ({ config, pkgs, ... }: { nixpkgs.overlays = [ linux-overlay-unstable ]; nix.settings.experimental-features = "nix-command flakes"; })
+          (
+            { config, pkgs, ... }:
+            {
+              nixpkgs.overlays = [ linux-overlay-unstable ];
+            }
+          )
+          ./config.nix
           ./machines/edrahil/configuration.nix
           sops-nix.nixosModules.sops
         ];
@@ -76,14 +85,26 @@
       nixosConfigurations."djmuk1" = nixpkgs-stable.lib.nixosSystem {
         system = linux-system;
         modules = [
-          ({ config, pkgs, ... }: { nixpkgs.overlays = [ linux-overlay-unstable ]; nix.settings.experimental-features = "nix-command flakes"; })
+          (
+            { config, pkgs, ... }:
+            {
+              nixpkgs.overlays = [ linux-overlay-unstable ];
+            }
+          )
+          ./config.nix
           ./machines/djmuk1/configuration.nix
         ];
       };
       nixosConfigurations."djmuk2" = nixpkgs-stable.lib.nixosSystem {
         system = linux-arm-system;
         modules = [
-          ({ config, pkgs, ... }: { nixpkgs.overlays = [ linux-arm-overlay-unstable ]; nix.settings.experimental-features = "nix-command flakes"; })
+          (
+            { config, pkgs, ... }:
+            {
+              nixpkgs.overlays = [ linux-arm-overlay-unstable ];
+            }
+          )
+          ./config.nix
           ./machines/djmuk2/configuration.nix
         ];
       };
@@ -94,7 +115,6 @@
           (
             { pkgs, ... }:
             {
-              nix.settings.experimental-features = "nix-command flakes";
               nix.settings.trusted-users = [
                 "dmorgan"
                 "@staff"
@@ -105,8 +125,14 @@
               #system.primaryUser = "dmorgan"; # required to update com.apple.symbolichotkeys
               system.keyboard.enableKeyMapping = true;
               system.keyboard.userKeyMapping = [
-                { HIDKeyboardModifierMappingSrc = 30064771296; HIDKeyboardModifierMappingDst = 30064771299; }
-                { HIDKeyboardModifierMappingSrc = 30064771299; HIDKeyboardModifierMappingDst = 30064771296; }
+                {
+                  HIDKeyboardModifierMappingSrc = 30064771296;
+                  HIDKeyboardModifierMappingDst = 30064771299;
+                }
+                {
+                  HIDKeyboardModifierMappingSrc = 30064771299;
+                  HIDKeyboardModifierMappingDst = 30064771296;
+                }
               ];
               #system.defaults.CustomUserPreferences = {
               #  "com.apple.symbolichotkeys" = {
@@ -130,28 +156,23 @@
               ];
             }
           )
-          # TODO remove or re-enable?
-          #home-manager.darwinModules.home-manager
-          #{
-          #  nixpkgs.overlays = [ darwin-overlay-unstable ];
-          #  nixpkgs.config = nixpkgs-config;
-          #  home-manager = {
-          #    useGlobalPkgs = true;
-          #    useUserPackages = true;
-          #    extraSpecialArgs = {
-          #      inherit inputs;
-          #      system = darwin-system;
-          #    };
-          #    users.dmorgan = ./home/otm.nix;
-          #  };
-          #}
+          ./config.nix
         ];
       };
       homeConfigurations."dmorgan@LDN-DMORGAN" = home-manager.lib.homeManagerConfiguration {
         pkgs = darwin-pkgs;
-        extraSpecialArgs = { inherit inputs; system = darwin-system; };
+        extraSpecialArgs = {
+          inherit inputs;
+          system = darwin-system;
+        };
         modules = [
-          ({ config, pkgs, ...  }: { nixpkgs.overlays = [ darwin-overlay-unstable ]; nixpkgs.config = nixpkgs-config; nix.package = pkgs.nix; })
+          (
+            { config, pkgs, ... }:
+            {
+              nixpkgs.overlays = [ darwin-overlay-unstable ];
+            }
+          )
+          ./config.nix
           ./home/otm.nix
         ];
       };
@@ -165,11 +186,10 @@
           (
             { config, pkgs, ... }:
             {
-              nix.package = pkgs.nix;
               nixpkgs.overlays = [ linux-overlay-unstable ];
-              nixpkgs.config = nixpkgs-config;
             }
           )
+          ./config.nix
           ./home/egalmoth.nix
         ];
       };
@@ -183,11 +203,10 @@
           (
             { config, pkgs, ... }:
             {
-              nix.package = pkgs.nix;
               nixpkgs.overlays = [ linux-overlay-unstable ];
-              nixpkgs.config = nixpkgs-config;
             }
           )
+          ./config.nix
           ./home/edrahil.nix
         ];
       };
@@ -201,11 +220,10 @@
           (
             { config, pkgs, ... }:
             {
-              nix.package = pkgs.nix;
               nixpkgs.overlays = [ linux-overlay-unstable ];
-              nixpkgs.config = nixpkgs-config;
             }
           )
+          ./config.nix
           ./home/djmuk1.nix
         ];
       };
@@ -219,11 +237,10 @@
           (
             { config, pkgs, ... }:
             {
-              nix.package = pkgs.nix;
               nixpkgs.overlays = [ linux-arm-overlay-unstable ];
-              nixpkgs.config = nixpkgs-config;
             }
           )
+          ./config.nix
           ./home/djmuk2.nix
         ];
       };
diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix
index e4f08e8..281cf2c 100644
--- a/nix-conf/home/includes/common.nix
+++ b/nix-conf/home/includes/common.nix
@@ -5,10 +5,6 @@
   inputs,
   ...
 }:
-let
-  hcr = pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; };
-  scr = pkgs.callPackage ./scripts/system-changes-report.nix { inherit config pkgs; };
-in
 {
   imports = [
     ./zsh.nix
@@ -36,12 +32,10 @@ in
 
   home.sessionVariables = {
     LSP_USE_PLISTS = "true";
+    NH_FLAKE = config.home.homeDirectory;
   };
 
   home.packages = with pkgs; [
-    hcr
-    scr
-
     (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]))
     bandwhich
     bottom
@@ -376,6 +370,7 @@ in
     };
   };
 
+  # TODO: programs.nh.flake bring in so many dependencies?
   programs.nh.enable = true;
 }
 
diff --git a/nix-conf/home/includes/scripts/hm-changes-report.nix b/nix-conf/home/includes/scripts/hm-changes-report.nix
deleted file mode 100644
index 65e7fe8..0000000
--- a/nix-conf/home/includes/scripts/hm-changes-report.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ config, pkgs, ... }:
-
-# https://github.com/gvolpe/nix-config/blob/e28a220d0087064e6bad6b992b4914a65eb545e5/home/scripts/changes-report.nix
-let
-  hm-profiles = "${config.home.homeDirectory}/.local/state/nix/profiles/home-manager-*-link";
-in
-pkgs.writeShellScriptBin "hm-changes-report" ''
-  # Disable nvd if there are less than 2 hm profiles.
-  if [ $(ls -d1v ${hm-profiles} 2>/dev/null | wc -l) -lt 2 ]; then
-    echo "Skipping changes report..."
-  else
-    ${pkgs.nvd}/bin/nvd diff $(ls -d1v ${hm-profiles} | tail -2)
-  fi
-''
diff --git a/nix-conf/home/includes/scripts/system-changes-report.nix b/nix-conf/home/includes/scripts/system-changes-report.nix
deleted file mode 100644
index b94498c..0000000
--- a/nix-conf/home/includes/scripts/system-changes-report.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ config, pkgs, ... }:
-
-# https://github.com/gvolpe/nix-config/blob/e28a220d0087064e6bad6b992b4914a65eb545e5/home/scripts/changes-report.nix
-let
-  system-profiles = "/nix/var/nix/profiles/system-*-link";
-in
-pkgs.writeShellScriptBin "system-changes-report" ''
-  # Disable nvd if there are less than 2 hm profiles.
-  if [ $(ls -d1v ${system-profiles} 2>/dev/null | wc -l) -lt 2 ]; then
-    echo "Skipping changes report..."
-  else
-    ${pkgs.nvd}/bin/nvd diff $(ls -d1v ${system-profiles} | tail -2)
-  fi
-''
diff --git a/nix-conf/machines/egalmoth/configuration.nix b/nix-conf/machines/egalmoth/configuration.nix
index 0da134b..d1fdd56 100644
--- a/nix-conf/machines/egalmoth/configuration.nix
+++ b/nix-conf/machines/egalmoth/configuration.nix
@@ -159,18 +159,6 @@
 
   services.locate.enable = true;
 
-  nix = {
-    settings = {
-      substituters = [
-        "https://nix-community.cachix.org"
-        "https://cache.nixos.org/"
-      ];
-      trusted-public-keys = [
-        "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
-      ];
-    };
-  };
-
   environment.systemPackages = with pkgs; [
     acpi
     acpitool