mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-04 16:11:06 +01:00
tests/git-sync: reorganize darwin and linux
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
2c4f8cb7d6
commit
e9bde7692e
8 changed files with 9 additions and 10 deletions
35
tests/modules/services/git-sync/linux/basic.nix
Normal file
35
tests/modules/services/git-sync/linux/basic.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.git-sync = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { outPath = "@git-sync@"; };
|
||||
repositories.test = {
|
||||
path = "/a/path";
|
||||
uri = "git+ssh://user@example.com:/~user/path/to/repo.git";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/git-sync-test.service
|
||||
|
||||
assertFileExists $serviceFile
|
||||
|
||||
assertFileContent $serviceFile ${builtins.toFile "expected" ''
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
Environment=PATH=@openssh@/bin:@git@/bin
|
||||
Environment=GIT_SYNC_DIRECTORY=/a/path
|
||||
Environment=GIT_SYNC_COMMAND=@git-sync@/bin/git-sync
|
||||
Environment=GIT_SYNC_REPOSITORY='git+ssh://user@example.com:/~user/path/to/repo.git'
|
||||
Environment=GIT_SYNC_INTERVAL=500
|
||||
ExecStart=@git-sync@/bin/git-sync-on-inotify
|
||||
Restart=on-abort
|
||||
|
||||
[Unit]
|
||||
Description=Git Sync test
|
||||
''}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue