make flake.nix header more readable
This commit is contained in:
parent
f2cc47be34
commit
47ccc9b0fe
45
flake.nix
45
flake.nix
@ -54,32 +54,32 @@
|
|||||||
# system and configures the given module to the user's Home Manager
|
# system and configures the given module to the user's Home Manager
|
||||||
# configuration
|
# configuration
|
||||||
homeManagerInit = {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
|
homeManagerInit = {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
|
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
|
||||||
|
{
|
||||||
|
imports = modules;
|
||||||
|
config = {
|
||||||
|
home = { inherit stateVersion; };
|
||||||
|
};
|
||||||
|
});
|
||||||
|
users = mapUserModules userModules;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = modules;
|
imports = [
|
||||||
config = {
|
inputs.home-manager.nixosModules.home-manager
|
||||||
home = { inherit stateVersion; };
|
];
|
||||||
};
|
|
||||||
});
|
|
||||||
users = mapUserModules userModules;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
inherit users;
|
inherit users;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs outputs vars;
|
inherit inputs outputs vars;
|
||||||
extraPkgs = mkExtraPkgs system;
|
extraPkgs = mkExtraPkgs system;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# This function produces a nixosSystem which imports configuration.nix and
|
# This function produces a nixosSystem which imports configuration.nix and
|
||||||
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
|
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
|
||||||
@ -108,6 +108,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# values to be passed to nixosModules and homeManagerModules wrappers
|
||||||
moduleInputs = {
|
moduleInputs = {
|
||||||
inherit mkExtraPkgs;
|
inherit mkExtraPkgs;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user