-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
59 lines (58 loc) · 1.77 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
{
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixpkgs-unstable";
follows = "comity/nixpkgs";
};
flake-utils = {
url = "github:numtide/flake-utils";
follows = "comity/flake-utils";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
follows = "comity/flake-compat";
};
comity.url = "github:abathur/comity";
bats-require = {
url = "github:abathur/bats-require";
follows = "comity/bats-require";
};
};
outputs = { self, nixpkgs, flake-utils, flake-compat, comity, bats-require }:
{
overlays.default = nixpkgs.lib.composeExtensions comity.overlays.default (final: prev: {
shellswain = final.callPackage ./shellswain.nix { };
});
# shell = ./shell.nix;
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
bats-require.overlays.default
comity.overlays.default
self.overlays.default
];
};
in
{
packages = {
inherit (pkgs) shellswain;
default = pkgs.shellswain;
};
checks = pkgs.callPackages ./test.nix {
inherit (pkgs) shellswain;
};
devShells = {
default = pkgs.mkShell {
# arcane because we want to hand the user an empty shell
# but we do want to go ahead and source the script.
shellHook = ''
exec env -i PATH=$PATH HOME=$(mktemp -d) PROMPT_COMMAND="source '${pkgs.shellswain}/bin/shellswain.bash'; unset PROMPT_COMMAND" ${pkgs.bashInteractive}/bin/bash --norc --noprofile -i
'';
};
};
}
);
}