1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

formatter: add deadnix (#7331)

This commit is contained in:
awwpotato 2025-06-28 14:28:39 -07:00 committed by GitHub
parent da077f20db
commit 76d0c31fce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 62 additions and 73 deletions

View file

@ -22,7 +22,7 @@ Also make sure to read the guidelines found at
- [ ] Change is backwards compatible. - [ ] Change is backwards compatible.
- [ ] Code formatted with `nix fmt` or - [ ] 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` - [ ] Code tested through `nix-shell --pure tests -A run.all`
or `nix build --reference-lock-file flake.lock ./tests#test-all` using Flakes. or `nix build --reference-lock-file flake.lock ./tests#test-all` using Flakes.

View file

@ -17,4 +17,4 @@ test-install:
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
format: 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"

View file

@ -55,6 +55,7 @@
pkgs.treefmt.withConfig { pkgs.treefmt.withConfig {
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
nixfmt-rfc-style nixfmt-rfc-style
deadnix
keep-sorted keep-sorted
]; ];
settings = pkgs.lib.importTOML ./treefmt.toml; settings = pkgs.lib.importTOML ./treefmt.toml;

View file

@ -187,28 +187,26 @@ in
corePlugins = corePlugins =
let let
corePluginsOptions = corePluginsOptions = {
{ config, ... }: options = {
{ enable = mkOption {
options = { type = types.bool;
enable = mkOption { default = true;
type = types.bool; description = "Whether to enable the plugin.";
default = true; };
description = "Whether to enable the plugin.";
};
name = mkOption { name = mkOption {
type = types.enum corePlugins; type = types.enum corePlugins;
description = "The plugin."; description = "The plugin.";
}; };
settings = mkOption { settings = mkOption {
type = with types; attrsOf anything; type = with types; attrsOf anything;
description = "Plugin settings to include."; description = "Plugin settings to include.";
default = { }; default = { };
};
}; };
}; };
};
in in
mkOption { mkOption {
description = "Core plugins to activate."; description = "Core plugins to activate.";
@ -220,28 +218,26 @@ in
communityPlugins = communityPlugins =
let let
communityPluginsOptions = communityPluginsOptions = {
{ config, ... }: options = {
{ enable = mkOption {
options = { type = types.bool;
enable = mkOption { default = true;
type = types.bool; description = "Whether to enable the plugin.";
default = true; };
description = "Whether to enable the plugin.";
};
pkg = mkOption { pkg = mkOption {
type = types.package; type = types.package;
description = "The plugin package."; description = "The plugin package.";
}; };
settings = mkOption { settings = mkOption {
type = with types; attrsOf anything; type = with types; attrsOf anything;
description = "Settings to include in the plugin's `data.json`."; description = "Settings to include in the plugin's `data.json`.";
default = { }; default = { };
};
}; };
}; };
};
in in
mkOption { mkOption {
description = "Community plugins to install and activate."; description = "Community plugins to install and activate.";
@ -295,22 +291,20 @@ in
themes = themes =
let let
themesOptions = themesOptions = {
{ config, ... }: options = {
{ enable = mkOption {
options = { type = types.bool;
enable = mkOption { default = true;
type = types.bool; description = "Whether to set the theme as active.";
default = true; };
description = "Whether to set the theme as active.";
};
pkg = mkOption { pkg = mkOption {
type = types.package; type = types.package;
description = "The theme package."; description = "The theme package.";
};
}; };
}; };
};
in in
mkOption { mkOption {
description = "Themes to install."; description = "Themes to install.";
@ -320,22 +314,20 @@ in
hotkeys = hotkeys =
let let
hotkeysOptions = hotkeysOptions = {
{ config, ... }: options = {
{ modifiers = mkOption {
options = { type = with types; listOf str;
modifiers = mkOption { description = "The hotkey modifiers.";
type = with types; listOf str; default = [ ];
description = "The hotkey modifiers."; };
default = [ ];
};
key = mkOption { key = mkOption {
type = types.str; type = types.str;
description = "The hotkey."; description = "The hotkey.";
};
}; };
}; };
};
in in
mkOption { mkOption {
description = "Hotkeys to configure."; description = "Hotkeys to configure.";

View file

@ -10,7 +10,6 @@ let
mkIf mkIf
mkOption mkOption
types types
literalExpression
; ;
cfg = config.services.stalonetray; cfg = config.services.stalonetray;

View file

@ -1,5 +1,3 @@
{ config, pkgs, ... }:
{ {
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.

View file

@ -1,5 +1,3 @@
{ config, pkgs, ... }:
{ {
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.

View file

@ -1,4 +1,3 @@
{ config, ... }:
{ {
programs.helix = { programs.helix = {
enable = true; enable = true;

View file

@ -1,4 +1,3 @@
{ pkgs, lib, ... }:
{ {
programs.lutris.enable = true; programs.lutris.enable = true;
nmt.script = nmt.script =

View file

@ -1,5 +1,3 @@
{ config, lib, ... }:
{ {
programs.mc = { programs.mc = {
enable = true; enable = true;

View file

@ -5,6 +5,11 @@ tree-root-file = "release.json"
command = "nixfmt" command = "nixfmt"
includes = [ "*.nix" ] includes = [ "*.nix" ]
[formatter.deadnix]
command = "deadnix"
options = [ "--edit", "--no-lambda-arg" ]
includes = [ "*.nix" ]
[formatter.keep-sorted] [formatter.keep-sorted]
command = "keep-sorted" command = "keep-sorted"
includes = [ "*" ] includes = [ "*" ]