-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake-module.nix
36 lines (34 loc) · 965 Bytes
/
flake-module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, flake-parts-lib, minimal-shell-lib, ... }:
let
inherit (flake-parts-lib) mkPerSystemOption;
inherit (minimal-shell-lib) minimalShellType;
in
{
config._module.args.minimal-shell-lib = import ./lib.nix {
inherit lib;
};
options = {
perSystem = mkPerSystemOption ({ pkgs, config, ... }:
let
mkMinimalShell = pkgs.callPackage ./package.nix {
inherit minimal-shell-lib;
};
in
{
options.minimalShells = lib.mkOption {
type = lib.types.lazyAttrsOf minimalShellType;
default = { };
description = lib.mdDoc ''
Configure `devShells` with minimal shell environment for direnv.
'';
};
config.devShells = lib.mapAttrs
(name: cfg: mkMinimalShell {
inherit name;
exports = cfg.exports or [ ];
packages = cfg.packages or cfg;
})
config.minimalShells;
});
};
}