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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705641746,
|
"lastModified": 1706098335,
|
||||||
"narHash": "sha256-D6c2aH8HQbWc7ZWSV0BUpFpd94ImFyCP8jFIsKQ4Slg=",
|
"narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d2003f2223cbb8cd95134e4a0541beea215c1073",
|
"rev": "a77ab169a83a4175169d78684ddd2e54486ac651",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -59,11 +59,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705697961,
|
"lastModified": 1706173671,
|
||||||
"narHash": "sha256-XepT3WS516evSFYkme3GrcI3+7uwXHqtHbip+t24J7E=",
|
"narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e5d1c87f5813afde2dda384ac807c57a105721cc",
|
"rev": "4fddc9be4eaf195d631333908f2a454b03628ee5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
49
flake.nix
49
flake.nix
@ -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 = 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}/
|
||||||
mkSystem = {system, hostname, username ? _username, stateVersion}:
|
mkSystem = {system, hostname, username ? _username, stateVersion, extraModules ? [] }:
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
@ -101,13 +101,14 @@
|
|||||||
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;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user