treewide: use inherit for attribute assignments

This change converts redundant attribute assignments of the form `a =
a;` or `a = someSet.a;` into cleaner `inherit` statements. This reduces
verbosity and follows common Nix style for bringing attributes into
scope.

Statix Codes: W03 (manual_inherit), W04 (manual_inherit_from)

Also include statix and the rule in our configuration.
This commit is contained in:
Austin Horstman
2026-04-07 22:46:12 -05:00
parent 9ddbb69d18
commit 01ea51d706
218 changed files with 351 additions and 317 deletions

View File

@@ -153,11 +153,15 @@ let
config = lib.listToAttrs (map poisonAttr (lib.filter (n: n != "_module") (lib.attrNames options)));
};
options =
(docsLib.evalModules {
modules = modules ++ [ poisonModule ];
class = "homeManager";
}).options;
inherit
(
(docsLib.evalModules {
modules = modules ++ [ poisonModule ];
class = "homeManager";
})
)
options
;
in
pkgs.buildPackages.nixosOptionsDoc (
{

View File

@@ -75,8 +75,7 @@
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./default.nix {
inherit pkgs lib;
release = releaseInfo.release;
isReleaseBranch = releaseInfo.isReleaseBranch;
inherit (releaseInfo) isReleaseBranch release;
};
in
{