From 2d3d2ef1d786c55c0cce1f629082174a7b33c1c9 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Mon, 21 Jul 2025 00:00:45 +0200 Subject: [PATCH] hjem: init Finally, a sane home management system. Signed-off-by: Bloxx12 Change-Id: I6a6a696430c3a408520811d1b0b3038a66b0f73a --- modules/home/hjem.mod.nix | 36 ++++++++++++++++++++++++++++++++++++ npins/sources.json | 13 +++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 modules/home/hjem.mod.nix diff --git a/modules/home/hjem.mod.nix b/modules/home/hjem.mod.nix new file mode 100644 index 0000000..a6c5e04 --- /dev/null +++ b/modules/home/hjem.mod.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + sources, + ... +}: +let + inherit (builtins) filter; + inherit (config.meta.mainUser) username; + inherit (lib.modules) mkForce; + inherit (lib.filesystem) listFilesRecursive; + inherit (lib.strings) hasSuffix; + +in +{ + + imports = [ (sources.hjem + "/modules/nixos") ]; + + config = { + hjem = { + clobberByDefault = true; + linker = pkgs.smfh; + users.${username} = { + enable = true; + user = username; + directory = config.users.users.${username}.home; + clobberFiles = mkForce true; + }; + extraModules = ((listFilesRecursive ./.) |> filter (hasSuffix ".hjem.nix")); + specialArgs = { + inherit sources; + }; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 0a9741d..68bd682 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -43,6 +43,19 @@ "url": "https://git.lix.systems/lix-project/flake-compat/archive/549f2762aebeff29a2e5ece7a7dc0f955281a1d1.tar.gz", "hash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=" }, + "hjem": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "feel-co", + "repo": "hjem" + }, + "branch": "main", + "submodules": false, + "revision": "3093a74542b30f8155954d585d0ae2401e3adbe5", + "url": "https://github.com/feel-co/hjem/archive/3093a74542b30f8155954d585d0ae2401e3adbe5.tar.gz", + "hash": "sha256-LzojKFWAAreWyH56aupj/MLwuPPnnyzplw/xdbavC9c=" + }, "impermanence": { "type": "Git", "repository": {