mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
@@ -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 (
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user