aboutsummaryrefslogtreecommitdiffstats
path: root/overlays
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-05-30 00:47:47 +0000
committersadbeast <sadbeast@sadbeast.com>2025-01-11 12:20:20 -0800
commit8c12d7db633cc421cd96690d077461cf45195334 (patch)
treec3112acb5cd045ceeb2ada81a281a5991b4c501d /overlays
downloadnix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.gz
nix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.bz2
oh no what have i doneHEADmain
Diffstat (limited to 'overlays')
-rw-r--r--overlays/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/overlays/default.nix b/overlays/default.nix
new file mode 100644
index 0000000..bade4e8
--- /dev/null
+++ b/overlays/default.nix
@@ -0,0 +1,38 @@
+{
+ 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};
+ };
+ # Adds my custom packages
+ additions = final: prev:
+ import ../pkgs {pkgs = final;};
+
+ # 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;
+ };
+ };
+}