-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigurationBuilder.nix
161 lines (154 loc) · 5.69 KB
/
configurationBuilder.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
inputs: flakePath: (
let
# Imports
mapDir = (import ./modules/nix-modules/mapDir.nix).mapDir;
flake-modules = (
# MapAttrs: { "feat.nix" = ./.../feat.nix; } -> { "feat.nix" = (import ./.../feat.nix flakePath); }
builtins.mapAttrs (
name: value: (import value flakePath)
) (mapDir ./modules/flake-modules)
);
config-utils = (import ./modules/flake-module-config-utils.nix flakePath);
in (
user: host: (
let
# Common Modifiers
commonModifiers = [
# Configuration-Utilities
(config-utils.build {
nixpkgs-lib = inputs.nixpkgs.lib;
home-manager-pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
home-manager-lib = inputs.home-manager.lib;
})
# User-Host-Scheme
(flake-modules."user-host-scheme.nix".build {
inherit user;
inherit host;
})
# Pkgs-Bundle
(flake-modules."package-bundle.nix".build (
let
architecture = host.system.architecture;
in {
inherit architecture;
autoImportPackages = (with inputs; {
stable = nixpkgs-stable;
unstable = nixpkgs-unstable;
unstable-fixed = nixpkgs-unstable-fixed;
});
packages = (with inputs; {
firefox-addons = {
pkgs = nurpkgs-firefox-addons.packages.${architecture};
buildFirefoxXpiAddon = nurpkgs-firefox-addons.lib.${architecture}.buildFirefoxXpiAddon;
};
fx-autoconfig = fx-autoconfig;
nixos-artwork = {
"wallpaper/nix-wallpaper-simple-blue.png" = nixos-artwork;
};
tiledmenu = tiledmenu;
papirus-colors-icons = {
"Papirus-Colors-Dark" = "${papirus-colors-icons}/Papirus-Colors-Dark";
};
mpv-input-event = mpv-input-event;
powershell-prompt = powershell-prompt;
git-tools = git-tools;
firefox-scripts = firefox-scripts;
});
}
))
# Public-Private-Domains
(flake-modules."public-private-domains.nix".build {
# Allows development in 'develop' branch while "AutoUpgrade" updates 'main' branch
# But dotfiles changes (caused by installed programs) should always happen in 'develop' (It's convenient!)
# Important: Only absolute paths notices the dev folder
configPath = if (user.username == "yo") then user.configDevFolder else user.configFolder;
# configPath = user.configFolder;
directories = {
dotfiles = "/dotfiles";
programs = "/programs";
resources = "/resources";
secrets = "/secrets";
};
})
# Map-Modules-Dir
(flake-modules."map-modules-directory.nix".build {
directory = ./modules;
})
# Agenix
(flake-modules."agenix.nix".build {
architecture = host.system.architecture;
package = inputs.agenix;
})
];
in {
# NixOS Configuration
nixosSystemConfig = (
# NixOS-System
flake-modules."nixos-system.nix".build {
architecture = host.system.architecture;
package = inputs.nixpkgs;
modifiers = commonModifiers ++ [
# Home-Manager-Module
(flake-modules."home-manager-module.nix".build {
username = user.username;
package = inputs.home-manager;
modifiers = commonModifiers ++ [
# Plasma-Manager
(flake-modules."plasma-manager.nix".build {
package = inputs.plasma-manager;
})
# Stylix
(flake-modules."stylix.nix".build {
package = inputs.stylix;
})
];
})
# Auto-Upgrade-List
(flake-modules."auto-upgrade-list.nix".build {
packages = (with inputs; {
inherit nixpkgs;
inherit home-manager;
inherit plasma-manager;
inherit agenix;
inherit stylix;
inherit nixpkgs-stable;
inherit nixpkgs-unstable;
#inherit nixpkgs-unstable-fixed;
inherit nixpkgs-unfree-unstable;
inherit nurpkgs-firefox-addons;
#inherit fx-autoconfig;
#inherit nixos-artwork;
#inherit tiledmenu;
#inherit papirus-colors-icons;
#inherit mpv-input-event;
#inherit powershell-prompt;
#inherit git-tools;
#inherit firefox-scripts;
});
})
];
}
);
# Home-Manager-Standalone Configuration
homeManagerConfig = (
# Home-Manager-Standalone
flake-modules."home-manager-standalone.nix".build {
package = inputs.home-manager;
systemPackage = inputs.nixpkgs;
username = user.username;
modifiers = commonModifiers ++ [
# Plasma-Manager
(flake-modules."plasma-manager.nix".build {
package = inputs.plasma-manager;
})
# Stylix
(flake-modules."stylix.nix".build {
package = inputs.stylix;
})
];
}
);
}
)
)
)