mirror of
https://gitlab.com/TECHNOFAB/nixible.git
synced 2025-12-12 18:20:09 +01:00
chore: initial commit
This commit is contained in:
commit
7602719790
24 changed files with 1916 additions and 0 deletions
33
lib/flakeModule.nix
Normal file
33
lib/flakeModule.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
flake-parts-lib,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types;
|
||||
in {
|
||||
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
nixible-lib = import ./. {inherit pkgs lib;};
|
||||
in {
|
||||
options.nixible = mkOption {
|
||||
type = types.attrsOf (types.submodule (args:
|
||||
# needed to get pkgs in there, weirdly enough
|
||||
import nixible-lib.module (args
|
||||
// {
|
||||
inherit pkgs;
|
||||
})));
|
||||
default = {};
|
||||
};
|
||||
|
||||
config.legacyPackages = lib.fold (playbook: acc: acc // playbook) {} (
|
||||
map (playbook_name: {
|
||||
"nixible:${playbook_name}" = (builtins.getAttr playbook_name config.nixible).cli;
|
||||
}) (builtins.attrNames config.nixible)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue