-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
83 lines (71 loc) · 1.88 KB
/
default.nix
File metadata and controls
83 lines (71 loc) · 1.88 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{ pkgs, lib, ... }:
let
username = "z0al";
homeFolder =
if pkgs.stdenv.isDarwin then
"/Users/${username}"
else
"/home/${username}";
in
{
imports = with lib; [
(mkAliasOptionModule [ "my" "user" ] [ "users" "users" username ])
(lib.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ])
(lib.mkAliasOptionModule
[ "home" ]
[ "home-manager" "users" username "home" ]
)
(lib.mkAliasOptionModule
[ "xdg" ]
[ "home-manager" "users" username "xdg" ]
)
];
# The typing system will take care of merging the extra options into the
# native NixOS/nix-darwin module
options.users.users =
with lib;
mkOption {
type = types.attrsOf (
types.submodule {
options = {
email = mkOption {
type = types.str;
description = ''
Email address for the user. Used only for Git at the moment.
'';
};
sshKey = mkOption {
type = types.str;
description = ''
Public SSH key for the user. Used Git signing and authentication.
'';
};
};
}
);
};
config = {
my.user = {
name = username;
description = username;
home = homeFolder;
shell = pkgs.fish;
email = "12673605+z0al@users.noreply.github.com";
sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICINRjw8qGiYwNcKWWwiqcO1fV1ZbCfrvKBI+i/xjJ0e";
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
users."${username}" = {
home = {
username = username;
homeDirectory = homeFolder;
stateVersion = lib.trivial.release;
};
xdg.enable = true;
programs.home-manager.enable = true;
};
};
};
}