From 190bf349658ceb6f64c6d69cdccbddfb5491f894 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sat, 16 Sep 2023 14:47:29 +0300 Subject: 2023-09-16 --- modules/common/bat.nix | 9 ++---- modules/common/common/nix/default.nix | 52 ++++++++++++++++-------------- modules/common/common/secrets.nix | 3 ++ modules/common/common/shell/default.nix | 30 +++++++---------- modules/common/emacs/default.nix | 16 ++++----- modules/common/emacs/doom/config.el | 6 ++-- modules/common/emacs/doom/init.el | 7 +--- modules/common/git.nix | 4 +-- modules/common/mpv.nix | 2 +- modules/common/nmap.nix | 8 ++--- modules/common/profiles/dev/containers.nix | 16 ++++----- modules/common/vscode.nix | 12 +++---- modules/common/wget.nix | 2 +- 13 files changed, 77 insertions(+), 90 deletions(-) (limited to 'modules/common') 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 -- cgit 1.4.1