users: home-manager only configurations

for non-root users or non-nixos systems
This commit is contained in:
Pacman99 2021-01-13 23:20:00 -08:00 committed by Timothy DeHerrera
parent a1fade8411
commit 88eecddab5
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
2 changed files with 27 additions and 5 deletions

View File

@ -29,7 +29,8 @@
inherit (builtins) attrValues; inherit (builtins) attrValues;
inherit (flake-utils.lib) eachDefaultSystem flattenTreeSystem; inherit (flake-utils.lib) eachDefaultSystem flattenTreeSystem;
inherit (nixos.lib) recursiveUpdate; inherit (nixos.lib) recursiveUpdate;
inherit (self.lib) overlays nixosModules genPackages pkgImport; inherit (self.lib) overlays nixosModules genPackages pkgImport
genHomeActivationPackages;
externOverlays = [ nur.overlay devshell.overlay ]; externOverlays = [ nur.overlay devshell.overlay ];
externModules = [ externModules = [
@ -52,6 +53,11 @@
inherit (pkgs) lib; inherit (pkgs) lib;
}); });
homeConfigurations =
builtins.mapAttrs
(_: config: config.config.home-manager.users)
self.nixosConfigurations;
overlay = import ./pkgs; overlay = import ./pkgs;
lib = import ./lib { lib = import ./lib {
@ -90,10 +96,17 @@
in in
pkgImport nixos overlays system; pkgImport nixos overlays system;
packages = flattenTreeSystem system packages =
(genPackages { let
inherit self pkgs; packages' = flattenTreeSystem system
}); (genPackages {
inherit self pkgs;
});
homeActivationPackages = genHomeActivationPackages
self.homeConfigurations;
in
recursiveUpdate packages' homeActivationPackages;
in in
{ {
inherit packages; inherit packages;

View File

@ -73,6 +73,15 @@ in
(recursiveUpdate cachixAttrs modulesAttrs) (recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs; profilesAttrs;
genHomeActivationPackages = hmConfigs: {
hmActivationPackages =
builtins.mapAttrs
(_: x: builtins.mapAttrs
(_: cfg: cfg.home.activationPackage)
x)
hmConfigs;
};
genPackages = { self, pkgs }: genPackages = { self, pkgs }:
let let
inherit (self) overlay overlays; inherit (self) overlay overlays;