lib: initial commit, start of custom lib

This commit is contained in:
Charlie Root 2024-08-28 18:17:55 +02:00
commit f4373bac52
9 changed files with 102 additions and 71 deletions

31
parts/lib/builders.nix Normal file
View file

@ -0,0 +1,31 @@
{
lib,
inputs,
self,
...
}: {
mkSystem = {
withSystem,
system,
...
} @ args:
withSystem system (
{
inputs',
self',
...
}:
lib.nixosSystem {
inherit system;
specialArgs =
lib.recursiveUpdate
{
inherit lib;
inherit inputs inputs';
inherit self self';
}
(args.specialArgs or {});
inherit (args) modules;
}
);
}

17
parts/lib/default.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
lib,
self,
...
}: let
callLibs = path: import path {inherit inputs lib self;};
sussyLib = inputs.nixpkgs.lib.extend (final: prev: {
builders = callLibs ./builders.nix;
});
in {
flake = {
lib = sussyLib;
# raf what the hell does this do you made me set it
_module.args.lib = sussyLib;
};
}

0
parts/lib/systemd.nix Normal file
View file