blob: b4b463060c98e5fd72f0174d69f4b486d87c5728 (
plain)
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
|
{ options, config, osConfig, lib, namespace, inputs, host, ... }:
with lib; with lib.${namespace}; let
cfg = config.${namespace}.impermanence;
os = osConfig.${namespace}.system.impermanence.home;
in {
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
];
options.${namespace}.impermanence = with types; {
skeleton = mkOption {
type = bool;
default = true;
};
enable = mkOption { type = uniq bool; };
location = mkOption { type = uniq str; };
secure.location = mkOption { type = uniq str; };
};
config = {
${namespace}.impermanence = {
inherit (os) enable location secure;
};
home.persistence.${cfg.location} = {
enable = cfg.enable;
allowOther = true;
directories = mkIf cfg.skeleton [
".local/share/applications"
".local/bin"
"Downloads"
"Documents"
"Pictures"
"Videos"
"Music"
"Games"
"Links"
"Persist"
];
};
home.persistence.${cfg.secure.location} = {
enable = cfg.enable;
allowOther = false;
directories = mkIf cfg.skeleton [
"Secure"
];
};
};
}
|