From 935a1f74c1d1735620f7da64bc69e88467bad9cf Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Fri, 13 Jun 2025 17:56:40 +0200 Subject: [PATCH 01/48] fix: :bug: explicitly set battery charge thresholds --- modules/system/common/hardware/powersave.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/system/common/hardware/powersave.nix b/modules/system/common/hardware/powersave.nix index 61f4673..f936de7 100644 --- a/modules/system/common/hardware/powersave.nix +++ b/modules/system/common/hardware/powersave.nix @@ -104,12 +104,15 @@ in { # Runtime power management RUNTIME_PM_ON_BAT = "auto"; - # Battery charge thresholds (for battery health) + # Explicitly set charge thresholds for all batteries + START_CHARGE_THRESH_BAT0 = cfg.batteryHealth.chargeThresholds.start; + STOP_CHARGE_THRESH_BAT0 = cfg.batteryHealth.chargeThresholds.stop; START_CHARGE_THRESH_BAT1 = cfg.batteryHealth.chargeThresholds.start; STOP_CHARGE_THRESH_BAT1 = cfg.batteryHealth.chargeThresholds.stop; # Ensure TLP applies these thresholds RESTORE_THRESHOLDS_ON_BAT = 1; + RESTORE_THRESHOLDS_ON_AC = 1; }; }; From 087edab3b5778ca3c6e874673609e0f0ef078e69 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sat, 14 Jun 2025 23:21:49 +0200 Subject: [PATCH 02/48] fix: :bug: mark yubikey touch detection task as complete --- TODO.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index e10ba29..1f2118b 100755 --- a/TODO.md +++ b/TODO.md @@ -8,7 +8,7 @@ - 🪵 Server: cedar - VMs: [hostname]-vm (fern-vm, oak-vm, cedar-vm) -- [ ] hydenix: some yubikey touch detection for hyprlock and waybar +- [x] hydenix: some yubikey touch detection for hyprlock and waybar - [?] bluemail - [x] scalar - [x] rust @@ -20,4 +20,3 @@ - [ ] Update flake - [ ] Test workflows - [x] Prisma module -- [ ] fix printing From bc3a674d6800bd4b13e9fb1faebcebc5ec1b208d Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:11:44 +0200 Subject: [PATCH 03/48] feat: add hyprland keybindings configuration --- modules/hm/desktops/configHydenix.nix | 179 ++++++++++++++++++++++++++ modules/hm/desktops/hydenix.nix | 19 +++ 2 files changed, 198 insertions(+) create mode 100644 modules/hm/desktops/configHydenix.nix diff --git a/modules/hm/desktops/configHydenix.nix b/modules/hm/desktops/configHydenix.nix new file mode 100644 index 0000000..5a1e81d --- /dev/null +++ b/modules/hm/desktops/configHydenix.nix @@ -0,0 +1,179 @@ +{ lib }: + +{ + hyprlandKeybindsConvert = '' + # █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ + # █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ + + # See https://wiki.hyprland.org/Configuring/Keywords/ + # & https://wiki.hyprland.org/Configuring/Binds/ + + # Main modifier + $mainMod = Super # super / meta / windows key + + # Assign apps // HyDE will try to use the default apps if values below are not set + # $TERMINAL = kitty + # $EDITOR = code + # $EXPLORER = dolphin + # $BROWSER = firefox + + + # Window/Session actions + bind = $mainMod, Q, exec, $scrPath/dontkillsteam.sh # close focused window + bind = Alt, F4, exec, $scrPath/dontkillsteam.sh # close focused window + bind = $mainMod, Delete, exit, # kill hyprland session + bind = $mainMod, W, togglefloating, # toggle the window between focus and float + bind = $mainMod, G, togglegroup, # toggle the window between focus and group + bind = Alt, Return, fullscreen, # toggle the window between focus and fullscreen + bind = $mainMod, L, exec, swaylock # launch lock screen + bind = $mainMod+Shift, F, exec, $scrPath/windowpin.sh # toggle pin on focused window + bind = $mainMod, Backspace, exec, $scrPath/logoutlaunch.sh # launch logout menu + bind = Alt_R, Control_R , exec, killall .waybar-wrapped || (env reload_flag=1 $scrPath/wbarconfgen.sh) # toggle waybar and reload config + #bind = Alt_R, Control_R, exec, killall .waybar-wrapped || waybar # toggle waybar without reloading, this is faster + + # Application shortcuts + bind = $mainMod, T, exec, $TERMINAL # launch terminal emulator + bind = $mainMod, E, exec, $EXPLORER # launch file manager + bind = $mainMod, C, exec, $EDITOR # launch text editor + bind = $mainMod, F, exec, $BROWSER # launch web browser + bind = Ctrl+Shift, Escape, exec, $scrPath/sysmonlaunch.sh # launch system monitor (htop/btop or fallback to top) + + # Rofi menus + bind = alt, space, exec, pkill -x rofi || $scrPath/rofilaunch.sh d # launch application launcher + bind = $mainMod, Tab, exec, pkill -x rofi || $scrPath/rofilaunch.sh w # launch window switcher + bind = $mainMod+Shift, E, exec, pkill -x rofi || $scrPath/rofilaunch.sh f # launch file explorer + + # Audio control + bindl = , F10, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute + bindel = , F11, exec, $scrPath/volumecontrol.sh -o d # decrease volume + bindel = , F12, exec, $scrPath/volumecontrol.sh -o i # increase volume + bindl = , XF86AudioMute, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute + bindl = , XF86AudioMicMute, exec, $scrPath/volumecontrol.sh -i m # toggle microphone mute + bindel = , XF86AudioLowerVolume, exec, $scrPath/volumecontrol.sh -o d # decrease volume + bindel = , XF86AudioRaiseVolume, exec, $scrPath/volumecontrol.sh -o i # increase volume + + # Media control + bindl = , XF86AudioPlay, exec, playerctl play-pause # toggle between media play and pause + bindl = , XF86AudioPause, exec, playerctl play-pause # toggle between media play and pause + bindl = , XF86AudioNext, exec, playerctl next # media next + bindl = , XF86AudioPrev, exec, playerctl previous # media previous + + # Brightness control + bindel = , XF86MonBrightnessUp, exec, $scrPath/brightnesscontrol.sh i # increase brightness + bindel = , XF86MonBrightnessDown, exec, $scrPath/brightnesscontrol.sh d # decrease brightness + + # Move between grouped windows + bind = $mainMod CTRL , H, changegroupactive, b + bind = $mainMod CTRL , L, changegroupactive, f + + # Screenshot/Screencapture/Color picker + bindd = $mainMod+Shift, P,Color Picker , exec, hyprpicker -a # Pick color (Hex) >> clipboard# + bind = $mainMod, P, exec, $scrPath/screenshot.sh s # partial screenshot capture + bind = $mainMod+Ctrl, P, exec, $scrPath/screenshot.sh sf # partial screenshot capture (frozen screen) + bind = $mainMod+Alt, P, exec, $scrPath/screenshot.sh m # monitor screenshot capture + bind = , Print, exec, $scrPath/screenshot.sh p # all monitors screenshot capture + + # Custom scripts + # TODO Make a main rofi menu for these selectors + bind = $mainMod+Alt, G, exec, $scrPath/gamemode.sh # disable hypr effects for gamemode + bind = $mainMod+Alt, Right, exec, $scrPath/swwwallpaper.sh -n # next wallpaper + bind = $mainMod+Alt, Left, exec, $scrPath/swwwallpaper.sh -p # previous wallpaper + bind = $mainMod+Alt, Up, exec, $scrPath/wbarconfgen.sh n # next waybar mode + bind = $mainMod+Alt, Down, exec, $scrPath/wbarconfgen.sh p # previous waybar mode + bind = $mainMod+Shift, R, exec, pkill -x rofi || $scrPath/wallbashtoggle.sh -m # launch wallbash mode select menu + bind = $mainMod+Shift, T, exec, pkill -x rofi || $scrPath/themeselect.sh # launch theme select menu + bind = $mainMod+Shift, A, exec, pkill -x rofi || $scrPath/rofiselect.sh # launch select menu + bind = $mainMod+Shift, W, exec, pkill -x rofi || $scrPath/swwwallselect.sh # launch wallpaper select menu + bind = $mainMod, V, exec, pkill -x rofi || $scrPath/cliphist.sh -c # launch clipboard + bind = $mainMod+Shift, V, exec, pkill -x rofi || $scrPath/cliphist.sh # launch clipboard Manager + bind = $mainMod, K, exec, $scrPath/keyboardswitch.sh # switch keyboard layout + bind = $mainMod, colon, exec, pkill -x rofi || $scrPath/keybinds_hint.sh c # launch keybinds hint + bind = $mainMod, semicolon,exec, pkill -x rofi || $scrPath/emoji-picker.sh # launch emoji picker + bind = $mainMod, period, exec, pkill -x rofi || $scrPath/glyph-picker.sh # launch glyph picker + + # Move/Change window focus + bind = $mainMod, Left, movefocus, l + bind = $mainMod, Right, movefocus, r + bind = $mainMod, Up, movefocus, u + bind = $mainMod, Down, movefocus, d + bind = Alt, Tab, movefocus, d + + # Switch workspaces + bind = $mainMod, ampersand, workspace, 1 + bind = $mainMod, eacute, workspace, 2 + bind = $mainMod, quotedbl, workspace, 3 + bind = $mainMod, apostrophe, workspace, 4 + bind = $mainMod, parenleft, workspace, 5 + bind = $mainMod, minus, workspace, 6 + bind = $mainMod, egrave, workspace, 7 + bind = $mainMod, underscore, workspace, 8 + bind = $mainMod, ccedilla, workspace, 9 + bind = $mainMod, agrave, workspace, 10 + + # Switch workspaces to a relative workspace + bind = $mainMod+Ctrl, Right, workspace, r+1 + bind = $mainMod+Ctrl, Left, workspace, r-1 + + # Move to the first empty workspace + bind = $mainMod+Ctrl, Down, workspace, empty + + # Resize windows + binde = $mainMod+Shift, Right, resizeactive, 30 0 + binde = $mainMod+Shift, Left, resizeactive, -30 0 + binde = $mainMod+Shift, Up, resizeactive, 0 -30 + binde = $mainMod+Shift, Down, resizeactive, 0 30 + + # Move focused window to a workspace + bind = $mainMod+Shift, ampersand, movetoworkspace, 1 + bind = $mainMod+Shift, eacute, movetoworkspace, 2 + bind = $mainMod+Shift, quotedbl, movetoworkspace, 3 + bind = $mainMod+Shift, apostrophe, movetoworkspace, 4 + bind = $mainMod+Shift, parenleft, movetoworkspace, 5 + bind = $mainMod+Shift, minus, movetoworkspace, 6 + bind = $mainMod+Shift, egrave, movetoworkspace, 7 + bind = $mainMod+Shift, underscore, movetoworkspace, 8 + bind = $mainMod+Shift, ccedilla, movetoworkspace, 9 + bind = $mainMod+Shift, agrave, movetoworkspace, 10 + + # Move focused window to a relative workspace + bind = $mainMod+Ctrl+Alt, Right, movetoworkspace, r+1 + bind = $mainMod+Ctrl+Alt, Left, movetoworkspace, r-1 + + # Move active window around current workspace with mainMod + SHIFT + CTRL [←→↑↓] + $moveactivewindow=grep -q "true" <<< $(hyprctl activewindow -j | jq -r .floating) && hyprctl dispatch moveactive + binded = $mainMod SHIFT $CONTROL, left,Move activewindow to the right,exec, $moveactivewindow -30 0 || hyprctl dispatch movewindow l + binded = $mainMod SHIFT $CONTROL, right,Move activewindow to the right,exec, $moveactivewindow 30 0 || hyprctl dispatch movewindow r + binded = $mainMod SHIFT $CONTROL, up,Move activewindow to the right,exec, $moveactivewindow 0 -30 || hyprctl dispatch movewindow u + binded = $mainMod SHIFT $CONTROL, down,Move activewindow to the right,exec, $moveactivewindow 0 30 || hyprctl dispatch movewindow d + + # Scroll through existing workspaces + bind = $mainMod, mouse_down, workspace, e+1 + bind = $mainMod, mouse_up, workspace, e-1 + + # Move/Resize focused window + bindm = $mainMod, mouse:272, movewindow + bindm = $mainMod, mouse:273, resizewindow + bindm = $mainMod, Z, movewindow + bindm = $mainMod, X, resizewindow + + # Move/Switch to special workspace (scratchpad) + bind = $mainMod+Shift, grave, movetoworkspace, special + bind = $mainMod+Alt, grave, movetoworkspacesilent, special + bind = $mainMod, grave, togglespecialworkspace, + + # Toggle focused window split + bind = $mainMod, J, togglesplit + + # Move focused window to a workspace silently + bind = $mainMod+Alt, ampersand, movetoworkspacesilent, 1 + bind = $mainMod+Alt, eacute, movetoworkspacesilent, 2 + bind = $mainMod+Alt, quotedbl, movetoworkspacesilent, 3 + bind = $mainMod+Alt, apostrophe, movetoworkspacesilent, 4 + bind = $mainMod+Alt, parenleft, movetoworkspacesilent, 5 + bind = $mainMod+Alt, minus, movetoworkspacesilent, 6 + bind = $mainMod+Alt, egrave, movetoworkspacesilent, 7 + bind = $mainMod+Alt, underscore, movetoworkspacesilent, 8 + bind = $mainMod+Alt, ccedilla, movetoworkspacesilent, 9 + bind = $mainMod+Alt, agrave, movetoworkspacesilent, 10 + ''; +} \ No newline at end of file diff --git a/modules/hm/desktops/hydenix.nix b/modules/hm/desktops/hydenix.nix index 0376510..4b77c9a 100644 --- a/modules/hm/desktops/hydenix.nix +++ b/modules/hm/desktops/hydenix.nix @@ -9,6 +9,8 @@ with lib; let cfg = config.desktops.hydenix; + + config = import ./configHydenix.nix { inherit lib; }; in { @@ -85,6 +87,15 @@ in }; home.file = { + ".config/hypr/keybindings.conf" = lib.mkForce { + text = '' + ${config.hyprlandKeybindsConvert} + ''; + force = true; + }; + + + ".config/hypr/userprefs.conf" = lib.mkForce { text = '' input { @@ -113,6 +124,14 @@ in # Disable an unused monitor (example) # monitor=DP-4,disable + + # Alt + Enter to toggle fullscreen + bind = ALT, Return, fullscreen, 0 + # Alt + Tab to cycle between fullscreen windows + bind = ALT, Tab, cyclenext + bind = ALT, Tab, bringactivetotop + + exec-once = sleep 1 && keepassxc ''; force = true; mutable = true; From d1951810c1204239f6073fdf4355172efd4e671a Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:12:06 +0200 Subject: [PATCH 04/48] refactor: reorganize module for improved package management --- modules/hm/common/browser/default.nix | 52 +++++++---- .../hm/common/communication/mail/default.nix | 15 ++-- modules/hm/common/dev/global-tools/cli.nix | 23 +++-- modules/hm/common/documentation/default.nix | 22 +++-- modules/hm/common/emulator/default.nix | 73 ++++++++-------- modules/hm/common/engine/default.nix | 22 +++-- modules/hm/common/network/tunnel.nix | 62 +++++++------ modules/hm/common/shell/disk-usage.nix | 31 +++++-- modules/system/common/default.nix | 2 +- modules/system/common/games/games.nix | 86 +++++++++++-------- modules/system/common/security/antivirus.nix | 57 ++++++++---- .../common/security/password-manager.nix | 75 ++++++++-------- 12 files changed, 307 insertions(+), 213 deletions(-) diff --git a/modules/hm/common/browser/default.nix b/modules/hm/common/browser/default.nix index f83c5ac..a795e18 100644 --- a/modules/hm/common/browser/default.nix +++ b/modules/hm/common/browser/default.nix @@ -1,10 +1,41 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.browser; + cfg = config.modules.hm.browser; + + # Map browsers to their packages (using pkgs.) + browserToPackage = with pkgs; { + chromium = [ chromium ]; + chrome = [ google-chrome ]; + firefox = [ firefox ]; + brave = [ brave ]; + vivaldi = [ vivaldi ]; + edge = [ microsoft-edge ]; + }; + + # Map browsers to their drivers (using pkgs.) + browserToDriver = with pkgs; { + chromium = chromedriver; + chrome = chromedriver; + vivaldi = chromedriver; + brave = chromedriver; + firefox = geckodriver; + edge = msedgedriver; + }; + + # Get packages for enabled browsers + browserPackages = lib.concatMap (browser: browserToPackage.${browser} or []) cfg.emulators; + + # Get drivers for enabled browsers (if driver.enable is true) + drivers = lib.optionals cfg.driver.enable ( + lib.unique (lib.filter (drv: drv != null) ( + map (browser: browserToDriver.${browser} or null) cfg.emulators + )) + ); + in { - options.modules.common.browser = { + options.modules.hm.browser = { emulators = lib.mkOption { type = lib.types.listOf (lib.types.enum ["chromium" "chrome" "firefox" "brave" "vivaldi" "edge"]); default = []; @@ -18,21 +49,6 @@ in }; config = { - home.packages = with pkgs; - lib.unique ( - (lib.optionals (lib.elem "chromium" cfg.emulators) [chromium]) ++ - (lib.optionals (lib.elem "chrome" cfg.emulators) [google-chrome]) ++ - (lib.optionals (lib.elem "firefox" cfg.emulators) [firefox]) ++ - (lib.optionals (lib.elem "brave" cfg.emulators) [brave]) ++ - (lib.optionals (lib.elem "vivaldi" cfg.emulators) [vivaldi]) ++ - (lib.optionals (lib.elem "edge" cfg.emulators) [microsoft-edge]) ++ - (lib.optionals - (cfg.driver.enable && - (lib.any (browser: lib.elem browser cfg.emulators) - [ "chromium" "chrome" "vivaldi" "brave" ])) - [chromedriver]) ++ - (lib.optionals (cfg.driver.enable && lib.elem "firefox" cfg.emulators) [geckodriver]) ++ - (lib.optionals (cfg.driver.enable && lib.elem "edge" cfg.emulators) [msedgedriver]) - ); + home.packages = lib.unique (browserPackages ++ drivers); }; } \ No newline at end of file diff --git a/modules/hm/common/communication/mail/default.nix b/modules/hm/common/communication/mail/default.nix index f0f18b4..e62cc82 100644 --- a/modules/hm/common/communication/mail/default.nix +++ b/modules/hm/common/communication/mail/default.nix @@ -1,22 +1,21 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.communication.mail; + cfg = config.modules.hm.communication.mail; serviceList = cfg.services; - # Map service names to their corresponding packages + # Map service names to their corresponding packages or list of packages serviceToPackage = { - thunderbird = pkgs.thunderbird-latest; - bluemail = (import ./bluemail.nix { inherit pkgs lib config; }).bluemailWithGPU; + thunderbird = [ pkgs.thunderbird-latest ]; + bluemail = [ (import ./bluemail.nix { inherit pkgs lib config; }).bluemailWithGPU ]; }; - # Get packages for enabled services, filtering out nulls - packagesToInstall = lib.filter (pkg: pkg != null) - (map (service: serviceToPackage.${service}) serviceList); + # Flatten the list of packages from all enabled services + packagesToInstall = lib.concatMap (service: serviceToPackage.${service}) serviceList; in { - options.modules.common.communication.mail = { + options.modules.hm.communication.mail = { services = lib.mkOption { type = lib.types.listOf (lib.types.enum ["thunderbird" "bluemail"]); default = []; diff --git a/modules/hm/common/dev/global-tools/cli.nix b/modules/hm/common/dev/global-tools/cli.nix index 0141a82..d7b6b7d 100644 --- a/modules/hm/common/dev/global-tools/cli.nix +++ b/modules/hm/common/dev/global-tools/cli.nix @@ -1,11 +1,21 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.global-tools.cli; + cfg = config.modules.hm.dev.global-tools.cli; + + # Map CLI tools to their packages + cliToPackage = with pkgs; { + vercel = nodePackages.vercel; + graphite = graphite-cli; + }; + + # Get packages for enabled CLI tools + cliPackages = lib.filter (pkg: pkg != null) + (map (tool: cliToPackage.${tool} or null) cfg.elements); + in { - options.modules.common.dev.global-tools.cli = { - + options.modules.hm.dev.global-tools.cli = { elements = lib.mkOption { type = lib.types.listOf (lib.types.enum ["vercel" "graphite"]); default = []; @@ -14,9 +24,6 @@ in }; config = { - home.packages = (with pkgs; - lib.optional (lib.elem "vercel" cfg.elements) nodePackages.vercel ++ - lib.optional (lib.elem "graphite" cfg.elements) graphite-cli - ); + home.packages = cliPackages; }; -} +} \ No newline at end of file diff --git a/modules/hm/common/documentation/default.nix b/modules/hm/common/documentation/default.nix index d27afca..e40f95c 100644 --- a/modules/hm/common/documentation/default.nix +++ b/modules/hm/common/documentation/default.nix @@ -1,10 +1,21 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.documentation; + cfg = config.modules.hm.documentation; + + # Map document editors to their packages + editorToPackage = with pkgs; { + onlyoffice = onlyoffice-bin; + okular = okular; + }; + + # Get packages for enabled editors + editorPackages = lib.filter (pkg: pkg != null) + (map (editor: editorToPackage.${editor} or null) cfg.editor); + in { - options.modules.common.documentation = { + options.modules.hm.documentation = { editor = lib.mkOption { type = lib.types.listOf (lib.types.enum ["onlyoffice" "okular"]); default = []; @@ -13,9 +24,6 @@ in }; config = { - home.packages = with pkgs; ( - (lib.optional (lib.elem "onlyoffice" cfg.editor) onlyoffice-bin) ++ - (lib.optional (lib.elem "okular" cfg.editor) okular) - ); + home.packages = editorPackages; }; -} +} \ No newline at end of file diff --git a/modules/hm/common/emulator/default.nix b/modules/hm/common/emulator/default.nix index 7d533b9..091740b 100644 --- a/modules/hm/common/emulator/default.nix +++ b/modules/hm/common/emulator/default.nix @@ -1,12 +1,39 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.emulator; -in -{ - options.modules.common.emulator = { - enable = lib.mkEnableOption "Enable emulators for running Windows applications and games on Linux"; + cfg = config.modules.hm.emulator; + # Map emulators to their packages + emulatorToPackage = with pkgs; { + playonlinux = [ playonlinux ]; + bottles = [ bottles ]; + dosbox = [ dosbox ]; + }; + + # Wine packages based on version + winePackages = with pkgs; { + stable = wine; + staging = wineStaging; + wayland = wineWayland; + fonts = wine; + }; + + # Proton packages + protonPackages = with pkgs; [ + protonup-qt + protontricks + ]; + + # Get packages for enabled emulators + baseEmulatorPackages = lib.concatMap (emulator: emulatorToPackage.${emulator} or []) cfg.emulators; + + # Additional packages based on configuration + additionalPackages = with pkgs; [] + ++ lib.optionals cfg.wine.enable [ (winePackages.${cfg.wine.version} or pkgs.wine) winetricks ] + ++ lib.optionals cfg.proton.enable protonPackages; + +in { + options.modules.hm.emulator = { emulators = lib.mkOption { type = lib.types.listOf (lib.types.enum ["playonlinux" "proton" "wine" "bottles" "dosbox"]); default = ["wine"]; @@ -20,7 +47,7 @@ in defaultText = "true if 'wine' is in emulators list"; description = "Enable Wine Windows compatibility layer"; }; - + version = lib.mkOption { type = lib.types.enum ["stable" "staging" "wayland" "fonts"]; default = "staging"; @@ -44,38 +71,8 @@ in }; }; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; ( - # Wine ecosystem - (lib.optionals (cfg.wine.enable) [ - ({ - stable = wine; - staging = wineStaging; - wayland = wineWayland; - }.${cfg.wine.version} or wine) - winetricks - ]) ++ - - # PlayOnLinux - (lib.optionals (lib.elem "playonlinux" cfg.emulators) [ - playonlinux - ]) ++ - - # Proton - (lib.optionals (cfg.proton.enable) [ - protonup-qt - protontricks - ]) ++ - - (lib.optionals (lib.elem "bottles" cfg.emulators) [ - bottles - ]) ++ - - # DOS emulation - (lib.optionals (lib.elem "dosbox" cfg.emulators) [ - dosbox - ]) - ); + config = { + home.packages = lib.unique (baseEmulatorPackages ++ additionalPackages); # Environment variables for Wine/Proton home.sessionVariables = lib.mkIf (cfg.wine.enable || cfg.proton.enable) { diff --git a/modules/hm/common/engine/default.nix b/modules/hm/common/engine/default.nix index 135a702..6152e8b 100644 --- a/modules/hm/common/engine/default.nix +++ b/modules/hm/common/engine/default.nix @@ -1,10 +1,18 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common; -in -{ - options.modules.common = { + cfg = config.modules.hm; + + # Map game engines to their packages + engineToPackage = with pkgs; { + unity = [ unityhub ]; + }; + + # Get packages for enabled engines + enginePackages = lib.concatMap (engine: engineToPackage.${engine} or []) cfg.engine; + +in { + options.modules.hm = { engine = lib.mkOption { type = lib.types.listOf (lib.types.enum ["unity"]); default = []; @@ -13,8 +21,6 @@ in }; config = { - home.packages = with pkgs; ( - (lib.optionals (lib.elem "unity" cfg.engine) [unityhub]) - ); + home.packages = enginePackages; }; -} +} \ No newline at end of file diff --git a/modules/hm/common/network/tunnel.nix b/modules/hm/common/network/tunnel.nix index 0a04c91..3c11825 100644 --- a/modules/hm/common/network/tunnel.nix +++ b/modules/hm/common/network/tunnel.nix @@ -1,8 +1,16 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.network.tunnel; - + cfg = config.modules.hm.network.tunnel; + + # Map services to their packages + serviceToPackage = with pkgs; { + localtunnel = [ nodePackages.localtunnel ]; + cloudflare = [ cloudflared ]; + ngrok = [ ngrok ]; + }; + + # Tunnel command aliases tunnelAliases = { localtunnel = { ltn = "npx localtunnel --port ${toString cfg.localtunnel.port}"; @@ -17,14 +25,27 @@ let }; }; + # Get packages for enabled services + servicePackages = lib.concatMap (service: serviceToPackage.${service} or []) cfg.service; + + # Get aliases for enabled services enabledAliases = lib.foldl (acc: service: acc // (tunnelAliases.${service} or {}) ) {} cfg.service; -in -{ - options.modules.common.network.tunnel = { - enable = lib.mkEnableOption "Enable network tunneling for development"; + # Cloudflare token configuration + cloudflareTokenConfig = lib.mkIf (builtins.elem "cloudflare" cfg.service && cfg.cloudflare.tokenPath != null) { + home.sessionVariables.CLOUDFLARE_TOKEN_FILE = cfg.cloudflare.tokenPath; + home.file.".cloudflared/token".source = cfg.cloudflare.tokenPath; + }; + + # Ngrok config file + ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.service && cfg.ngrok.configPath != null) { + home.file.".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath; + }; + +in { + options.modules.hm.network.tunnel = { service = lib.mkOption { type = lib.types.listOf (lib.types.enum ["localtunnel" "cloudflare" "ngrok"]); default = ["localtunnel"]; @@ -66,26 +87,13 @@ in }; }; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; ( - (lib.optionals (builtins.elem "localtunnel" cfg.service) [ nodePackages.localtunnel ]) ++ - (lib.optionals (builtins.elem "cloudflare" cfg.service) [ cloudflared ]) ++ - (lib.optionals (builtins.elem "ngrok" cfg.service) [ ngrok ]) - ); - - home.shellAliases = enabledAliases; + config = lib.mkMerge [ + { + home.packages = servicePackages; + home.shellAliases = enabledAliases; + } - home.sessionVariables = lib.mkIf (builtins.elem "cloudflare" cfg.service && cfg.cloudflare.tokenPath != null) { - CLOUDFLARE_TOKEN_FILE = cfg.cloudflare.tokenPath; - }; - - home.file = lib.mkMerge [ - (lib.mkIf (builtins.elem "cloudflare" cfg.service && cfg.cloudflare.tokenPath != null) { - ".cloudflared/token".source = cfg.cloudflare.tokenPath; - }) - (lib.mkIf (builtins.elem "ngrok" cfg.service && cfg.ngrok.configPath != null) { - ".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath; - }) - ]; - }; + cloudflareTokenConfig + ngrokConfig + ]; } \ No newline at end of file diff --git a/modules/hm/common/shell/disk-usage.nix b/modules/hm/common/shell/disk-usage.nix index 7718d4c..27d2c18 100644 --- a/modules/hm/common/shell/disk-usage.nix +++ b/modules/hm/common/shell/disk-usage.nix @@ -1,19 +1,32 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.disk-usage; - validTools = [ "ncdu" "diskonaut" "gdu" "dust" "parallel-disk-usage" "squirreldisk" ]; -in -{ - options.modules.common.shell.disk-usage = { + cfg = config.modules.hm.shell.disk-usage; + + # Map disk usage tools to their packages + toolToPackage = with pkgs; { + ncdu = ncdu; + diskonaut = diskonaut; + gdu = gdu; + dust = dust; + parallel-disk-usage = parallel-disk-usage; + squirreldisk = squirreldisk; + }; + + # Get packages for enabled tools + toolPackages = lib.filter (pkg: pkg != null) + (map (tool: toolToPackage.${tool} or null) cfg.tools); + +in { + options.modules.hm.shell.disk-usage = { tools = lib.mkOption { - type = lib.types.listOf (lib.types.enum validTools); + type = lib.types.listOf (lib.types.enum (lib.attrNames toolToPackage)); default = []; - description = "List of disk usage analyzers to install."; + description = "List of disk usage analyzers to install"; }; }; - config = lib.mkIf cfg.enable { - home.packages = builtins.map (tool: pkgs.${tool}) cfg.tools; + config = { + home.packages = toolPackages; }; } \ No newline at end of file diff --git a/modules/system/common/default.nix b/modules/system/common/default.nix index b0448df..b2e53d6 100644 --- a/modules/system/common/default.nix +++ b/modules/system/common/default.nix @@ -25,6 +25,6 @@ ./security/antivirus.nix ./security/password-manager.nix - ./virtualisation/containers/containers.nix + ./virtualisation/containers.nix ]; } diff --git a/modules/system/common/games/games.nix b/modules/system/common/games/games.nix index 8dfa9a9..13545ad 100755 --- a/modules/system/common/games/games.nix +++ b/modules/system/common/games/games.nix @@ -1,23 +1,35 @@ { pkgs, config, lib, ... }: let - cfg = config.modules.games; -in -{ - options.modules.games = { - enable = lib.mkEnableOption "Enable all gaming-related configuration"; + cfg = config.modules.system.games; - steam = { - compatToolsPath = lib.mkOption { - type = lib.types.path; - default = "${builtins.getEnv "HOME"}/.steam/root/compatibilitytools.d"; - description = "Path for Steam compatibility tools"; - }; - enable = lib.mkEnableOption "Enable Steam support"; + # Map gaming clients to their packages + clientToPackage = with pkgs; { + steam = [ steam ]; + lutris = [ lutris ]; + heroic = [ heroic ]; + }; + + # Get packages for enabled clients + clientPackages = lib.concatMap (client: clientToPackage.${client} or []) cfg.clients; + +in { + options.modules.system.games = { + clients = lib.mkOption { + type = lib.types.listOf (lib.types.enum (lib.attrNames clientToPackage)); + default = []; + description = '' + List of gaming clients to enable. Supported options are "steam", "lutris", + and "heroic". This allows you to specify which gaming clients should be + configured in your NixOS setup. + ''; }; - lutris.enable = lib.mkEnableOption "Enable Lutris support"; - heroic.enable = lib.mkEnableOption "Enable Heroic support"; + steam.compatToolsPath = lib.mkOption { + type = lib.types.path; + default = "${builtins.getEnv "HOME"}/.steam/root/compatibilitytools.d"; + description = "Path for Steam compatibility tools"; + }; gamemode = { enable = lib.mkEnableOption "Enable GameMode support"; @@ -51,30 +63,28 @@ in }; }; - config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; - lib.optional cfg.steam.enable steam - ++ lib.optional cfg.lutris.enable lutris - ++ lib.optional cfg.heroic.enable heroic; - - environment.sessionVariables = lib.mkIf cfg.steam.enable { - STEAM_EXTRA_COMPAT_TOOLS_PATHS = cfg.steam.compatToolsPath; - }; + config = lib.mkMerge [ + { + environment.systemPackages = lib.unique clientPackages; + environment.sessionVariables = lib.mkIf (lib.elem "steam" cfg.clients) { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = cfg.steam.compatToolsPath; + }; + } - programs = lib.mkMerge [ - (lib.mkIf cfg.gamemode.enable { - gamemode = { - enable = true; - enableRenice = cfg.gamemode.enableRenice; - settings = { - general = cfg.gamemode.generalSettings; - gpu = cfg.gamemode.gpuSettings; - custom = cfg.gamemode.notificationCommands; - }; + (lib.mkIf cfg.gamemode.enable { + programs.gamemode = { + enable = true; + enableRenice = cfg.gamemode.enableRenice; + settings = { + general = cfg.gamemode.generalSettings; + gpu = cfg.gamemode.gpuSettings; + custom = cfg.gamemode.notificationCommands; }; - }) + }; + }) - (lib.mkIf cfg.steam.enable { + (lib.mkIf (lib.elem "steam" cfg.clients) { + programs = { gamescope = { enable = true; capSysNice = true; @@ -86,7 +96,7 @@ in localNetworkGameTransfers.openFirewall = true; dedicatedServer.openFirewall = true; }; - }) - ]; - }; + }; + }) + ]; } \ No newline at end of file diff --git a/modules/system/common/security/antivirus.nix b/modules/system/common/security/antivirus.nix index c0676fd..67544bf 100644 --- a/modules/system/common/security/antivirus.nix +++ b/modules/system/common/security/antivirus.nix @@ -1,28 +1,51 @@ { config, lib, pkgs, ... }: let - cfg = config.modules.security.antivirus; -in { - #### 🛠 Options - options.modules.security.antivirus = { - enable = lib.mkEnableOption "Enable antivirus system-wide"; - - gui.enable = lib.mkEnableOption "Enable GUI tools for the antivirus"; + cfg = config.modules.system.security.antivirus; - engine = lib.mkOption { - type = lib.types.enum [ "clamav" "none" ]; - default = "clamav"; - description = "Select the antivirus engine to install."; + # Map engines to their packages and service configs + engineConfigs = { + clamav = { + packages = [ pkgs.clamav ] ++ lib.optionals cfg.gui.enable [ pkgs.clamtk ]; + services = { + clamav = { + daemon.enable = true; + updater.enable = true; + }; + }; + }; + sophos = { + packages = [ pkgs.sophos-av ]; + services = {}; + }; + none = { + packages = []; + services = {}; }; }; - #### ⚙ Configuration - config = lib.mkIf cfg.enable { - environment.systemPackages = lib.optionals (cfg.engine == "clamav") [pkgs.clamav] ++ lib.optionals (cfg.engine == "clamav" && cfg.gui.enable) [pkgs.clamtk]; + enabledEngines = lib.filter (e: e != "none") cfg.engines; - services = lib.mkIf (cfg.engine == "clamav") { - clamav.daemon.enable = true; - clamav.updater.enable = true; +in { + #### 🛠 Options + options.modules.system.security.antivirus = { + gui.enable = lib.mkEnableOption "Enable GUI tools for the antivirus"; + engines = lib.mkOption { + type = lib.types.listOf (lib.types.enum (lib.attrNames engineConfigs)); + default = ["none"]; + description = "Select antivirus engines to install"; }; }; + + #### ⚙ Configuration + config = lib.mkMerge [ + { + environment.systemPackages = lib.concatMap + (engine: engineConfigs.${engine}.packages) + enabledEngines; + } + (lib.mkIf (lib.elem "clamav" enabledEngines) + engineConfigs.clamav.services + ) + ]; } diff --git a/modules/system/common/security/password-manager.nix b/modules/system/common/security/password-manager.nix index adc2b98..75f0b1a 100644 --- a/modules/system/common/security/password-manager.nix +++ b/modules/system/common/security/password-manager.nix @@ -1,49 +1,56 @@ { config, lib, pkgs, ... }: -with lib; - let - cfg = config.modules.security; + cfg = config.modules.system.security; + + # Map password managers to their packages + passwordManagerToPackage = with pkgs; { + keepassxc = [ keepassxc ]; + bitwarden = [ bitwarden-desktop ]; + }; + + # YubiKey packages + yubikeyPackages = with pkgs; [ + yubikey-manager + yubikey-personalization + yubioath-flutter + yubikey-touch-detector + age + age-plugin-yubikey + pam_u2f + ]; + + # Get packages for enabled password managers + passwordManagerPackages = lib.concatMap + (manager: passwordManagerToPackage.${manager} or []) + cfg.passwordManager.backend; + in { - options.modules.security = { - yubikey.enable = mkEnableOption "Enable YubiKey support for password management"; + options.modules.system.security = { + yubikey.enable = lib.mkEnableOption "Enable YubiKey support for password management"; passwordManager = { - backend = mkOption { - type = types.listOf (types.enum ["keepassxc" "bitwarden"]); + backend = lib.mkOption { + type = lib.types.listOf (lib.types.enum (builtins.attrNames passwordManagerToPackage)); default = ["keepassxc"]; description = "Select the password manager backend(s) to use."; }; }; }; - config = { - security.pam.u2f.enable = cfg.yubikey.enable; - - services = { - pcscd.enable = cfg.yubikey.enable; - - udev.packages = lib.optionals cfg.yubikey.enable [ - pkgs.yubikey-personalization - pkgs.yubikey-manager + config = lib.mkMerge [ + (lib.mkIf cfg.yubikey.enable { + security.pam.u2f.enable = true; + services.pcscd.enable = true; + services.udev.packages = with pkgs; [ + yubikey-personalization + yubikey-manager ]; - }; + }) - environment.systemPackages = - (lib.optionals cfg.yubikey.enable [ - pkgs.yubikey-manager - pkgs.yubikey-personalization - pkgs.yubioath-flutter - pkgs.yubikey-touch-detector - pkgs.age - pkgs.age-plugin-yubikey - pkgs.pam_u2f - ]) ++ - (lib.optionals (lib.elem "keepassxc" cfg.passwordManager.backend) [ - pkgs.keepassxc - ]) ++ - (lib.optionals (lib.elem "bitwarden" cfg.passwordManager.backend) [ - pkgs.bitwarden-desktop - ]); - }; + { + environment.systemPackages = passwordManagerPackages + ++ lib.optionals cfg.yubikey.enable yubikeyPackages; + } + ]; } \ No newline at end of file From 9b5b15917eeaa549b75fe556650bffc313eef147 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:12:13 +0200 Subject: [PATCH 05/48] feat: add configuration for container engines support --- .../system/common/virtualisation/{containers => }/containers.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/system/common/virtualisation/{containers => }/containers.nix (100%) diff --git a/modules/system/common/virtualisation/containers/containers.nix b/modules/system/common/virtualisation/containers.nix similarity index 100% rename from modules/system/common/virtualisation/containers/containers.nix rename to modules/system/common/virtualisation/containers.nix From 97dc106c2d808babaf9e0b624dba7d1827ae63c1 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:41:19 +0200 Subject: [PATCH 06/48] refactor: update module paths to use hm namespace for consistency --- modules/hm/common/communication/mail/bluemail.nix | 2 -- modules/hm/common/communication/teams.nix | 4 ++-- modules/hm/common/dev/dotnet.nix | 4 ++-- modules/hm/common/dev/editor/android-studio.nix | 4 ++-- modules/hm/common/dev/editor/dbeaver.nix | 4 ++-- modules/hm/common/dev/editor/jetbrains.nix | 4 ++-- modules/hm/common/dev/editor/vs-code.nix | 4 ++-- modules/hm/common/dev/global-tools/act-github.nix | 4 ++-- modules/hm/common/dev/global-tools/nix.nix | 4 ++-- modules/hm/common/dev/node/node.nix | 4 ++-- modules/hm/common/dev/node/pm2.nix | 4 ++-- modules/hm/common/dev/node/prisma.nix | 4 ++-- modules/hm/common/dev/python.nix | 4 ++-- modules/hm/common/dev/rust.nix | 4 ++-- modules/hm/common/documentation/default.nix | 10 +++++----- modules/hm/common/documentation/obsidian.nix | 4 ++-- modules/hm/common/emulator/default.nix | 5 ++--- modules/hm/common/extra/ignore-file-retriever.nix | 4 ++-- modules/hm/common/games/mangohud.nix | 4 ++-- modules/hm/common/games/minecraft.nix | 4 ++-- modules/hm/common/games/northstar.nix | 4 ++-- modules/hm/common/games/roblox.nix | 4 ++-- modules/hm/common/games/rocket-league.nix | 4 ++-- modules/hm/common/games/star-citizen.nix | 4 ++-- modules/hm/common/multimedia/gimp.nix | 4 ++-- modules/hm/common/multimedia/mpv.nix | 4 ++-- modules/hm/common/multimedia/obs.nix | 4 ++-- modules/hm/common/multimedia/openshot-qt.nix | 4 ++-- modules/hm/common/multimedia/parsec.nix | 4 ++-- modules/hm/common/multimedia/stremio.nix | 4 ++-- modules/hm/common/network/tunnel.nix | 14 +++++++------- modules/hm/common/shell/btop.nix | 4 ++-- modules/hm/common/shell/fzf.nix | 4 ++-- modules/hm/common/shell/navi.nix | 4 ++-- modules/hm/common/shell/ranger.nix | 6 +++--- modules/hm/common/shell/starship.nix | 4 ++-- modules/hm/common/shell/tools.nix | 4 ++-- modules/hm/common/utilities/filezilla.nix | 4 ++-- modules/hm/common/utilities/kde-connect.nix | 4 ++-- modules/hm/common/utilities/scalar.nix | 4 ++-- modules/hm/common/utilities/stacer.nix | 4 ++-- modules/hm/desktops/hydenix.nix | 4 ++-- modules/hm/hosts/oak/default.nix | 15 ++++----------- 43 files changed, 95 insertions(+), 105 deletions(-) diff --git a/modules/hm/common/communication/mail/bluemail.nix b/modules/hm/common/communication/mail/bluemail.nix index 9919813..c3c11dc 100644 --- a/modules/hm/common/communication/mail/bluemail.nix +++ b/modules/hm/common/communication/mail/bluemail.nix @@ -1,7 +1,5 @@ { pkgs, config, lib, ... }: let - cfg = config.modules.common.communication.mail.bluemail; - bluemail = pkgs.bluemail; bluemailWithGPU = pkgs.symlinkJoin { diff --git a/modules/hm/common/communication/teams.nix b/modules/hm/common/communication/teams.nix index ee85801..e8da2e8 100644 --- a/modules/hm/common/communication/teams.nix +++ b/modules/hm/common/communication/teams.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.communication.teams; + cfg = config.modules.hm.communication.teams; in { - options.modules.common.communication.teams = { + options.modules.hm.communication.teams = { enable = lib.mkEnableOption "Enable Microsoft Teams for Linux"; }; diff --git a/modules/hm/common/dev/dotnet.nix b/modules/hm/common/dev/dotnet.nix index 57e3e4f..3a2d92f 100644 --- a/modules/hm/common/dev/dotnet.nix +++ b/modules/hm/common/dev/dotnet.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.dotnet; + cfg = config.modules.hm.dev.dotnet; sdkVersions = cfg.sdk-versions; @@ -14,7 +14,7 @@ let in { - options.modules.common.dev.dotnet = { + options.modules.hm.dev.dotnet = { enable = lib.mkEnableOption "Enable .NET development environment"; sdk-versions = lib.mkOption { type = lib.types.listOf lib.types.str; diff --git a/modules/hm/common/dev/editor/android-studio.nix b/modules/hm/common/dev/editor/android-studio.nix index 8fd201f..84af0ba 100644 --- a/modules/hm/common/dev/editor/android-studio.nix +++ b/modules/hm/common/dev/editor/android-studio.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.editor.android-studio; + cfg = config.modules.hm.dev.editor.android-studio; in { - options.modules.common.dev.editor.android-studio = { + options.modules.hm.dev.editor.android-studio = { enable = lib.mkEnableOption "Enable Android Studio development environment"; }; diff --git a/modules/hm/common/dev/editor/dbeaver.nix b/modules/hm/common/dev/editor/dbeaver.nix index dbe0213..ba96f26 100644 --- a/modules/hm/common/dev/editor/dbeaver.nix +++ b/modules/hm/common/dev/editor/dbeaver.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.editor.dbeaver; + cfg = config.modules.hm.dev.editor.dbeaver; in { - options.modules.common.dev.editor.dbeaver = { + options.modules.hm.dev.editor.dbeaver = { enable = lib.mkEnableOption "Enable DBeaver database management tool"; }; diff --git a/modules/hm/common/dev/editor/jetbrains.nix b/modules/hm/common/dev/editor/jetbrains.nix index 990d11b..3113fd3 100644 --- a/modules/hm/common/dev/editor/jetbrains.nix +++ b/modules/hm/common/dev/editor/jetbrains.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.editor.jetbrains; + cfg = config.modules.hm.dev.editor.jetbrains; in { - options.modules.common.dev.editor.jetbrains = { + options.modules.hm.dev.editor.jetbrains = { enable = lib.mkEnableOption "Enable JetBrains IDEs for development"; ides = lib.mkOption { diff --git a/modules/hm/common/dev/editor/vs-code.nix b/modules/hm/common/dev/editor/vs-code.nix index b150aac..5f2c2e0 100644 --- a/modules/hm/common/dev/editor/vs-code.nix +++ b/modules/hm/common/dev/editor/vs-code.nix @@ -1,11 +1,11 @@ { config, lib, pkgs, vars, ... }: let - cfg = config.modules.common.dev.editor.vs-code; + cfg = config.modules.hm.dev.editor.vs-code; in { # Add options for vs-code - options.modules.common.dev.editor.vs-code = { + options.modules.hm.dev.editor.vs-code = { enable = lib.mkEnableOption "Enable Visual Studio Code for development"; }; diff --git a/modules/hm/common/dev/global-tools/act-github.nix b/modules/hm/common/dev/global-tools/act-github.nix index 6c0d317..61f8c56 100644 --- a/modules/hm/common/dev/global-tools/act-github.nix +++ b/modules/hm/common/dev/global-tools/act-github.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.global-tools.act-github; + cfg = config.modules.hm.dev.global-tools.act-github; in { - options.modules.common.dev.global-tools.act-github = { + options.modules.hm.dev.global-tools.act-github = { enable = lib.mkEnableOption "Enable act for running GitHub Actions locally"; }; diff --git a/modules/hm/common/dev/global-tools/nix.nix b/modules/hm/common/dev/global-tools/nix.nix index c82f82d..c5bc2c8 100755 --- a/modules/hm/common/dev/global-tools/nix.nix +++ b/modules/hm/common/dev/global-tools/nix.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.global-tools.nix; + cfg = config.modules.hm.dev.global-tools.nix; in { - options.modules.common.dev.global-tools.nix = { + options.modules.hm.dev.global-tools.nix = { enable = lib.mkEnableOption "Enable Nix development environment"; }; diff --git a/modules/hm/common/dev/node/node.nix b/modules/hm/common/dev/node/node.nix index 72ea43a..d243733 100644 --- a/modules/hm/common/dev/node/node.nix +++ b/modules/hm/common/dev/node/node.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.node; + cfg = config.modules.hm.dev.node; expandPath = path: if lib.hasPrefix "~/" path then "${config.home.homeDirectory}/${lib.removePrefix "~/" path}" @@ -27,7 +27,7 @@ let allNodePackages = lib.flatten (map nodeWithPackageManager cfg.versions) ++ (map (pkgName: pkgs.${pkgName}) cfg.extraPackages); in { - options.modules.common.dev.node = { + options.modules.hm.dev.node = { enable = lib.mkEnableOption "Enable Node.js development environment"; packageManager = lib.mkOption { type = lib.types.enum [ "pnpm" "yarn" "npm" ]; diff --git a/modules/hm/common/dev/node/pm2.nix b/modules/hm/common/dev/node/pm2.nix index b9e83ee..3f8de7e 100644 --- a/modules/hm/common/dev/node/pm2.nix +++ b/modules/hm/common/dev/node/pm2.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.node.pm2; + cfg = config.modules.hm.dev.node.pm2; in { - options.modules.common.dev.node.pm2 = { + options.modules.hm.dev.node.pm2 = { enable = lib.mkEnableOption "Enable PM2 process manager for Node.js applications"; }; diff --git a/modules/hm/common/dev/node/prisma.nix b/modules/hm/common/dev/node/prisma.nix index 1f2219f..4ea7b2b 100644 --- a/modules/hm/common/dev/node/prisma.nix +++ b/modules/hm/common/dev/node/prisma.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.node.prisma; + cfg = config.modules.hm.dev.node.prisma; in { - options.modules.common.dev.node.prisma = { + options.modules.hm.dev.node.prisma = { enable = lib.mkEnableOption "Enable Prisma ORM for Node.js applications"; }; diff --git a/modules/hm/common/dev/python.nix b/modules/hm/common/dev/python.nix index bbb1480..35533ca 100644 --- a/modules/hm/common/dev/python.nix +++ b/modules/hm/common/dev/python.nix @@ -2,7 +2,7 @@ let # Shorthand for accessing module config - cfg = config.modules.common.dev.python; + cfg = config.modules.hm.dev.python; # add home directory to devShell.shellPaths if not already present homePath = cfg.devShell.defaultPath; # or: builtins.toString config.home.homeDirectory @@ -63,7 +63,7 @@ let ''; in { - options.modules.common.dev.python = { + options.modules.hm.dev.python = { # Main toggle enable = lib.mkEnableOption "Enable Python development environment"; diff --git a/modules/hm/common/dev/rust.nix b/modules/hm/common/dev/rust.nix index 8a37b2c..ed9e955 100644 --- a/modules/hm/common/dev/rust.nix +++ b/modules/hm/common/dev/rust.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.dev.rust; + cfg = config.modules.hm.dev.rust; rustDefaultPackages = with pkgs; [rustc cargo rust-analyzer clippy rustfmt]; @@ -9,7 +9,7 @@ let in { - options.modules.common.dev.rust = { + options.modules.hm.dev.rust = { enable = lib.mkEnableOption "Enable Rust development environment"; extraPackages = lib.mkOption { type = lib.types.listOf lib.types.package; diff --git a/modules/hm/common/documentation/default.nix b/modules/hm/common/documentation/default.nix index e40f95c..aa92408 100644 --- a/modules/hm/common/documentation/default.nix +++ b/modules/hm/common/documentation/default.nix @@ -4,19 +4,19 @@ let cfg = config.modules.hm.documentation; # Map document editors to their packages - editorToPackage = with pkgs; { + editorsToPackage = with pkgs; { onlyoffice = onlyoffice-bin; okular = okular; }; # Get packages for enabled editors - editorPackages = lib.filter (pkg: pkg != null) - (map (editor: editorToPackage.${editor} or null) cfg.editor); + editorsPackages = lib.filter (pkg: pkg != null) + (map (editor: editorsToPackage.${editor} or null) cfg.editors); in { options.modules.hm.documentation = { - editor = lib.mkOption { + editors = lib.mkOption { type = lib.types.listOf (lib.types.enum ["onlyoffice" "okular"]); default = []; description = "List of document editors to install"; @@ -24,6 +24,6 @@ in }; config = { - home.packages = editorPackages; + home.packages = editorsPackages; }; } \ No newline at end of file diff --git a/modules/hm/common/documentation/obsidian.nix b/modules/hm/common/documentation/obsidian.nix index 76b8e71..0dd9545 100644 --- a/modules/hm/common/documentation/obsidian.nix +++ b/modules/hm/common/documentation/obsidian.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - cfg = config.modules.common.documentation.obsidian; + cfg = config.modules.hm.documentation.obsidian; #──────── Canonical default ────────# defaultObsiPath = @@ -119,7 +119,7 @@ in /*────────────────────────── │ Module options │ └──────────────────────────*/ - options.modules.common.documentation.obsidian = { + options.modules.hm.documentation.obsidian = { enable = lib.mkEnableOption "Enable the Obsidian module"; backupMethod = lib.mkOption { diff --git a/modules/hm/common/emulator/default.nix b/modules/hm/common/emulator/default.nix index 091740b..5cf4ac3 100644 --- a/modules/hm/common/emulator/default.nix +++ b/modules/hm/common/emulator/default.nix @@ -13,7 +13,6 @@ let # Wine packages based on version winePackages = with pkgs; { stable = wine; - staging = wineStaging; wayland = wineWayland; fonts = wine; }; @@ -49,8 +48,8 @@ in { }; version = lib.mkOption { - type = lib.types.enum ["stable" "staging" "wayland" "fonts"]; - default = "staging"; + type = lib.types.enum ["stable" "wayland" "fonts"]; + default = "stable"; description = "Wine version to install"; }; diff --git a/modules/hm/common/extra/ignore-file-retriever.nix b/modules/hm/common/extra/ignore-file-retriever.nix index 1a222f9..b78acec 100644 --- a/modules/hm/common/extra/ignore-file-retriever.nix +++ b/modules/hm/common/extra/ignore-file-retriever.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.extra.ignore-file-retriever; + cfg = config.modules.hm.extra.ignore-file-retriever; expandPath = path: if lib.hasPrefix "~/" path then lib.removeSuffix "/" (lib.replacePrefix "~/" "${config.home.homeDirectory}/" path) @@ -86,7 +86,7 @@ let ''; in { - options.modules.common.extra.ignore-file-retriever = { + options.modules.hm.extra.ignore-file-retriever = { enable = lib.mkEnableOption "Enable ignore file retriever script to create .stignore from .gitignore patterns"; templatePath = lib.mkOption { diff --git a/modules/hm/common/games/mangohud.nix b/modules/hm/common/games/mangohud.nix index 76de1a0..d11f6fb 100644 --- a/modules/hm/common/games/mangohud.nix +++ b/modules/hm/common/games/mangohud.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.games.mangohud; + cfg = config.modules.hm.games.mangohud; in { - options.modules.common.games.mangohud = { + options.modules.hm.games.mangohud = { enable = lib.mkEnableOption "Enable MangoHud, a Vulkan and OpenGL overlay layer for monitoring performance"; cpu_text = lib.mkOption { type = lib.types.str; diff --git a/modules/hm/common/games/minecraft.nix b/modules/hm/common/games/minecraft.nix index 180953b..5b01904 100755 --- a/modules/hm/common/games/minecraft.nix +++ b/modules/hm/common/games/minecraft.nix @@ -1,10 +1,10 @@ { config, lib, pkgs, ... }: let - cfg = config.modules.common.games.minecraft; + cfg = config.modules.hm.games.minecraft; in { - options.modules.common.games.minecraft = { + options.modules.hm.games.minecraft = { enable = lib.mkEnableOption "Enable Minecraft Launcher"; }; diff --git a/modules/hm/common/games/northstar.nix b/modules/hm/common/games/northstar.nix index 7908369..dd31910 100644 --- a/modules/hm/common/games/northstar.nix +++ b/modules/hm/common/games/northstar.nix @@ -1,10 +1,10 @@ { config, lib, pkgs, inputs, ... }: let - cfg = config.modules.common.games.northstar; + cfg = config.modules.hm.games.northstar; in { - options.modules.common.games.northstar = { + options.modules.hm.games.northstar = { enable = lib.mkEnableOption "Enable Northstar (Titanfall 2 mod) with Proton and Viper"; }; diff --git a/modules/hm/common/games/roblox.nix b/modules/hm/common/games/roblox.nix index b76d7d5..5b1c72d 100644 --- a/modules/hm/common/games/roblox.nix +++ b/modules/hm/common/games/roblox.nix @@ -1,10 +1,10 @@ { config, lib, pkgs, inputs, ... }: let - cfg = config.modules.common.games.roblox; + cfg = config.modules.hm.games.roblox; in { - options.modules.common.games.roblox = { + options.modules.hm.games.roblox = { enable = lib.mkEnableOption "Enable Roblox Player"; }; diff --git a/modules/hm/common/games/rocket-league.nix b/modules/hm/common/games/rocket-league.nix index 90c8e44..c2c9ea9 100644 --- a/modules/hm/common/games/rocket-league.nix +++ b/modules/hm/common/games/rocket-league.nix @@ -1,10 +1,10 @@ { config, lib, pkgs, inputs, ... }: let - cfg = config.modules.common.games.rocket-league; + cfg = config.modules.hm.games.rocket-league; in { - options.modules.common.games.rocket-league = { + options.modules.hm.games.rocket-league = { enable = lib.mkEnableOption "Enable Rocket League game installation via nix-gaming"; }; diff --git a/modules/hm/common/games/star-citizen.nix b/modules/hm/common/games/star-citizen.nix index d82d292..f0cc75c 100644 --- a/modules/hm/common/games/star-citizen.nix +++ b/modules/hm/common/games/star-citizen.nix @@ -1,10 +1,10 @@ { config, lib, pkgs, inputs, ... }: let - cfg = config.modules.common.games.star-citizen; + cfg = config.modules.hm.games.star-citizen; in { - options.modules.common.games.star-citizen = { + options.modules.hm.games.star-citizen = { enable = lib.mkEnableOption "Enable Star Citizen Launcher"; }; diff --git a/modules/hm/common/multimedia/gimp.nix b/modules/hm/common/multimedia/gimp.nix index caf246f..95a92e0 100644 --- a/modules/hm/common/multimedia/gimp.nix +++ b/modules/hm/common/multimedia/gimp.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.multimedia.gimp; + cfg = config.modules.hm.multimedia.gimp; in { - options.modules.common.multimedia.gimp = { + options.modules.hm.multimedia.gimp = { enable = lib.mkEnableOption "Enable GIMP image editor"; }; diff --git a/modules/hm/common/multimedia/mpv.nix b/modules/hm/common/multimedia/mpv.nix index f671596..0dc8479 100644 --- a/modules/hm/common/multimedia/mpv.nix +++ b/modules/hm/common/multimedia/mpv.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.multimedia.mpv; + cfg = config.modules.hm.multimedia.mpv; in { - options.modules.common.multimedia.mpv = { + options.modules.hm.multimedia.mpv = { enable = lib.mkEnableOption "Enable mpv media player with custom scripts"; }; diff --git a/modules/hm/common/multimedia/obs.nix b/modules/hm/common/multimedia/obs.nix index 0660555..d972804 100755 --- a/modules/hm/common/multimedia/obs.nix +++ b/modules/hm/common/multimedia/obs.nix @@ -1,10 +1,10 @@ { pkgs, config, lib, ... }: let - cfg = config.modules.common.multimedia.obs; + cfg = config.modules.hm.multimedia.obs; in { - options.modules.common.multimedia.obs = { + options.modules.hm.multimedia.obs = { enable = lib.mkEnableOption "Enable OBS Studio for video recording and streaming"; }; diff --git a/modules/hm/common/multimedia/openshot-qt.nix b/modules/hm/common/multimedia/openshot-qt.nix index d47fee5..695d98b 100644 --- a/modules/hm/common/multimedia/openshot-qt.nix +++ b/modules/hm/common/multimedia/openshot-qt.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.multimedia.openshot-qt; + cfg = config.modules.hm.multimedia.openshot-qt; in { - options.modules.common.multimedia.openshot-qt = { + options.modules.hm.multimedia.openshot-qt = { enable = lib.mkEnableOption "Enable OpenShot video editor"; }; diff --git a/modules/hm/common/multimedia/parsec.nix b/modules/hm/common/multimedia/parsec.nix index 696243d..b9234ba 100644 --- a/modules/hm/common/multimedia/parsec.nix +++ b/modules/hm/common/multimedia/parsec.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.multimedia.parsec; + cfg = config.modules.hm.multimedia.parsec; in { - options.modules.common.multimedia.parsec = { + options.modules.hm.multimedia.parsec = { enable = lib.mkEnableOption "Enable Parsec for remote desktop access"; }; diff --git a/modules/hm/common/multimedia/stremio.nix b/modules/hm/common/multimedia/stremio.nix index 9386488..092328a 100644 --- a/modules/hm/common/multimedia/stremio.nix +++ b/modules/hm/common/multimedia/stremio.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.multimedia.stremio; + cfg = config.modules.hm.multimedia.stremio; in { - options.modules.common.multimedia.stremio = { + options.modules.hm.multimedia.stremio = { enable = lib.mkEnableOption "Enable Stremio media center"; }; diff --git a/modules/hm/common/network/tunnel.nix b/modules/hm/common/network/tunnel.nix index 3c11825..461bbd7 100644 --- a/modules/hm/common/network/tunnel.nix +++ b/modules/hm/common/network/tunnel.nix @@ -4,7 +4,7 @@ let cfg = config.modules.hm.network.tunnel; # Map services to their packages - serviceToPackage = with pkgs; { + servicesToPackage = with pkgs; { localtunnel = [ nodePackages.localtunnel ]; cloudflare = [ cloudflared ]; ngrok = [ ngrok ]; @@ -26,27 +26,27 @@ let }; # Get packages for enabled services - servicePackages = lib.concatMap (service: serviceToPackage.${service} or []) cfg.service; + servicesPackages = lib.concatMap (service: servicesToPackage.${service} or []) cfg.services; # Get aliases for enabled services enabledAliases = lib.foldl (acc: service: acc // (tunnelAliases.${service} or {}) - ) {} cfg.service; + ) {} cfg.services; # Cloudflare token configuration - cloudflareTokenConfig = lib.mkIf (builtins.elem "cloudflare" cfg.service && cfg.cloudflare.tokenPath != null) { + cloudflareTokenConfig = lib.mkIf (builtins.elem "cloudflare" cfg.services && cfg.cloudflare.tokenPath != null) { home.sessionVariables.CLOUDFLARE_TOKEN_FILE = cfg.cloudflare.tokenPath; home.file.".cloudflared/token".source = cfg.cloudflare.tokenPath; }; # Ngrok config file - ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.service && cfg.ngrok.configPath != null) { + ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.services && cfg.ngrok.configPath != null) { home.file.".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath; }; in { options.modules.hm.network.tunnel = { - service = lib.mkOption { + services = lib.mkOption { type = lib.types.listOf (lib.types.enum ["localtunnel" "cloudflare" "ngrok"]); default = ["localtunnel"]; description = "List of tunneling services to enable"; @@ -89,7 +89,7 @@ in { config = lib.mkMerge [ { - home.packages = servicePackages; + home.packages = servicesPackages; home.shellAliases = enabledAliases; } diff --git a/modules/hm/common/shell/btop.nix b/modules/hm/common/shell/btop.nix index f5712e5..5298165 100644 --- a/modules/hm/common/shell/btop.nix +++ b/modules/hm/common/shell/btop.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.btop; + cfg = config.modules.hm.shell.btop; in { - options.modules.common.shell.btop = { + options.modules.hm.shell.btop = { enable = lib.mkEnableOption "Enable btop system monitor"; }; diff --git a/modules/hm/common/shell/fzf.nix b/modules/hm/common/shell/fzf.nix index edfcd33..35e1f31 100644 --- a/modules/hm/common/shell/fzf.nix +++ b/modules/hm/common/shell/fzf.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.fzf; + cfg = config.modules.hm.shell.fzf; in { - options.modules.common.shell.fzf = { + options.modules.hm.shell.fzf = { enable = lib.mkEnableOption "Enable FZF (fuzzy finder)"; }; diff --git a/modules/hm/common/shell/navi.nix b/modules/hm/common/shell/navi.nix index 49c089b..4e2ea17 100644 --- a/modules/hm/common/shell/navi.nix +++ b/modules/hm/common/shell/navi.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.navi; + cfg = config.modules.hm.shell.navi; in { - options.modules.common.shell.navi = { + options.modules.hm.shell.navi = { enable = lib.mkEnableOption "Enable Navi (CLI cheat sheet tool)"; }; diff --git a/modules/hm/common/shell/ranger.nix b/modules/hm/common/shell/ranger.nix index 0fe65f4..83e988c 100644 --- a/modules/hm/common/shell/ranger.nix +++ b/modules/hm/common/shell/ranger.nix @@ -1,14 +1,14 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.ranger; + cfg = config.modules.hm.shell.ranger; in { - options.modules.common.shell.ranger = { + options.modules.hm.shell.ranger = { enable = lib.mkEnableOption "Enable Ranger (file manager)"; }; - config = lib.mkIf config.modules.common.shell.ranger.enable { + config = lib.mkIf cfg.enable { home.packages = (with pkgs; [ ranger ]); diff --git a/modules/hm/common/shell/starship.nix b/modules/hm/common/shell/starship.nix index 121143f..3238df9 100644 --- a/modules/hm/common/shell/starship.nix +++ b/modules/hm/common/shell/starship.nix @@ -6,10 +6,10 @@ ... }: let - cfg = config.modules.common.shell.starship; + cfg = config.modules.hm.shell.starship; in { - options.modules.common.shell.starship = { + options.modules.hm.shell.starship = { enable = lib.mkEnableOption "Enable Starship (cross-shell prompt)"; }; diff --git a/modules/hm/common/shell/tools.nix b/modules/hm/common/shell/tools.nix index 7cc25f5..39b1b8a 100644 --- a/modules/hm/common/shell/tools.nix +++ b/modules/hm/common/shell/tools.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.shell.tools; + cfg = config.modules.hm.shell.tools; in { - options.modules.common.shell.tools = { + options.modules.hm.shell.tools = { enable = lib.mkEnableOption "Enable common shell tools"; }; diff --git a/modules/hm/common/utilities/filezilla.nix b/modules/hm/common/utilities/filezilla.nix index 795e2b3..96a9958 100644 --- a/modules/hm/common/utilities/filezilla.nix +++ b/modules/hm/common/utilities/filezilla.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.utilities.filezilla; + cfg = config.modules.hm.utilities.filezilla; in { - options.modules.common.utilities.filezilla = { + options.modules.hm.utilities.filezilla = { enable = lib.mkEnableOption "Enable FileZilla (FTP client)"; }; diff --git a/modules/hm/common/utilities/kde-connect.nix b/modules/hm/common/utilities/kde-connect.nix index 68dd37b..ffa0dd8 100644 --- a/modules/hm/common/utilities/kde-connect.nix +++ b/modules/hm/common/utilities/kde-connect.nix @@ -3,10 +3,10 @@ with lib; let - cfg = config.modules.common.utilities.kde-connect; + cfg = config.modules.hm.utilities.kde-connect; in { - options.modules.common.utilities.kde-connect = { + options.modules.hm.utilities.kde-connect = { enable = mkEnableOption "KDE Connect"; indicator = mkOption { type = types.bool; diff --git a/modules/hm/common/utilities/scalar.nix b/modules/hm/common/utilities/scalar.nix index f8eb9c8..79de38a 100644 --- a/modules/hm/common/utilities/scalar.nix +++ b/modules/hm/common/utilities/scalar.nix @@ -3,7 +3,7 @@ with lib; let - cfg = config.modules.common.utilities.scalar; + cfg = config.modules.hm.utilities.scalar; scalar-deb = pkgs.fetchurl { url = "https://download.scalar.com/linux/deb/x64"; @@ -62,7 +62,7 @@ let }; in { - options.modules.common.utilities.scalar = { + options.modules.hm.utilities.scalar = { enable = mkEnableOption "Scalar desktop application"; }; diff --git a/modules/hm/common/utilities/stacer.nix b/modules/hm/common/utilities/stacer.nix index a0a55e5..215bbc5 100644 --- a/modules/hm/common/utilities/stacer.nix +++ b/modules/hm/common/utilities/stacer.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.common.utilities.stacer; + cfg = config.modules.hm.utilities.stacer; in { - options.modules.common.utilities.stacer = { + options.modules.hm.utilities.stacer = { enable = lib.mkEnableOption "Enable Stacer system optimizer and monitoring tool"; }; diff --git a/modules/hm/desktops/hydenix.nix b/modules/hm/desktops/hydenix.nix index 4b77c9a..5004e0a 100644 --- a/modules/hm/desktops/hydenix.nix +++ b/modules/hm/desktops/hydenix.nix @@ -10,7 +10,7 @@ with lib; let cfg = config.desktops.hydenix; - config = import ./configHydenix.nix { inherit lib; }; + configHydenix = import ./configHydenix.nix { inherit lib; }; in { @@ -89,7 +89,7 @@ in home.file = { ".config/hypr/keybindings.conf" = lib.mkForce { text = '' - ${config.hyprlandKeybindsConvert} + ${configHydenix.hyprlandKeybindsConvert} ''; force = true; }; diff --git a/modules/hm/hosts/oak/default.nix b/modules/hm/hosts/oak/default.nix index 9aca276..43b331a 100644 --- a/modules/hm/hosts/oak/default.nix +++ b/modules/hm/hosts/oak/default.nix @@ -8,7 +8,7 @@ ../../common ]; - config.modules.common = { + config.modules.hm = { shell = { btop.enable = true; starship.enable = true; @@ -33,7 +33,7 @@ driver.enable = true; }; documentation = { - editor = ["onlyoffice"]; + editors = ["onlyoffice"]; obsidian = { enable = true; backupMethod = "git-push-temp"; @@ -66,17 +66,10 @@ mail.services = ["thunderbird"]; }; network.tunnel = { - enable = true; - service = ["localtunnel" "ngrok"]; + services = ["localtunnel"]; localtunnel.port = 8080; - ngrok = { - port = 3000; - }; - }; - utilities = { - kde-connect.enable = true; - scalar.enable = true; }; + utilities.scalar.enable = true; #extra = { #ignore-file-retriever = { #enable = true; From dfe53e169c857644f3ac3d262f87b010f7ddc127 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:41:32 +0200 Subject: [PATCH 07/48] refactor: update module paths to use system namespace for consistency --- modules/system/common/backup/syncthing.nix | 4 +- modules/system/common/dev/dev.nix | 4 +- modules/system/common/dev/flatpak.nix | 4 +- modules/system/common/dev/flutter.nix | 4 +- modules/system/common/dev/php.nix | 4 +- modules/system/common/games/gamescope.nix | 4 +- modules/system/common/hardware/autologin.nix | 4 +- modules/system/common/hardware/boot.nix | 4 +- modules/system/common/hardware/powersave.nix | 4 +- modules/system/common/networks/portmaster.nix | 139 ------------------ .../system/common/networks/print/print.nix | 4 +- .../system/common/networks/vpn/tailscale.nix | 4 +- modules/system/common/nix/linux-cachyos.nix | 4 +- modules/system/common/nix/nix-garbage.nix | 4 +- modules/system/common/nix/polkit.nix | 4 +- modules/system/common/security/antivirus.nix | 50 +++---- .../common/virtualisation/containers.nix | 10 +- modules/system/hosts/fern/default.nix | 4 +- modules/system/hosts/fern/drivers.nix | 4 +- modules/system/hosts/fern/openrgb.nix | 68 --------- modules/system/hosts/fern/plex.nix | 4 +- modules/system/hosts/fern/sunshine.nix | 4 +- modules/system/hosts/fern/vfio/default.nix | 4 +- modules/system/hosts/fern/wol.nix | 4 +- modules/system/hosts/oak/default.nix | 18 +-- 25 files changed, 66 insertions(+), 299 deletions(-) delete mode 100644 modules/system/common/networks/portmaster.nix delete mode 100644 modules/system/hosts/fern/openrgb.nix diff --git a/modules/system/common/backup/syncthing.nix b/modules/system/common/backup/syncthing.nix index f1e351c..6772a43 100644 --- a/modules/system/common/backup/syncthing.nix +++ b/modules/system/common/backup/syncthing.nix @@ -7,10 +7,10 @@ }: let - cfg = config.modules.backup.syncthing; + cfg = config.modules.system.backup.syncthing; in { - options.modules.backup.syncthing = { + options.modules.system.backup.syncthing = { enable = lib.mkEnableOption "Enable Syncthing for file synchronization"; port = lib.mkOption { diff --git a/modules/system/common/dev/dev.nix b/modules/system/common/dev/dev.nix index 5d4231f..f8a184d 100755 --- a/modules/system/common/dev/dev.nix +++ b/modules/system/common/dev/dev.nix @@ -6,10 +6,10 @@ }: let - cfg = config.modules.dev.dev-global; + cfg = config.modules.system.dev.dev-global; in { - options.modules.dev.dev-global = { + options.modules.system.dev.dev-global = { enable = lib.mkEnableOption "Enable global development tools and libraries"; }; diff --git a/modules/system/common/dev/flatpak.nix b/modules/system/common/dev/flatpak.nix index 47c690d..55e4a2d 100644 --- a/modules/system/common/dev/flatpak.nix +++ b/modules/system/common/dev/flatpak.nix @@ -6,10 +6,10 @@ }: let - cfg = config.modules.dev.flatpak; + cfg = config.modules.system.dev.flatpak; in { - options.modules.dev.flatpak = { + options.modules.system.dev.flatpak = { enable = lib.mkEnableOption "Enable Flatpak development environment"; flathubRepoUrls = lib.mkOption { diff --git a/modules/system/common/dev/flutter.nix b/modules/system/common/dev/flutter.nix index 9135ce6..024d7d4 100755 --- a/modules/system/common/dev/flutter.nix +++ b/modules/system/common/dev/flutter.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, vars, ... }: let - cfg = config.modules.dev.flutter; + cfg = config.modules.system.dev.flutter; # Android SDK configuration androidComposition = pkgs.androidenv.composeAndroidPackages { @@ -12,7 +12,7 @@ let androidSdk = androidComposition.androidsdk; in { - options.modules.dev.flutter = { + options.modules.system.dev.flutter = { enable = lib.mkEnableOption "Flutter development environment"; withAndroid = lib.mkEnableOption "Include Android SDK tooling"; diff --git a/modules/system/common/dev/php.nix b/modules/system/common/dev/php.nix index 0216333..d13e7e6 100644 --- a/modules/system/common/dev/php.nix +++ b/modules/system/common/dev/php.nix @@ -1,10 +1,10 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.dev.php; + cfg = config.modules.system.dev.php; in { - options.modules.dev.php = { + options.modules.system.dev.php = { enable = lib.mkEnableOption "Enable PHP development environment"; }; diff --git a/modules/system/common/games/gamescope.nix b/modules/system/common/games/gamescope.nix index dd2416f..f745fbd 100755 --- a/modules/system/common/games/gamescope.nix +++ b/modules/system/common/games/gamescope.nix @@ -8,10 +8,10 @@ with lib; let - cfg = config.modules.games.gamescope; + cfg = config.modules.system.games.gamescope; in { - options.modules.games.gamescope = { + options.modules.system.games.gamescope = { enable = mkEnableOption "Enable Gamescope compositor for gaming"; }; diff --git a/modules/system/common/hardware/autologin.nix b/modules/system/common/hardware/autologin.nix index 30c7673..653ab33 100755 --- a/modules/system/common/hardware/autologin.nix +++ b/modules/system/common/hardware/autologin.nix @@ -5,10 +5,10 @@ }: let - cfg = config.modules.hardware.autologin; + cfg = config.modules.system.hardware.autologin; in { - options.modules.hardware.autologin = { + options.modules.system.hardware.autologin = { enable = lib.mkEnableOption "Enable autologin for SDDM"; user = lib.mkOption { diff --git a/modules/system/common/hardware/boot.nix b/modules/system/common/hardware/boot.nix index d598b28..3da1c59 100755 --- a/modules/system/common/hardware/boot.nix +++ b/modules/system/common/hardware/boot.nix @@ -6,11 +6,11 @@ }: let - cfg = config.modules.hardware.boot; + cfg = config.modules.system.hardware.boot; in { - options.modules.hardware.boot = { + options.modules.system.hardware.boot = { enable = lib.mkEnableOption "Enable boot configuration for Hydenix systems"; }; diff --git a/modules/system/common/hardware/powersave.nix b/modules/system/common/hardware/powersave.nix index f936de7..9f7ddf1 100644 --- a/modules/system/common/hardware/powersave.nix +++ b/modules/system/common/hardware/powersave.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, vars, ... }: let - cfg = config.modules.hardware.powersave; + cfg = config.modules.system.hardware.powersave; in { - options.modules.hardware.powersave = { + options.modules.system.hardware.powersave = { enable = lib.mkEnableOption "Enable power saving configuration"; architecture = lib.mkOption { diff --git a/modules/system/common/networks/portmaster.nix b/modules/system/common/networks/portmaster.nix deleted file mode 100644 index e64bf68..0000000 --- a/modules/system/common/networks/portmaster.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.modules.networks.portmaster; - - portmaster-deb = pkgs.fetchurl { - url = "https://updates.safing.io/latest/linux_amd64/packages/portmaster-installer.deb"; - sha256 = "sha256-2b9Gn9Hzvuiu/YEeAZRTvJU1Iom06tp0bTC5LhbmghM="; - }; - - portmaster-desktop = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster.desktop"; - sha256 = "sha256-ewwD5FUt2Gyu/y1iixM0bP5wpkavEausZVXjSORsKNo="; # Replace with actual hash - }; - - portmaster-app = pkgs.stdenv.mkDerivation { - name = "portmaster-desktop"; - src = portmaster-deb; - - nativeBuildInputs = [ pkgs.autoPatchelfHook pkgs.dpkg pkgs.makeWrapper ]; - buildInputs = with pkgs; [ - alsa-lib - mesa - libdrm - libglvnd - vulkan-loader - libva - gtk3 - libsecret - nss - xorg.libXdamage - xorg.libXtst - xorg.libXcomposite - xorg.libXrandr - systemd - networkmanager - adwaita-icon-theme - ]; - - unpackPhase = "dpkg -x $src ."; - - installPhase = '' - # Main binary - mkdir -p $out/opt/safing/portmaster - cp -r opt/safing/portmaster/* $out/opt/safing/portmaster/ - - # Systemd service - mkdir -p $out/etc/systemd/system - cat > $out/etc/systemd/system/portmaster.service < Date: Sun, 15 Jun 2025 12:47:22 +0200 Subject: [PATCH 08/48] refactor: consolidate tailscale vpn configuration --- modules/system/common/default.nix | 2 +- modules/system/common/networks/vpn.nix | 24 +++++++++++++++++++ .../system/common/networks/vpn/tailscale.nix | 20 ---------------- modules/system/hosts/oak/default.nix | 2 +- 4 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 modules/system/common/networks/vpn.nix delete mode 100644 modules/system/common/networks/vpn/tailscale.nix diff --git a/modules/system/common/default.nix b/modules/system/common/default.nix index b2e53d6..2f3c720 100644 --- a/modules/system/common/default.nix +++ b/modules/system/common/default.nix @@ -16,7 +16,7 @@ ./hardware/powersave.nix ./networks/print/print.nix - ./networks/vpn/tailscale.nix + ./networks/vpn.nix ./nix/linux-cachyos.nix ./nix/nix-garbage.nix diff --git a/modules/system/common/networks/vpn.nix b/modules/system/common/networks/vpn.nix new file mode 100644 index 0000000..5863276 --- /dev/null +++ b/modules/system/common/networks/vpn.nix @@ -0,0 +1,24 @@ +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.modules.system.networks; +in +{ + options.modules.system.networks = { + vpn = lib.mkOption { + type = lib.types.listOf (lib.types.enum ["tailscale"]); + default = []; + description = "List of VPN services to enable. Currently only 'tailscale' is supported."; + }; + }; + + config = { + services.tailscale = { + enable = lib.elem "tailscale" cfg.vpn; + }; + }; +} diff --git a/modules/system/common/networks/vpn/tailscale.nix b/modules/system/common/networks/vpn/tailscale.nix deleted file mode 100644 index 65b4674..0000000 --- a/modules/system/common/networks/vpn/tailscale.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - cfg = config.modules.system.networks.vpn.tailscale; -in -{ - options.modules.system.networks.vpn.tailscale = { - enable = lib.mkEnableOption "Enable Tailscale VPN support"; - }; - - config = lib.mkIf cfg.enable { - services.tailscale = { - enable = true; - }; - }; -} diff --git a/modules/system/hosts/oak/default.nix b/modules/system/hosts/oak/default.nix index d0e157c..26569c9 100644 --- a/modules/system/hosts/oak/default.nix +++ b/modules/system/hosts/oak/default.nix @@ -13,7 +13,7 @@ polkit.enable = true; }; games.clients = ["steam" "lutris"]; - networks.vpn.tailscale.enable = true; + networks.vpn = ["tailscale"]; virtualisation.containers.engines = ["docker"]; backup.syncthing = { enable = true; From 844085ef01a77227fb974ac28def7bd4157cbdf2 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:51:27 +0200 Subject: [PATCH 09/48] feat: add joystick support for games configuration --- modules/hm/common/default.nix | 1 + modules/hm/common/games/joystick.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 modules/hm/common/games/joystick.nix diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index 1e4fd3f..a8618e7 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -31,6 +31,7 @@ #./extra/ignore-file-retriever.nix + ./games/joystick.nix ./games/mangohud.nix ./games/minecraft.nix ./games/roblox.nix diff --git a/modules/hm/common/games/joystick.nix b/modules/hm/common/games/joystick.nix new file mode 100644 index 0000000..de67fcc --- /dev/null +++ b/modules/hm/common/games/joystick.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.modules.hm.games.joystick; +in +{ + options.modules.hm.games.joystick = { + enable = lib.mkEnableOption "Enable Joystick support for games"; + }; + + config = lib.mkIf cfg.enable { + home.packages = (with pkgs; [ + joystickwake + qjoypad + ]); + }; +} From bff51e92a32d747113b1101d478e73ff335ddf39 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:57:31 +0200 Subject: [PATCH 10/48] feat: add game configuration module --- modules/hm/common/default.nix | 11 +++---- modules/hm/common/games/games.nix | 48 +++++++++++++++++++++++++++++++ modules/hm/hosts/oak/default.nix | 2 +- 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 modules/hm/common/games/games.nix diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index a8618e7..b4a7654 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -33,11 +33,12 @@ ./games/joystick.nix ./games/mangohud.nix - ./games/minecraft.nix - ./games/roblox.nix - ./games/rocket-league.nix - ./games/star-citizen.nix - ./games/northstar.nix + ./games/games.nix + #./games/minecraft.nix + #./games/roblox.nix + #./games/rocket-league.nix + #./games/star-citizen.nix + #./games/northstar.nix ./multimedia/gimp.nix ./multimedia/mpv.nix diff --git a/modules/hm/common/games/games.nix b/modules/hm/common/games/games.nix new file mode 100644 index 0000000..6b84f46 --- /dev/null +++ b/modules/hm/common/games/games.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, inputs, ... }: + +let + cfg = config.modules.hm.games; + + # Define all available games + availableGames = { + minecraft = { + packages = with pkgs; [ prismlauncher jdk17 gcc glibc ]; + description = "Minecraft Launcher with PrismLauncher"; + }; + northstar = { + packages = with inputs.nix-gaming.packages.${pkgs.system}; [ northstar-proton viper ]; + description = "Northstar (Titanfall 2 mod) with Proton and Viper"; + }; + roblox = { + packages = with inputs.nix-gaming.packages.${pkgs.system}; [ roblox-player ]; + description = "Roblox Player"; + }; + rocket-league = { + packages = with inputs.nix-gaming.packages.${pkgs.system}; [ rocket-league ]; + description = "Rocket League via nix-gaming"; + }; + star-citizen = { + packages = with inputs.nix-gaming.packages.${pkgs.system}; [ star-citizen ]; + description = "Star Citizen Launcher"; + }; + }; + + # Get list of game names for the enum type + gameNames = builtins.attrNames availableGames; + + # Get packages for enabled games + gamePackages = lib.concatMap (game: availableGames.${game}.packages) cfg.enabledGames; + +in { + options.modules.hm.games = { + enabledGames = lib.mkOption { + type = lib.types.listOf (lib.types.enum gameNames); + default = []; + description = "List of games to enable"; + }; + }; + + config = lib.mkIf (cfg.enabledGames != []) { + home.packages = gamePackages; + }; +} \ No newline at end of file diff --git a/modules/hm/hosts/oak/default.nix b/modules/hm/hosts/oak/default.nix index 43b331a..5d8a517 100644 --- a/modules/hm/hosts/oak/default.nix +++ b/modules/hm/hosts/oak/default.nix @@ -22,7 +22,7 @@ enable = true; cpu_text = "Ryzen 7 7435HS"; }; - minecraft.enable = true; + enabledGames = ["minecraft"]; }; multimedia = { gimp.enable = true; From 18d60b76d849b48c6670a349acd400a118c008e1 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:59:05 +0200 Subject: [PATCH 11/48] refactor: remove unused game configuration files --- modules/hm/common/default.nix | 5 ----- modules/hm/common/games/minecraft.nix | 19 ------------------- modules/hm/common/games/northstar.nix | 17 ----------------- modules/hm/common/games/roblox.nix | 16 ---------------- modules/hm/common/games/rocket-league.nix | 16 ---------------- modules/hm/common/games/star-citizen.nix | 16 ---------------- 6 files changed, 89 deletions(-) delete mode 100755 modules/hm/common/games/minecraft.nix delete mode 100644 modules/hm/common/games/northstar.nix delete mode 100644 modules/hm/common/games/roblox.nix delete mode 100644 modules/hm/common/games/rocket-league.nix delete mode 100644 modules/hm/common/games/star-citizen.nix diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index b4a7654..8fadd5d 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -34,11 +34,6 @@ ./games/joystick.nix ./games/mangohud.nix ./games/games.nix - #./games/minecraft.nix - #./games/roblox.nix - #./games/rocket-league.nix - #./games/star-citizen.nix - #./games/northstar.nix ./multimedia/gimp.nix ./multimedia/mpv.nix diff --git a/modules/hm/common/games/minecraft.nix b/modules/hm/common/games/minecraft.nix deleted file mode 100755 index 5b01904..0000000 --- a/modules/hm/common/games/minecraft.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.modules.hm.games.minecraft; -in -{ - options.modules.hm.games.minecraft = { - enable = lib.mkEnableOption "Enable Minecraft Launcher"; - }; - - config = lib.mkIf cfg.enable { - home.packages = (with pkgs; [ - prismlauncher - jdk17 - gcc - glibc - ]); - }; -} diff --git a/modules/hm/common/games/northstar.nix b/modules/hm/common/games/northstar.nix deleted file mode 100644 index dd31910..0000000 --- a/modules/hm/common/games/northstar.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.modules.hm.games.northstar; -in -{ - options.modules.hm.games.northstar = { - enable = lib.mkEnableOption "Enable Northstar (Titanfall 2 mod) with Proton and Viper"; - }; - - config = lib.mkIf cfg.enable { - home.packages = (with pkgs; [ - inputs.nix-gaming.packages.${pkgs.system}.northstar-proton - inputs.nix-gaming.packages.${pkgs.system}.viper - ]); - }; -} diff --git a/modules/hm/common/games/roblox.nix b/modules/hm/common/games/roblox.nix deleted file mode 100644 index 5b1c72d..0000000 --- a/modules/hm/common/games/roblox.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.modules.hm.games.roblox; -in -{ - options.modules.hm.games.roblox = { - enable = lib.mkEnableOption "Enable Roblox Player"; - }; - - config = lib.mkIf cfg.enable { - home.packages = (with pkgs; [ - inputs.nix-gaming.packages.${pkgs.system}.roblox-player - ]); - }; -} diff --git a/modules/hm/common/games/rocket-league.nix b/modules/hm/common/games/rocket-league.nix deleted file mode 100644 index c2c9ea9..0000000 --- a/modules/hm/common/games/rocket-league.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.modules.hm.games.rocket-league; -in -{ - options.modules.hm.games.rocket-league = { - enable = lib.mkEnableOption "Enable Rocket League game installation via nix-gaming"; - }; - - config = lib.mkIf cfg.enable { - home.packages = (with pkgs; [ - inputs.nix-gaming.packages.${pkgs.system}.rocket-league - ]); - }; -} diff --git a/modules/hm/common/games/star-citizen.nix b/modules/hm/common/games/star-citizen.nix deleted file mode 100644 index f0cc75c..0000000 --- a/modules/hm/common/games/star-citizen.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.modules.hm.games.star-citizen; -in -{ - options.modules.hm.games.star-citizen = { - enable = lib.mkEnableOption "Enable Star Citizen Launcher"; - }; - - config = lib.mkIf cfg.enable { - home.packages = (with pkgs; [ - inputs.nix-gaming.packages.${pkgs.system}.star-citizen - ]); - }; -} From 45abaab3e756898bb2b8538cc4672c095553106c Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 13:02:06 +0200 Subject: [PATCH 12/48] refactor: rename options for browser and cli tools for clarity --- modules/hm/common/browser/default.nix | 2 +- modules/hm/common/dev/global-tools/cli.nix | 8 ++++---- modules/hm/hosts/oak/default.nix | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/hm/common/browser/default.nix b/modules/hm/common/browser/default.nix index a795e18..4f5c372 100644 --- a/modules/hm/common/browser/default.nix +++ b/modules/hm/common/browser/default.nix @@ -36,7 +36,7 @@ let in { options.modules.hm.browser = { - emulators = lib.mkOption { + clients = lib.mkOption { type = lib.types.listOf (lib.types.enum ["chromium" "chrome" "firefox" "brave" "vivaldi" "edge"]); default = []; }; diff --git a/modules/hm/common/dev/global-tools/cli.nix b/modules/hm/common/dev/global-tools/cli.nix index d7b6b7d..159a703 100644 --- a/modules/hm/common/dev/global-tools/cli.nix +++ b/modules/hm/common/dev/global-tools/cli.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let - cfg = config.modules.hm.dev.global-tools.cli; + cfg = config.modules.hm.dev.global-tools; # Map CLI tools to their packages cliToPackage = with pkgs; { @@ -11,12 +11,12 @@ let # Get packages for enabled CLI tools cliPackages = lib.filter (pkg: pkg != null) - (map (tool: cliToPackage.${tool} or null) cfg.elements); + (map (tool: cliToPackage.${tool} or null) cfg.cli); in { - options.modules.hm.dev.global-tools.cli = { - elements = lib.mkOption { + options.modules.hm.dev.global-tools = { + cli = lib.mkOption { type = lib.types.listOf (lib.types.enum ["vercel" "graphite"]); default = []; description = "List of CLI tools to install"; diff --git a/modules/hm/hosts/oak/default.nix b/modules/hm/hosts/oak/default.nix index 5d8a517..3e8e745 100644 --- a/modules/hm/hosts/oak/default.nix +++ b/modules/hm/hosts/oak/default.nix @@ -22,14 +22,14 @@ enable = true; cpu_text = "Ryzen 7 7435HS"; }; - enabledGames = ["minecraft"]; + enabledGames = ["minecraft"]; }; multimedia = { gimp.enable = true; stremio.enable = true; }; browser = { - emulators = ["chrome" "firefox"]; + clients = ["chrome" "firefox"]; driver.enable = true; }; documentation = { @@ -50,7 +50,7 @@ global-tools = { act-github.enable = true; nix.enable = true; - cli.elements = ["vercel" "graphite"]; + cli = ["vercel" "graphite"]; }; node = { enable = true; From e081821375a37c5c8d96a7f69065dcfe0402f6a0 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 14:01:23 +0200 Subject: [PATCH 13/48] refactor: streamline keybindings configuration in hydenix --- modules/hm/desktops/configHydenix.nix | 215 ++++++-------------------- modules/hm/desktops/hydenix.nix | 11 +- 2 files changed, 48 insertions(+), 178 deletions(-) diff --git a/modules/hm/desktops/configHydenix.nix b/modules/hm/desktops/configHydenix.nix index 5a1e81d..ca82de2 100644 --- a/modules/hm/desktops/configHydenix.nix +++ b/modules/hm/desktops/configHydenix.nix @@ -2,178 +2,55 @@ { hyprlandKeybindsConvert = '' - # █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ - # █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ - - # See https://wiki.hyprland.org/Configuring/Keywords/ - # & https://wiki.hyprland.org/Configuring/Binds/ - - # Main modifier - $mainMod = Super # super / meta / windows key - - # Assign apps // HyDE will try to use the default apps if values below are not set - # $TERMINAL = kitty - # $EDITOR = code - # $EXPLORER = dolphin - # $BROWSER = firefox - - - # Window/Session actions - bind = $mainMod, Q, exec, $scrPath/dontkillsteam.sh # close focused window - bind = Alt, F4, exec, $scrPath/dontkillsteam.sh # close focused window - bind = $mainMod, Delete, exit, # kill hyprland session - bind = $mainMod, W, togglefloating, # toggle the window between focus and float - bind = $mainMod, G, togglegroup, # toggle the window between focus and group - bind = Alt, Return, fullscreen, # toggle the window between focus and fullscreen - bind = $mainMod, L, exec, swaylock # launch lock screen - bind = $mainMod+Shift, F, exec, $scrPath/windowpin.sh # toggle pin on focused window - bind = $mainMod, Backspace, exec, $scrPath/logoutlaunch.sh # launch logout menu - bind = Alt_R, Control_R , exec, killall .waybar-wrapped || (env reload_flag=1 $scrPath/wbarconfgen.sh) # toggle waybar and reload config - #bind = Alt_R, Control_R, exec, killall .waybar-wrapped || waybar # toggle waybar without reloading, this is faster - - # Application shortcuts - bind = $mainMod, T, exec, $TERMINAL # launch terminal emulator - bind = $mainMod, E, exec, $EXPLORER # launch file manager - bind = $mainMod, C, exec, $EDITOR # launch text editor - bind = $mainMod, F, exec, $BROWSER # launch web browser - bind = Ctrl+Shift, Escape, exec, $scrPath/sysmonlaunch.sh # launch system monitor (htop/btop or fallback to top) - - # Rofi menus - bind = alt, space, exec, pkill -x rofi || $scrPath/rofilaunch.sh d # launch application launcher - bind = $mainMod, Tab, exec, pkill -x rofi || $scrPath/rofilaunch.sh w # launch window switcher - bind = $mainMod+Shift, E, exec, pkill -x rofi || $scrPath/rofilaunch.sh f # launch file explorer - - # Audio control - bindl = , F10, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute - bindel = , F11, exec, $scrPath/volumecontrol.sh -o d # decrease volume - bindel = , F12, exec, $scrPath/volumecontrol.sh -o i # increase volume - bindl = , XF86AudioMute, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute - bindl = , XF86AudioMicMute, exec, $scrPath/volumecontrol.sh -i m # toggle microphone mute - bindel = , XF86AudioLowerVolume, exec, $scrPath/volumecontrol.sh -o d # decrease volume - bindel = , XF86AudioRaiseVolume, exec, $scrPath/volumecontrol.sh -o i # increase volume - - # Media control - bindl = , XF86AudioPlay, exec, playerctl play-pause # toggle between media play and pause - bindl = , XF86AudioPause, exec, playerctl play-pause # toggle between media play and pause - bindl = , XF86AudioNext, exec, playerctl next # media next - bindl = , XF86AudioPrev, exec, playerctl previous # media previous - - # Brightness control - bindel = , XF86MonBrightnessUp, exec, $scrPath/brightnesscontrol.sh i # increase brightness - bindel = , XF86MonBrightnessDown, exec, $scrPath/brightnesscontrol.sh d # decrease brightness - - # Move between grouped windows - bind = $mainMod CTRL , H, changegroupactive, b - bind = $mainMod CTRL , L, changegroupactive, f - - # Screenshot/Screencapture/Color picker - bindd = $mainMod+Shift, P,Color Picker , exec, hyprpicker -a # Pick color (Hex) >> clipboard# - bind = $mainMod, P, exec, $scrPath/screenshot.sh s # partial screenshot capture - bind = $mainMod+Ctrl, P, exec, $scrPath/screenshot.sh sf # partial screenshot capture (frozen screen) - bind = $mainMod+Alt, P, exec, $scrPath/screenshot.sh m # monitor screenshot capture - bind = , Print, exec, $scrPath/screenshot.sh p # all monitors screenshot capture - - # Custom scripts - # TODO Make a main rofi menu for these selectors - bind = $mainMod+Alt, G, exec, $scrPath/gamemode.sh # disable hypr effects for gamemode - bind = $mainMod+Alt, Right, exec, $scrPath/swwwallpaper.sh -n # next wallpaper - bind = $mainMod+Alt, Left, exec, $scrPath/swwwallpaper.sh -p # previous wallpaper - bind = $mainMod+Alt, Up, exec, $scrPath/wbarconfgen.sh n # next waybar mode - bind = $mainMod+Alt, Down, exec, $scrPath/wbarconfgen.sh p # previous waybar mode - bind = $mainMod+Shift, R, exec, pkill -x rofi || $scrPath/wallbashtoggle.sh -m # launch wallbash mode select menu - bind = $mainMod+Shift, T, exec, pkill -x rofi || $scrPath/themeselect.sh # launch theme select menu - bind = $mainMod+Shift, A, exec, pkill -x rofi || $scrPath/rofiselect.sh # launch select menu - bind = $mainMod+Shift, W, exec, pkill -x rofi || $scrPath/swwwallselect.sh # launch wallpaper select menu - bind = $mainMod, V, exec, pkill -x rofi || $scrPath/cliphist.sh -c # launch clipboard - bind = $mainMod+Shift, V, exec, pkill -x rofi || $scrPath/cliphist.sh # launch clipboard Manager - bind = $mainMod, K, exec, $scrPath/keyboardswitch.sh # switch keyboard layout - bind = $mainMod, colon, exec, pkill -x rofi || $scrPath/keybinds_hint.sh c # launch keybinds hint - bind = $mainMod, semicolon,exec, pkill -x rofi || $scrPath/emoji-picker.sh # launch emoji picker - bind = $mainMod, period, exec, pkill -x rofi || $scrPath/glyph-picker.sh # launch glyph picker - - # Move/Change window focus - bind = $mainMod, Left, movefocus, l - bind = $mainMod, Right, movefocus, r - bind = $mainMod, Up, movefocus, u - bind = $mainMod, Down, movefocus, d - bind = Alt, Tab, movefocus, d - - # Switch workspaces - bind = $mainMod, ampersand, workspace, 1 - bind = $mainMod, eacute, workspace, 2 - bind = $mainMod, quotedbl, workspace, 3 - bind = $mainMod, apostrophe, workspace, 4 - bind = $mainMod, parenleft, workspace, 5 - bind = $mainMod, minus, workspace, 6 - bind = $mainMod, egrave, workspace, 7 - bind = $mainMod, underscore, workspace, 8 - bind = $mainMod, ccedilla, workspace, 9 - bind = $mainMod, agrave, workspace, 10 - - # Switch workspaces to a relative workspace - bind = $mainMod+Ctrl, Right, workspace, r+1 - bind = $mainMod+Ctrl, Left, workspace, r-1 - - # Move to the first empty workspace - bind = $mainMod+Ctrl, Down, workspace, empty - - # Resize windows - binde = $mainMod+Shift, Right, resizeactive, 30 0 - binde = $mainMod+Shift, Left, resizeactive, -30 0 - binde = $mainMod+Shift, Up, resizeactive, 0 -30 - binde = $mainMod+Shift, Down, resizeactive, 0 30 + ## █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ + ## █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ + # $scrPath=$HOME/.local/lib/hyde # set scripts path + + + $l=Launcher + $d=[$l|Rofi menus] + bindd = $mainMod, colon, $d keybindings hint, exec, pkill -x rofi || $scrPath/keybinds_hint.sh c # launch keybinds hint + bindd = $mainMod, semicolon , $d glyph picker , exec, pkill -x rofi || $scrPath/glyph-picker.sh # launch glyph picker + + $ws=Workspaces + $d=[$ws|Navigation] + bindd = $mainMod, ampersand, $d navigate to workspace 1 , workspace, 1 + bindd = $mainMod, eacute, $d navigate to workspace 2 , workspace, 2 + bindd = $mainMod, quotedbl, $d navigate to workspace 3 , workspace, 3 + bindd = $mainMod, apostrophe, $d navigate to workspace 4 , workspace, 4 + bindd = $mainMod, parenleft, $d navigate to workspace 5 , workspace, 5 + bindd = $mainMod, minus, $d navigate to workspace 6 , workspace, 6 + bindd = $mainMod, egrave, $d navigate to workspace 7 , workspace, 7 + bindd = $mainMod, underscore, $d navigate to workspace 8 , workspace, 8 + bindd = $mainMod, ccedilla, $d navigate to workspace 9 , workspace, 9 + bindd = $mainMod, agrave, $d navigate to workspace 10 , workspace, 10 # Move focused window to a workspace - bind = $mainMod+Shift, ampersand, movetoworkspace, 1 - bind = $mainMod+Shift, eacute, movetoworkspace, 2 - bind = $mainMod+Shift, quotedbl, movetoworkspace, 3 - bind = $mainMod+Shift, apostrophe, movetoworkspace, 4 - bind = $mainMod+Shift, parenleft, movetoworkspace, 5 - bind = $mainMod+Shift, minus, movetoworkspace, 6 - bind = $mainMod+Shift, egrave, movetoworkspace, 7 - bind = $mainMod+Shift, underscore, movetoworkspace, 8 - bind = $mainMod+Shift, ccedilla, movetoworkspace, 9 - bind = $mainMod+Shift, agrave, movetoworkspace, 10 - - # Move focused window to a relative workspace - bind = $mainMod+Ctrl+Alt, Right, movetoworkspace, r+1 - bind = $mainMod+Ctrl+Alt, Left, movetoworkspace, r-1 - - # Move active window around current workspace with mainMod + SHIFT + CTRL [←→↑↓] - $moveactivewindow=grep -q "true" <<< $(hyprctl activewindow -j | jq -r .floating) && hyprctl dispatch moveactive - binded = $mainMod SHIFT $CONTROL, left,Move activewindow to the right,exec, $moveactivewindow -30 0 || hyprctl dispatch movewindow l - binded = $mainMod SHIFT $CONTROL, right,Move activewindow to the right,exec, $moveactivewindow 30 0 || hyprctl dispatch movewindow r - binded = $mainMod SHIFT $CONTROL, up,Move activewindow to the right,exec, $moveactivewindow 0 -30 || hyprctl dispatch movewindow u - binded = $mainMod SHIFT $CONTROL, down,Move activewindow to the right,exec, $moveactivewindow 0 30 || hyprctl dispatch movewindow d - - # Scroll through existing workspaces - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - - # Move/Resize focused window - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - bindm = $mainMod, Z, movewindow - bindm = $mainMod, X, resizewindow - - # Move/Switch to special workspace (scratchpad) - bind = $mainMod+Shift, grave, movetoworkspace, special - bind = $mainMod+Alt, grave, movetoworkspacesilent, special - bind = $mainMod, grave, togglespecialworkspace, - - # Toggle focused window split - bind = $mainMod, J, togglesplit + $d=[$ws|Move window to workspace] + bindd = $mainMod Shift, ampersand, $d move to workspace 1 , movetoworkspace, 1 + bindd = $mainMod Shift, eacute, $d move to workspace 2 , movetoworkspace, 2 + bindd = $mainMod Shift, quotedbl, $d move to workspace 3 , movetoworkspace, 3 + bindd = $mainMod Shift, apostrophe, $d move to workspace 4 , movetoworkspace, 4 + bindd = $mainMod Shift, parenleft, $d move to workspace 5 , movetoworkspace, 5 + bindd = $mainMod Shift, minus, $d move to workspace 6 , movetoworkspace, 6 + bindd = $mainMod Shift, egrave, $d move to workspace 7 , movetoworkspace, 7 + bindd = $mainMod Shift, underscore, $d move to workspace 8 , movetoworkspace, 8 + bindd = $mainMod Shift, ccedilla, $d move to workspace 9 , movetoworkspace, 9 + bindd = $mainMod Shift, agrave, $d move to workspace 10 , movetoworkspace, 10 # Move focused window to a workspace silently - bind = $mainMod+Alt, ampersand, movetoworkspacesilent, 1 - bind = $mainMod+Alt, eacute, movetoworkspacesilent, 2 - bind = $mainMod+Alt, quotedbl, movetoworkspacesilent, 3 - bind = $mainMod+Alt, apostrophe, movetoworkspacesilent, 4 - bind = $mainMod+Alt, parenleft, movetoworkspacesilent, 5 - bind = $mainMod+Alt, minus, movetoworkspacesilent, 6 - bind = $mainMod+Alt, egrave, movetoworkspacesilent, 7 - bind = $mainMod+Alt, underscore, movetoworkspacesilent, 8 - bind = $mainMod+Alt, ccedilla, movetoworkspacesilent, 9 - bind = $mainMod+Alt, agrave, movetoworkspacesilent, 10 + $d=[$ws|Navigation|Move window silently] + bindd = $mainMod Alt, ampersand, $d move to workspace 1 (silent), movetoworkspacesilent, 1 + bindd = $mainMod Alt, eacute, $d move to workspace 2 (silent), movetoworkspacesilent, 2 + bindd = $mainMod Alt, quotedbl, $d move to workspace 3 (silent), movetoworkspacesilent, 3 + bindd = $mainMod Alt, apostrophe, $d move to workspace 4 (silent), movetoworkspacesilent, 4 + bindd = $mainMod Alt, parenleft, $d move to workspace 5 (silent), movetoworkspacesilent, 5 + bindd = $mainMod Alt, minus, $d move to workspace 6 (silent), movetoworkspacesilent, 6 + bindd = $mainMod Alt, egrave, $d move to workspace 7 (silent), movetoworkspacesilent, 7 + bindd = $mainMod Alt, underscore, $d move to workspace 8 (silent), movetoworkspacesilent, 8 + bindd = $mainMod Alt, ccedilla, $d move to workspace 9 (silent), movetoworkspacesilent, 9 + bindd = $mainMod Alt, agrave, $d move to workspace 10 (silent), movetoworkspacesilent, 10 + + $d=#! unset the group name ''; } \ No newline at end of file diff --git a/modules/hm/desktops/hydenix.nix b/modules/hm/desktops/hydenix.nix index 5004e0a..de616de 100644 --- a/modules/hm/desktops/hydenix.nix +++ b/modules/hm/desktops/hydenix.nix @@ -87,21 +87,14 @@ in }; home.file = { - ".config/hypr/keybindings.conf" = lib.mkForce { - text = '' - ${configHydenix.hyprlandKeybindsConvert} - ''; - force = true; - }; - - - ".config/hypr/userprefs.conf" = lib.mkForce { text = '' input { kb_layout = fr } + ${configHydenix.hyprlandKeybindsConvert} + # Example monitor configuration # Replace names like HDMI-A-1, DP-1, etc. with the actual names of your monitors (use `hyprctl monitors` to list) # monitor = ,,,,, From 7878c757e43542d6f814675d487c9725488e0f33 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 15 Jun 2025 14:01:32 +0200 Subject: [PATCH 14/48] refactor: update browser to use clients instead of emulators --- modules/hm/common/browser/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hm/common/browser/default.nix b/modules/hm/common/browser/default.nix index 4f5c372..746ecaa 100644 --- a/modules/hm/common/browser/default.nix +++ b/modules/hm/common/browser/default.nix @@ -24,12 +24,12 @@ let }; # Get packages for enabled browsers - browserPackages = lib.concatMap (browser: browserToPackage.${browser} or []) cfg.emulators; + browserPackages = lib.concatMap (browser: browserToPackage.${browser} or []) cfg.clients; # Get drivers for enabled browsers (if driver.enable is true) drivers = lib.optionals cfg.driver.enable ( lib.unique (lib.filter (drv: drv != null) ( - map (browser: browserToDriver.${browser} or null) cfg.emulators + map (browser: browserToDriver.${browser} or null) cfg.clients )) ); From df25076f2447f208a2551cdda58aa2c00fa218ba Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:16:34 +0200 Subject: [PATCH 15/48] refactor: remove lutris from games clients configuration --- modules/system/hosts/oak/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/hosts/oak/default.nix b/modules/system/hosts/oak/default.nix index 26569c9..86be718 100644 --- a/modules/system/hosts/oak/default.nix +++ b/modules/system/hosts/oak/default.nix @@ -12,7 +12,7 @@ }; polkit.enable = true; }; - games.clients = ["steam" "lutris"]; + games.clients = ["steam"]; networks.vpn = ["tailscale"]; virtualisation.containers.engines = ["docker"]; backup.syncthing = { From 16d22206da2690313480e843221484bf99ce65b8 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:16:57 +0200 Subject: [PATCH 16/48] refactor: remove unused environment variable --- modules/system/common/dev/flutter.nix | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/system/common/dev/flutter.nix b/modules/system/common/dev/flutter.nix index 024d7d4..303782a 100755 --- a/modules/system/common/dev/flutter.nix +++ b/modules/system/common/dev/flutter.nix @@ -56,7 +56,7 @@ in # Environment variables environment.variables = lib.mkMerge [ { JAVA_HOME = "${cfg.jdkPackage}"; } - { STUDIO_JDK = "${cfg.jdkPackage}"; } + #{ STUDIO_JDK = "${cfg.jdkPackage}"; } (lib.mkIf cfg.withAndroid { ANDROID_HOME = "${androidSdk}/libexec/android-sdk"; }) @@ -69,13 +69,5 @@ in "adbusers" ]; }; - - # Shell profile additions - environment.shellInit = '' - export PATH="$JAVA_HOME/bin:${pkgs.flutter}/bin:${pkgs.flutter}/bin/cache/dart-sdk/bin:$PATH" - ${lib.optionalString cfg.withAndroid '' - export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH" - ''} - ''; }; } \ No newline at end of file From eeb34268bd91b6c11e0ce995f46e56dd1689a995 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:17:31 +0200 Subject: [PATCH 17/48] refactor: simplify python and remove shell.nix generation --- modules/hm/common/dev/python.nix | 122 +++++++++---------------------- 1 file changed, 33 insertions(+), 89 deletions(-) diff --git a/modules/hm/common/dev/python.nix b/modules/hm/common/dev/python.nix index 35533ca..92ad47e 100644 --- a/modules/hm/common/dev/python.nix +++ b/modules/hm/common/dev/python.nix @@ -4,13 +4,6 @@ let # Shorthand for accessing module config cfg = config.modules.hm.dev.python; - # add home directory to devShell.shellPaths if not already present - homePath = cfg.devShell.defaultPath; # or: builtins.toString config.home.homeDirectory - devShellPaths = lib.unique ( - (lib.optionals (cfg.devShell.shellPaths == []) [ homePath ]) - ++ cfg.devShell.shellPaths - ); - # Function to get the required Python version with pipx, pip, and extra packages pythonWithPipx = version: let pythonAttr = "python${version}"; @@ -32,36 +25,6 @@ let # Flattened list of all selected Python versions with extras allPythonPackages = lib.flatten (map pythonWithPipx cfg.versions); - # Template for shell.nix content - shellNixText = '' - let - pkgs = import {}; - python = pkgs.${"python" + cfg.defaultVersion}; - in - pkgs.mkShell { - buildInputs = [ - python - python.pkgs.pip - python.pkgs.pipx - ${lib.concatMapStringsSep "\n " (pkg: "python.pkgs.${pkg}") cfg.extraPackages} - ]; - - shellHook = ''' - if [ -f "pyproject.toml" ] || [ -f "requirements.txt" ]; then - if [ ! -d ".venv" ]; then - echo "🔧 No .venv found. Creating it..." - python -m venv .venv - fi - - source .venv/bin/activate - echo "🐍 Activated .venv" - else - echo "⚠️ No pyproject.toml or requirements.txt found, skipping .venv auto-activation." - fi - '''; - } - ''; - in { options.modules.hm.dev.python = { # Main toggle @@ -92,62 +55,43 @@ in { poetry.enable = lib.mkEnableOption "Install Poetry"; pdm.enable = lib.mkEnableOption "Install PDM"; tools.enable = lib.mkEnableOption "Install dev tools (pytest, black, flake8)"; - - # Dev shell generation - devShell = { - enable = lib.mkEnableOption "Generate a shell.nix file"; - defaultPath = lib.mkOption { - type = lib.types.str; - default = "./Templates"; - description = "Default path for shell.nix generation"; - }; - - # Additional paths to generate shell.nix in (besides $HOME) - shellPaths = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = []; - description = "Additional relative paths to create shell.nix (besides home)"; - }; - }; }; # Actual config if module is enabled config = lib.mkIf cfg.enable { # Install core packages and optional tools - home.packages = - allPythonPackages - ++ lib.optional cfg.poetry.enable pkgs.poetry - ++ lib.optional cfg.pdm.enable pkgs.pdm - ++ lib.optionals cfg.tools.enable [ - pkgs."python${cfg.defaultVersion}Packages".black - pkgs."python${cfg.defaultVersion}Packages".flake8 - pkgs."python${cfg.defaultVersion}Packages".pytest - ]; - - # Files to write to the home directory - home.file = lib.mkMerge ( - [ - { - ".config/profile.d/python-aliases.sh".text = '' - export PATH=${pkgs."python${cfg.defaultVersion}"}/bin:$PATH - alias py="python" - alias pipx="pipx" - alias pip="pip" - alias pyclean="find . -type f -name '*.py[co]' -delete" - alias pytest="python -m pytest" - ''; - } - ] - ++ - (lib.optionals cfg.devShell.enable ( - map (path: { - "${path}/shell.nix" = { - text = shellNixText; - force = true; - mutable = true; - }; - }) devShellPaths - )) - ); + home = { + packages = + allPythonPackages + ++ lib.optional cfg.poetry.enable pkgs.poetry + ++ lib.optional cfg.pdm.enable pkgs.pdm + ++ lib.optionals cfg.tools.enable [ + pkgs."python${cfg.defaultVersion}Packages".black + pkgs."python${cfg.defaultVersion}Packages".flake8 + pkgs."python${cfg.defaultVersion}Packages".pytest + ]; + + # Files to write to the home directory + file = lib.mkMerge ( + [ + { + ".config/profile.d/python-aliases.sh".text = '' + export PATH=${pkgs."python${cfg.defaultVersion}"}/bin:$PATH + alias py="python" + alias pipx="pipx" + alias pip="pip" + alias pyclean="find . -type f -name '*.py[co]' -delete" + alias pytest="python -m pytest" + ''; + } + ] + ); + # Shell aliases + shellAliases = { + py = "python"; + pyclean = "find . -type f -name '*.py[co]' -delete"; + pytest = "python -m pytest"; + }; + }; }; } From e5d974924841043da9e9b0b9cbd0924489abe5d7 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:18:32 +0200 Subject: [PATCH 18/48] refactor: add prisma engine binaries to session variables --- modules/hm/common/dev/node/prisma.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hm/common/dev/node/prisma.nix b/modules/hm/common/dev/node/prisma.nix index 4ea7b2b..5844966 100644 --- a/modules/hm/common/dev/node/prisma.nix +++ b/modules/hm/common/dev/node/prisma.nix @@ -13,5 +13,13 @@ in home.packages = (with pkgs; [ prisma ]); + + home.sessionVariables = { + PRISMA_SCHEMA_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/schema-engine"; + PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine"; + PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node"; + PRISMA_FMT_BINARY = "${pkgs.prisma-engines}/bin/prisma-fmt"; + PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING = 1; + }; }; } From 94ef4c51770b019cd3ad1777710988fe05216997 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:19:18 +0200 Subject: [PATCH 19/48] refactor: replace keepassxc with bitwarden in desktop configuration --- modules/hm/desktops/hydenix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/desktops/hydenix.nix b/modules/hm/desktops/hydenix.nix index de616de..84f5051 100644 --- a/modules/hm/desktops/hydenix.nix +++ b/modules/hm/desktops/hydenix.nix @@ -124,7 +124,7 @@ in bind = ALT, Tab, cyclenext bind = ALT, Tab, bringactivetotop - exec-once = sleep 1 && keepassxc + exec-once = sleep 1 && bitwarden ''; force = true; mutable = true; From 68c56af9ce1f0200985162a07fc2ec2b66dc973f Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Sun, 22 Jun 2025 15:19:48 +0200 Subject: [PATCH 20/48] refactor: add discord communication module and update configuration --- modules/hm/common/communication/discord.nix | 57 +++++++++++++++++++++ modules/hm/common/default.nix | 1 + modules/hm/hosts/oak/default.nix | 10 ++-- 3 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 modules/hm/common/communication/discord.nix diff --git a/modules/hm/common/communication/discord.nix b/modules/hm/common/communication/discord.nix new file mode 100644 index 0000000..2bf7e19 --- /dev/null +++ b/modules/hm/common/communication/discord.nix @@ -0,0 +1,57 @@ +{ pkgs, lib, config, ... }: + +let + cfg = config.modules.hm.communication.discord; + + # Map Discord clients to their packages + clientsToPackage = with pkgs; { + discord = discord; + discordo = discordo; + discord-sh = discord-sh; + discord-ptb = discord-ptb; + discord-canary = discord-canary; + discord-development = discord-development; + cordless = cordless; + }; + + # Map overlay names to their packages + overlaysToPackage = with pkgs; { + "discover-overlay" = discover-overlay; + overlayed = overlayed; + }; + + # Get packages for enabled clients + clientPackages = map (client: clientsToPackage.${client}) cfg.clients; + + # Get overlay packages + overlayPackages = map (overlay: overlaysToPackage.${overlay}) cfg.overlays; + + # RPC package + rpcPackage = lib.optional cfg.rpc.enable pkgs.discord-rpc; + +in +{ + options.modules.hm.communication.discord = { + clients = lib.mkOption { + type = lib.types.listOf (lib.types.enum (lib.attrNames clientsToPackage)); + default = []; + description = "List of Discord clients to install"; + }; + + overlays = lib.mkOption { + type = lib.types.listOf (lib.types.enum (lib.attrNames overlaysToPackage)); + default = []; + description = "List of Discord overlays to install"; + }; + + rpc.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to enable Discord Rich Presence support"; + }; + }; + + config = lib.mkIf (cfg.clients != [] || cfg.overlays != []) { + home.packages = clientPackages ++ overlayPackages ++ rpcPackage; + }; +} \ No newline at end of file diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index 8fadd5d..f7f71b0 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -6,6 +6,7 @@ ./browser ./communication/mail + ./communication/discord.nix ./communication/teams.nix ./dev/editor/dbeaver.nix diff --git a/modules/hm/hosts/oak/default.nix b/modules/hm/hosts/oak/default.nix index 3e8e745..2209414 100644 --- a/modules/hm/hosts/oak/default.nix +++ b/modules/hm/hosts/oak/default.nix @@ -11,7 +11,6 @@ config.modules.hm = { shell = { btop.enable = true; - starship.enable = true; fzf.enable = true; ranger.enable = true; tools.enable = true; @@ -29,7 +28,7 @@ stremio.enable = true; }; browser = { - clients = ["chrome" "firefox"]; + clients = ["firefox"]; driver.enable = true; }; documentation = { @@ -50,20 +49,17 @@ global-tools = { act-github.enable = true; nix.enable = true; - cli = ["vercel" "graphite"]; }; node = { enable = true; prisma.enable = true; }; - python = { - enable = true; - devShell.enable = true; - }; + python.enable = true; }; communication = { teams.enable = true; mail.services = ["thunderbird"]; + discord.rpc.enable = true; }; network.tunnel = { services = ["localtunnel"]; From 04b09370d054f8551155a66419ab0e93253c93a3 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:42:14 +0200 Subject: [PATCH 21/48] refactor: add pine host configuration and deployment support --- flake.nix | 9 +++++ hosts/pine/default.nix | 90 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 hosts/pine/default.nix diff --git a/flake.nix b/flake.nix index 9a4820c..7d36081 100755 --- a/flake.nix +++ b/flake.nix @@ -95,13 +95,16 @@ nixosConfigurations = { fern = mkHost "fern"; oak = mkHost "oak"; + pine = mkHost "pine"; "fern.local" = mkHost "fern"; "oak.local" = mkHost "oak"; + "pine.local" = mkHost "pine"; }; deploy.nodes = { fern = mkDeployNode "fern.local"; oak = mkDeployNode "oak.local"; + pine = mkDeployNode "pine.local"; }; packages.${inputs.hydenix.lib.system} = { @@ -119,9 +122,12 @@ ${pkgs.deploy-rs}/bin/deploy --skip-checks .#oak ;; "fern") ${pkgs.deploy-rs}/bin/deploy --skip-checks .#fern ;; + "pine") + ${pkgs.deploy-rs}/bin/deploy --skip-checks .#pine ;; "all") ${pkgs.deploy-rs}/bin/deploy --skip-checks .#oak ${pkgs.deploy-rs}/bin/deploy --skip-checks .#fern + ${pkgs.deploy-rs}/bin/deploy --skip-checks .#pine ;; *) echo "Usage: rb [oak|fern|all]" >&2; exit 1 ;; esac @@ -136,6 +142,9 @@ fern-check = inputs.deploy-rs.lib.${system}.deployChecks { nodes.fern = inputs.self.deploy.nodes.fern; }; + pine-check = inputs.deploy-rs.lib.${system}.deployChecks { + nodes.pine = inputs.self.deploy.nodes.pine; + }; }; }; } diff --git a/hosts/pine/default.nix b/hosts/pine/default.nix new file mode 100644 index 0000000..f453abd --- /dev/null +++ b/hosts/pine/default.nix @@ -0,0 +1,90 @@ +{ + inputs, + vars, + ... +}: +let + pkgs = import inputs.hydenix.inputs.hydenix-nixpkgs { + inherit (inputs.hydenix.lib) system; + config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; + overlays = [ + inputs.hydenix.lib.overlays + (final: prev: { + userPkgs = import inputs.nixpkgs { + inherit (inputs.hydenix.lib) system; + config.allowUnfree = true; + android_sdk.accept_license = true; + }; + }) + ]; + }; +in +{ + nixpkgs.pkgs = pkgs; + + imports = [ + inputs.hydenix.inputs.home-manager.nixosModules.home-manager + inputs.hydenix.lib.nixOsModules + ./hardware-configuration.nix + ../../modules/system/hosts/pine + + + # === GPU-specific configurations === + + /* + For drivers, we are leveraging nixos-hardware + Most common drivers are below, but you can see more options here: https://github.com/NixOS/nixos-hardware + */ + + #! EDIT THIS SECTION + # === Other common modules === + inputs.hydenix.inputs.nixos-hardware.nixosModules.common-pc + inputs.hydenix.inputs.nixos-hardware.nixosModules.common-pc-ssd + ]; + + boot.kernelParams = [ "video=HDMI-A-1:e" ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit inputs; + }; + users."${vars.user}" = + { ... }: + { + # hm import + imports = [ + ../../modules/hm/hosts/pine + ]; + + desktops.hydenix = { + enable = true; + hostname = "pine"; + }; + }; + }; + + hydenix = { + enable = true; + hostname = "pine"; + timezone = "Europe/Paris"; + locale = "fr_FR.UTF-8"; + }; + + users.users.${vars.user} = { + isNormalUser = true; + #initialPassword = "${vars.user}"; + extraGroups = [ + "wheel" + "networkmanager" + "video" + "lp" + "scanner" + ]; + shell = pkgs.zsh; + }; +} From 4116ee31dc962db1adfa55e23734cbc569596aa5 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:42:30 +0200 Subject: [PATCH 22/48] refactor: enhance dotnet configuration with extrapackages support --- modules/hm/hosts/oak/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/hm/hosts/oak/default.nix b/modules/hm/hosts/oak/default.nix index 2209414..5bdefa2 100644 --- a/modules/hm/hosts/oak/default.nix +++ b/modules/hm/hosts/oak/default.nix @@ -45,7 +45,10 @@ vs-code.enable = true; android-studio.enable = true; }; - dotnet.enable = true; + dotnet = { + enable = true; + extraPackages = [ "dotnet-ef" ]; + }; global-tools = { act-github.enable = true; nix.enable = true; @@ -66,12 +69,5 @@ localtunnel.port = 8080; }; utilities.scalar.enable = true; - #extra = { - #ignore-file-retriever = { - #enable = true; - #watchMode = true; - #watchPaths = [ "~/Documents" ]; - #}; - #}; }; } From e8e59da585ed2ed3d960a8a15361b9d1ca48516b Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:42:43 +0200 Subject: [PATCH 23/48] refactor: update obsidian path to use home directory configuration --- modules/hm/common/documentation/obsidian.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/common/documentation/obsidian.nix b/modules/hm/common/documentation/obsidian.nix index 0dd9545..fa30aa6 100644 --- a/modules/hm/common/documentation/obsidian.nix +++ b/modules/hm/common/documentation/obsidian.nix @@ -6,7 +6,7 @@ let #──────── Canonical default ────────# defaultObsiPath = let dflt = builtins.getEnv "XDG_DOCUMENTS_DIR"; - in if dflt == "" then "$HOME/Documents" else dflt; + in if dflt == "" then "${config.home.homeDirectory}/Documents" else dflt; /*────────────────────────── │ Assets (theme & colors) │ From 6e5f453d4bca315f8a6827e73fbe5a4abee3e417 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 17:48:22 +0200 Subject: [PATCH 24/48] refactor: update ignore-file-retriever to normalize paths --- modules/hm/common/default.nix | 2 +- modules/hm/common/extra/ignore-file-retriever.nix | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index f7f71b0..a7b20bb 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -30,7 +30,7 @@ ./engine - #./extra/ignore-file-retriever.nix + ./extra/ignore-file-retriever.nix ./games/joystick.nix ./games/mangohud.nix diff --git a/modules/hm/common/extra/ignore-file-retriever.nix b/modules/hm/common/extra/ignore-file-retriever.nix index b78acec..eec0e09 100644 --- a/modules/hm/common/extra/ignore-file-retriever.nix +++ b/modules/hm/common/extra/ignore-file-retriever.nix @@ -3,10 +3,12 @@ let cfg = config.modules.hm.extra.ignore-file-retriever; - expandPath = path: if lib.hasPrefix "~/" path then - lib.removeSuffix "/" (lib.replacePrefix "~/" "${config.home.homeDirectory}/" path) + expandPath = path: let + normalized = lib.removeSuffix "/" path; + in if lib.hasPrefix "~/" normalized then + config.home.homeDirectory + (lib.removePrefix "~/" normalized) else - lib.removeSuffix "/" path; + normalized; templatePath = expandPath cfg.templatePath; outputPath = expandPath cfg.outputPath; @@ -64,15 +66,15 @@ let # Handle directory patterns if [[ "$pattern" =~ /$ ]]; then - echo "${rel_path}${pattern}" >> "$TMP_FILE" + echo "''${rel_path}''${pattern}" >> "$TMP_FILE" else # Handle normal patterns with proper directory prefix if [[ "$pattern" =~ / ]]; then # Pattern contains subdirectories - echo "${rel_path}${pattern}" >> "$TMP_FILE" + echo "''${rel_path}''${pattern}" >> "$TMP_FILE" else # Simple pattern applies to all levels - echo "**/${pattern}" >> "$TMP_FILE" + echo "**/''${pattern}" >> "$TMP_FILE" fi fi done < "$gitignore" From 98b7a079ed50c079a4cbb8e7e39c81133c733b20 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 19:16:05 +0200 Subject: [PATCH 25/48] refactor: add macos configuration support in flake.nix --- flake.nix | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 7d36081..c784a97 100755 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,6 @@ # Hydenix and its nixpkgs - kept separate to avoid conflicts hydenix = { - # Available inputs: - # Main: github:richen604/hydenix - # Dev: github:richen604/hydenix/dev - # Commit: github:richen604/hydenix/ - # Version: github:richen604/hydenix/v1.0.0 url = "github:richen604/hydenix"; }; @@ -29,12 +24,14 @@ url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nix-darwin = { + url = "github:nix-darwin/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = - { - ... - }@inputs: + outputs = { self, nix-darwin, ... }@inputs: let vars = { user = "mirage"; @@ -54,6 +51,20 @@ ]; }; + # Create macOS configuration + mkDarwinHost = + hostname: + nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; # or "x86_64-darwin" for Intel Macs + specialArgs = { + inherit inputs vars; + hostname = hostname; + }; + modules = [ + ./hosts/darwin/${hostname} + ]; + }; + # Create VM variant function mkVm = hostname: @@ -77,7 +88,6 @@ mkDeployNode = hostname: { hostname = hostname; profiles.system = { - # Change from root to your user user = "${vars.user}"; path = inputs.deploy-rs.lib.${system}.activate.nixos inputs.self.nixosConfigurations.${hostname}; sshUser = "${vars.user}"; @@ -101,6 +111,11 @@ "pine.local" = mkHost "pine"; }; + darwinConfigurations = { + # Replace "macbook" with your actual hostname (run 'scutil --get LocalHostName' to find it) + macbook = mkDarwinHost "macbook"; + }; + deploy.nodes = { fern = mkDeployNode "fern.local"; oak = mkDeployNode "oak.local"; @@ -134,7 +149,6 @@ ''; }; - # Only check the specific deployment node checks.${system} = { oak-check = inputs.deploy-rs.lib.${system}.deployChecks { nodes.oak = inputs.self.deploy.nodes.oak; @@ -147,4 +161,4 @@ }; }; }; -} +} \ No newline at end of file From 300a12843634a89cb1db840ec93f74fef717ca95 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:30:00 +0200 Subject: [PATCH 26/48] refactor: add nix-darwin configuration to flake.lock --- flake.lock | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/flake.lock b/flake.lock index 7ba0bdb..7f76bd7 100755 --- a/flake.lock +++ b/flake.lock @@ -215,6 +215,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750618568, + "narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-gaming": { "inputs": { "flake-parts": "flake-parts", @@ -377,6 +398,7 @@ "chaotic": "chaotic", "deploy-rs": "deploy-rs", "hydenix": "hydenix", + "nix-darwin": "nix-darwin", "nix-gaming": "nix-gaming", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs_3", From 4d83b5e530c5f4c71242da30efeb563e9c63c295 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:31:19 +0200 Subject: [PATCH 27/48] refactor: update option types to use dynamic enums for various modules --- modules/hm/common/browser/default.nix | 2 +- modules/hm/common/communication/mail/default.nix | 2 +- modules/hm/common/dev/global-tools/cli.nix | 4 ++-- modules/hm/common/documentation/default.nix | 2 +- modules/hm/common/engine/default.nix | 2 +- modules/hm/common/network/tunnel.nix | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/hm/common/browser/default.nix b/modules/hm/common/browser/default.nix index 746ecaa..cb9e85c 100644 --- a/modules/hm/common/browser/default.nix +++ b/modules/hm/common/browser/default.nix @@ -37,7 +37,7 @@ in { options.modules.hm.browser = { clients = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["chromium" "chrome" "firefox" "brave" "vivaldi" "edge"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames browserToDriver)); default = []; }; diff --git a/modules/hm/common/communication/mail/default.nix b/modules/hm/common/communication/mail/default.nix index e62cc82..cb3ec63 100644 --- a/modules/hm/common/communication/mail/default.nix +++ b/modules/hm/common/communication/mail/default.nix @@ -17,7 +17,7 @@ in { options.modules.hm.communication.mail = { services = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["thunderbird" "bluemail"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames serviceToPackage)); default = []; description = "List of mail services to enable"; }; diff --git a/modules/hm/common/dev/global-tools/cli.nix b/modules/hm/common/dev/global-tools/cli.nix index 159a703..ce51bd4 100644 --- a/modules/hm/common/dev/global-tools/cli.nix +++ b/modules/hm/common/dev/global-tools/cli.nix @@ -17,13 +17,13 @@ in { options.modules.hm.dev.global-tools = { cli = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["vercel" "graphite"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames cliToPackage)); default = []; description = "List of CLI tools to install"; }; }; config = { - home.packages = cliPackages; + home.packages = lib.unique cliPackages; }; } \ No newline at end of file diff --git a/modules/hm/common/documentation/default.nix b/modules/hm/common/documentation/default.nix index aa92408..3b20d3c 100644 --- a/modules/hm/common/documentation/default.nix +++ b/modules/hm/common/documentation/default.nix @@ -17,7 +17,7 @@ in { options.modules.hm.documentation = { editors = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["onlyoffice" "okular"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames editorsToPackage)); default = []; description = "List of document editors to install"; }; diff --git a/modules/hm/common/engine/default.nix b/modules/hm/common/engine/default.nix index 6152e8b..e98b14a 100644 --- a/modules/hm/common/engine/default.nix +++ b/modules/hm/common/engine/default.nix @@ -14,7 +14,7 @@ let in { options.modules.hm = { engine = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["unity"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames engineToPackage)); default = []; description = "List of game engines to install"; }; diff --git a/modules/hm/common/network/tunnel.nix b/modules/hm/common/network/tunnel.nix index 461bbd7..d90a4f9 100644 --- a/modules/hm/common/network/tunnel.nix +++ b/modules/hm/common/network/tunnel.nix @@ -47,7 +47,7 @@ let in { options.modules.hm.network.tunnel = { services = lib.mkOption { - type = lib.types.listOf (lib.types.enum ["localtunnel" "cloudflare" "ngrok"]); + type = lib.types.listOf (lib.types.enum (lib.attrNames servicesToPackage)); default = ["localtunnel"]; description = "List of tunneling services to enable"; }; From fa83270726aead4ae2e4a145135686acd0c912b0 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:31:29 +0200 Subject: [PATCH 28/48] refactor: enhance rust package handling to abort on unknown packages --- modules/hm/common/dev/rust.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hm/common/dev/rust.nix b/modules/hm/common/dev/rust.nix index ed9e955..a39a730 100644 --- a/modules/hm/common/dev/rust.nix +++ b/modules/hm/common/dev/rust.nix @@ -5,7 +5,9 @@ let rustDefaultPackages = with pkgs; [rustc cargo rust-analyzer clippy rustfmt]; - rustPackages = rustDefaultPackages ++ (map (pkgName: pkgs.${pkgName}) cfg.extraPackages); + rustPackages = rustDefaultPackages + ++ (map (pkgName: pkgs.${pkgName} or (abort "Unknown Rust pkg: ${pkgName}")) + cfg.extraPackages); in { From 0ce6e6272576cc72ec634e9cc04bbcc89ccf579a Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:31:35 +0200 Subject: [PATCH 29/48] refactor: change default emulator list to empty --- modules/hm/common/emulator/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/common/emulator/default.nix b/modules/hm/common/emulator/default.nix index 5cf4ac3..1b4e41f 100644 --- a/modules/hm/common/emulator/default.nix +++ b/modules/hm/common/emulator/default.nix @@ -35,7 +35,7 @@ in { options.modules.hm.emulator = { emulators = lib.mkOption { type = lib.types.listOf (lib.types.enum ["playonlinux" "proton" "wine" "bottles" "dosbox"]); - default = ["wine"]; + default = []; description = "List of emulators to enable"; }; From e34abb7ba210438d24353e0f3e0c25dbe2ab6d83 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:31:44 +0200 Subject: [PATCH 30/48] refactor: add nexus package support to games module --- modules/system/common/games/games.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/system/common/games/games.nix b/modules/system/common/games/games.nix index 13545ad..7e9a064 100755 --- a/modules/system/common/games/games.nix +++ b/modules/system/common/games/games.nix @@ -8,6 +8,7 @@ let steam = [ steam ]; lutris = [ lutris ]; heroic = [ heroic ]; + nexus = [ nexusmods-app-unfree ]; }; # Get packages for enabled clients From e6aba3b9ec9a5b118f33a9a48822974c85694977 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:31:53 +0200 Subject: [PATCH 31/48] refactor: remove 'none' option from antivirus engine selection --- modules/system/common/security/antivirus.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/system/common/security/antivirus.nix b/modules/system/common/security/antivirus.nix index 93c9c79..08a6b7c 100644 --- a/modules/system/common/security/antivirus.nix +++ b/modules/system/common/security/antivirus.nix @@ -7,7 +7,6 @@ let engineToPackages = { clamav = [ pkgs.clamav ] ++ lib.optionals cfg.gui.enable [ pkgs.clamtk ]; sophos = [ pkgs.sophos-av ]; - none = []; }; enabledEngines = lib.filter (e: e != "none") cfg.engines; @@ -17,7 +16,7 @@ in { gui.enable = lib.mkEnableOption "Enable GUI tools for the antivirus"; engines = lib.mkOption { type = lib.types.listOf (lib.types.enum (lib.attrNames engineToPackages)); - default = ["none"]; + default = []; description = "Select antivirus engines to install"; }; }; From 5e3e69f55e1f5ec29c8762c735d9f7f4a27bfba0 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:32:32 +0200 Subject: [PATCH 32/48] refactor: :art: moved modules from fern to sys --- modules/system/common/default.nix | 1 + .../{hosts/fern => common/networks}/wol.nix | 4 +- modules/system/hosts/fern/default.nix | 10 +-- modules/system/hosts/fern/drivers.nix | 63 ------------------- modules/system/hosts/fern/sunshine.nix | 1 - modules/system/hosts/oak/default.nix | 2 +- 6 files changed, 9 insertions(+), 72 deletions(-) rename modules/system/{hosts/fern => common/networks}/wol.nix (92%) delete mode 100644 modules/system/hosts/fern/drivers.nix diff --git a/modules/system/common/default.nix b/modules/system/common/default.nix index 2f3c720..ec2cf1e 100644 --- a/modules/system/common/default.nix +++ b/modules/system/common/default.nix @@ -17,6 +17,7 @@ ./networks/print/print.nix ./networks/vpn.nix + ./networks/wol.nix ./nix/linux-cachyos.nix ./nix/nix-garbage.nix diff --git a/modules/system/hosts/fern/wol.nix b/modules/system/common/networks/wol.nix similarity index 92% rename from modules/system/hosts/fern/wol.nix rename to modules/system/common/networks/wol.nix index 7a219cd..da898ac 100755 --- a/modules/system/hosts/fern/wol.nix +++ b/modules/system/common/networks/wol.nix @@ -5,10 +5,10 @@ ... }: let - cfg = config.modules.system.fern.wol; + cfg = config.modules.system.networks.wol; in { - options.modules.system.fern.wol = { + options.modules.system.networks.wol = { enable = lib.mkEnableOption "Wake-on-LAN support"; interface = lib.mkOption { type = lib.types.str; diff --git a/modules/system/hosts/fern/default.nix b/modules/system/hosts/fern/default.nix index 7123590..fba44d2 100644 --- a/modules/system/hosts/fern/default.nix +++ b/modules/system/hosts/fern/default.nix @@ -2,11 +2,9 @@ { imports = [ ../../common - ./drivers.nix ./plex.nix ./sunshine.nix ./vfio - ./wol.nix ]; modules.system = { @@ -16,13 +14,15 @@ }; games.steam.enable = true; - # fern specific modules - fern = { + networks = { wol = { enable = true; interface = "enp7s0"; }; - drivers.enable = true; + }; + + # fern specific modules + fern = { plex.enable = true; sunshine.enable = true; vfio.enable = true; diff --git a/modules/system/hosts/fern/drivers.nix b/modules/system/hosts/fern/drivers.nix deleted file mode 100644 index b721422..0000000 --- a/modules/system/hosts/fern/drivers.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - config, - pkgs, - lib, - inputs, - ... -}: - -let - cfg = config.modules.system.fern.drivers; -in -{ - - imports = [ - inputs.hydenix.inputs.nixos-hardware.nixosModules.common-gpu-amd - inputs.hydenix.inputs.nixos-hardware.nixosModules.common-cpu-intel - ]; - - options.modules.system.fern.drivers = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = "Enable drivers"; - }; - }; - - config = lib.mkIf cfg.enable { - - hardware = { - graphics = { - enable = true; - enable32Bit = true; - }; - nvidia = pkgs.lib.mkForce { - modesetting.enable = true; - powerManagement.enable = false; - open = false; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - amdgpuBusId = "PCI:3:0:0"; - nvidiaBusId = "PCI:8:0:0"; - }; - }; - - amdgpu = { - initrd.enable = true; - }; - }; - - services.xserver = { - enable = true; - videoDrivers = [ - "amdgpu" - "nvidia" - ]; - }; - }; -} diff --git a/modules/system/hosts/fern/sunshine.nix b/modules/system/hosts/fern/sunshine.nix index 1ab2981..701bc6e 100755 --- a/modules/system/hosts/fern/sunshine.nix +++ b/modules/system/hosts/fern/sunshine.nix @@ -133,6 +133,5 @@ in iptables -A INPUT -p udp -s ${net} -j ACCEPT '') cfg.allowedNetworks; }; - }; } diff --git a/modules/system/hosts/oak/default.nix b/modules/system/hosts/oak/default.nix index 86be718..df1766b 100644 --- a/modules/system/hosts/oak/default.nix +++ b/modules/system/hosts/oak/default.nix @@ -12,7 +12,7 @@ }; polkit.enable = true; }; - games.clients = ["steam"]; + games.clients = ["steam" "nexus"]; networks.vpn = ["tailscale"]; virtualisation.containers.engines = ["docker"]; backup.syncthing = { From cd8342050b55ded596000d474530e201f5780d91 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:49:39 +0200 Subject: [PATCH 33/48] refactor: update usage message to include 'pine' option in rb command --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index c784a97..5043797 100755 --- a/flake.nix +++ b/flake.nix @@ -144,7 +144,7 @@ ${pkgs.deploy-rs}/bin/deploy --skip-checks .#fern ${pkgs.deploy-rs}/bin/deploy --skip-checks .#pine ;; - *) echo "Usage: rb [oak|fern|all]" >&2; exit 1 ;; + *) echo "Usage: rb [oak|fern|pine|all]" >&2; exit 1 ;; esac ''; }; From e71f55057db34a31b26c74ea8339309cad1ba86d Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:50:43 +0200 Subject: [PATCH 34/48] refactor: consolidate android sdk configuration in nix files --- hosts/oak/default.nix | 6 ++++-- hosts/pine/default.nix | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts/oak/default.nix b/hosts/oak/default.nix index 8e019dc..b9e49d0 100644 --- a/hosts/oak/default.nix +++ b/hosts/oak/default.nix @@ -15,8 +15,10 @@ let (final: prev: { userPkgs = import inputs.nixpkgs { inherit (inputs.hydenix.lib) system; - config.allowUnfree = true; - android_sdk.accept_license = true; + config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; }; }) ]; diff --git a/hosts/pine/default.nix b/hosts/pine/default.nix index f453abd..1cdf2ab 100644 --- a/hosts/pine/default.nix +++ b/hosts/pine/default.nix @@ -7,7 +7,6 @@ let pkgs = import inputs.hydenix.inputs.hydenix-nixpkgs { inherit (inputs.hydenix.lib) system; config = { - android_sdk.accept_license = true; allowUnfree = true; }; overlays = [ @@ -16,7 +15,6 @@ let userPkgs = import inputs.nixpkgs { inherit (inputs.hydenix.lib) system; config.allowUnfree = true; - android_sdk.accept_license = true; }; }) ]; From d0effeb9f6fcabec3685408f2c7cb59be8c61307 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:50:51 +0200 Subject: [PATCH 35/48] refactor: reorder game module imports in default.nix --- modules/hm/common/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/common/default.nix b/modules/hm/common/default.nix index a7b20bb..285630d 100644 --- a/modules/hm/common/default.nix +++ b/modules/hm/common/default.nix @@ -32,9 +32,9 @@ ./extra/ignore-file-retriever.nix + ./games/games.nix ./games/joystick.nix ./games/mangohud.nix - ./games/games.nix ./multimedia/gimp.nix ./multimedia/mpv.nix From 6e036d053037f4f4a0763e79014e8afbbd13bf08 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:51:14 +0200 Subject: [PATCH 36/48] refactor: update discord rpc option to default to false --- modules/hm/common/communication/discord.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hm/common/communication/discord.nix b/modules/hm/common/communication/discord.nix index 2bf7e19..e55134b 100644 --- a/modules/hm/common/communication/discord.nix +++ b/modules/hm/common/communication/discord.nix @@ -46,12 +46,12 @@ in rpc.enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Whether to enable Discord Rich Presence support"; }; }; - config = lib.mkIf (cfg.clients != [] || cfg.overlays != []) { + config = lib.mkIf (cfg.clients != [] || cfg.overlays != [] || cfg.rpc.enable) { home.packages = clientPackages ++ overlayPackages ++ rpcPackage; }; } \ No newline at end of file From 40c027a32b4bb00699f35e8faedca5a44b5be751 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:51:31 +0200 Subject: [PATCH 37/48] refactor: ensure unique packages in mail communication module --- modules/hm/common/communication/mail/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/common/communication/mail/default.nix b/modules/hm/common/communication/mail/default.nix index cb3ec63..876b42d 100644 --- a/modules/hm/common/communication/mail/default.nix +++ b/modules/hm/common/communication/mail/default.nix @@ -12,7 +12,7 @@ let }; # Flatten the list of packages from all enabled services - packagesToInstall = lib.concatMap (service: serviceToPackage.${service}) serviceList; + packagesToInstall = lib.unique (lib.concatMap (s: serviceToPackage.${s}) serviceList); in { options.modules.hm.communication.mail = { From 0d51c32646979bc57649f589b11cbaeebe8317cb Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:51:48 +0200 Subject: [PATCH 38/48] refactor: ensure unique ide packages in jetbrains configuration --- modules/hm/common/dev/editor/jetbrains.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/hm/common/dev/editor/jetbrains.nix b/modules/hm/common/dev/editor/jetbrains.nix index 3113fd3..cee4d15 100644 --- a/modules/hm/common/dev/editor/jetbrains.nix +++ b/modules/hm/common/dev/editor/jetbrains.nix @@ -15,11 +15,12 @@ in }; config = lib.mkIf cfg.enable { - home.packages = lib.optionals (cfg.ides != []) (lib.concatMap (ide: - let - idePackage = builtins.getAttr ide pkgs.jetbrains; - in - [ idePackage ] - ) cfg.ides); + home.packages = lib.optionals (cfg.ides != []) + (lib.concatMap (ide: + let + idePackage = builtins.getAttr ide pkgs.jetbrains; + in + [ idePackage ] + ) (lib.unique cfg.ides)); }; } From 11230d3dffe5f422d5ffd651bc5237aa15832faa Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:51:56 +0200 Subject: [PATCH 39/48] refactor: ensure unique editor packages in documentation configuration --- modules/hm/common/documentation/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hm/common/documentation/default.nix b/modules/hm/common/documentation/default.nix index 3b20d3c..1e5d901 100644 --- a/modules/hm/common/documentation/default.nix +++ b/modules/hm/common/documentation/default.nix @@ -10,8 +10,8 @@ let }; # Get packages for enabled editors - editorsPackages = lib.filter (pkg: pkg != null) - (map (editor: editorsToPackage.${editor} or null) cfg.editors); + editorsPackages = lib.unique (lib.filter (pkg: pkg != null) + (map (e: editorsToPackage.${e} or null) cfg.editors)); in { From 24e572e35164e810eb061420d084a3d96ce32846 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:00 +0200 Subject: [PATCH 40/48] refactor: ensure unique game packages in games module --- modules/hm/common/games/games.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hm/common/games/games.nix b/modules/hm/common/games/games.nix index 6b84f46..d044a24 100644 --- a/modules/hm/common/games/games.nix +++ b/modules/hm/common/games/games.nix @@ -31,7 +31,7 @@ let gameNames = builtins.attrNames availableGames; # Get packages for enabled games - gamePackages = lib.concatMap (game: availableGames.${game}.packages) cfg.enabledGames; + gamePackages = lib.unique (lib.concatMap (game: availableGames.${game}.packages) cfg.enabledGames); in { options.modules.hm.games = { From 01746f9ef7ff3301acb346382d5308a180a588ac Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:19 +0200 Subject: [PATCH 41/48] refactor: update tunnel for cloudflare and ngrok with recursive targets --- modules/hm/common/network/tunnel.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/hm/common/network/tunnel.nix b/modules/hm/common/network/tunnel.nix index d90a4f9..68f57ff 100644 --- a/modules/hm/common/network/tunnel.nix +++ b/modules/hm/common/network/tunnel.nix @@ -36,9 +36,15 @@ let # Cloudflare token configuration cloudflareTokenConfig = lib.mkIf (builtins.elem "cloudflare" cfg.services && cfg.cloudflare.tokenPath != null) { home.sessionVariables.CLOUDFLARE_TOKEN_FILE = cfg.cloudflare.tokenPath; - home.file.".cloudflared/token".source = cfg.cloudflare.tokenPath; + home.file.".cloudflared/token" = { + source = cfg.cloudflare.tokenPath; + target.recursive = true; + }; }; - + home.file.".config/ngrok/ngrok.yml" = { + source = cfg.ngrok.configPath; + target.recursive = true; + }; # Ngrok config file ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.services && cfg.ngrok.configPath != null) { home.file.".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath; @@ -89,7 +95,7 @@ in { config = lib.mkMerge [ { - home.packages = servicesPackages; + home.packages = lib.unique servicesPackages; home.shellAliases = enabledAliases; } From ddd049c7aea706c42521e06bef4168fc17d20173 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:25 +0200 Subject: [PATCH 42/48] refactor: add 'nexus' to supported gaming clients in configuration --- modules/system/common/games/games.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/common/games/games.nix b/modules/system/common/games/games.nix index 7e9a064..35a97a5 100755 --- a/modules/system/common/games/games.nix +++ b/modules/system/common/games/games.nix @@ -21,7 +21,7 @@ in { default = []; description = '' List of gaming clients to enable. Supported options are "steam", "lutris", - and "heroic". This allows you to specify which gaming clients should be + "heroic", and "nexus". This allows you to specify which gaming clients should be configured in your NixOS setup. ''; }; From 25cae4b02b3b03c16e3f5dd8826318723f422908 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:42 +0200 Subject: [PATCH 43/48] refactor: enhance battery charge threshold configuration --- modules/system/common/hardware/powersave.nix | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/system/common/hardware/powersave.nix b/modules/system/common/hardware/powersave.nix index 9f7ddf1..c49046b 100644 --- a/modules/system/common/hardware/powersave.nix +++ b/modules/system/common/hardware/powersave.nix @@ -105,14 +105,22 @@ in { RUNTIME_PM_ON_BAT = "auto"; # Explicitly set charge thresholds for all batteries - START_CHARGE_THRESH_BAT0 = cfg.batteryHealth.chargeThresholds.start; - STOP_CHARGE_THRESH_BAT0 = cfg.batteryHealth.chargeThresholds.stop; - START_CHARGE_THRESH_BAT1 = cfg.batteryHealth.chargeThresholds.start; - STOP_CHARGE_THRESH_BAT1 = cfg.batteryHealth.chargeThresholds.stop; - - # Ensure TLP applies these thresholds - RESTORE_THRESHOLDS_ON_BAT = 1; - RESTORE_THRESHOLDS_ON_AC = 1; + # Set charge thresholds for primary battery (BAT0) + START_CHARGE_THRESH_BAT0 = lib.optionalString cfg.batteryHealth.enable + cfg.batteryHealth.chargeThresholds.start; + STOP_CHARGE_THRESH_BAT0 = lib.optionalString cfg.batteryHealth.enable + cfg.batteryHealth.chargeThresholds.stop; + + # Set charge thresholds for secondary battery (BAT1) if present + START_CHARGE_THRESH_BAT1 = lib.optionalString cfg.batteryHealth.enable + cfg.batteryHealth.chargeThresholds.start; + STOP_CHARGE_THRESH_BAT1 = lib.optionalString cfg.batteryHealth.enable + cfg.batteryHealth.chargeThresholds.stop; + + # Threshold persistence settings + # Ensures thresholds are maintained across power state changes + RESTORE_THRESHOLDS_ON_BAT = lib.optionalString cfg.batteryHealth.enable 1; # Restore when on battery + RESTORE_THRESHOLDS_ON_AC = lib.optionalString cfg.batteryHealth.enable 1; # Restore when on AC power }; }; From 1db1838b7064d7f846a534a4c66af7c6fd032e91 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:47 +0200 Subject: [PATCH 44/48] refactor: streamline antivirus engine package configuration --- modules/system/common/security/antivirus.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/common/security/antivirus.nix b/modules/system/common/security/antivirus.nix index 08a6b7c..90233ed 100644 --- a/modules/system/common/security/antivirus.nix +++ b/modules/system/common/security/antivirus.nix @@ -9,7 +9,9 @@ let sophos = [ pkgs.sophos-av ]; }; - enabledEngines = lib.filter (e: e != "none") cfg.engines; + enabledEngines = lib.concatMap + (engine: engineToPackages.${engine}) + cfg.engines; in { options.modules.system.security.antivirus = { @@ -22,9 +24,7 @@ in { }; config = { - environment.systemPackages = lib.concatMap - (engine: engineToPackages.${engine}) - enabledEngines; + environment.systemPackages = lib.unique enabledEngines; services.clamav = lib.mkIf (lib.elem "clamav" enabledEngines) { daemon.enable = true; From d02c122d18bfa409a306ddb58bc48c0f9caaa3cc Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:52:57 +0200 Subject: [PATCH 45/48] refactor: ensure unique password manager packages --- modules/system/common/security/password-manager.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/system/common/security/password-manager.nix b/modules/system/common/security/password-manager.nix index 75f0b1a..1ff2e58 100644 --- a/modules/system/common/security/password-manager.nix +++ b/modules/system/common/security/password-manager.nix @@ -49,8 +49,10 @@ in { }) { - environment.systemPackages = passwordManagerPackages - ++ lib.optionals cfg.yubikey.enable yubikeyPackages; + environment.systemPackages = lib.unique ( + passwordManagerPackages + ++ lib.optionals cfg.yubikey.enable yubikeyPackages + ); } ]; } \ No newline at end of file From 4c4e745c9d5daabade2a5448d510bb2c8f245e87 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:08:50 +0200 Subject: [PATCH 46/48] refactor: simplify ngrok configuration in tunnel setup --- modules/hm/common/network/tunnel.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/hm/common/network/tunnel.nix b/modules/hm/common/network/tunnel.nix index 68f57ff..21fd85d 100644 --- a/modules/hm/common/network/tunnel.nix +++ b/modules/hm/common/network/tunnel.nix @@ -41,13 +41,12 @@ let target.recursive = true; }; }; + + ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.services && cfg.ngrok.configPath != null) { home.file.".config/ngrok/ngrok.yml" = { source = cfg.ngrok.configPath; target.recursive = true; }; - # Ngrok config file - ngrokConfig = lib.mkIf (builtins.elem "ngrok" cfg.services && cfg.ngrok.configPath != null) { - home.file.".config/ngrok/ngrok.yml".source = cfg.ngrok.configPath; }; in { From 14de2df96b4278736e6ef258546460af5fa8162e Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:08:57 +0200 Subject: [PATCH 47/48] refactor: remove gamescope configuration from system modules --- modules/system/common/default.nix | 1 - modules/system/common/games/gamescope.nix | 27 ----------------------- 2 files changed, 28 deletions(-) delete mode 100755 modules/system/common/games/gamescope.nix diff --git a/modules/system/common/default.nix b/modules/system/common/default.nix index ec2cf1e..f32fc5c 100644 --- a/modules/system/common/default.nix +++ b/modules/system/common/default.nix @@ -8,7 +8,6 @@ ./dev/flutter.nix ./dev/php.nix - ./games/gamescope.nix ./games/games.nix ./hardware/autologin.nix diff --git a/modules/system/common/games/gamescope.nix b/modules/system/common/games/gamescope.nix deleted file mode 100755 index f745fbd..0000000 --- a/modules/system/common/games/gamescope.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -with lib; - -let - cfg = config.modules.system.games.gamescope; -in -{ - options.modules.system.games.gamescope = { - enable = mkEnableOption "Enable Gamescope compositor for gaming"; - }; - - config = mkIf cfg.enable { - # Add capability settings for gamescope - security.wrappers.gamescope = { - owner = "root"; - group = "root"; - capabilities = "cap_sys_nice+ep"; - source = "${pkgs.gamescope}/bin/gamescope"; - }; - }; -} From e56b489f009aeff4f56740d9b1704ae2cd314818 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:09:00 +0200 Subject: [PATCH 48/48] refactor: restructure games configuration to include gamemode support --- modules/system/hosts/oak/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/system/hosts/oak/default.nix b/modules/system/hosts/oak/default.nix index df1766b..56c1ee6 100644 --- a/modules/system/hosts/oak/default.nix +++ b/modules/system/hosts/oak/default.nix @@ -12,7 +12,10 @@ }; polkit.enable = true; }; - games.clients = ["steam" "nexus"]; + games = { + clients = ["steam" "nexus"]; + gamemode.enable = true; + }; networks.vpn = ["tailscale"]; virtualisation.containers.engines = ["docker"]; backup.syncthing = {