moved rebuild

This commit is contained in:
John Lancaster
2026-03-10 23:39:23 -05:00
parent 0af3e51ebf
commit ce55bbc194
4 changed files with 43 additions and 43 deletions

View File

@@ -0,0 +1,43 @@
{ inputs, ... }:
{
flake.modules.homeManager.rebuild =
{ pkgs, lib, config, ... }:
{
options = {
homeManagerFlakeDir = lib.mkOption {
type = lib.types.str;
default = "${config.xdg.configHome}/home-manager";
description = "Path to the home-manager flake directory.";
};
};
config = let
nixBin = lib.getExe pkgs.nix;
flakeDir = config.homeManagerFlakeDir;
in
{
home.activation.printFlakeDir = lib.hm.dag.entryAfter ["writeBoundary"] ''
run echo "Home Manager flake directory: ${flakeDir}"
'';
home.packages = with pkgs; [
home-manager
(writeShellScriptBin "flake-parts-test" ''
echo "Test ${flakeDir}"
'')
(writeShellScriptBin "flake-parts-check" ''
cd ${flakeDir}
${nixBin} run ".#write-flake"
${nixBin} flake check
'')
(writeShellScriptBin "nhms" ''
${lib.getExe home-manager} switch --impure --flake ${flakeDir}
'')
(writeShellScriptBin "nhmu" ''
${nixBin} flake update --flake ${flakeDir}
nhms
'')
];
};
};
}

View File

@@ -19,6 +19,7 @@
# Import the corresponding homeManager module for the given username
home-manager.users."${username}" = {
imports = [
self.modules.homeManager.base
self.modules.homeManager."${username}"
];
};