Compare commits

..

No commits in common. "d855bfcb3d863340f45b450f185b08a09137ea23" and "ac96adae265d4234477837f6ef78920c5803f862" have entirely different histories.

2 changed files with 30 additions and 31 deletions

12
flake.lock generated
View File

@ -43,11 +43,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1706098335, "lastModified": 1705641746,
"narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=", "narHash": "sha256-D6c2aH8HQbWc7ZWSV0BUpFpd94ImFyCP8jFIsKQ4Slg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a77ab169a83a4175169d78684ddd2e54486ac651", "rev": "d2003f2223cbb8cd95134e4a0541beea215c1073",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -59,11 +59,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1706173671, "lastModified": 1705697961,
"narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", "narHash": "sha256-XepT3WS516evSFYkme3GrcI3+7uwXHqtHbip+t24J7E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", "rev": "e5d1c87f5813afde2dda384ac807c57a105721cc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -54,36 +54,36 @@
# 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 = [ imports = modules;
inputs.home-manager.nixosModules.home-manager config = {
]; 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}/
mkSystem = {system, hostname, username ? _username, stateVersion, extraModules ? [] }: mkSystem = {system, hostname, username ? _username, stateVersion}:
lib.nixosSystem { lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
@ -101,14 +101,13 @@
module = import ./hosts/${hostname}/home.nix; module = import ./hosts/${hostname}/home.nix;
inherit username system stateVersion; inherit username system stateVersion;
}) })
] ++ extraModules; ];
specialArgs = { specialArgs = {
inherit inputs outputs vars; inherit inputs outputs vars;
extraPkgs = mkExtraPkgs system; extraPkgs = mkExtraPkgs system;
}; };
}; };
# values to be passed to nixosModules and homeManagerModules wrappers
moduleInputs = { moduleInputs = {
inherit mkExtraPkgs; inherit mkExtraPkgs;
}; };