summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-05-11 17:20:52 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-05-11 17:20:52 -0500
commit4e4ec16117af9dbf1043e8b9e82e908e0efbfa75 (patch)
tree235e7a77f52e380720ebc6f7d7491ea87f421530 /lib
parent9c851cb90d57ec2d2f4041cba3b684974d462231 (diff)
downloadnixos-standalone-home.tar.xz
nixos-standalone-home.zip
new standalone home-manager config in flakestandalone-home
Diffstat (limited to 'lib')
-rw-r--r--lib/home-manager/default.nix3
-rw-r--r--lib/home-manager/mkprofile.nix9
-rw-r--r--lib/mkprofile.nix10
3 files changed, 17 insertions, 5 deletions
diff --git a/lib/home-manager/default.nix b/lib/home-manager/default.nix
new file mode 100644
index 0000000..01801a2
--- /dev/null
+++ b/lib/home-manager/default.nix
@@ -0,0 +1,3 @@
+{
+ _mkProfileArchetype = import ./mkprofile.nix;
+}
diff --git a/lib/home-manager/mkprofile.nix b/lib/home-manager/mkprofile.nix
new file mode 100644
index 0000000..dae4d60
--- /dev/null
+++ b/lib/home-manager/mkprofile.nix
@@ -0,0 +1,9 @@
+profileName: nixosConfig: homeConfig: { config, lib, ... }: let
+ cfg = config._archetypes.profiles.${profileName};
+in {
+ options._archetypes.profiles.${profileName} = {
+ enable = lib.mkEnableOption "enable (standalone) home-manager profile ${profileName} for the configured user";
+ };
+
+ config = lib.mkIf cfg.enable (lib.mkMerge [ homeConfig ]);
+}
diff --git a/lib/mkprofile.nix b/lib/mkprofile.nix
index ec851de..c8cfe12 100644
--- a/lib/mkprofile.nix
+++ b/lib/mkprofile.nix
@@ -8,11 +8,11 @@ in {
options._archetypes.profiles.${profileName} = {
enable = lib.mkEnableOption "enable nixos profile ${profileName}";
home.users = lib.mkOption {
- type = lib.types.attrsOf (lib.types.submodule {
- options = {
- enable = lib.mkEnableOption "home-manager profile ${profileName} for user";
- };
- });
+ type = lib.types.attrsOf (lib.types.submodule {
+ options = {
+ enable = lib.mkEnableOption "home-manager profile ${profileName} for user";
+ };
+ });
default = {};
description = "enable home-manager profile ${profileName} for user the specified user";
};