From f395c61ee308cfbe58f5c244064b3e3a837f24b3 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Fri, 2 May 2025 11:49:11 +0200 Subject: [PATCH 1/3] Add encryption --- docs/src/README.md | 4 +- home/common.nix | 5 - modules/conf.nix | 11 +- modules/programs/drives.nix | 27 ++ modules/programs/hyprland/hyprland.nix | 502 +++++++++++++------------ 5 files changed, 292 insertions(+), 257 deletions(-) diff --git a/docs/src/README.md b/docs/src/README.md index 0a9e778..d5f1a80 100644 --- a/docs/src/README.md +++ b/docs/src/README.md @@ -5,7 +5,7 @@ -An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManger which can be enabled, disabled, configured or replaced at will. +An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManager which can be enabled, disabled, configured or replaced at will. # Usage @@ -116,7 +116,7 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang # ]; # or amd, whatever you have gpu.nvidia.enable = true; - kde_connect.enable = true; + kdeConnect.enable = true; # login manager: # default is greetd # greetd = { }; diff --git a/home/common.nix b/home/common.nix index 8d21635..31d67b9 100644 --- a/home/common.nix +++ b/home/common.nix @@ -25,11 +25,6 @@ in { }; keyboard = null; - - #file.".local/share/flatpak/overrides/global".text = lib.mkForce '' - # [Context] - # filesystems=xdg-config/gtk-3.0;xdg-config/gtk-4.0 - #''; }; programs.nix-index = { diff --git a/modules/conf.nix b/modules/conf.nix index c7d26b5..5189e92 100644 --- a/modules/conf.nix +++ b/modules/conf.nix @@ -33,7 +33,16 @@ example = true; description = '' enables secure boot. - Please don't forget to add your keys. + Note: Secure boot is NOT reproducible + Here are the necessary steps: + + create your keys with sbctl -> sudo sbctl create-keys + + build with systemd once -> set this to false and build once + + build with secureBoot true + + verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify + + enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft + + reboot with secureboot enabled + Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys + You likely have to disable these vendor specific keys (example HP: sure boot) ''; }; diff --git a/modules/programs/drives.nix b/modules/programs/drives.nix index 647bf80..c085144 100644 --- a/modules/programs/drives.nix +++ b/modules/programs/drives.nix @@ -25,6 +25,18 @@ Use swap in drive. ''; }; + useEncryption = lib.mkOption { + default = false; + example = true; + type = lib.types.bool; + description = '' + Enables encryption. + !WARNING! + You need your root drive to be named root exactly! + Otherwise there will not be a root crypt! + !WARNING! + ''; + }; homeAndRootFsTypes = lib.mkOption { default = "ext4"; example = "btrfs"; @@ -149,6 +161,21 @@ config = ( lib.optionalAttrs (options ? fileSystems) { + boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) ( + builtins.listToAttrs ( + map ( + { + name, + drive, + }: { + cryptstorage.device = lib.mkIf (name != "root") drive?device; + cryptoroot.device = lib.mkIf (name == "root") drive?device; + } + ) + config.mods.drives.extraDrives + ) + ); + fileSystems = lib.mkIf (config.mods.drives.variant == "manual" && !config.conf.wsl) ( builtins.listToAttrs ( map ( diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix index 4fa4c79..a517f98 100644 --- a/modules/programs/hyprland/hyprland.nix +++ b/modules/programs/hyprland/hyprland.nix @@ -124,265 +124,269 @@ in { settings = if config.mods.hyprland.useDefaultConfig then - { - "$mod" = "SUPER"; + ( + lib.recursiveUpdate + { + "$mod" = "SUPER"; - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizeactive" - ]; - - bind = [ - # screenshots - ''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy'' - ''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -'' - ''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy'' - - # regular programs - "$mod SUPER,F,exec,${browserName}" - (lib.mkIf ( - browserName == "firefox" || browserName == "zen" - ) "$mod SUPERSHIFT,F,exec,${browserName} -p special") - "$mod SUPER,T,exec,kitty -1" - "$mod SUPER,E,exec,nautilus -w" - "$mod SUPER,N,exec,neovide" - "$mod SUPER,M,exec,oxidash" - "$mod SUPER,R,exec,oxirun" - "$mod SUPER,G,exec,oxicalc" - "$mod SUPER,D,exec,oxishut" - "$mod SUPER,A,exec,oxipaste-iced" - "$mod SUPERSHIFT,P,exec,hyprdock --gui" - "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" - "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" - - # media keys - (lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute") - (lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audioControl sink -5%") - (lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audioControl sink +5%") - ",XF86AudioPlay,exec, playerctl play-pause" - ",XF86AudioNext,exec, playerctl next" - ",XF86AudioPrev,exec, playerctl previous" - (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, changeBrightness brightness 10%-") - (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, changeBrightness brightness +10%") - - # hyprland keybinds - # misc - "$mod SUPER,V,togglefloating," - "$mod SUPER,B,fullscreen," - "$mod SUPER,C,togglesplit" - "$mod SUPER,Q,killactive," - "$mod SUPERSHIFTALT,M,exit," - "$mod SUPERSHIFT,W,togglespecialworkspace" - - # move - "$mod SUPER,left,movewindow,l" - "$mod SUPER,right,movewindow,r" - "$mod SUPER,up,movewindow,u" - "$mod SUPER,down,movewindow,d" - - # workspaces - "$mod SUPER,1,workspace,1" - "$mod SUPER,2,workspace,2" - "$mod SUPER,3,workspace,3" - "$mod SUPER,4,workspace,4" - "$mod SUPER,5,workspace,5" - "$mod SUPER,6,workspace,6" - "$mod SUPER,7,workspace,7" - "$mod SUPER,8,workspace,8" - "$mod SUPER,9,workspace,9" - "$mod SUPER,0,workspace,10" - - # move to workspace - "$mod SUPERSHIFT,1,movetoworkspace,1" - "$mod SUPERSHIFT,2,movetoworkspace,2" - "$mod SUPERSHIFT,3,movetoworkspace,3" - "$mod SUPERSHIFT,4,movetoworkspace,4" - "$mod SUPERSHIFT,5,movetoworkspace,5" - "$mod SUPERSHIFT,6,movetoworkspace,6" - "$mod SUPERSHIFT,7,movetoworkspace,7" - "$mod SUPERSHIFT,8,movetoworkspace,8" - "$mod SUPERSHIFT,9,movetoworkspace,9" - "$mod SUPERSHIFT,0,movetoworkspace,10" - - # move to workspace silent - "$mod SUPERSHIFTALT,1,movetoworkspacesilent,1" - "$mod SUPERSHIFTALT,2,movetoworkspacesilent,2" - "$mod SUPERSHIFTALT,3,movetoworkspacesilent,3" - "$mod SUPERSHIFTALT,4,movetoworkspacesilent,4" - "$mod SUPERSHIFTALT,5,movetoworkspacesilent,5" - "$mod SUPERSHIFTALT,6,movetoworkspacesilent,6" - "$mod SUPERSHIFTALT,7,movetoworkspacesilent,7" - "$mod SUPERSHIFTALT,8,movetoworkspacesilent,8" - "$mod SUPERSHIFTALT,9,movetoworkspacesilent,9" - "$mod SUPERSHIFTALT,0,movetoworkspacesilent,10" - - # preselection - "$mod SUPERALT,j,layoutmsg,preselect l" - "$mod SUPERALT,k,layoutmsg,preselect d" - "$mod SUPERALT,l,layoutmsg,preselect u" - "$mod SUPERALT,semicolon,layoutmsg,preselect r" - "$mod SUPERALT,h,layoutmsg,preselect n" - ]; - - binde = [ - # hyprland keybinds - # focus - "$mod SUPER,J,movefocus,l" - "$mod SUPER,semicolon,movefocus,r" - "$mod SUPER,L,movefocus,u" - "$mod SUPER,K,movefocus,d" - - # resize - "$mod SUPER,U,resizeactive,-20 0" - "$mod SUPER,P,resizeactive,20 0" - "$mod SUPER,O,resizeactive,0 -20" - "$mod SUPER,I,resizeactive,0 20" - ]; - - general = { - gaps_out = "3,5,5,5"; - border_size = 3; - "col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg"; - # "col.inactive_border" = "0x66333333"; - allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true; - }; - - decoration = { - rounding = 4; - }; - - animations = { - bezier = "penguin,0.05,0.9,0.1,1.0"; - animation = [ - "windowsMove,1,4,default" - "windows,1,7,default,popin 70%" - "windowsOut,1,7,default,popin 70%" - "border,1,10,default" - "fade,1,7,default" - "workspaces,1,6,default" - "layers,1,3,default,popin" + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizeactive" ]; - }; - dwindle = { - preserve_split = true; - pseudotile = 0; - permanent_direction_override = false; - }; + bind = [ + # screenshots + ''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy'' + ''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -'' + ''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy'' - input = { - kb_layout = "${config.mods.xkb.layout}"; - kb_variant = "${config.mods.xkb.variant}"; - repeat_delay = 200; - force_no_accel = true; - touchpad = { - natural_scroll = true; - tap-to-click = true; - tap-and-drag = true; + # regular programs + "$mod SUPER,F,exec,${browserName}" + (lib.mkIf ( + browserName == "firefox" || browserName == "zen" + ) "$mod SUPERSHIFT,F,exec,${browserName} -p special") + "$mod SUPER,T,exec,kitty -1" + "$mod SUPER,E,exec,nautilus -w" + "$mod SUPER,N,exec,neovide" + "$mod SUPER,M,exec,oxidash" + "$mod SUPER,R,exec,anyrun" + "$mod SUPER,G,exec,oxicalc" + "$mod SUPER,D,exec,oxishut" + "$mod SUPER,A,exec,oxipaste-iced" + "$mod SUPERSHIFT,P,exec,hyprdock --gui" + "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" + "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" + + # media keys + (lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute") + (lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audioControl sink -5%") + (lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audioControl sink +5%") + ",XF86AudioPlay,exec, playerctl play-pause" + ",XF86AudioNext,exec, playerctl next" + ",XF86AudioPrev,exec, playerctl previous" + (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, changeBrightness brightness 10%-") + (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, changeBrightness brightness +10%") + + # hyprland keybinds + # misc + "$mod SUPER,V,togglefloating," + "$mod SUPER,B,fullscreen," + "$mod SUPER,C,togglesplit" + "$mod SUPER,Q,killactive," + "$mod SUPERSHIFTALT,M,exit," + "$mod SUPERSHIFT,W,togglespecialworkspace" + + # move + "$mod SUPER,left,movewindow,l" + "$mod SUPER,right,movewindow,r" + "$mod SUPER,up,movewindow,u" + "$mod SUPER,down,movewindow,d" + + # workspaces + "$mod SUPER,1,workspace,1" + "$mod SUPER,2,workspace,2" + "$mod SUPER,3,workspace,3" + "$mod SUPER,4,workspace,4" + "$mod SUPER,5,workspace,5" + "$mod SUPER,6,workspace,6" + "$mod SUPER,7,workspace,7" + "$mod SUPER,8,workspace,8" + "$mod SUPER,9,workspace,9" + "$mod SUPER,0,workspace,10" + + # move to workspace + "$mod SUPERSHIFT,1,movetoworkspace,1" + "$mod SUPERSHIFT,2,movetoworkspace,2" + "$mod SUPERSHIFT,3,movetoworkspace,3" + "$mod SUPERSHIFT,4,movetoworkspace,4" + "$mod SUPERSHIFT,5,movetoworkspace,5" + "$mod SUPERSHIFT,6,movetoworkspace,6" + "$mod SUPERSHIFT,7,movetoworkspace,7" + "$mod SUPERSHIFT,8,movetoworkspace,8" + "$mod SUPERSHIFT,9,movetoworkspace,9" + "$mod SUPERSHIFT,0,movetoworkspace,10" + + # move to workspace silent + "$mod SUPERSHIFTALT,1,movetoworkspacesilent,1" + "$mod SUPERSHIFTALT,2,movetoworkspacesilent,2" + "$mod SUPERSHIFTALT,3,movetoworkspacesilent,3" + "$mod SUPERSHIFTALT,4,movetoworkspacesilent,4" + "$mod SUPERSHIFTALT,5,movetoworkspacesilent,5" + "$mod SUPERSHIFTALT,6,movetoworkspacesilent,6" + "$mod SUPERSHIFTALT,7,movetoworkspacesilent,7" + "$mod SUPERSHIFTALT,8,movetoworkspacesilent,8" + "$mod SUPERSHIFTALT,9,movetoworkspacesilent,9" + "$mod SUPERSHIFTALT,0,movetoworkspacesilent,10" + + # preselection + "$mod SUPERALT,j,layoutmsg,preselect l" + "$mod SUPERALT,k,layoutmsg,preselect d" + "$mod SUPERALT,l,layoutmsg,preselect u" + "$mod SUPERALT,semicolon,layoutmsg,preselect r" + "$mod SUPERALT,h,layoutmsg,preselect n" + ]; + + binde = [ + # hyprland keybinds + # focus + "$mod SUPER,J,movefocus,l" + "$mod SUPER,semicolon,movefocus,r" + "$mod SUPER,L,movefocus,u" + "$mod SUPER,K,movefocus,d" + + # resize + "$mod SUPER,U,resizeactive,-20 0" + "$mod SUPER,P,resizeactive,20 0" + "$mod SUPER,O,resizeactive,0 -20" + "$mod SUPER,I,resizeactive,0 20" + ]; + + general = { + gaps_out = "3,5,5,5"; + border_size = 3; + "col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg"; + # "col.inactive_border" = "0x66333333"; + allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true; }; - }; - misc = { - animate_manual_resizes = 1; - enable_swallow = true; - disable_splash_rendering = true; - disable_hyprland_logo = true; - swallow_regex = "^(.*)(kitty)(.*)$"; - initial_workspace_tracking = 1; - # just doesn't work - enable_anr_dialog = false; - }; + decoration = { + rounding = 4; + }; - cursor = { - enable_hyprcursor = true; - no_hardware_cursors = lib.mkIf config.mods.gpu.nvidia.enable true; - # done with nix, this would break the current setup otherwise - sync_gsettings_theme = false; - }; + animations = { + bezier = "penguin,0.05,0.9,0.1,1.0"; + animation = [ + "windowsMove,1,4,default" + "windows,1,7,default,popin 70%" + "windowsOut,1,7,default,popin 70%" + "border,1,10,default" + "fade,1,7,default" + "workspaces,1,6,default" + "layers,1,3,default,popin" + ]; + }; - gestures = { - workspace_swipe = true; - }; + dwindle = { + preserve_split = true; + pseudotile = 0; + permanent_direction_override = false; + }; - monitor = config.mods.hyprland.monitor; - workspace = config.mods.hyprland.workspace; - - env = [ - "GTK_CSD,0" - ''TERM,"kitty /bin/fish"'' - "XDG_CURRENT_DESKTOP=Hyprland" - "XDG_SESSION_TYPE=wayland" - "XDG_SESSION_DESKTOP=Hyprland" - "HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}" - "HYPRCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" - "XCURSOR_THEME,${config.mods.stylix.cursor.name}" - "XCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" - "QT_QPA_PLATFORM,wayland" - "QT_QPA_PLATFORMTHEME,qt5ct" - "QT_WAYLAND_FORCE_DPI,96" - "QT_AUTO_SCREEN_SCALE_FACTOR,0" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "QT_SCALE_FACTOR,1" - ''EDITOR,"neovide --novsync --nofork"'' - (lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1") - "GTK_USE_PORTAL, 1" - - (lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia") - (lib.mkIf config.mods.gpu.nvidia.enable "XDG_SESSION_TYPE,wayland") - (lib.mkIf config.mods.gpu.nvidia.enable "GBM_BACKEND,nvidia-drm") - (lib.mkIf config.mods.gpu.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia") - ]; - - layerrule = [ - # layer rules - # mainly to disable animations within slurp and grim - "noanim, selection" - ]; - - windowrule = [ - # window rules - "float,class:^(.*)(OxiCalc)(.*)$" - "float,class:^(.*)(winecfg.exe)(.*)$" - "float,class:^(.*)(copyq)(.*)$" - "center,class:^(.*)(swappy)(.*)$" - "float,title:^(.*)(reset)(.*)$" - "workspace 10 silent,class:^(.*)(steam)(.*)$" - "workspace 9 silent,class:^(.*)(dota)(.*)$" - "workspace 9 silent,class:^(.*)(battlebits)(.*)$" - "workspace 9 silent,class:^(.*)(aoe)(.*)$" - "suppressevent fullscreen maximize,class:^(.*)(neovide)(.*)$" - "immediate,class:^(.*)(Pal)$" - "immediate,class:^(.*)(dota2)$" - "immediate,class:^(.*)(needforspeedheat.exe)$" - ]; - - exec-once = - [ - # environment - "systemctl --user import-environment" - "dbus-update-activation-environment --systemd --all" - "hyprctl setcursor Bibata-Modern-Classic 24" - - # other programs - "hyprpaper" - "ironbar" - "${browserName}" - "oxipaste_daemon" - "oxinoti" - ] - ++ config.mods.hyprland.extraAutostart; - - plugin = - { - hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { - bind = [ - "SUPER, W, overview:toggle, toggle" - ]; + input = { + kb_layout = "${config.mods.xkb.layout}"; + kb_variant = "${config.mods.xkb.variant}"; + repeat_delay = 200; + force_no_accel = true; + touchpad = { + natural_scroll = true; + tap-to-click = true; + tap-and-drag = true; }; - } - // config.mods.hyprland.pluginConfig; - } - // config.mods.hyprland.customConfig + }; + + misc = { + animate_manual_resizes = 1; + enable_swallow = true; + disable_splash_rendering = true; + disable_hyprland_logo = true; + swallow_regex = "^(.*)(kitty)(.*)$"; + initial_workspace_tracking = 1; + # just doesn't work + enable_anr_dialog = false; + }; + + cursor = { + enable_hyprcursor = true; + no_hardware_cursors = lib.mkIf config.mods.gpu.nvidia.enable true; + # done with nix, this would break the current setup otherwise + sync_gsettings_theme = false; + }; + + gestures = { + workspace_swipe = true; + }; + + monitor = config.mods.hyprland.monitor; + workspace = config.mods.hyprland.workspace; + + env = [ + "GTK_CSD,0" + ''TERM,"kitty /bin/fish"'' + "XDG_CURRENT_DESKTOP=Hyprland" + "XDG_SESSION_TYPE=wayland" + "XDG_SESSION_DESKTOP=Hyprland" + "HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}" + "HYPRCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" + "XCURSOR_THEME,${config.mods.stylix.cursor.name}" + "XCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" + "QT_QPA_PLATFORM,wayland" + "QT_QPA_PLATFORMTHEME,qt5ct" + "QT_WAYLAND_FORCE_DPI,96" + "QT_AUTO_SCREEN_SCALE_FACTOR,0" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "QT_SCALE_FACTOR,1" + ''EDITOR,"neovide --novsync --nofork"'' + (lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1") + "GTK_USE_PORTAL, 1" + + (lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia") + (lib.mkIf config.mods.gpu.nvidia.enable "XDG_SESSION_TYPE,wayland") + (lib.mkIf config.mods.gpu.nvidia.enable "GBM_BACKEND,nvidia-drm") + (lib.mkIf config.mods.gpu.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia") + ]; + + layerrule = [ + # layer rules + # mainly to disable animations within slurp and grim + "noanim, selection" + ]; + + windowrule = [ + # window rules + "float,class:^(.*)(OxiCalc)(.*)$" + "float,class:^(.*)(winecfg.exe)(.*)$" + "float,class:^(.*)(copyq)(.*)$" + "center,class:^(.*)(swappy)(.*)$" + "float,title:^(.*)(reset)(.*)$" + "workspace 10 silent,class:^(.*)(steam)(.*)$" + "workspace 9 silent,class:^(.*)(dota)(.*)$" + "workspace 9 silent,class:^(.*)(battlebits)(.*)$" + "workspace 9 silent,class:^(.*)(aoe)(.*)$" + "suppressevent fullscreen maximize,class:^(.*)(neovide)(.*)$" + "immediate,class:^(.*)(Pal)$" + "immediate,class:^(.*)(dota2)$" + "immediate,class:^(.*)(needforspeedheat.exe)$" + ]; + + exec-once = + [ + # environment + "systemctl --user import-environment" + "dbus-update-activation-environment --systemd --all" + "hyprctl setcursor Bibata-Modern-Classic 24" + + # other programs + "hyprpaper" + "ironbar" + "${browserName}" + "oxipaste_daemon" + "oxinoti" + ] + ++ config.mods.hyprland.extraAutostart; + + plugin = + lib.recursiveUpdate + { + hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { + bind = [ + "SUPER, W, overview:toggle, toggle" + ]; + }; + } + config.mods.hyprland.pluginConfig; + } + config.mods.hyprland.customConfig + ) else lib.mkForce config.mods.hyprland.customConfig; plugins = [ -- 2.51.2 From 5b13d145adf885752d64dd108a1407c847f305d7 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Fri, 2 May 2025 11:53:29 +0200 Subject: [PATCH 2/3] Binary cache optimization --- base/common_hardware.nix | 30 ++++++++++++++++++++++++++++++ flake.nix | 32 -------------------------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 0688ded..87d6279 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -100,6 +100,36 @@ in { trusted-users = [username]; auto-optimise-store = true; + builders-use-substitutes = true; + + substituters = [ + "https://hyprland.cachix.org" + "https://anyrun.cachix.org" + "https://cache.garnix.io" + "https://oxipaste.cachix.org" + "https://oxinoti.cachix.org" + "https://oxishut.cachix.org" + "https://oxidash.cachix.org" + "https://oxicalc.cachix.org" + "https://hyprdock.cachix.org" + "https://reset.cachix.org" + "https://chaotic-nyx.cachix.org/" + ]; + + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc=" + "oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc=" + "oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU=" + "oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30=" + "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" + "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" + "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" + "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" + ]; + experimental-features = "nix-command flakes pipe-operators"; }; }; diff --git a/flake.nix b/flake.nix index b1ffa47..e7e7c44 100644 --- a/flake.nix +++ b/flake.nix @@ -124,36 +124,4 @@ modules = ./modules; iso = dashNixLib.buildIso.config.system.build.isoImage; }; - - nixConfig = { - builders-use-substitutes = true; - - extra-substituters = [ - "https://hyprland.cachix.org" - "https://anyrun.cachix.org" - "https://cache.garnix.io" - "https://oxipaste.cachix.org" - "https://oxinoti.cachix.org" - "https://oxishut.cachix.org" - "https://oxidash.cachix.org" - "https://oxicalc.cachix.org" - "https://hyprdock.cachix.org" - "https://reset.cachix.org" - "https://chaotic-nyx.cachix.org/" - ]; - - extra-trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" - "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc=" - "oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc=" - "oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU=" - "oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30=" - "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" - "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" - "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" - "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" - ]; - }; } -- 2.51.2 From e657564ef7904c68e23bedd6932966132b2e3a8e Mon Sep 17 00:00:00 2001 From: DashieTM Date: Fri, 2 May 2025 12:00:05 +0200 Subject: [PATCH 3/3] Stylix firefox profile names --- modules/programs/browser/firefox.nix | 6 ++++ modules/programs/gpu.nix | 2 +- modules/programs/hyprland/anyrun.nix | 4 +-- modules/programs/hyprland/hyprland.nix | 39 ++++++++++++++------------ 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/modules/programs/browser/firefox.nix b/modules/programs/browser/firefox.nix index 01722c9..4db465a 100644 --- a/modules/programs/browser/firefox.nix +++ b/modules/programs/browser/firefox.nix @@ -80,6 +80,12 @@ }; config = lib.mkIf (config.mods.browser.firefox.enable || config.mods.homePackages.browser == "firefox") ( lib.optionalAttrs (options ? programs.firefox.profiles) { + stylix.targets.firefox.profileNames = + map ( + {name, ...}: + name + ) + config.mods.browser.firefox.profiles; programs.firefox = { enable = true; policies = config.mods.browser.firefox.configuration; diff --git a/modules/programs/gpu.nix b/modules/programs/gpu.nix index 56083db..339b694 100644 --- a/modules/programs/gpu.nix +++ b/modules/programs/gpu.nix @@ -87,7 +87,7 @@ (lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl) (lib.mkIf config.mods.gpu.vapi.enable pkgs.libva) (lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau) - (lib.mkIf (config.mods.gpu.intelgpu.enable || config.mods.gpu.amdgpu.enable) pkgs.mesa.drivers) + (lib.mkIf (config.mods.gpu.intelgpu.enable || config.mods.gpu.amdgpu.enable) pkgs.mesa) ]; rocmPackages = [ pkgs.rocmPackages.clr.icd diff --git a/modules/programs/hyprland/anyrun.nix b/modules/programs/hyprland/anyrun.nix index 5b17669..6a3a24e 100644 --- a/modules/programs/hyprland/anyrun.nix +++ b/modules/programs/hyprland/anyrun.nix @@ -10,8 +10,8 @@ hyprland = { anyrun = { enable = lib.mkOption { - default = true; - example = false; + default = false; + example = true; type = lib.types.bool; description = "Enables anyrun"; }; diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix index a517f98..ff13a4c 100644 --- a/modules/programs/hyprland/hyprland.nix +++ b/modules/programs/hyprland/hyprland.nix @@ -124,8 +124,8 @@ in { settings = if config.mods.hyprland.useDefaultConfig then - ( - lib.recursiveUpdate + lib.mkMerge + [ { "$mod" = "SUPER"; @@ -148,12 +148,13 @@ in { "$mod SUPER,T,exec,kitty -1" "$mod SUPER,E,exec,nautilus -w" "$mod SUPER,N,exec,neovide" - "$mod SUPER,M,exec,oxidash" - "$mod SUPER,R,exec,anyrun" - "$mod SUPER,G,exec,oxicalc" - "$mod SUPER,D,exec,oxishut" - "$mod SUPER,A,exec,oxipaste-iced" - "$mod SUPERSHIFT,P,exec,hyprdock --gui" + (lib.mkIf (config.mods.hyprland.anyrun.enable) "$mod SUPER,R,exec,anyrun") + (lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun") + (lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash") + (lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc") + (lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut") + (lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste-iced") + (lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui") "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" @@ -375,18 +376,20 @@ in { ++ config.mods.hyprland.extraAutostart; plugin = - lib.recursiveUpdate - { - hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { - bind = [ - "SUPER, W, overview:toggle, toggle" - ]; - }; - } - config.mods.hyprland.pluginConfig; + lib.mkMerge + [ + { + hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { + bind = [ + "SUPER, W, overview:toggle, toggle" + ]; + }; + } + config.mods.hyprland.pluginConfig + ]; } config.mods.hyprland.customConfig - ) + ] else lib.mkForce config.mods.hyprland.customConfig; plugins = [ -- 2.51.2