added test-build
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
{ inputs, ... }:
|
||||
{ self, inputs, ... }:
|
||||
{
|
||||
flake.modules.homeManager.rebuild =
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
nixBin = lib.getExe pkgs.nix;
|
||||
flakeDir = config.homeManagerFlakeDir;
|
||||
echoCmd = lib.getExe' pkgs.coreutils "echo";
|
||||
hostnameCmd = "$(${lib.getExe pkgs.hostname} -s)";
|
||||
@@ -31,10 +32,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
nixBin = lib.getExe pkgs.nix;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
home.activation.printFlakeDir = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
run ${echoCmd} "Home Manager flake directory: ${flakeDir}"
|
||||
'';
|
||||
@@ -69,6 +67,15 @@
|
||||
${lib.getExe git} -C ${flakeDir} add ${flakeDir}/flake.lock > /dev/null 2>&1
|
||||
${lib.getExe nfs}
|
||||
'')
|
||||
(writeShellScriptBin "test-build" ''
|
||||
if [ -z "$1" ]; then
|
||||
HOSTNAME=${hostnameCmd}
|
||||
else
|
||||
HOSTNAME="$1"
|
||||
fi
|
||||
${echoCmd} "Testing the evaulation of the nixos config for $HOSTNAME"
|
||||
${nixBin} eval ${flakeDir}#nixosConfigurations.$HOSTNAME.config.system.build.toplevel.drvPath
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user