config: make mkHome more universal

I don't know how to deploy the home-manager configurations with more
than one systems reliably without ruining the experience of having to
pass an autogenerated name for the correct configuration. The way it's
currently done provides no benefit for multi-system users.

It's not perfect but for now, we'll set the system through importing
nixpkgs which has auto-detection for its system. Though, this makes the
user system declaration ineffective.
This commit is contained in:
Gabriel Arazas 2023-12-10 18:34:20 +08:00
parent e1c081b96d
commit 198ded079b
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 4 additions and 5 deletions

View File

@ -380,9 +380,8 @@
lib'.mapAttrs
(filename: metadata:
let
name = metadata._name;
system = metadata._system;
pkgs = inputs.${metadata.nixpkgs-channel or "nixpkgs"}.legacyPackages.${system};
name = metadata.username or filename;
pkgs = import nixpkgs { inherit overlays; };
path = ./users/home-manager/${name};
extraModules = [
({ pkgs, config, ... }: {
@ -417,7 +416,7 @@
];
in
mkHome {
inherit pkgs system extraModules extraArgs;
inherit pkgs extraModules extraArgs;
home-manager-channel = metadata.home-manager-channel or "home-manager";
})
users;

View File

@ -13,7 +13,7 @@
};
# A wrapper around the home-manager configuration function.
mkHome = { pkgs, system, extraModules ? [ ], extraArgs ? { }, home-manager-channel ? "home-manager" }:
mkHome = { pkgs, extraModules ? [ ], extraArgs ? { }, home-manager-channel ? "home-manager" }:
inputs."${home-manager-channel}".lib.homeManagerConfiguration {
inherit lib pkgs;
extraSpecialArgs = extraArgs;