about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-09-16 14:47:29 +0300
committerAzat Bahawi <azat@bahawi.net>2023-09-16 14:47:29 +0300
commit190bf349658ceb6f64c6d69cdccbddfb5491f894 (patch)
tree33a563624d4725cc042f7dc2f805078e8f34818e /modules
parent2023-09-16 (diff)
2023-09-16
Diffstat (limited to '')
-rw-r--r--modules/common/bat.nix9
-rw-r--r--modules/common/common/nix/default.nix52
-rw-r--r--modules/common/common/secrets.nix3
-rw-r--r--modules/common/common/shell/default.nix30
-rw-r--r--modules/common/emacs/default.nix16
-rw-r--r--modules/common/emacs/doom/config.el6
-rw-r--r--modules/common/emacs/doom/init.el7
-rw-r--r--modules/common/git.nix4
-rw-r--r--modules/common/mpv.nix2
-rw-r--r--modules/common/nmap.nix8
-rw-r--r--modules/common/profiles/dev/containers.nix16
-rw-r--r--modules/common/vscode.nix12
-rw-r--r--modules/common/wget.nix2
-rw-r--r--modules/nixos/beets.nix2
-rw-r--r--modules/nixos/common/nix.nix10
-rw-r--r--modules/nixos/docker.nix2
-rw-r--r--modules/nixos/firefox/default.nix1
-rw-r--r--modules/nixos/games/minecraft.nix4
-rw-r--r--modules/nixos/podman.nix5
-rw-r--r--modules/nixos/profiles/headful.nix4
-rw-r--r--modules/nixos/xmonad.nix2
21 files changed, 92 insertions, 105 deletions
diff --git a/modules/common/bat.nix b/modules/common/bat.nix
index 2b31d16..e2d5da1 100644
--- a/modules/common/bat.nix
+++ b/modules/common/bat.nix
@@ -1,7 +1,6 @@
 {
   config,
   lib,
-  pkgs,
   ...
 }:
 with lib; let
@@ -23,11 +22,9 @@ in {
       };
 
       bash = {
-        shellAliases = let
-          bat = "${pkgs.bat}/bin/bat";
-        in {
-          bay = "${bat} --language=yaml --tabs 2";
-          baj = "${bat} --language=json --tabs 2";
+        shellAliases = {
+          bay = "bat --language=yaml --tabs 2";
+          baj = "bat --language=json --tabs 2";
         };
 
         initExtra = mkAfter ''
diff --git a/modules/common/common/nix/default.nix b/modules/common/common/nix/default.nix
index f0add5e..d6cd362 100644
--- a/modules/common/common/nix/default.nix
+++ b/modules/common/common/nix/default.nix
@@ -82,13 +82,34 @@ with lib; {
 
   nixpkgs.overlays = with inputs; [
     self.overlays.default
-    (_: super:
-      {
-        helm = with super;
-          kubernetes-helm-wrapped.override {
-            plugins = with kubernetes-helmPlugins; [helm-secrets];
+    nur.overlay
+    (
+      _: super: {
+        grc = super.grc.overrideAttrs (_: final: {
+          version = "devel";
+
+          src = super.fetchFromGitHub {
+            owner = "garabik";
+            repo = "grc";
+            rev = "4d6a51fd78ad7e19af8dd12b2a828d1807267079";
+            hash = "sha256-SmOZrgV0lgLryFoxADU15IKJ7jhxXar0MgbsV/z1GaE=";
           };
 
+          patches = [
+            (super.fetchpatch {
+              url = "https://patch-diff.githubusercontent.com/raw/garabik/grc/pull/214.patch";
+              hash = "sha256-VNr9jl5oFbFNJbGsjflwFV3oTbCzJ0lBIZA4eyeoXLY=";
+            })
+          ];
+
+          postPatch =
+            final.postPatch
+            + ''
+              substituteInPlace grc.conf \
+                --replace "^([/\w\.]+\/)" "^([/\w\.\-]+\/)"
+            '';
+        });
+
         alejandra = super.alejandra.overrideAttrs (_: final: {
           patches = final.patches ++ [./patches/alejandra-no-ads.patch];
         });
@@ -99,26 +120,7 @@ with lib; {
 
         inherit (pkgsPr 245433 "sha256-FF1WW0+/pJ15+mPVjv0bkrh0dpHfQU08HNat2gu1PQk=") openmw;
       }
-      // (with super; {
-        # Normalises package names. This is done purely for aesthetics.
-        css-language-server = nodePackages.vscode-css-languageserver-bin;
-        dhall-language-server = dhall-lsp-server;
-        dockerfile-language-server = nodePackages.dockerfile-language-server-nodejs;
-        editorconfig = editorconfig-core-c;
-        go-language-server = gopls;
-        html-language-server = nodePackages.vscode-html-languageserver-bin;
-        inherit (nodePackages) bash-language-server;
-        inherit (nodePackages) vim-language-server;
-        json-language-server = nodePackages.vscode-json-languageserver-bin;
-        k3d = kube3d;
-        kubelogin = kubelogin-oidc;
-        nix-language-server = rnix-lsp;
-        telepresence = telepresence2;
-        tor-browser = tor-browser-bundle-bin;
-      }))
-    agenix.overlays.default
-    nix-vscode-extensions.overlays.default
-    nur.overlay
+    )
   ];
 
   environment.systemPackages = with pkgs;
diff --git a/modules/common/common/secrets.nix b/modules/common/common/secrets.nix
index e15dea8..fdc2501 100644
--- a/modules/common/common/secrets.nix
+++ b/modules/common/common/secrets.nix
@@ -1,5 +1,6 @@
 {
   config,
+  inputs,
   lib,
   pkgs,
   this,
@@ -17,5 +18,7 @@ with lib; {
           config.services.openssh.hostKeys);
 
     environment.systemPackages = with pkgs; [agenix];
+
+    nixpkgs.overlays = [inputs.agenix.overlays.default];
   };
 }
diff --git a/modules/common/common/shell/default.nix b/modules/common/common/shell/default.nix
index 2b034e6..be86bd8 100644
--- a/modules/common/common/shell/default.nix
+++ b/modules/common/common/shell/default.nix
@@ -104,16 +104,6 @@ with lib; {
                   name = "upper";
                   command = ["tr" "'[:lower:]'" "'[:upper:]'"];
                 })
-                (mkAlias {
-                  name = "disk";
-                  command = [
-                    "df"
-                    "--human-readable"
-                    "--exclude-type=tmpfs"
-                    "--exclude-type=devtmpfs"
-                    "2>/dev/null"
-                  ];
-                })
               ]
             ))
           // genAttrs ["grep" "egrep" "fgrep"]
@@ -130,12 +120,16 @@ with lib; {
     home.packages = with pkgs; [grc];
   };
 
-  environment.systemPackages = with pkgs; [
-    bash-completion
-    bc
-    gawk
-    hr
-    moreutils
-    pv
-  ];
+  environment = {
+    etc."grc.conf".source = "${pkgs.grc}/etc/grc.conf";
+
+    systemPackages = with pkgs; [
+      bash-completion
+      bc
+      gawk
+      hr
+      moreutils
+      pv
+    ];
+  };
 }
diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix
index 9589e65..ed25536 100644
--- a/modules/common/emacs/default.nix
+++ b/modules/common/emacs/default.nix
@@ -71,31 +71,29 @@ in {
                         python-lsp-server # :lang (python +lsp)
                       ]))
                     asmfmt # :editor format
-                    bash-language-server # :lang (sh +lsp)
                     clang-tools # :lang (cc +lsp) :editor format
                     cmake # :term vterm
                     cmake-format # :lang cc :editor format
                     cmigemo # :lang japanese
-                    css-language-server # :lang (web +lsp)
-                    dockerfile-language-server # :tools (docker +lsp)
-                    editorconfig # :tools editorconfig
+                    dockerfile-language-server-nodejs # :tools (docker +lsp)
+                    dockfmt # :tools docker
+                    editorconfig-core-c # :tools editorconfig
                     fd # doom!
                     gcc # :tools magit :term vterm
                     gnumake # :term vterm
                     gnuplot # :lang (org +gnuplot)
                     gnutls # doom!
-                    go-language-server # :lang (go +lsp)
                     gomodifytags # :lang go
+                    gopls # :lang (go +lsp)
                     gore # :lang go
-                    gotests # :lang go
                     gotools # :lang go
                     graphviz # :lang (org +roam2) :lang plantuml
-                    html-language-server # :lang (web +lsp)
                     html-tidy # :lang web
                     jre # :lang plantuml
-                    json-language-server # :lang (json +lsp)
                     libtool # :term vterm
-                    nix-language-server # :lang (nix +lsp)
+                    libxml2 # :lang data
+                    nixd # :lang (nix +lsp)
+                    nodePackages.bash-language-server # :lang (sh +lsp)
                     nodePackages.eslint # :lang (json +lsp)
                     nodePackages.js-beautify # :lang web
                     nodePackages.prettier # :editor format
diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el
index b6b39e5..e7e0bd4 100644
--- a/modules/common/emacs/doom/config.el
+++ b/modules/common/emacs/doom/config.el
@@ -85,9 +85,9 @@
 (after! lsp-mode
   (add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
   (lsp-register-client
-   (make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
-                    :major-modes '(nix-mode)
-                    :server-id 'nix)))
+    (make-lsp-client :new-connection (lsp-stdio-connection '("nixd"))
+                     :major-modes '(nix-mode)
+                     :server-id 'nix)))
 
 ;;
 ;;; YAML
diff --git a/modules/common/emacs/doom/init.el b/modules/common/emacs/doom/init.el
index fbd7c4d..21b10c7 100644
--- a/modules/common/emacs/doom/init.el
+++ b/modules/common/emacs/doom/init.el
@@ -65,24 +65,20 @@
        (magit +forge)
        make
        (pass +auth)
-       ;; pdf
+       pdf
        terraform
        tree-sitter
        upload
 
        :os
        (:if IS-MAC macos)
-       ;; (tty +osc)
 
        :lang
        (cc +lsp +tree-sitter)
        (common-lisp +lsp +tree-sitter)
-       ;; (csharp +lsp +tree-sitter)
        data
-       ;; (dhall +lsp +tree-sitter)
        (emacs-lisp +lsp +tree-sitter)
        (go +lsp +tree-sitter)
-       ;; graphql
        (:if IS-LINUX (haskell +lsp +tree-sitter))
        (java +lsp +tree-sitter)
        (javascript +lsp +tree-sitter)
@@ -95,7 +91,6 @@
        plantuml
        (python +lsp +tree-sitter)
        (:if IS-LINUX (racket +lsp +tree-sitter))
-       ;; rst
        (rust +lsp +tree-sitter)
        (:if IS-LINUX (scheme +lsp +tree-sitter +racket))
        (sh +lsp +tree-sitter)
diff --git a/modules/common/git.nix b/modules/common/git.nix
index cfd1bf4..70fb7c7 100644
--- a/modules/common/git.nix
+++ b/modules/common/git.nix
@@ -129,8 +129,8 @@ in {
 
         bash = {
           shellAliases = {
-            gl = "${pkgs.glab}/bin/glab";
-            ht = "${pkgs.hut}/bin/hut";
+            gl = "glab";
+            ht = "hut";
           };
           initExtra = mkAfter ''
             _complete_alias gl __start_glab glab
diff --git a/modules/common/mpv.nix b/modules/common/mpv.nix
index 28b3cf5..a44e9ca 100644
--- a/modules/common/mpv.nix
+++ b/modules/common/mpv.nix
@@ -143,7 +143,7 @@ in {
       };
 
       bash = {
-        shellAliases.cam = "${config.hm.programs.mpv.package}/bin/mpv av://v4l2:/dev/video0";
+        shellAliases.cam = "mpv av://v4l2:/dev/video0";
 
         initExtra = mkAfter ''
           _complete_alias cam _mpv mpv
diff --git a/modules/common/nmap.nix b/modules/common/nmap.nix
index 73f948c..03586c0 100644
--- a/modules/common/nmap.nix
+++ b/modules/common/nmap.nix
@@ -26,11 +26,9 @@ in {
       };
 
       programs.bash = {
-        shellAliases = let
-          base = "${pkgs.nmap}/bin/nmap -sV";
-        in {
-          nmap-vulners = "${base} --script=vulners/vulners.nse";
-          nmap-vulscan = "${base} --script=vulscan/vulscan.nse";
+        shellAliases = {
+          nmap-vulners = "nmap -sV --script=vulners/vulners.nse";
+          nmap-vulscan = "nmap -sV --script=vulscan/vulscan.nse";
         };
         initExtra = mkAfter ''
           _complete_alias nmap-vulners _nmap nmap
diff --git a/modules/common/profiles/dev/containers.nix b/modules/common/profiles/dev/containers.nix
index da6b0e1..06826f9 100644
--- a/modules/common/profiles/dev/containers.nix
+++ b/modules/common/profiles/dev/containers.nix
@@ -33,7 +33,6 @@ in {
           clusterctl
           cmctl
           datree
-          helm
           istioctl
           k9s
           kubeconform
@@ -42,8 +41,9 @@ in {
           kubectl-images
           kubectl-tree
           kubectx
-          kubelogin
+          kubelogin-oidc
           kubent
+          kubernetes-helm
           kubescape
           kubeseal
           kubespy
@@ -51,18 +51,18 @@ in {
           skaffold
           skopeo
           stern
-          telepresence
+          telepresence2
           werf
         ];
       };
 
       programs.bash = {
         shellAliases = with pkgs; {
-          b = "${buildah}/bin/buildah";
-          h = "${helm}/bin/helm";
-          k = "${kubectl}/bin/kubectl";
-          kns = "${kubectx}/bin/kubens";
-          ktx = "${kubectx}/bin/kubectx";
+          b = "buildah";
+          h = "helm";
+          k = "kubectl";
+          kns = "kubens";
+          ktx = "kubectx";
         };
         initExtra = mkAfter ''
           _complete_alias b _buildah buildah
diff --git a/modules/common/vscode.nix b/modules/common/vscode.nix
index 0498fea..d90d301 100644
--- a/modules/common/vscode.nix
+++ b/modules/common/vscode.nix
@@ -1,5 +1,6 @@
 {
   config,
+  inputs,
   lib,
   pkgs,
   ...
@@ -124,12 +125,9 @@ in {
           ignoreRecommendations = true;
         };
 
-        terminal = {
-          external.linuxExec = "${pkgs.alacritty}/bin/alacritty";
-          integrated = {
-            inherit fontFamily fontSize;
-            enableBell = true;
-          };
+        terminal.integrated = {
+          inherit fontFamily fontSize;
+          enableBell = true;
         };
 
         update = {
@@ -233,5 +231,7 @@ in {
         redhat.telemetry.enabled = false;
       };
     };
+
+    nixpkgs.overlays = [inputs.nix-vscode-extensions.overlays.default];
   };
 }
diff --git a/modules/common/wget.nix b/modules/common/wget.nix
index 9a16fcc..1cd8eae 100644
--- a/modules/common/wget.nix
+++ b/modules/common/wget.nix
@@ -11,7 +11,7 @@ in {
 
   config = mkIf cfg.enable {
     hm = {
-      programs.bash.shellAliases.wget = "${pkgs.wget}/bin/wget --hsts-file=/tmp/wget-hsts";
+      programs.bash.shellAliases.wget = "wget --hsts-file=/tmp/wget-hsts";
 
       home.sessionVariables.WGETRC = pkgs.writeText "wgetrc" ''
         adjust_extension = on
diff --git a/modules/nixos/beets.nix b/modules/nixos/beets.nix
index 7a380cc..ccceaeb 100644
--- a/modules/nixos/beets.nix
+++ b/modules/nixos/beets.nix
@@ -92,7 +92,7 @@ in {
           };
         };
 
-        bash.shellAliases.beet = "${config.hm.programs.beets.package}/bin/beet --config ${config.dirs.config}/beets/config.yaml";
+        bash.shellAliases.beet = "beet --config ${config.dirs.config}/beets/config.yaml";
       };
     };
   };
diff --git a/modules/nixos/common/nix.nix b/modules/nixos/common/nix.nix
index 9978513..c0061db 100644
--- a/modules/nixos/common/nix.nix
+++ b/modules/nixos/common/nix.nix
@@ -14,15 +14,7 @@ in {
   };
 
   config = {
-    nixpkgs = {
-      config.allowUnfreePredicate = p: elem (getName p) cfg.allowedUnfreePackages;
-
-      overlays = with inputs; [
-        nix-minecraft.overlay
-        pollymc.overlays.default
-        xmonad-ng.overlays.default
-      ];
-    };
+    nixpkgs.config.allowUnfreePredicate = p: elem (getName p) cfg.allowedUnfreePackages;
 
     system.stateVersion = with builtins;
       head (split "\n" (readFile "${inputs.nixpkgs}/.version"));
diff --git a/modules/nixos/docker.nix b/modules/nixos/docker.nix
index e642030..31c0dda 100644
--- a/modules/nixos/docker.nix
+++ b/modules/nixos/docker.nix
@@ -32,7 +32,7 @@ in {
     my.extraGroups = ["docker"];
 
     hm.programs.bash = {
-      shellAliases.d = "${pkgs.docker}/bin/docker";
+      shellAliases.d = "docker";
       initExtra = mkAfter ''
         _complete_alias d _docker docker
       '';
diff --git a/modules/nixos/firefox/default.nix b/modules/nixos/firefox/default.nix
index 8e2380b..e5b54fe 100644
--- a/modules/nixos/firefox/default.nix
+++ b/modules/nixos/firefox/default.nix
@@ -539,7 +539,6 @@ 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;
diff --git a/modules/nixos/games/minecraft.nix b/modules/nixos/games/minecraft.nix
index b8a2949..f738c33 100644
--- a/modules/nixos/games/minecraft.nix
+++ b/modules/nixos/games/minecraft.nix
@@ -32,6 +32,8 @@ in {
   config = mkMerge [
     (mkIf cfg.client.enable {
       hm.home.packages = with pkgs; [pollymc-unwrapped];
+
+      nixpkgs.overlays = [inputs.pollymc.overlays.default];
     })
     (mkIf cfg.server.enable {
       nixfiles.modules.common.nix.allowedUnfreePackages = ["minecraft-server"];
@@ -80,6 +82,8 @@ in {
         };
       };
 
+      nixpkgs.overlays = [inputs.nix-minecraft.overlay];
+
       my.extraGroups = [config.services.minecraft-servers.group];
     })
   ];
diff --git a/modules/nixos/podman.nix b/modules/nixos/podman.nix
index cda8a4b..ceb748b 100644
--- a/modules/nixos/podman.nix
+++ b/modules/nixos/podman.nix
@@ -55,7 +55,10 @@ in {
       };
 
       programs.bash = {
-        shellAliases.p = "${pkgs.podman}/bin/podman";
+        shellAliases = {
+          podman = "grc -es ${pkgs.podman}/bin/podman";
+          p = "podman";
+        };
         initExtra = mkAfter ''
           _complete_alias p __start_podman podman
         '';
diff --git a/modules/nixos/profiles/headful.nix b/modules/nixos/profiles/headful.nix
index e1480b0..f8df169 100644
--- a/modules/nixos/profiles/headful.nix
+++ b/modules/nixos/profiles/headful.nix
@@ -27,11 +27,11 @@ in {
         imv
         mumble
         tdesktop
-        tor-browser
+        tor-browser-bundle-bin
       ];
 
       programs = {
-        bash.shellAliases.open = "${pkgs.xdg-utils}/bin/xdg-open";
+        bash.shellAliases.open = "xdg-open";
 
         thunderbird = {
           enable = true;
diff --git a/modules/nixos/xmonad.nix b/modules/nixos/xmonad.nix
index da005b2..c5fedc2 100644
--- a/modules/nixos/xmonad.nix
+++ b/modules/nixos/xmonad.nix
@@ -23,5 +23,7 @@ in {
     };
 
     services.xserver.displayManager.startx.enable = true;
+
+    nixpkgs.overlays = [inputs.xmonad-ng.overlays.default];
   };
 }

Consider giving Nix/NixOS a try! <3