Compare commits
4 Commits
ac96adae26
...
d855bfcb3d
Author | SHA1 | Date | |
---|---|---|---|
d855bfcb3d | |||
47ccc9b0fe | |||
f2cc47be34 | |||
6355496bf7 |
12
flake.lock
generated
12
flake.lock
generated
@ -43,11 +43,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705641746,
|
||||
"narHash": "sha256-D6c2aH8HQbWc7ZWSV0BUpFpd94ImFyCP8jFIsKQ4Slg=",
|
||||
"lastModified": 1706098335,
|
||||
"narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d2003f2223cbb8cd95134e4a0541beea215c1073",
|
||||
"rev": "a77ab169a83a4175169d78684ddd2e54486ac651",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -59,11 +59,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1705697961,
|
||||
"narHash": "sha256-XepT3WS516evSFYkme3GrcI3+7uwXHqtHbip+t24J7E=",
|
||||
"lastModified": 1706173671,
|
||||
"narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e5d1c87f5813afde2dda384ac807c57a105721cc",
|
||||
"rev": "4fddc9be4eaf195d631333908f2a454b03628ee5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
49
flake.nix
49
flake.nix
@ -54,36 +54,36 @@
|
||||
# system and configures the given module to the user's Home Manager
|
||||
# configuration
|
||||
homeManagerInit = {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
|
||||
{
|
||||
imports = modules;
|
||||
config = {
|
||||
home = { inherit stateVersion; };
|
||||
};
|
||||
});
|
||||
users = mapUserModules userModules;
|
||||
in
|
||||
{
|
||||
imports = modules;
|
||||
config = {
|
||||
home = { inherit stateVersion; };
|
||||
};
|
||||
});
|
||||
users = mapUserModules userModules;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
inherit users;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs vars;
|
||||
extraPkgs = mkExtraPkgs system;
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
inherit users;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs vars;
|
||||
extraPkgs = mkExtraPkgs system;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# This function produces a nixosSystem which imports configuration.nix and
|
||||
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
|
||||
mkSystem = {system, hostname, username ? _username, stateVersion}:
|
||||
mkSystem = {system, hostname, username ? _username, stateVersion, extraModules ? [] }:
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
@ -101,13 +101,14 @@
|
||||
module = import ./hosts/${hostname}/home.nix;
|
||||
inherit username system stateVersion;
|
||||
})
|
||||
];
|
||||
] ++ extraModules;
|
||||
specialArgs = {
|
||||
inherit inputs outputs vars;
|
||||
extraPkgs = mkExtraPkgs system;
|
||||
};
|
||||
};
|
||||
|
||||
# values to be passed to nixosModules and homeManagerModules wrappers
|
||||
moduleInputs = {
|
||||
inherit mkExtraPkgs;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user