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

View File

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