-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.nix
66 lines (62 loc) · 1.35 KB
/
environment.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
63
64
65
66
{
lib,
pkgs,
user,
private,
...
}: let
# readFile = fileName:
# "\n# BEGIN: ${fileName}\n"
# # + (builtins.replaceStrings ["@tailscaleKey@"] ["${private.tailscaleKey}"]
# + (builtins.readFile fileName)
# + "\n# END: ${fileName}\n\n";
prefix =
if pkgs.system == "aarch64-darwin"
then "Users"
else "home";
homeDir = "/${prefix}/${user}";
in {
imports =
[
]
++ ((lib.optionals (lib.hasAttr "personal" private && private.personal)) [
# personal only
# ./programs/tailscale.nix - if desired again
]);
users.users.${user} = {
shell = pkgs.fish;
name = user;
home = homeDir;
};
programs.zsh.enable = true;
programs.fish.enable = true;
environment.shells = with pkgs; [
fish
zsh
];
# services.tailscale = {
# enable = true;
# };
system.activationScripts = {
preActivation.text = ''
DIRS=(
"${homeDir}/.ssh/control"
"${homeDir}/Screenshots"
"${homeDir}/projects/sheeley"
"${homeDir}/bin"
"${homeDir}/scratch"
)
for DIR in "''${DIRS[@]}"; do
mkdir -p "$DIR"
chown -R ${user} "$DIR"
done
'';
# postActivation.text = lib.concatStrings (
# map (fileName: readFile (./scripts + "/${fileName}"))
# [
# "clocker.bash"
# "magnet.bash"
# ]
# );
};
}