1{
2 pkgs,
3 lib,
4 tlib,
5 config,
6 ...
7}@globalAttrs:
8let
9 l = lib // builtins;
10
11 nixosConfig = globalAttrs.config;
12in
13{
14 imports = [ ./stylix.nix ];
15
16 users.users.patriot = {
17 isNormalUser = true;
18 createHome = true;
19 home = "/home/patriot";
20 extraGroups = l.flatten [
21 "wheel"
22 "adbusers"
23 "dialout"
24 "video"
25 "nix-build-key-access"
26 (l.optional nixosConfig.networking.networkmanager.enable "networkmanager")
27 (l.optional nixosConfig.virtualisation.docker.enable "docker")
28 (l.optionals nixosConfig.virtualisation.libvirtd.enable [
29 "libvirtd"
30 "kvm"
31 ])
32 ];
33 shell = pkgs.zsh;
34 hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
35 };
36 environment = {
37 persistence.${config.system.persistDir}.directories = l.flatten [
38 # because steam will be fucked otherwise
39 (l.optional nixosConfig.programs.steam.enable "/home/patriot/.local/share/Steam")
40 # because cargo doesnt work otherwise
41 "/home/patriot/.cargo"
42 # same thing since i work with cargo and other shit
43 "/home/patriot/proj"
44 # same thing as steam
45 "/home/patriot/games"
46 # flatpak stuff
47 "/home/patriot/.var"
48 # libvirt stuff, dont think fuse mount would work here
49 "/home/patriot/.config/libvirt"
50 "/home/patriot/.config/unity3d"
51 "/home/patriot/.config/HKModInstaller"
52 ];
53 systemPackages = with pkgs; [ qt5.qtwayland ];
54 shells = with pkgs; [
55 bashInteractive
56 zsh
57 ];
58 };
59 xdg.portal = {
60 enable = true;
61 wlr.enable = true;
62 wlr.settings.screencast = {
63 output_name = "eDP-1";
64 max_fps = 60;
65 chooser_type = "default";
66 };
67 };
68 programs = {
69 # cuz nixos complains
70 zsh.enable = true;
71 # this is needed for impermanence
72 fuse.userAllowOther = true;
73 adb.enable = true;
74 steam.enable = true;
75 gamescope.enable = true;
76 # gnome stuffs
77 seahorse.enable = true;
78 dconf.enable = true;
79 weylus.users = [ "patriot" ];
80 java = {
81 enable = false;
82 package = pkgs.jre8;
83 };
84 };
85 services = {
86 gnome.gnome-keyring.enable = true;
87 };
88 # gnome keyring better fr fr
89 security.pam.services.patriot = {
90 enableGnomeKeyring = true;
91 enableKwallet = false;
92 };
93 security.pam.services.swaylock = {
94 text = ''
95 auth include login
96 '';
97 };
98 systemd = {
99 targets.network-online.enable = false;
100 services = {
101 systemd-networkd-wait-online.enable = false;
102 NetworkManager-wait-online.enable = false;
103 };
104 };
105 home-manager.users.patriot =
106 {
107 config,
108 pkgs,
109 inputs,
110 secrets,
111 ...
112 }:
113 let
114 personal = import ../../personal.nix;
115 name = personal.name;
116 email = personal.emails.primary;
117 in
118 {
119 imports =
120 let
121 modulesToEnable = l.flatten [
122 # wm
123 # ["hyprland" "foot"]
124 [
125 "sway"
126 "wayland"
127 "foot"
128 ]
129 # ["fluxbox" "urxvt"]
130 # desktop stuff
131 # ["wayland" "foot"]
132 [
133 "obsidian"
134 "firefox"
135 "vesktop"
136 ]
137 # cli stuff
138 [
139 "zoxide"
140 "zsh"
141 "fzf"
142 "starship"
143 "direnv"
144 ]
145 # dev stuff
146 [
147 "helix"
148 "git"
149 "ssh"
150 ]
151 # ["godot"]
152 [
153 "musikcube"
154 "musikcubed"
155 ]
156 [ "arrpc" ]
157 [ "s3s" ]
158 ];
159 in
160 l.flatten [
161 ../../modules/persist
162 inputs.nixos-persistence.nixosModules.home-manager.impermanence
163 (tlib.prefixStrings "${inputs.self}/users/modules/" modulesToEnable)
164 ];
165
166 system.persistDir = nixosConfig.system.persistDir;
167
168 home.persistence."${config.system.persistDir}${config.home.homeDirectory}" =
169 let
170 mkPaths = pfx: paths: tlib.prefixStrings "${pfx}/" (l.flatten paths);
171 in
172 {
173 directories =
174 l.flatten [
175 "Downloads"
176 ".wine"
177 # ssh / gpg / keys
178 ".ssh"
179 ".gnupg"
180 "keys"
181 # caches / history stuff
182 ".directory_history"
183 ".cache"
184 "Bitwig Studio"
185 ".BitwigStudio"
186 ".vst"
187 ]
188 ++ mkPaths ".local/share" [
189 "bottles"
190 "direnv"
191 "zsh"
192 "keyrings"
193 "yuzu"
194 # "lutris"
195 # "Terraria"
196 "PrismLauncher"
197 ]
198 ++ mkPaths ".config" [
199 # "lutris"
200 "dconf"
201 "retroarch"
202 "yuzu"
203 "blender"
204 ];
205 files = l.flatten [
206 ".config/gnome-initial-setup-done"
207 (lib.removePrefix "~/" config.programs.ssh.userKnownHostsFile)
208 ];
209 allowOther = true;
210 };
211
212 fonts.fontconfig.enable = l.mkForce true;
213
214 settings.iconTheme = {
215 name = "Yaru-dark";
216 package = pkgs.yaru-theme;
217 };
218
219 home.pointerCursor = {
220 package = pkgs.bibata-cursors;
221 name = "Bibata-Modern-Classic";
222 size = 24;
223 gtk.enable = true;
224 x11.enable = true;
225 };
226 gtk.enable = true;
227 gtk.theme.package = pkgs.yaru-theme;
228 gtk.theme.name = "Yaru-dark";
229
230 # home.sessionVariables.QT_QPA_PLATFORMTHEME = "qt5ct";
231 # xdg.configFile = {
232 # "environment.d/20-apply-qtct.conf".text = ''
233 # QT_QPA_PLATFORMTHEME=qt5ct
234 # '';
235 # };
236 # qt.enable = true;
237 # qt.platformTheme = "qtct";
238 # qt.style.name = "phantom";
239 # qt.style.package = pkgs.phantom;
240
241 stylix.targets.gnome.enable = lib.mkForce false;
242 stylix.targets.gtk.enable = lib.mkForce false;
243
244 home = {
245 homeDirectory = nixosConfig.users.users.patriot.home;
246 packages = with pkgs; [
247 # Font stuff
248 noto-fonts-cjk
249 font-awesome
250 dejavu_fonts
251 # Programs
252 pixelorama
253 krita
254 gnupg
255 imv
256 mpv
257 ffmpeg
258 mupdf
259 xdg-utils
260 protontricks
261 libreoffice-fresh
262 helvum
263 nix-output-monitor
264 inputs.nh.packages.${pkgs.system}.default
265 # steamPackages.steamcmd
266 # steam-tui
267 # fractal-next
268 # gtkcord4
269 # gh
270 transmission_4-gtk
271 kdenlive
272 ### music prod
273 yabridge
274 yabridgectl
275 bitwig-studio
276 ### stream / record
277 obs-studio
278 ### gayming
279 # prismlauncher
280 # (retroarch.override {
281 # cores = with libretro; [desmume citra];
282 # })
283 # yuzu
284 # wineWowPackages.stagingFull
285 # lutris
286 # distrobox
287 bottles
288 blender
289 ];
290 };
291 programs = {
292 musikcube.enable = true;
293 command-not-found.enable = nixosConfig.programs.command-not-found.enable;
294 git = {
295 userName = name;
296 userEmail = email;
297 extraConfig = {
298 gpg.format = "ssh";
299 commit.gpgsign = true;
300 user.signingkey = builtins.readFile ../../secrets/yusdacra.key.pub;
301 };
302 };
303 };
304 services = {
305 musikcubed = {
306 enable = true;
307 settings.password = "somethingidk";
308 };
309 gpg-agent =
310 let
311 defaultCacheTtl = 3600 * 6;
312 maxCacheTtl = 3600 * 24;
313 in
314 {
315 inherit defaultCacheTtl maxCacheTtl;
316 enable = true;
317 enableSshSupport = true;
318 sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ];
319 defaultCacheTtlSsh = defaultCacheTtl;
320 maxCacheTtlSsh = maxCacheTtl;
321 grabKeyboardAndMouse = false;
322 pinentryFlavor = "gnome3";
323 };
324 };
325 };
326}