about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-11-20 23:14:33 +0300
committerAzat Bahawi <azat@bahawi.net>2022-11-20 23:14:33 +0300
commit3229e56e0d3620ddc735edcfbbefb167efa3b23f (patch)
tree5000ad05647c66687244dbd0ef29e0b29a3a6241 /modules
parent2022-11-10 (diff)
2022-11-20
Diffstat (limited to '')
-rw-r--r--modules/nixfiles/common/nix/default.nix1
-rw-r--r--modules/nixfiles/common/tmp.nix2
-rw-r--r--modules/nixfiles/emacs/default.nix4
-rw-r--r--modules/nixfiles/emacs/doom/config.el44
-rw-r--r--modules/nixfiles/emacs/doom/init.el16
-rw-r--r--modules/nixfiles/emacs/doom/packages.el6
-rw-r--r--modules/nixfiles/firefox/default.nix15
-rw-r--r--modules/nixfiles/firefox/userContent.css44
-rw-r--r--modules/nixfiles/fonts.nix12
-rw-r--r--modules/nixfiles/games/default.nix9
-rw-r--r--modules/nixfiles/kde.nix9
-rw-r--r--modules/nixfiles/libvirtd.nix10
-rw-r--r--modules/nixfiles/openconnect.nix83
-rw-r--r--modules/nixfiles/profiles/dev/containers.nix1
14 files changed, 194 insertions, 62 deletions
diff --git a/modules/nixfiles/common/nix/default.nix b/modules/nixfiles/common/nix/default.nix
index f6c75ba..c9d3b04 100644
--- a/modules/nixfiles/common/nix/default.nix
+++ b/modules/nixfiles/common/nix/default.nix
@@ -104,6 +104,7 @@ with lib; {
       in {
         # Normalises package names. This is done purely for aesthetics.
         css-language-server = np.vscode-css-languageserver-bin;
+        dhall-language-server = dhall-lsp-server;
         dockerfile-language-server = np.dockerfile-language-server-nodejs;
         editorconfig = editorconfig-core-c;
         go-language-server = gopls;
diff --git a/modules/nixfiles/common/tmp.nix b/modules/nixfiles/common/tmp.nix
index 9527f28..d56e2b6 100644
--- a/modules/nixfiles/common/tmp.nix
+++ b/modules/nixfiles/common/tmp.nix
@@ -11,7 +11,7 @@ _: {
         "nodev"
         "nosuid"
         "rw"
-        "size=50%"
+        "size=25%"
       ];
     }
   ];
diff --git a/modules/nixfiles/emacs/default.nix b/modules/nixfiles/emacs/default.nix
index fa72549..0ae2bf9 100644
--- a/modules/nixfiles/emacs/default.nix
+++ b/modules/nixfiles/emacs/default.nix
@@ -53,6 +53,7 @@ in {
             cmake-format # :lang cc :editor format
             cmigemo # :lang japanese
             css-language-server # :lang (web +lsp)
+            dhall-language-server # :lang (dhall +lsp)
             dockerfile-language-server # :tools (docker +lsp)
             editorconfig # :tools editorconfig
             fd # doom!
@@ -116,8 +117,9 @@ in {
 
           (setq custom-file (file-name-concat doom-emacs-dir "custom.el"))
 
+          ;; Font must be set to n+2 because otherwise it looks too small.
           (setq doom-font (font-spec :family "${config.fontScheme.monospaceFont.family}"
-                                     :size ${toString config.fontScheme.monospaceFont.size})
+                                     :size ${toString (config.fontScheme.monospaceFont.size + 2)})
                 doom-unicode-font doom-font)
 
           (appendq! auth-sources '("${config.secrets.authinfo.path}"))
diff --git a/modules/nixfiles/emacs/doom/config.el b/modules/nixfiles/emacs/doom/config.el
index 4f2d835..9fa9984 100644
--- a/modules/nixfiles/emacs/doom/config.el
+++ b/modules/nixfiles/emacs/doom/config.el
@@ -133,14 +133,6 @@
                                      "a.gondor@yahoo.com"
                                      "a.gondor@yahoo.com"))
 
-(set-email-account! "yahoo"
-                    '((mu4e-sent-folder   . "/yahoo/Sent")
-                      (mu4e-drafts-folder . "/yahoo/Drafts")
-                      (mu4e-trash-folder  . "/yahoo/Trash")
-                      (mu4e-refile-folder . "/yahoo/Archive")
-                      (smtpmail-smtp-user . "a.gondor"))
-                    t)
-
 (set-email-account! "shire"
                     '((mu4e-drafts-folder . "/shire/Drafts")
                       (mu4e-refile-folder . "/shire/Archive")
@@ -149,6 +141,14 @@
                       (smtpmail-smtp-user . "azahi"))
                     t)
 
+(set-email-account! "yahoo"
+                    '((mu4e-sent-folder   . "/yahoo/Sent")
+                      (mu4e-drafts-folder . "/yahoo/Drafts")
+                      (mu4e-trash-folder  . "/yahoo/Trash")
+                      (mu4e-refile-folder . "/yahoo/Archive")
+                      (smtpmail-smtp-user . "a.gondor"))
+                    t)
+
 (setq +mu4e-compose-org-msg-toggle-next nil)
 
 ;;
@@ -170,11 +170,11 @@
     :user "azahi/oftc"
     :pass nixfiles/irc-bouncer-password-f))
 
-;; (set-irc-server! "hackint"
-;;   `(:host "shire.me"
-;;     :port 6667
-;;     :user "azahi/hackint"
-;;     :pass nixfiles/irc-bouncer-password-f))
+(set-irc-server! "hackint"
+  `(:host "shire.me"
+    :port 6667
+    :user "azahi/hackint"
+    :pass nixfiles/irc-bouncer-password-f))
 
 (set-irc-server! "rizon"
   `(:host "shire.me"
@@ -204,14 +204,14 @@
 ;;   :init
 ;;   (setq hledger-input-buffer-height 20))
 
-(use-package! kubernetes
-  :defer t
-  :commands (kubernetes-overview)
-  :init (setq kubernetes-poll-frequency 3600
-              kubernetes-redraw-frequency 3600))
+;; (use-package! kubernetes
+;;   :defer t
+;;   :commands (kubernetes-overview)
+;;   :init (setq kubernetes-poll-frequency 3600
+;;               kubernetes-redraw-frequency 3600))
 
-(use-package! kubernetes-evil
-  :after kubernetes-overview)
+;; (use-package! kubernetes-evil
+;;   :after kubernetes-overview)
 
-(use-package! kubernetes-tramp
-  :defer t)
+;; (use-package! kubernetes-tramp
+;;   :defer t)
diff --git a/modules/nixfiles/emacs/doom/init.el b/modules/nixfiles/emacs/doom/init.el
index 1bf1ca2..ef663a0 100644
--- a/modules/nixfiles/emacs/doom/init.el
+++ b/modules/nixfiles/emacs/doom/init.el
@@ -1,7 +1,7 @@
 ;;; init.el -*- lexical-binding: t; -*-
 
 (doom! :input
-       japanese
+       ;; japanese
 
        :completion
        company
@@ -58,10 +58,10 @@
        ;; grammar
 
        :tools
-       ansible
+       ;; ansible
        (debugger +lsp)
        direnv
-       (docker +lsp)
+       ;; (docker +lsp)
        editorconfig
        (eval +overlay)
        (lookup +dictionary +offline)
@@ -69,10 +69,10 @@
        (magit +forge)
        make
        (pass +auth)
-       pdf
+       ;; pdf
        terraform
        tree-sitter
-       upload
+       ;; upload
 
        :os
        (tty +osc)
@@ -91,7 +91,7 @@
        (javascript +lsp +tree-sitter)
        json
        (latex +lsp +tree-sittter)
-       ;; (lua +lsp +tree-sitter)
+       (lua +lsp +tree-sitter)
        (markdown +lsp +tree-sitter)
        (nix +lsp)
        (org +pandoc +roam2)
@@ -99,12 +99,12 @@
        (python +lsp +tree-sitter)
        ;; (racket +lsp +tree-sitter)
        ;; rst
-       ;; (rust +lsp +tree-sitter)
+       (rust +lsp +tree-sitter)
        ;; (scheme +lsp +tree-sitter +racket)
        (sh +lsp +tree-sitter)
        web
        yaml
-       ;; (zig +lsp +tree-sitter)
+       (zig +lsp +tree-sitter)
 
        :email
        mu4e
diff --git a/modules/nixfiles/emacs/doom/packages.el b/modules/nixfiles/emacs/doom/packages.el
index 369fb2e..d3e6354 100644
--- a/modules/nixfiles/emacs/doom/packages.el
+++ b/modules/nixfiles/emacs/doom/packages.el
@@ -14,6 +14,6 @@
 
 ;; (package! hledger-mode)
 
-(package! kubernetes)
-(package! kubernetes-evil)
-(package! kubernetes-tramp)
+;; (package! kubernetes)
+;; (package! kubernetes-evil)
+;; (package! kubernetes-tramp)
diff --git a/modules/nixfiles/firefox/default.nix b/modules/nixfiles/firefox/default.nix
index 6f4d327..8557d64 100644
--- a/modules/nixfiles/firefox/default.nix
+++ b/modules/nixfiles/firefox/default.nix
@@ -49,11 +49,11 @@ in {
               '')
               (with config.fontScheme; ''
                     --sans-serif-font-family: "${sansSerifFont.family}", "${sansSerifFontFallback.family}", sans-serif;
-                    --sans-serif-font-size: ${toString sansSerifFont.size};
+                    --sans-serif-font-size: ${toString sansSerifFont.size}px;
                     --serif-font-family: "${serifFont.family}", "${serifFontFallback.family}", serif;
-                    --serif-font-size: ${toString serifFont.size};
+                    --serif-font-size: ${toString serifFont.size}px;
                     --monospace-font-family: "${monospaceFont.family}", "${monospaceFontFallback.family}", monospace;
-                    --monospace-font-size: ${toString monospaceFont.size};
+                    --monospace-font-size: ${toString monospaceFont.size}px;
                 }
               '')
               (builtins.readFile css)
@@ -66,7 +66,7 @@ in {
           # A way to change the look of the Firefox itself.
           userChrome = mkCssWithRoot ./userChrome.css;
 
-          # A way to remove annoyances and visual bloat of many webpages.
+          # A way to remove annoyances and visual bloat from many webpages.
           userContent = mkCssWithRoot ./userContent.css;
 
           # https://github.com/arkenfox/user.js/blob/master/user.js
@@ -238,6 +238,7 @@ in {
 
           settings = {
             "app.update.auto" = false;
+            "browser.backspace_action" = 0;
             "browser.bookmarks.max_backups" = 1;
             "browser.disableResetPrompt" = true;
             "browser.newtabpage.introShown" = true;
@@ -258,14 +259,17 @@ in {
             "extensions.screenshots.disabled" = true;
             "extensions.update.autoUpdateDefault" = false;
             "extensions.update.enabled" = false;
+            "font.name-list.emoji" = "emoji";
             "full-screen-api.warning.delay" = 0;
             "full-screen-api.warning.timeout" = 0;
             "general.autoScroll" = true;
             "general.smoothScroll" = true;
+            "gfx.font_rendering.opentype_svg.enabled" = false;
             "identity.fxaccounts.enabled" = false;
             "media.autoplay.blocking_policy" = 2;
             "media.autoplay.default" = 5;
             "media.autoplay.enabled" = false;
+            "media.hardwaremediakeys.enabled" = false;
             "reader.parse-on-load.enabled" = false;
             "signon.rememberSignons" = false;
             "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
@@ -273,7 +277,6 @@ in {
         };
 
         extensions = with pkgs.nur.repos.rycee.firefox-addons;
-        with config.nixfiles.modules;
           [
             bitwarden
             consent-o-matic
@@ -284,7 +287,7 @@ in {
             ublock-origin
             violentmonkey
           ]
-          ++ optional ipfs.enable ipfs-companion;
+          ++ optional config.nixfiles.modules.ipfs.enable ipfs-companion;
       };
     };
 
diff --git a/modules/nixfiles/firefox/userContent.css b/modules/nixfiles/firefox/userContent.css
index 9b2dd4e..04c4c5a 100644
--- a/modules/nixfiles/firefox/userContent.css
+++ b/modules/nixfiles/firefox/userContent.css
@@ -26,6 +26,11 @@
 
 @-moz-document regexp("https?://(.*.)?gitlab(\..*)?\.(com|org).*")
 {
+    body {
+        font-family: var(--sans-serif-font-family) !important;
+        font-size: var(--sans-serif-font-size) !important;
+    }
+
     code {
         font-family: var(--monospace-font-family) !important;
         font-size: var(--monospace-font-size) !important;
@@ -36,7 +41,7 @@
 {
     #org-repo-pin-select-menu,
     #sponsor-button,
-    .btn.ml-2.d-none.d-md-block, /* "Go to file" button. */
+    .btn.ml-2,
     .dropdown-divider,
     .footer,
     .octicon.octicon-info,
@@ -55,8 +60,7 @@
     a[href^="/organizations/enterprise"],
     a[href^="/sponsors"],
     a[href^="/topics"],
-    a[href^="/trending"],
-    get-repo /* Find files button. */ {
+    a[href^="/trending"] {
         display: none !important;
     }
 
@@ -175,6 +179,7 @@
         transition: none !important;
     }
 
+    html,
     body {
         font-family: var(--sans-serif-font-family) !important;
         font-size: var(--sans-serif-font-size) !important;
@@ -199,6 +204,12 @@
         margin: 0 !important;
     }
 
+    html,
+    body {
+        font-family: var(--sans-serif-font-family) !important;
+        font-size: var(--sans-serif-font-size) !important;
+    }
+
     code {
         font-family: var(--monospace-font-family) !important;
         font-size: var(--monospace-font-size) !important;
@@ -269,6 +280,21 @@
     .sidebar {
         --offset: default !important;
     }
+
+    html,
+    body {
+        font-family: var(--sans-serif-font-family) !important;
+        font-size: var(--sans-serif-font-size) !important;
+    }
+}
+
+@-moz-document regexp("https?://music\.yandex\.ru.*")
+{
+    .bar-below.bar-below_plus,
+    .footer,
+    .teaser {
+        display: none !important;
+    }
 }
 
 @-moz-document regexp("https?://(.*\.)?wikipedia\.org/wiki/.*")
@@ -278,6 +304,12 @@
     #siteNotice {
         display: none !important;
     }
+
+    html,
+    body {
+        font-family: var(--sans-serif-font-family) !important;
+        font-size: var(--sans-serif-font-size) !important;
+    }
 }
 
 @-moz-document regexp("https?://wikiless\.org/wiki/.*")
@@ -291,4 +323,10 @@
     .mw-body {
         margin-left: auto !important;
     }
+
+    html,
+    body {
+        font-family: var(--sans-serif-font-family) !important;
+        font-size: var(--sans-serif-font-size) !important;
+    }
 }
diff --git a/modules/nixfiles/fonts.nix b/modules/nixfiles/fonts.nix
index 042c0e8..dbae282 100644
--- a/modules/nixfiles/fonts.nix
+++ b/modules/nixfiles/fonts.nix
@@ -45,37 +45,37 @@ in {
       serifFont = mkFont {
         family = "Iosevka Etoile";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
 
       serifFontFallback = mkFont {
         family = "Sarasa Gothic J";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
 
       sansSerifFont = mkFont {
         family = "Iosevka Aile";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
 
       sansSerifFontFallback = mkFont {
         family = "Sarasa Gothic J";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
 
       monospaceFont = mkFont {
         family = "Iosevka";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
 
       monospaceFontFallback = mkFont {
         family = "Sarasa Mono J";
         style = "Regular";
-        size = 16;
+        size = 14;
       };
     };
   };
diff --git a/modules/nixfiles/games/default.nix b/modules/nixfiles/games/default.nix
index 13345fc..1c5766b 100644
--- a/modules/nixfiles/games/default.nix
+++ b/modules/nixfiles/games/default.nix
@@ -24,15 +24,6 @@ in {
       jack.alsa.support32Bit = config.services.jack.alsa.enable;
 
       pipewire.alsa.support32Bit = config.services.pipewire.alsa.enable;
-
-      xserver.inputClassSections = [
-        ''
-          Identifier "ds-touchpad"
-          Driver "libinput"
-          MatchProduct "Wireless Controller Touchpad"
-          Option "Ignore" "true"
-        ''
-      ];
     };
 
     hardware = {
diff --git a/modules/nixfiles/kde.nix b/modules/nixfiles/kde.nix
index 6b20569..a430294 100644
--- a/modules/nixfiles/kde.nix
+++ b/modules/nixfiles/kde.nix
@@ -16,6 +16,15 @@ in {
       x11.enable = true;
     };
 
+    hm = {
+      home.sessionVariables.GTK_USE_PORTAL = 1;
+
+      programs.firefox.profiles.default.settings = {
+        "widget.use-xdg-desktop-portal.file-picker" = 1;
+        "widget.use-xdg-desktop-portal.mime-handler" = 1;
+      };
+    };
+
     services.xserver = {
       desktopManager.plasma5 = {
         enable = true;
diff --git a/modules/nixfiles/libvirtd.nix b/modules/nixfiles/libvirtd.nix
index 5ce37f0..ae8b336 100644
--- a/modules/nixfiles/libvirtd.nix
+++ b/modules/nixfiles/libvirtd.nix
@@ -7,8 +7,7 @@
 with lib; let
   cfg = config.nixfiles.modules.libvirtd;
 in {
-  options.nixfiles.modules.libvirtd.enable =
-    mkEnableOption "Wether to enable libvirtd.";
+  options.nixfiles.modules.libvirtd.enable = mkEnableOption "libvirtd";
 
   config = mkIf cfg.enable {
     virtualisation.libvirtd = {
@@ -17,6 +16,11 @@ in {
       onBoot = "ignore";
       onShutdown = "shutdown";
 
+      extraConfig = ''
+        log_level = 4
+        log_outputs = "4:stderr"
+      '';
+
       qemu = {
         package = pkgs.qemu_kvm;
         runAsRoot = false;
@@ -27,7 +31,7 @@ in {
         };
 
         swtpm = {
-          enable = false;
+          enable = false; # Is this required for Windows 11?
           package = pkgs.swtpm-tpm2;
         };
       };
diff --git a/modules/nixfiles/openconnect.nix b/modules/nixfiles/openconnect.nix
new file mode 100644
index 0000000..780f93f
--- /dev/null
+++ b/modules/nixfiles/openconnect.nix
@@ -0,0 +1,83 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.openconnect;
+in {
+  options.nixfiles.modules.openconnect.enable =
+    mkEnableOption "OpenConnect VPN";
+
+  config = mkIf.enable {
+    assertions = [
+      {
+        assertion = config.networking.networkmanager.enable;
+        message = "NetworkManager is required";
+      }
+    ];
+
+    # Spent three days trying to make this work but still getting "No SSO
+    # handler" even on the HEAD version that 100% has SSO support baked in.
+    # It's all so tiresome[1]... aaand KDE is not supported[2].
+    #
+    # I fucking hate AnyConnect, truly an example of how shit is is non-free
+    # software. SAML also sucks balls. I also hate my company for using this
+    # shit, guess I have no other choice but to use the absolute dogshit laptop
+    # they gave me.
+    #
+    # [1]: https://gitlab.gnome.org/GNOME/NetworkManager-openconnect
+    # [1]: https://gitlab.com/openconnect/openconnect/-/issues/424
+    # [2]: https://groups.google.com/g/linux.debian.bugs.dist/c/lK8u-LMY7n4
+    # [2]: https://bugs.kde.org/show_bug.cgi?id=448153
+
+    networking.networkmanager.plugins = with pkgs; [
+      ((networkmanager-openconnect.override {
+          withGnome = false;
+          openconnect = openconnect.overrideAttrs (_: super: {
+            version = "unstable-2022-10-23";
+            src = fetchFromGitLab {
+              owner = "openconnect";
+              repo = "openconnect";
+              rev = "acdfc753f7885b2a539f99036ac41ba1b78cc7ae";
+              hash = "sha256-ub+Z4WFD77h5YMQTb+TLc7EyY2KjBWglF1QVTirCHJM=";
+            };
+          });
+        })
+        .overrideAttrs (_: super: {
+          version = "unstable-2022-09-10";
+          src = fetchFromGitLab {
+            domain = "gitlab.gnome.org";
+            owner = "GNOME";
+            repo = "NetworkManager-openconnect";
+            rev = "3c1590786518e9acca33c250660ad21cae565acd";
+            hash = "sha256-YTUN46QHsHkXPAhImPG/MMLMqjlSRknapVO8u43nnWk=";
+          };
+          buildInputs =
+            super.buildInputs
+            ++ [
+              (webkitgtk_4_1.override {
+                inherit (gnome) libsoup;
+              })
+            ];
+          nativeBuildInputs =
+            super.nativeBuildInputs
+            ++ [
+              autoreconfHook
+            ];
+          postPatch = ''
+            substituteInPlace configure.ac \
+              --replace "PKG_CHECK_MODULES(LIBSECRET, libsecret-1 >= 0.18)" ""
+          '';
+          preAutoreconf = ''
+            autoupdate
+          '';
+          preConfigure = ''
+            NOCONFIGURE=x ./autogen.sh
+            touch gtk4/nm-openconnect-dialog.ui
+          '';
+        }))
+    ];
+  };
+}
diff --git a/modules/nixfiles/profiles/dev/containers.nix b/modules/nixfiles/profiles/dev/containers.nix
index ef41229..da7aa27 100644
--- a/modules/nixfiles/profiles/dev/containers.nix
+++ b/modules/nixfiles/profiles/dev/containers.nix
@@ -34,6 +34,7 @@ in {
           buildah
           chart-testing
           cmctl
+          datree
           helm
           kubectl
           kubectx

Consider giving Nix/NixOS a try! <3