flake.nix: fix references to lib to being an argument

It turns out the functions that is being wrapped by `mkHost` and
`mkUser` both accept `lib` as one of the attribute on their respective
functions. It is better to use that instead of chucking it as part of
`extraSpecialArgs` or something similar.
This commit is contained in:
Gabriel Arazas 2022-07-09 10:42:16 +08:00
parent 3d9494d92a
commit e235ad949e

View File

@ -94,10 +94,8 @@
(lib'.makeOverridable inputs.nixpkgs.lib.nixosSystem) { (lib'.makeOverridable inputs.nixpkgs.lib.nixosSystem) {
# The system of the NixOS system. # The system of the NixOS system.
inherit system; inherit system;
specialArgs = { lib = lib';
lib = lib'; specialArgs = { inherit system inputs self; };
inherit system inputs self;
};
modules = modules =
# Append with our custom NixOS modules from the modules folder. # Append with our custom NixOS modules from the modules folder.
(lib'.modulesToList (lib'.filesToAttr ./modules/nixos)) (lib'.modulesToList (lib'.filesToAttr ./modules/nixos))
@ -115,7 +113,8 @@
# making them available to our system. This will also prevent the # making them available to our system. This will also prevent the
# annoying downloads since it always get the latest revision. # annoying downloads since it always get the latest revision.
nix.registry = { nix.registry = {
# I'm narcissistic so I want my config to be one of the flakes in the registry. # I'm narcissistic so I want my config to be one of the flakes in the
# registry.
config.flake = self; config.flake = self;
# All of the important flakes will be included. # All of the important flakes will be included.
@ -180,19 +179,14 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.sharedModules = home-manager.sharedModules =
lib'.modulesToList (lib'.filesToAttr ./modules/home-manager); lib'.modulesToList (lib'.filesToAttr ./modules/home-manager);
home-manager.extraSpecialArgs = { home-manager.extraSpecialArgs = { inherit inputs system self; };
lib = lib';
inherit inputs system self;
};
}; };
mkUser = { system ? defaultSystem, extraModules ? [ ] }: mkUser = { system ? defaultSystem, extraModules ? [ ] }:
inputs.home-manager.lib.homeManagerConfiguration { inputs.home-manager.lib.homeManagerConfiguration {
inherit system; inherit system;
extraSpecialArgs = { extraSpecialArgs = { inherit system self inputs; };
lib = lib'; lib = lib';
inherit system self inputs;
};
modules = modules =
# Importing our custom home-manager modules. # Importing our custom home-manager modules.
(lib'.modulesToList (lib'.filesToAttr ./modules/home-manager)) (lib'.modulesToList (lib'.filesToAttr ./modules/home-manager))