-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
66 lines (61 loc) · 2.1 KB
/
flake.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
{
description = "NixOS utility functions";
inputs = { };
outputs = { ... }:
rec {
unfreeMerger = import ./nixpkgs_merger.nix;
listDir = dir: builtins.attrNames (builtins.readDir dir);
trimNixExts = configs: builtins.map (entry: builtins.substring 0 (builtins.stringLength entry - 4) entry) configs;
findNixFilesInDir = dir: trimNixExts (builtins.filter (u: (builtins.substring (builtins.stringLength u - 4) 4 u) == ".nix") (listDir dir));
generateUser =
{ name
, username
, email
, groups
, hosts
, face
, background
, files ? { }
, extraNixosConfig ? { }
, extraHomeConfig ? { }
, extraPackages ? [ ]
, pkgs
,
}: {
inherit hosts;
nixosConfig = {
isNormalUser = true;
description = name;
extraGroups = [ "networkmanager" "video" "audio" ] ++ groups;
shell = pkgs.zsh;
} // extraNixosConfig;
homeConfig = {
home.username = username;
home.homeDirectory = "/home/${username}";
home.packages = extraPackages;
programs.git.userName = name;
programs.git.userEmail = email;
home.file = {
".face".source = face;
} // files;
dconf.settings = {
"org/gnome/desktop/background" = {
"picture-uri" = "file://${background}";
"picture-uri-dark" = "file://${background}";
"color-shading-type" = "solid";
"picture-options" = "zoom";
"primary-color" = "#000000000000";
"secondary-color" = "#000000000000";
};
"org/gnome/desktop/screensaver" = {
"picture-uri" = "file://${background}";
"color-shading-type" = "solid";
"picture-options" = "zoom";
"primary-color" = "#000000000000";
"secondary-color" = "#000000000000";
};
};
} // extraHomeConfig;
};
};
}