update nextcloud module, cleanup
This commit is contained in:
parent
982b8f7d7c
commit
bc7778e46c
4 changed files with 136 additions and 109 deletions
62
nixos-shell.nix
Normal file
62
nixos-shell.nix
Normal file
|
|
@ -0,0 +1,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 = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue