diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0ac4da5b4..b5ea00b4b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -22,7 +22,7 @@ Also make sure to read the guidelines found at - [ ] Change is backwards compatible. - [ ] Code formatted with `nix fmt` or - `nix-shell -p treefmt nixfmt-rfc-style keep-sorted --run treefmt`. + `nix-shell -p treefmt nixfmt-rfc-style deadnix keep-sorted --run treefmt`. - [ ] Code tested through `nix-shell --pure tests -A run.all` or `nix build --reference-lock-file flake.lock ./tests#test-all` using Flakes. diff --git a/Makefile b/Makefile index c6ab25611..ac9b791e4 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,4 @@ test-install: HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install format: - nix-shell -p treefmt nixfmt-rfc-style keep-sorted --run "treefmt --config-file ./treefmt.toml" + nix-shell -p treefmt nixfmt-rfc-style deadnix keep-sorted --run "treefmt --config-file ./treefmt.toml" diff --git a/flake.nix b/flake.nix index b914b55eb..27ce59636 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,7 @@ pkgs.treefmt.withConfig { runtimeInputs = with pkgs; [ nixfmt-rfc-style + deadnix keep-sorted ]; settings = pkgs.lib.importTOML ./treefmt.toml; diff --git a/modules/programs/obsidian.nix b/modules/programs/obsidian.nix index e77e31c29..8a9ae53d3 100644 --- a/modules/programs/obsidian.nix +++ b/modules/programs/obsidian.nix @@ -187,28 +187,26 @@ in corePlugins = let - corePluginsOptions = - { config, ... }: - { - options = { - enable = mkOption { - type = types.bool; - default = true; - description = "Whether to enable the plugin."; - }; + corePluginsOptions = { + options = { + enable = mkOption { + type = types.bool; + default = true; + description = "Whether to enable the plugin."; + }; - name = mkOption { - type = types.enum corePlugins; - description = "The plugin."; - }; + name = mkOption { + type = types.enum corePlugins; + description = "The plugin."; + }; - settings = mkOption { - type = with types; attrsOf anything; - description = "Plugin settings to include."; - default = { }; - }; + settings = mkOption { + type = with types; attrsOf anything; + description = "Plugin settings to include."; + default = { }; }; }; + }; in mkOption { description = "Core plugins to activate."; @@ -220,28 +218,26 @@ in communityPlugins = let - communityPluginsOptions = - { config, ... }: - { - options = { - enable = mkOption { - type = types.bool; - default = true; - description = "Whether to enable the plugin."; - }; + communityPluginsOptions = { + options = { + enable = mkOption { + type = types.bool; + default = true; + description = "Whether to enable the plugin."; + }; - pkg = mkOption { - type = types.package; - description = "The plugin package."; - }; + pkg = mkOption { + type = types.package; + description = "The plugin package."; + }; - settings = mkOption { - type = with types; attrsOf anything; - description = "Settings to include in the plugin's `data.json`."; - default = { }; - }; + settings = mkOption { + type = with types; attrsOf anything; + description = "Settings to include in the plugin's `data.json`."; + default = { }; }; }; + }; in mkOption { description = "Community plugins to install and activate."; @@ -295,22 +291,20 @@ in themes = let - themesOptions = - { config, ... }: - { - options = { - enable = mkOption { - type = types.bool; - default = true; - description = "Whether to set the theme as active."; - }; + themesOptions = { + options = { + enable = mkOption { + type = types.bool; + default = true; + description = "Whether to set the theme as active."; + }; - pkg = mkOption { - type = types.package; - description = "The theme package."; - }; + pkg = mkOption { + type = types.package; + description = "The theme package."; }; }; + }; in mkOption { description = "Themes to install."; @@ -320,22 +314,20 @@ in hotkeys = let - hotkeysOptions = - { config, ... }: - { - options = { - modifiers = mkOption { - type = with types; listOf str; - description = "The hotkey modifiers."; - default = [ ]; - }; + hotkeysOptions = { + options = { + modifiers = mkOption { + type = with types; listOf str; + description = "The hotkey modifiers."; + default = [ ]; + }; - key = mkOption { - type = types.str; - description = "The hotkey."; - }; + key = mkOption { + type = types.str; + description = "The hotkey."; }; }; + }; in mkOption { description = "Hotkeys to configure."; diff --git a/modules/services/stalonetray.nix b/modules/services/stalonetray.nix index e6fc4da1c..f657fa577 100644 --- a/modules/services/stalonetray.nix +++ b/modules/services/stalonetray.nix @@ -10,7 +10,6 @@ let mkIf mkOption types - literalExpression ; cfg = config.services.stalonetray; diff --git a/tests/integration/standalone/alice-home-init.nix b/tests/integration/standalone/alice-home-init.nix index 6a21e324d..946ddd4f8 100644 --- a/tests/integration/standalone/alice-home-init.nix +++ b/tests/integration/standalone/alice-home-init.nix @@ -1,5 +1,3 @@ -{ config, pkgs, ... }: - { # Home Manager needs a bit of information about you and the paths it should # manage. diff --git a/tests/integration/standalone/home-with-symbols-init.nix b/tests/integration/standalone/home-with-symbols-init.nix index 0574a4f03..5506041fc 100644 --- a/tests/integration/standalone/home-with-symbols-init.nix +++ b/tests/integration/standalone/home-with-symbols-init.nix @@ -1,5 +1,3 @@ -{ config, pkgs, ... }: - { # Home Manager needs a bit of information about you and the paths it should # manage. diff --git a/tests/modules/programs/helix/only-extraconfig.nix b/tests/modules/programs/helix/only-extraconfig.nix index c2d3231cb..bffbea518 100644 --- a/tests/modules/programs/helix/only-extraconfig.nix +++ b/tests/modules/programs/helix/only-extraconfig.nix @@ -1,4 +1,3 @@ -{ config, ... }: { programs.helix = { enable = true; diff --git a/tests/modules/programs/lutris/empty.nix b/tests/modules/programs/lutris/empty.nix index 8e2409e22..dfa600328 100644 --- a/tests/modules/programs/lutris/empty.nix +++ b/tests/modules/programs/lutris/empty.nix @@ -1,4 +1,3 @@ -{ pkgs, lib, ... }: { programs.lutris.enable = true; nmt.script = diff --git a/tests/modules/programs/mc/basic-configuration.nix b/tests/modules/programs/mc/basic-configuration.nix index e23042f1f..0d2d7e879 100644 --- a/tests/modules/programs/mc/basic-configuration.nix +++ b/tests/modules/programs/mc/basic-configuration.nix @@ -1,5 +1,3 @@ -{ config, lib, ... }: - { programs.mc = { enable = true; diff --git a/treefmt.toml b/treefmt.toml index c642cdce6..a6569fa2b 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -5,6 +5,11 @@ tree-root-file = "release.json" command = "nixfmt" includes = [ "*.nix" ] +[formatter.deadnix] +command = "deadnix" +options = [ "--edit", "--no-lambda-arg" ] +includes = [ "*.nix" ] + [formatter.keep-sorted] command = "keep-sorted" includes = [ "*" ]