users: home-manager only configurations
for non-root users or non-nixos systems
This commit is contained in:
parent
a1fade8411
commit
88eecddab5
2 changed files with 27 additions and 5 deletions
17
flake.nix
17
flake.nix
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue