-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
61 lines (54 loc) · 1.88 KB
/
home.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
{
options,
config,
lib,
...
}:
with lib; {
# Aliases for a better typing experience.
# home-manager.users.${config.user.name} -> hm.user
# home-manager.users.${config.user.name}.xdg.configFile -> hm.configFile
# home-manager.users.${config.user.name}.home.packages -> hm.packages
# home-manager.users.${config.user.name}.home.file -> hm.file
# home-manager.users.${config.user.name}.programs -> hm.programs
# home-manager.users.${config.user.name}.services -> hm.services
options = with types; {
hm = {
user = mkOpt attrs {};
file = mkOpt attrs {};
configFile = mkOpt attrs {};
packages = mkOpt attrs {};
programs = mkOpt attrs {};
services = mkOpt attrs {};
};
};
config = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${config.user.name} = mkAliasDefinitions options.hm.user;
};
hm.user = {
home = {
username = "${config.user.name}";
homeDirectory = "/home/${config.user.name}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "22.05";
packages = mkAliasDefinitions options.hm.packages;
file = mkAliasDefinitions options.hm.file;
};
xdg.configFile = mkAliasDefinitions options.hm.configFile;
programs = mkAliasDefinitions options.hm.programs;
services = mkAliasDefinitions options.hm.services;
};
# Let Home Manager install and manage itself.
hm.programs.home-manager.enable = true;
};
}