about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorazahi <azat@bahawi.net>2025-02-02 01:48:24 +0300
committerazahi <azat@bahawi.net>2025-02-02 01:48:24 +0300
commitba11ee8c7a130cebcf0b13640563ae748cef0e5f (patch)
tree86b8b52745708a49ca23486155726e02652745d2 /modules
parent2025-01-24 (diff)
2025-02-02
Diffstat (limited to '')
-rw-r--r--modules/common/xdg.nix6
-rw-r--r--modules/firefox/addons.json3
-rw-r--r--modules/firefox/default.nix1
-rw-r--r--modules/games/default.nix6
-rw-r--r--modules/games/steam.nix14
-rw-r--r--modules/hyprland.nix8
-rw-r--r--modules/kde.nix5
-rw-r--r--modules/profiles/dev/default.nix1
-rw-r--r--modules/profiles/headful.nix18
-rw-r--r--modules/wireguard.nix25
10 files changed, 52 insertions, 35 deletions
diff --git a/modules/common/xdg.nix b/modules/common/xdg.nix
index df7d624..e91d2c5 100644
--- a/modules/common/xdg.nix
+++ b/modules/common/xdg.nix
@@ -84,7 +84,11 @@ in
 
   config = {
     xdg = {
-      portal.enable = this.isHeadful;
+      portal = {
+        enable = this.isHeadful;
+        xdgOpenUsePortal = this.isHeadful;
+      };
+
       sounds.enable = this.isHeadful;
     };
 
diff --git a/modules/firefox/addons.json b/modules/firefox/addons.json
index 55919c3..e3867c1 100644
--- a/modules/firefox/addons.json
+++ b/modules/firefox/addons.json
@@ -36,9 +36,6 @@
     "slug": "redirector"
   },
   {
-    "slug": "skip-redirect"
-  },
-  {
     "slug": "switchyomega"
   },
   {
diff --git a/modules/firefox/default.nix b/modules/firefox/default.nix
index 69324b7..bad56ff 100644
--- a/modules/firefox/default.nix
+++ b/modules/firefox/default.nix
@@ -110,7 +110,6 @@ in
                 no-pdf-download
                 redirector
                 rikaichamp
-                skip-redirect
                 switchyomega
                 ublock-origin
                 user-agent-switcher
diff --git a/modules/games/default.nix b/modules/games/default.nix
index 4f474b4..b70b94b 100644
--- a/modules/games/default.nix
+++ b/modules/games/default.nix
@@ -14,12 +14,10 @@ in
       services = {
         jack.alsa.support32Bit = config.services.jack.alsa.enable;
         pipewire.alsa.support32Bit = config.services.pipewire.alsa.enable;
+        pulseaudio.support32Bit = config.services.pulseaudio.enable;
       };
 
-      hardware = {
-        graphics.enable32Bit = true;
-        pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
-      };
+      hardware.graphics.enable32Bit = true;
     })
   ];
 }
diff --git a/modules/games/steam.nix b/modules/games/steam.nix
index d1da8ee..d8c6964 100644
--- a/modules/games/steam.nix
+++ b/modules/games/steam.nix
@@ -13,11 +13,15 @@ in
 
   config = mkIf cfg.enable {
     nixfiles.modules = {
-      common.nix.allowedUnfreePackages = [
-        "steam"
-        "steam-run"
-        "steam-unwrapped"
-      ];
+      common = {
+        nix.allowedUnfreePackages = [
+          "steam"
+          "steam-run"
+          "steam-unwrapped"
+        ];
+
+        xdg.defaultApplications.steam = [ "x-scheme-handler/steam" ];
+      };
 
       games = {
         enable32BitSupport = true;
diff --git a/modules/hyprland.nix b/modules/hyprland.nix
index c7f574a..a2776dc 100644
--- a/modules/hyprland.nix
+++ b/modules/hyprland.nix
@@ -112,11 +112,11 @@ in
                     let
                       c = (x + 1) / 10;
                     in
-                    toString (x + 1 - (c * 10));
+                    x + 1 - (c * 10) |> toString;
                 in
                 [
-                  "SUPER, ${ws}, workspace, ${toString (x + 1)}"
-                  "SUPER SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
+                  "SUPER,       ${ws}, workspace,       ${x + 1 |> toString}"
+                  "SUPER SHIFT, ${ws}, movetoworkspace, ${x + 1 |> toString}"
                 ]
               ) 10
             ));
@@ -125,7 +125,5 @@ in
 
       programs.hyprlock.enable = true;
     };
-
-    programs.hyprland.enable = true;
   };
 }
diff --git a/modules/kde.nix b/modules/kde.nix
index 9490b71..c227620 100644
--- a/modules/kde.nix
+++ b/modules/kde.nix
@@ -20,9 +20,6 @@ in
     };
 
     hm = {
-      # NOTE This will fail the home-manager service upon startup while a Plasma
-      # session is not initialised. Something about dbus not being able to
-      # communicate with presumably KDE configuration daemon.
       stylix.targets.kde.enable = true;
 
       programs.firefox.profiles.default.settings = {
@@ -55,7 +52,7 @@ in
         enable = true;
 
         wayland = {
-          enable = false;
+          enable = true;
           compositor = "kwin";
         };
       };
diff --git a/modules/profiles/dev/default.nix b/modules/profiles/dev/default.nix
index 38a2117..bb7cfc9 100644
--- a/modules/profiles/dev/default.nix
+++ b/modules/profiles/dev/default.nix
@@ -68,6 +68,7 @@ in
           ])
           age
           dbeaver-bin
+          devenv
           distrobox
           htmlq
           httpie
diff --git a/modules/profiles/headful.nix b/modules/profiles/headful.nix
index a315af4..e328691 100644
--- a/modules/profiles/headful.nix
+++ b/modules/profiles/headful.nix
@@ -17,6 +17,8 @@ in
 
   config = mkIf cfg.enable {
     nixfiles.modules = {
+      common.xdg.defaultApplications."org.telegram.desktop" = [ "x-scheme-handler/tg" ];
+
       profiles.dev.enable = true;
 
       alacritty.enable = mkDefault true;
@@ -85,7 +87,21 @@ in
     };
 
     boot = {
-      kernelPackages = mkDefault pkgs.linuxPackages_latest;
+      kernelPackages = mkDefault (
+        if config.boot.zfs.enabled then
+          pkgs.linuxKernel.packages
+          |> lib.filterAttrs (
+            k: v:
+            (builtins.match "linux_[0-9]+_[0-9]+" k) != null
+            && (builtins.tryEval v).success
+            && (!v.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
+          )
+          |> builtins.attrValues
+          |> lib.sort (a: b: lib.versionOlder a.kernel.version b.kernel.version)
+          |> lib.last
+        else
+          pkgs.linuxPackages_latest
+      );
 
       kernelParams = [
         # https://wiki.archlinux.org/title/improving_performance#Watchdogs
diff --git a/modules/wireguard.nix b/modules/wireguard.nix
index 92497e1..c9d9937 100644
--- a/modules/wireguard.nix
+++ b/modules/wireguard.nix
@@ -22,25 +22,27 @@ let
   );
 
   extraOptions = {
-    jc = 23;
-    jmin = 58;
-    jmax = 1021;
-    s1 = 49;
-    s2 = 87;
-    h1 = 1264154357;
-    h2 = 462401493;
-    h3 = 737329836;
-    h4 = 1039929807;
+    Jc = 23;
+    Jmin = 58;
+    Jmax = 1021;
+    S1 = 49;
+    S2 = 87;
+    H1 = 1264154357;
+    H2 = 462401493;
+    H3 = 737329836;
+    H4 = 1039929807;
   };
 in
 {
   disabledModules = [
     "services/networking/wg-quick.nix"
     "services/networking/wireguard.nix"
+    "services/networking/wireguard-networkd.nix"
   ];
   imports = [
     "${inputs.nixpkgs-amneziawg}/nixos/modules/services/networking/wg-quick.nix"
     "${inputs.nixpkgs-amneziawg}/nixos/modules/services/networking/wireguard.nix"
+    "${inputs.nixpkgs-amneziawg}/nixos/modules/services/networking/wireguard-networkd.nix"
   ];
 
   options.nixfiles.modules.wireguard = {
@@ -218,8 +220,9 @@ in
         networking = {
           wireguard = {
             enable = true;
-            type = "amneziawg";
+            useNetworkd = false; # Does not work with "amneziawg".
             interfaces.${cfg.interface} = with cfg.server; {
+              type = "amneziawg";
               privateKeyFile = config.secrets."wireguard-private-key-${this.hostname}".path;
               ips = [
                 "${ipv6.address}/16"
@@ -227,7 +230,7 @@ in
               ];
               listenPort = port;
               inherit peers extraOptions;
-              postSetup = DNSSetup;
+              postSetup = lib.optionalString (!config.networking.wireguard.useNetworkd) DNSSetup;
               allowedIPsAsRoutes = false;
             };
           };

Consider giving Nix/NixOS a try! <3