nh: add options for specific flakes (#7566)

* nh: Add options for specific flakes
* nh: Add tests for specific flake options

---------

Co-authored-by: Foxocube <git@foxocube.xyz>
This commit is contained in:
Foxocube 2025-07-31 18:41:29 +01:00 committed by GitHub
parent bd82507edd
commit 4e97102bd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 87 additions and 10 deletions

View file

@ -3,6 +3,9 @@
enable = true;
flake = "/path/to/flake";
osFlake = "/path/to/osFlake";
homeFlake = "/path/to/homeFlake";
darwinFlake = "/path/to/darwinFlake";
clean = {
enable = true;
@ -18,5 +21,8 @@
assertFileContent $serviceFileNormalized ${./launchd.plist}
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_FLAKE="/path/to/flake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_OS_FLAKE="/path/to/osFlake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_HOME_FLAKE="/path/to/homeFlake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_DARWIN_FLAKE="/path/to/darwinFlake"'
'';
}

View file

@ -5,6 +5,9 @@
package = config.lib.test.mkStubPackage { version = "4.0.0"; };
flake = "/path/to/flake";
osFlake = "/path/to/osFlake";
homeFlake = "/path/to/homeFlake";
darwinFlake = "/path/to/darwinFlake";
clean = {
enable = true;
@ -31,5 +34,8 @@
assertFileExists $unitDir/timers.target.wants/nh-clean.timer
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_FLAKE="/path/to/flake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_OS_FLAKE="/path/to/osFlake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_HOME_FLAKE="/path/to/homeFlake"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_DARWIN_FLAKE="/path/to/darwinFlake"'
'';
}