aboutsummaryrefslogtreecommitdiffstats
path: root/overlays
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-05-30 00:47:47 +0000
committersadbeast <sadbeast@sadbeast.com>2024-10-05 16:44:14 -0700
commit09513b5c4e4babfaefdd06c592ef34c0908dc572 (patch)
tree5a9af6ef0407346c223334e295adc8012654f112 /overlays
downloadnix-config-main.tar.gz
nix-config-main.tar.bz2
oh god what have i doneHEADmain
Diffstat (limited to 'overlays')
-rw-r--r--overlays/default.nix37
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;
+ };
+ };
+}