mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
overlay: auto import
This commit is contained in:
parent
3924268b42
commit
276da56045
1 changed files with 28 additions and 6 deletions
|
|
@ -4,13 +4,35 @@ let
|
|||
inherit (flake) inputs;
|
||||
inherit (inputs) self;
|
||||
packages = self + /packages;
|
||||
|
||||
in
|
||||
self: super: {
|
||||
self: super:
|
||||
let
|
||||
# Auto-import all packages from the packages directory
|
||||
# TODO: Upstream this to nixos0-unified?
|
||||
entries = builtins.readDir packages;
|
||||
|
||||
# Convert directory entries to package definitions
|
||||
makePackage = name: type:
|
||||
let
|
||||
# Remove .nix extension for package name
|
||||
pkgName =
|
||||
if type == "regular" && builtins.match ".*\\.nix$" name != null
|
||||
then builtins.replaceStrings [ ".nix" ] [ "" ] name
|
||||
else name;
|
||||
in
|
||||
{
|
||||
name = pkgName;
|
||||
value = self.callPackage (packages + "/${name}") { };
|
||||
};
|
||||
|
||||
# Import everything in packages directory
|
||||
packageOverlays = builtins.listToAttrs
|
||||
(builtins.attrValues (builtins.mapAttrs makePackage entries));
|
||||
|
||||
in
|
||||
packageOverlays // {
|
||||
# External overlays
|
||||
nuenv = (inputs.nuenv.overlays.nuenv self super).nuenv;
|
||||
fuckport = self.callPackage "${packages}/fuckport.nix" { };
|
||||
sshuttle-via = self.callPackage "${packages}/sshuttle-via.nix" { };
|
||||
ci = self.callPackage "${packages}/ci" { };
|
||||
touchpr = self.callPackage "${packages}/touchpr" { };
|
||||
# omnix = inputs.omnix.packages.${self.system}.default;
|
||||
git-merge-and-delete = self.callPackage "${packages}/git-merge-and-delete.nix" { };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue