feat(nix): Automatically output all overlays

Now that I have more experience with nix, I know how to write an
expression that automatically outputs all the overlays in the
repository, as well as automatically import them inside the nixos
configuration.
This commit is contained in:
Donovan Glover 2024-03-31 18:51:09 -04:00
parent da0b9b3ae6
commit 5674d3ed81
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
4 changed files with 8 additions and 15 deletions

View File

@ -2,7 +2,6 @@
{ {
imports = [ imports = [
../overlays
../modules/fish.nix ../modules/fish.nix
../modules/fonts.nix ../modules/fonts.nix
../modules/home-manager.nix ../modules/home-manager.nix

View File

@ -9,6 +9,5 @@
./home ./home
./modules ./modules
./packages ./packages
./overlays
]; ];
} }

View File

@ -21,12 +21,17 @@
}; };
}; };
outputs = { nixpkgs, ... } @ attrs: with nixpkgs.lib; { outputs = { self, nixpkgs, ... } @ attrs: with nixpkgs.lib; {
nixosConfigurations = { nixosConfigurations = {
nixos = nixosSystem { nixos = nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = attrs; specialArgs = attrs;
modules = [ ./. ]; modules = [
./.
{
nixpkgs.overlays = builtins.attrValues self.overlays;
}
];
}; };
}; };
@ -38,11 +43,6 @@
webp-thumbnailer = callPackage ./packages/webp-thumbnailer.nix { }; webp-thumbnailer = callPackage ./packages/webp-thumbnailer.nix { };
}; };
overlays = { overlays = builtins.mapAttrs (name: value: import ./overlays/${name}) (builtins.readDir ./overlays);
base16-schemes = import ./overlays/base16-schemes.nix;
kitty = import ./overlays/kitty.nix;
srb2 = import ./overlays/srb2.nix;
zola = import ./overlays/zola.nix;
};
}; };
} }

View File

@ -1,5 +0,0 @@
{ self, ... }:
{
nixpkgs.overlays = builtins.attrValues self.overlays;
}