diff options
Diffstat (limited to 'overlays')
-rw-r--r-- | overlays/default.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..63b9906 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,37 @@ +{ + inputs, + outputs, +}: { + # For every flake input, aliases 'pkgs.inputs.${flake}' to + # 'inputs.${flake}.packages.${pkgs.system}' or + # 'inputs.${flake}.legacyPackages.${pkgs.system}' + flake-inputs = final: _: { + inputs = + builtins.mapAttrs ( + _: flake: let + legacyPackages = (flake.legacyPackages or {}).${final.system} or {}; + packages = (flake.packages or {}).${final.system} or {}; + in + if legacyPackages != {} + then legacyPackages + else packages + ) + inputs; + }; + + # Adds pkgs.stable == inputs.nixpkgs-stable.legacyPackages.${pkgs.system} + stable = final: _: { + stable = inputs.nixpkgs-stable.legacyPackages.${final.system}; + }; + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs final.pkgs; + + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + stable-packages = final: _prev: { + stable = import inputs.nixpkgs-stable { + system = final.system; + config.allowUnfree = true; + }; + }; +} |