From 8c946f2d3b36c8e34c1fba4df314f03b74d25a34 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 2 Jan 2021 16:21:34 +0100 Subject: fix user-profiles --- system-profiles/core.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'system-profiles') diff --git a/system-profiles/core.nix b/system-profiles/core.nix index 79c2fe82..5f2433bb 100644 --- a/system-profiles/core.nix +++ b/system-profiles/core.nix @@ -1,6 +1,8 @@ { flake, flakeInputs, path, hostName, config, lib, pkgs, customUtils, ... }: let profileSet = customUtils.types.attrNameSet flake.nixosModules.systemProfiles; + userProfileSet = customUtils.types.attrNameSet (lib.zipAttrs (lib.attrValues flake.nixosModules.userProfiles)); + hasSops = config.sops.secrets != {}; in { imports = with flakeInputs; [ sops-nix.nixosModules.sops @@ -16,6 +18,18 @@ in { Set (list without duplicates) of ‘systemProfiles’ enabled for this host ''; }; + + users.users = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule { + options.profiles = lib.mkOption { + type = userProfileSet; + default = []; + description = '' + Set (list without duplicates) of ‘userProfiles’ enabled for this user + ''; + }; + }); + }; }; config = { @@ -48,6 +62,11 @@ in { # documentation.nixos.includeAllModules = true; # incompatible with home-manager (build fails) - home-manager.useGlobalPkgs = true; # Otherwise home-manager would only work impurely + home-manager = { + useGlobalPkgs = true; # Otherwise home-manager would only work impurely + useUserPackages = true; + }; + + sops.gnupgHome = lib.mkIf hasSops "/root/.gnupg"; }; } -- cgit v1.2.3