-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
55 lines (52 loc) · 1.42 KB
/
configuration.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
{ lib, ... }:
let
current = import ./current.nix;
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz";
modules = current.modules;
user-groups =
let
getGroups = module: module.groups;
filterEmptyGroups = module: builtins.hasAttr "groups" module;
in
builtins.concatMap getGroups (builtins.filter filterEmptyGroups modules);
home-imports =
let
getHome = module: module.home;
filterEmptyHome = module: builtins.hasAttr "home" module;
in
map getHome (builtins.filter filterEmptyHome modules);
system-imports =
let
getSystem = module: module.system;
filterEmptySystem = module: builtins.hasAttr "system" module;
in
map getSystem (builtins.filter filterEmptySystem modules);
in
{
imports = [
(import "${home-manager}/nixos")
current.machine
] ++ system-imports;
users.users = {
root = {
description = lib.mkForce "Admin";
};
"${current.username}" = {
isNormalUser = true;
description = current.usernameDescription;
extraGroups = [ "wheel" ] ++ user-groups;
};
};
home-manager.backupFileExtension = "bk";
home-manager.users = {
root = {
imports = home-imports;
home.stateVersion = "18.09";
};
"${current.username}" = {
imports = home-imports;
home.stateVersion = "18.09";
};
};
system.stateVersion = "24.05";
}