-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
73 lines (66 loc) · 1.94 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
64
65
66
67
68
69
70
71
72
{
description = "ppenguin's nix dev shells";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
# inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import ./overlay.nix)];
};
unstable = import nixpkgs-unstable {inherit (pkgs) config;};
inherit (pkgs) lib;
getnixes = dir: prefix: (
with builtins;
lib.attrNames
(lib.filterAttrs (
n: v:
v
== "regular"
&& (
all (e: e)
(
map (pfun: pfun (baseNameOf n))
[(lib.hasPrefix prefix) (lib.hasSuffix ".nix")]
)
)
) (readDir dir))
);
genshells = dir: prefix: (
with builtins;
lib.genAttrs
(map (
s: (lib.removeSuffix ".nix" (lib.removePrefix prefix s))
) (getnixes dir prefix))
(n: (import (dir + "/${prefix}${n}.nix") {inherit pkgs unstable;}))
);
in {
# run-shells:
testshell = import ./dev/test.nix {inherit pkgs;};
# devshells generated from ./dev
devShells =
(genshells ./dev "devshell-")
//
# more devshells
{
test = import ./dev/test.nix {inherit pkgs;};
# run-jupyter = import ./run/jupyter.nix { inherit pkgs; }; # FIXME: .nix broken
dev-fhs-simple = import ./dev/fhs-simple.nix {inherit pkgs unstable;};
};
# test function
getnixes = getnixes;
}
);
}