forked from numtide/devshell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathback-compat.nix
More file actions
68 lines (61 loc) · 1.4 KB
/
back-compat.nix
File metadata and controls
68 lines (61 loc) · 1.4 KB
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
{
lib,
pkgs,
config,
...
}:
# Avoid breaking back-compat for now.
let
# Because we want to be able to push pure JSON-like data into the
# environment.
strOrPackage = import ../nix/strOrPackage.nix { inherit lib pkgs; };
inherit (lib)
types
mkOption
noDepEntry
;
in
{
options = {
bash.extra = mkOption {
internal = true;
type = types.lines;
default = "";
};
bash.interactive = mkOption {
internal = true;
type = types.lines;
default = "";
};
motd = mkOption {
internal = true;
type = types.nullOr types.str;
default = null;
};
name = mkOption {
internal = true;
type = types.nullOr types.str;
default = null;
};
packages = mkOption {
internal = true;
type = types.listOf strOrPackage;
default = [ ];
};
packagesFrom = mkOption {
internal = true;
type = types.listOf strOrPackage;
default = [ ];
};
};
# Copy the values over to the devshell module
config.devshell =
{
packages = config.packages;
packagesFrom = config.packagesFrom;
startup.bash_extra = noDepEntry config.bash.extra;
interactive.bash_interactive = noDepEntry config.bash.interactive;
}
// (lib.optionalAttrs (config.motd != null) { motd = config.motd; })
// (lib.optionalAttrs (config.name != null) { name = config.name; });
}