-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
63 lines (61 loc) · 1.79 KB
/
flake.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "A flake for building development shells";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
mk-minimal-shell.url = "github:n-hass/mk-minimal-shell";
};
outputs =
{
self,
nixpkgs,
flake-utils,
mk-minimal-shell,
}:
{
mkMiniDevShell =
argThunk:
(flake-utils.lib.eachDefaultSystem (
system:
let
requiredPkgs = import nixpkgs {
inherit system;
overlays = [
mk-minimal-shell.overlay
self.overlay
];
};
uncheckedArgs = argThunk system requiredPkgs;
extraFlakeOutputs = uncheckedArgs.extraFlakeOutputs or { };
args = {
pkgs = requiredPkgs;
} // uncheckedArgs;
pkgs = args.pkgs;
myLib = import ./lib.nix { };
lib = pkgs.lib;
shellArgs = args // {
extraFlakeOutputs = null;
pkgs = null;
};
in
(lib.recursiveUpdate {
devShells =
let
shell = myLib.mkCustomShell pkgs.mkMinimalShell shellArgs pkgs;
in
{
default =
let
result =
lib.warnIf (!(pkgs ? mkMinimalShell))
"mkMinimalShell is missing! If you've overriden pkgs, ensure that it's provided as pkgs.mkMinimalShell."
shell;
in
result;
};
} extraFlakeOutputs)
));
lib = import ./lib.nix { };
overlay = (import ./overlay.nix { inherit mk-minimal-shell; }).overlay;
};
}