From dd1ef4cf6c9100adf9e6771619e6c9dc7006e325 Mon Sep 17 00:00:00 2001 From: NullBite Date: Mon, 22 Jan 2024 14:16:17 +0100 Subject: [PATCH] Add start of home-manager multi user builder --- flake.nix | 11 +++++++++-- home/root.nix | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 home/root.nix diff --git a/flake.nix b/flake.nix index ab4764c..e7f7dc7 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,14 @@ # This function produces a module that adds the home-manager module to the # system and configures the given module to the user's Home Manager # configuration - homeManagerInit = {system, username ? _username , module}: { config, lib, pkgs, ... }: { + homeManagerInit = {system, username ? _username , module ? _ : {}, users ? { ${username} = module;} }: + let + # TODO ooprs i forgor home-manager needs a state version and i currently + # don't pass the system name to this so there is no way to derive this + # value properly and it should probably be derived with mkSystem + users = users // { root = ./home/root.nix;}; + in + { config, lib, pkgs, ... }: { imports = [ inputs.home-manager.nixosModules.home-manager ]; @@ -55,7 +62,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users.${username} = module; + inherit users; extraSpecialArgs = { inherit inputs outputs vars; extraPkgs = mkExtraPkgs system; diff --git a/home/root.nix b/home/root.nix new file mode 100644 index 0000000..f857ce8 --- /dev/null +++ b/home/root.nix @@ -0,0 +1,2 @@ +{ config, lib, pkgs, ... }@args: +{ }