From 33b8cd83487d3f21b9258f3bb2fc264afd2b87df Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Tue, 19 Dec 2023 19:38:19 -0600 Subject: [PATCH] style: Add statix https://knowyourmeme.com/memes/i-have-no-idea-what-im-doing --- flake.nix | 3 ++- hosts/framework/hardware-configuration.nix | 2 +- lib/nixos.nix | 2 +- modules/editors/emacs.nix | 4 ++-- modules/options.nix | 4 ++-- modules/security.nix | 2 +- modules/shell/zsh.nix | 2 +- modules/themes/default.nix | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index f9684c5c..315d29cc 100644 --- a/flake.nix +++ b/flake.nix @@ -106,12 +106,13 @@ systems = [ "x86_64-linux" ]; - perSystem = {...}: { + perSystem = _: { treefmt = { projectRootFile = ".git/config"; programs.alejandra.enable = true; programs.deadnix.enable = true; programs.prettier.enable = true; + programs.statix.enable = true; }; }; }; diff --git a/hosts/framework/hardware-configuration.nix b/hosts/framework/hardware-configuration.nix index 32209a28..93f05bb8 100644 --- a/hosts/framework/hardware-configuration.nix +++ b/hosts/framework/hardware-configuration.nix @@ -41,7 +41,7 @@ # https://github.com/NixOS/nixpkgs/issues/171136#issuecomment-1627779037 security.pam.services.login.fprintAuth = false; # similarly to how other distributions handle the fingerprinting login - security.pam.services.gdm-fingerprint = lib.mkIf (config.services.fprintd.enable) { + security.pam.services.gdm-fingerprint = lib.mkIf config.services.fprintd.enable { text = '' auth required pam_shells.so auth requisite pam_nologin.so diff --git a/lib/nixos.nix b/lib/nixos.nix index beab3cc7..307a64af 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -24,6 +24,6 @@ in { ]; }; - mapHosts = dir: attrs @ {...}: + mapHosts = dir: attrs: mapModules dir (hostPath: mkHost hostPath attrs); } diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 69427b3c..4ebca153 100644 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -9,7 +9,7 @@ with lib; with lib.my; let cfg = config.modules.editors.emacs; - configDir = config.dotfiles.configDir; + inherit (config.dotfiles) configDir; in { options.modules.editors.emacs = { enable = mkBoolOpt false; @@ -44,7 +44,7 @@ in { fd # faster projectile indexing ffmpeg # whisper.el imagemagick # for image-dired - (mkIf (config.programs.gnupg.agent.enable) + (mkIf config.programs.gnupg.agent.enable pinentry-emacs) # in-emacs gnupg prompts zstd # for undo-fu-session/undo-tree compression diff --git a/modules/options.nix b/modules/options.nix index 5102f788..31b60741 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -31,7 +31,7 @@ with lib.my; { type = attrsOf (oneOf [str path (listOf (either str path))]); apply = mapAttrs (_n: v: if isList v - then concatMapStringsSep ":" (x: toString x) v + then concatMapStringsSep ":" toString v else (toString v)); default = {}; description = "TODO"; @@ -76,7 +76,7 @@ with lib.my; { file = mkAliasDefinitions options.home.file; # Necessary for home-manager to work with flakes, otherwise it will # look for a nixpkgs channel. - stateVersion = config.system.stateVersion; + inherit (config.system) stateVersion; }; xdg = { configFile = mkAliasDefinitions options.home.configFile; diff --git a/modules/security.nix b/modules/security.nix index 3f7a8e5f..a9e85270 100644 --- a/modules/security.nix +++ b/modules/security.nix @@ -1,4 +1,4 @@ -{...}: { +_: { ## System security tweaks boot.tmp.useTmpfs = true; security.protectKernelImage = true; diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index 28c440fa..c0ce8029 100644 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -8,7 +8,7 @@ with lib; with lib.my; let cfg = config.modules.shell.zsh; - configDir = config.dotfiles.configDir; + inherit (config.dotfiles) configDir; in { options.modules.shell.zsh = with types; { enable = mkBoolOpt false; diff --git a/modules/themes/default.nix b/modules/themes/default.nix index 996cde0e..a157ea94 100644 --- a/modules/themes/default.nix +++ b/modules/themes/default.nix @@ -175,7 +175,7 @@ in { ''gtk-theme-name="${cfg.gtk.theme}"''} ${optionalString (cfg.gtk.iconTheme != "") ''gtk-icon-theme-name="${cfg.gtk.iconTheme}"''} - gtk-font-name="Sans ${toString (cfg.fonts.sans.size)}" + gtk-font-name="Sans ${toString cfg.fonts.sans.size}" ''; # QT4/5 global theme "Trolltech.conf".text = ''