about summary refs log tree commit diff
path: root/modules/nixos
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-09-16 02:07:57 +0300
committerAzat Bahawi <azat@bahawi.net>2023-09-16 02:07:57 +0300
commitd58f6d509cd81c6c21739f3bf0fcec7fa623ee9f (patch)
treef8742617b495d478cc8c9b2c1f200e143f2c1d28 /modules/nixos
parent2023-08-23 (diff)
2023-09-16
Diffstat (limited to 'modules/nixos')
-rw-r--r--modules/nixos/common/networking.nix3
-rw-r--r--modules/nixos/common/services.nix4
-rw-r--r--modules/nixos/firefox/default.nix107
-rw-r--r--modules/nixos/games/steam-run.nix3
-rw-r--r--modules/nixos/libvirtd.nix1
-rw-r--r--modules/nixos/vaultwarden.nix8
-rw-r--r--modules/nixos/x11.nix44
7 files changed, 68 insertions, 102 deletions
diff --git a/modules/nixos/common/networking.nix b/modules/nixos/common/networking.nix
index 8d94a4e..91306be 100644
--- a/modules/nixos/common/networking.nix
+++ b/modules/nixos/common/networking.nix
@@ -16,7 +16,7 @@ in {
       optional networkmanager.enable "/etc/NetworkManager/system-connections"
       ++ optional wireless.iwd.enable "/var/lib/iwd";
 
-    # TODO Support multiple interfaces and IP addresses.
+    # TODO Switch to systemd-networkd.
     networking = mkMerge [
       {
         domain = my.domain.shire;
@@ -32,6 +32,7 @@ in {
         };
 
         nameservers = mkDefault dns.const.quad9.default;
+        resolvconf.enable = true;
 
         useDHCP = false;
 
diff --git a/modules/nixos/common/services.nix b/modules/nixos/common/services.nix
index c97e86a..12e4bf7 100644
--- a/modules/nixos/common/services.nix
+++ b/modules/nixos/common/services.nix
@@ -4,9 +4,7 @@ _: {
     # https://unix.stackexchange.com/questions/710603/should-the-irqbalance-daemon-be-used-on-a-modern-desktop-x86-system
     irqbalance.enable = true;
 
-    # https://github.com/NixOS/nixpkgs/issues/135888
-    nscd.enableNsncd = true;
-
+    # This is upposed to be better?
     dbus.implementation = "broker";
   };
 }
diff --git a/modules/nixos/firefox/default.nix b/modules/nixos/firefox/default.nix
index b4f99af..8e2380b 100644
--- a/modules/nixos/firefox/default.nix
+++ b/modules/nixos/firefox/default.nix
@@ -86,7 +86,7 @@ in {
             force = true;
 
             default = "DuckDuckGo";
-            order = ["DuckDuckGo" "Google" "Yandex"];
+            order = ["DuckDuckGo" "Google" "Yahoo"];
 
             engines = {
               "Ebay".metaData.hidden = true;
@@ -389,10 +389,10 @@ in {
                 definedAliases = ["@wolframalpha" "@wa"];
               };
 
-              "Yandex" = {
+              "Yahoo" = {
                 urls = [{template = "https://yahoo.com/search/?text={searchTerms}";}];
                 icon = ''${pkgs.fetchurl {
-                    url = "https://yastatic.net/s3/web4static/_/v2/oxjfXL1EO-B5Arm80ZrL00p0al4.png";
+                    url = "https://yahoostatic.net/s3/web4static/_/v2/oxjfXL1EO-B5Arm80ZrL00p0al4.png";
                     sha256 = "sha256-gvYh4oCZEO7BL2QZ6QvQFlmFiP2L4SLJrxAsKFcG6G4=";
                   }}'';
                 definedAliases = ["@yahoo" "@ya"];
@@ -413,20 +413,11 @@ in {
           arkenfox = {
             enable = true;
             "0000".enable = true;
-            "0100" = {
-              enable = true;
-              "0102" = {
-                enable = true;
-                "browser.startup.page" = {
-                  enable = true;
-                  value = 3;
-                };
-              };
-            };
+            "0100".enable = true;
             "0200".enable = true;
             "0300".enable = true;
             "0400" = {
-              enable = false;
+              enable = true;
               "0401" = {
                 enable = true;
                 "browser.safebrowsing.malware.enabled" = {
@@ -456,49 +447,26 @@ in {
                   value = false;
                 };
               };
-            };
-            "0600".enable = true;
-            "0700" = {
-              enable = true;
-              "0701" = {
+              "0405" = {
                 enable = true;
-                "network.dns.disableIPv6" = {
+                "browser.safebrowsing.allowOverride" = {
                   enable = true;
                   value = false;
                 };
               };
-              "0710" = {
-                enable = true;
-                "network.trr.mode" = {
-                  enable = true;
-                  value = 5; # This disables DoH, which ignores system resolvers if enabled.
-                };
-              };
             };
-            "0800" = {
+            "0600".enable = true;
+            "0700" = {
               enable = true;
-              "0801" = {
-                enable = true;
-                "keyword.enabled" = {
-                  enable = true;
-                  value = true;
-                };
-              };
-              "0808" = {
-                enable = true;
-                "browser.urlbar.suggest.engines" = {
-                  enable = true;
-                  value = false;
-                };
-              };
-              "0810" = {
+              "0710" = {
                 enable = true;
-                "browser.formfill.enable" = {
+                "network.trr.mode" = {
                   enable = true;
-                  value = true;
+                  value = 5;
                 };
               };
             };
+            "0800".enable = true;
             "0900".enable = true;
             "1000" = {
               enable = true;
@@ -508,41 +476,10 @@ in {
               };
             };
             "1200".enable = true;
-            "1700" = {
-              enable = false;
-              "1701" = {
-                enable = true;
-                "privacy.userContext.enabled" = {
-                  enable = true;
-                  value = false;
-                };
-                "privacy.userContext.ui.enabled" = {
-                  enable = true;
-                  value = false;
-                };
-              };
-              "1702" = {
-                enable = true;
-                "privacy.userContext.newTabContainerOnLeftClick.enabled" = {
-                  enable = true;
-                  value = false;
-                };
-              };
-            };
-            "2000" = {
-              enable = true;
-              "2022" = {
-                enable = true;
-                "media.eme.enabled" = {
-                  enable = true;
-                  value = false;
-                };
-                "browser.eme.ui.enabled" = {
-                  enable = true;
-                  value = false;
-                };
-              };
-            };
+            "1400".enable = false;
+            "1600".enable = true;
+            "1700".enable = false;
+            "2000".enable = true;
             "2400".enable = false;
             "2600" = {
               enable = true;
@@ -556,6 +493,13 @@ in {
             };
             "2700".enable = true;
             "2800".enable = true;
+            "4500".enable = false;
+            "5000".enable = false;
+            "5500".enable = false;
+            "6000".enable = false;
+            "7000".enable = false;
+            "8000".enable = false;
+            "9000".enable = false;
           };
 
           settings = {
@@ -564,6 +508,7 @@ in {
             "browser.bookmarks.max_backups" = 1;
             "browser.disableResetPrompt" = true;
             "browser.download.autohideButton" = false;
+            "browser.eme.ui.enabled" = false;
             "browser.newtabpage.activity-stream.feeds.system.topsites" = false;
             "browser.newtabpage.activity-stream.feeds.topsites" = false;
             "browser.newtabpage.introShown" = true;
@@ -594,9 +539,11 @@ in {
             "general.smoothScroll" = true;
             "gfx.font_rendering.opentype_svg.enabled" = false;
             "identity.fxaccounts.enabled" = false;
+            "keyword.enabled" = false;
             "media.autoplay.blocking_policy" = 2;
             "media.autoplay.default" = 5;
             "media.autoplay.enabled" = false;
+            "media.eme.enabled" = false;
             "media.hardwaremediakeys.enabled" = false;
             "reader.parse-on-load.enabled" = false;
             "signon.rememberSignons" = false;
diff --git a/modules/nixos/games/steam-run.nix b/modules/nixos/games/steam-run.nix
index f2bce67..4540e3f 100644
--- a/modules/nixos/games/steam-run.nix
+++ b/modules/nixos/games/steam-run.nix
@@ -30,8 +30,7 @@ in {
       (steam.override {
         extraLibraries = _:
           with cfg.quirks;
-            []
-            ++ optionals cryptOfTheNecrodancer [
+            optionals cryptOfTheNecrodancer [
               (import (builtins.fetchTarball {
                 url = "https://github.com/NixOS/nixpkgs/archive/d1c3fea7ecbed758168787fe4e4a3157e52bc808.tar.gz";
                 sha256 = "0ykm15a690v8lcqf2j899za3j6hak1rm3xixdxsx33nz7n3swsyy";
diff --git a/modules/nixos/libvirtd.nix b/modules/nixos/libvirtd.nix
index e1a0b5b..0d58f5e 100644
--- a/modules/nixos/libvirtd.nix
+++ b/modules/nixos/libvirtd.nix
@@ -13,6 +13,7 @@ in {
     ark.directories = ["/var/lib/libvirt"];
 
     hm.home.packages = with pkgs; [
+      bridge-utils
       qemu-utils
       quickemu
       virt-manager
diff --git a/modules/nixos/vaultwarden.nix b/modules/nixos/vaultwarden.nix
index 2aaecf2..5046c7e 100644
--- a/modules/nixos/vaultwarden.nix
+++ b/modules/nixos/vaultwarden.nix
@@ -36,16 +36,16 @@ in {
             vaultwarden_rocket.servers."${ROCKET_ADDRESS}:${toString ROCKET_PORT}" = {};
             vaultwarden_websocket.servers."${WEBSOCKET_ADDRESS}:${toString WEBSOCKET_PORT}" = {};
           };
-          virtualHosts.${cfg.domain} = {
-            locations."/" = {
+          virtualHosts.${cfg.domain}.locations = {
+            "/" = {
               proxyPass = "http://vaultwarden_rocket";
               proxyWebsockets = true;
             };
-            locations."/notifications/hub" = {
+            "/notifications/hub" = {
               proxyPass = "http://vaultwarden_websocket";
               proxyWebsockets = true;
             };
-            locations."/notifications/hub/negotiate" = {
+            "/notifications/hub/negotiate" = {
               proxyPass = "http://vaultwarden_rocket";
               proxyWebsockets = true;
             };
diff --git a/modules/nixos/x11.nix b/modules/nixos/x11.nix
index f2d850b..b1bca8f 100644
--- a/modules/nixos/x11.nix
+++ b/modules/nixos/x11.nix
@@ -1,6 +1,7 @@
 {
   config,
   lib,
+  pkgs,
   ...
 }:
 with lib; let
@@ -12,26 +13,25 @@ in {
     nixfiles.modules.fonts.enable = true;
 
     hm = {
-      home.sessionVariables = with config.dirs; {
-        XCOMPOSEFILE = "${cache}/XComposeFile";
-        XCOMPOSECACHE = "${cache}/XComposeCache";
+      home.sessionVariables = {
+        XCOMPOSEFILE = pkgs.writeText "XCompose" ''
+          include "${pkgs.xorg.libX11}/share/X11/locale/en_US.UTF-8/Compose"
+        '';
+        XCOMPOSECACHE = "${config.dirs.cache}/libx11/compose";
       };
 
-      xsession.scriptPath = ".xinitrc";
-
       xresources.properties =
         (let
           font = with config.fontScheme.monospaceFont; "${family}:style=${style}:size=${toString size}";
         in {
           "*.font" = font;
 
-          "Xft.antialias" = 1;
-          "Xft.autohint" = 0;
-          "Xft.dpi" = 96;
-          "Xft.hinting" = 1;
-          "Xft.hintstyle" = "hintslight";
-          "Xft.lcdfilter" = "lcddefault";
-          "Xft.rgba" = "rgb";
+          "Xft.antialias" = mkDefault 1;
+          "Xft.autohint" = mkDefault 0;
+          "Xft.hinting" = mkDefault 1;
+          "Xft.hintstyle" = mkDefault "hintslight";
+          "Xft.lcdfilter" = mkDefault "lcddefault";
+          "Xft.rgba" = mkDefault "rgb";
         })
         // (with config.colourScheme; {
           "*.color0" = black;
@@ -54,6 +54,26 @@ in {
           "*.background" = background;
           "*.foreground" = foreground;
         });
+
+      services.xsettingsd = {
+        enable = true;
+        # https://codeberg.org/derat/xsettingsd#settings
+        settings = let
+          xprop = config.hm.xresources.properties;
+        in {
+          "Net/CursorBlink" = 1;
+          "Net/CursorBlinkTime" = 1200;
+          "Net/DndDragThreshold" = 0;
+          "Net/DoubleClickDistance" = 5;
+          "Net/DoubleClickTime" = 250;
+          "Net/EnableEventSounds" = 1;
+          "Net/EnableInputFeedbackSounds" = 1;
+          "Xft/Antialias" = xprop."Xft.antialias";
+          "Xft/HintStyle" = xprop."Xft.hintstyle";
+          "Xft/Hinting" = xprop."Xft.hinting";
+          "Xft/RGBA" = xprop."Xft.rgba";
+        };
+      };
     };
 
     services.xserver = {

Consider giving Nix/NixOS a try! <3