fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Naïm Faviertests: fix `getOutput` on stubs221056c5

master
1.1 KiB40 linesraw
1{ config, ... }:
2
3{
4  services.git-sync = {
5    enable = true;
6    package = config.lib.test.mkStubPackage { outPath = "@git-sync@"; };
7    repositories.test = {
8      path = "/a/path";
9      uri = "git+ssh://user@example.com:/~user/path/to/repo.git";
10    };
11  };
12
13  test.stubs.openssh = { name = "openssh"; };
14
15  nmt.script = ''
16    serviceFile=home-files/.config/systemd/user/git-sync-test.service
17
18    assertFileExists $serviceFile
19
20    serviceFile=$(normalizeStorePaths $serviceFile)
21    assertFileContent $serviceFile ${
22      builtins.toFile "expected" ''
23        [Install]
24        WantedBy=default.target
25
26        [Service]
27        Environment=PATH=@openssh@/bin:/nix/store/00000000000000000000000000000000-git/bin
28        Environment=GIT_SYNC_DIRECTORY=/a/path
29        Environment=GIT_SYNC_COMMAND=@git-sync@/bin/git-sync
30        Environment=GIT_SYNC_REPOSITORY=git+ssh://user@example.com:/~user/path/to/repo.git
31        Environment=GIT_SYNC_INTERVAL=500
32        ExecStart=@git-sync@/bin/git-sync-on-inotify
33        Restart=on-abort
34
35        [Unit]
36        Description=Git Sync test
37      ''
38    }
39  '';
40}