-
Notifications
You must be signed in to change notification settings - Fork 3
/
nixos-shell.nix
62 lines (54 loc) · 1.54 KB
/
nixos-shell.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
{ lib, modulesPath, ... }:
{
imports = [
"${toString modulesPath}/virtualisation/qemu-vm.nix"
];
options.nixos-shell = with lib; {
mounts = let
cache = mkOption {
type = types.enum ["none" "loose" "fscache" "mmap"];
default = "loose"; # bad idea? Well, at least it is fast!1!!
description = "9p caching policy";
};
in {
mountHome = mkOption {
type = types.bool;
default = true;
description = "Whether to mount `/home`.";
};
mountNixProfile = mkOption {
type = types.bool;
default = true;
description = "Whether to mount the user's nix profile.";
};
inherit cache;
extraMounts = mkOption {
type = types.attrsOf (types.coercedTo
types.path (target: {
inherit target;
})
(types.submodule ({ config, ... }: {
options = {
target = mkOption {
type = types.path;
description = lib.mdDoc "Target on the guest.";
};
inherit cache;
tag = mkOption {
type = types.str;
internal = true;
};
};
config.tag = lib.mkDefault (
builtins.substring 0 31 ( # tags must be shorter than 32 bytes
"a" + # tags must not begin with a digit
builtins.hashString "md5" config._module.args.name
)
);
}))
);
default = {};
};
};
};
}