mirror of
https://github.com/nix-community/home-manager
synced 2025-02-17 05:35:06 +01:00
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
26 lines
752 B
Nix
26 lines
752 B
Nix
{ lib, pkgs, ... }:
|
|
|
|
lib.mkMerge [
|
|
{
|
|
services.syncthing = {
|
|
enable = true;
|
|
extraOptions = [ "-foo" ''-bar "baz"'' ];
|
|
};
|
|
}
|
|
|
|
(lib.mkIf pkgs.stdenv.isLinux {
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/systemd/user/syncthing.service
|
|
assertFileContains home-files/.config/systemd/user/syncthing.service \
|
|
"ExecStart=@syncthing@/bin/syncthing -no-browser -no-restart -no-upgrade '-gui-address=127.0.0.1:8384' '-logflags=0' -foo '-bar \"baz\"'"
|
|
'';
|
|
})
|
|
|
|
(lib.mkIf pkgs.stdenv.isDarwin {
|
|
nmt.script = ''
|
|
serviceFile=LaunchAgents/org.nix-community.home.syncthing.plist
|
|
assertFileExists "$serviceFile"
|
|
assertFileContent "$serviceFile" ${./expected-agent.plist}
|
|
'';
|
|
})
|
|
]
|