diff --git a/SwarselSystems.org b/SwarselSystems.org index fadd27a..9ebd05b 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -355,7 +355,6 @@ This sections puts together the =flake.nix= file from the [[#h:d39b8dfb-536d-414 outputs = inputs@{ self , nixpkgs - , nixpkgs-stable , home-manager , nix-darwin , systems @@ -599,13 +598,6 @@ Lastly I define some common module lists that I can simply load depending on the inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; - forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); - forAllSystems = lib.genAttrs [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; pkgsFor = lib.genAttrs (import systems) ( system: import nixpkgs { @@ -613,6 +605,13 @@ Lastly I define some common module lists that I can simply load depending on the config.allowUnfree = true; } ); + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + forAllSystems = lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; mkFullHost = host: isNixos: { ${host} = let @@ -703,15 +702,7 @@ In this section I am creating some attributes that define general concepts of my in import ./checks { inherit self inputs system pkgs; } ); - overlaysList = [ - (import ./overlays { inherit inputs; }).additions - (import ./overlays { inherit inputs; }).modifications - (import ./overlays { inherit inputs; }).nixpkgs-stable - (import ./overlays { inherit inputs; }).zjstatus - inputs.nur.overlays.default - inputs.emacs-overlay.overlay - inputs.nixgl.overlay - ]; + overlays = import ./overlays { inherit inputs; }; #+end_src @@ -892,7 +883,7 @@ This is the "reference implementation" of a setup that runs without NixOS, only imports = builtins.attrValues outputs.homeManagerModules; nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; @@ -985,7 +976,7 @@ My work machine. Built for more security, this is the gold standard of my config nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; @@ -1206,13 +1197,12 @@ My work machine. Built for more security, this is the gold standard of my config nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; }; - boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; @@ -2326,7 +2316,6 @@ This program sets up a new NixOS host. } #+end_src - *** Overlays (additions, overrides, nixpkgs-stable) :PROPERTIES: :CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab @@ -2336,7 +2325,9 @@ This file now holds all of the "nixpkgs-changes" that I am using across the conf #+begin_src nix :tangle overlays/default.nix - { inputs, ... }: { + { inputs, ... }: + + let additions = final: _prev: import ../pkgs { pkgs = final; }; modifications = _: _prev: { vesktop = _prev.vesktop.override { @@ -2379,6 +2370,19 @@ This file now holds all of the "nixpkgs-changes" that I am using across the conf zjstatus = inputs.zjstatus.packages.${_prev.system}.default; }; + in + { + default = + final: prev: + + (additions final prev) + // (modifications final prev) + // (nixpkgs-stable final prev) + // (zjstatus final prev) + // (inputs.nur.overlays.default final prev) + // (inputs.emacs-overlay.overlay final prev) + // (inputs.nixgl.overlay final prev); + } #+end_src @@ -6219,7 +6223,7 @@ This section sets up all the imports that are used in the home-manager section. nix.settings.experimental-features = "nix-command flakes"; nixpkgs = { hostPlatform = "x86_64-darwin"; - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; diff --git a/flake.nix b/flake.nix index 0b30531..25dcafb 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,6 @@ outputs = inputs@{ self , nixpkgs - , nixpkgs-stable , home-manager , nix-darwin , systems @@ -131,13 +130,6 @@ inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; - forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); - forAllSystems = lib.genAttrs [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; pkgsFor = lib.genAttrs (import systems) ( system: import nixpkgs { @@ -145,6 +137,13 @@ config.allowUnfree = true; } ); + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + forAllSystems = lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; mkFullHost = host: isNixos: { ${host} = let @@ -218,15 +217,7 @@ in import ./checks { inherit self inputs system pkgs; } ); - overlaysList = [ - (import ./overlays { inherit inputs; }).additions - (import ./overlays { inherit inputs; }).modifications - (import ./overlays { inherit inputs; }).nixpkgs-stable - (import ./overlays { inherit inputs; }).zjstatus - inputs.nur.overlays.default - inputs.emacs-overlay.overlay - inputs.nixgl.overlay - ]; + overlays = import ./overlays { inherit inputs; }; nixosConfigurations = diff --git a/hosts/home-manager/default/default.nix b/hosts/home-manager/default/default.nix index 89ec3ee..548b943 100644 --- a/hosts/home-manager/default/default.nix +++ b/hosts/home-manager/default/default.nix @@ -4,7 +4,7 @@ imports = builtins.attrValues outputs.homeManagerModules; nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; diff --git a/hosts/nixos/nbl-imba-2/default.nix b/hosts/nixos/nbl-imba-2/default.nix index 8da17d4..5c26295 100644 --- a/hosts/nixos/nbl-imba-2/default.nix +++ b/hosts/nixos/nbl-imba-2/default.nix @@ -29,7 +29,7 @@ in nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; diff --git a/hosts/nixos/winters/default.nix b/hosts/nixos/winters/default.nix index d4aaf80..5b41958 100644 --- a/hosts/nixos/winters/default.nix +++ b/hosts/nixos/winters/default.nix @@ -23,13 +23,12 @@ in nixpkgs = { - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; }; }; - boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; diff --git a/overlays/default.nix b/overlays/default.nix index 0d82bea..af39d4e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,4 +1,6 @@ -{ inputs, ... }: { +{ inputs, ... }: + +let additions = final: _prev: import ../pkgs { pkgs = final; }; modifications = _: _prev: { vesktop = _prev.vesktop.override { @@ -41,4 +43,17 @@ zjstatus = inputs.zjstatus.packages.${_prev.system}.default; }; +in +{ + default = + final: prev: + + (additions final prev) + // (modifications final prev) + // (nixpkgs-stable final prev) + // (zjstatus final prev) + // (inputs.nur.overlays.default final prev) + // (inputs.emacs-overlay.overlay final prev) + // (inputs.nixgl.overlay final prev); + } diff --git a/profiles/darwin/nixos/default.nix b/profiles/darwin/nixos/default.nix index 49d8d89..67256c9 100644 --- a/profiles/darwin/nixos/default.nix +++ b/profiles/darwin/nixos/default.nix @@ -10,7 +10,7 @@ in nix.settings.experimental-features = "nix-command flakes"; nixpkgs = { hostPlatform = "x86_64-darwin"; - overlays = outputs.overlaysList; + overlays = [ outputs.overlays.default ]; config = { allowUnfree = true; };