mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
tomat: init service (#8138)
This commit is contained in:
parent
ba15db2a15
commit
2907788315
6 changed files with 127 additions and 0 deletions
5
tests/modules/services/tomat/default.nix
Normal file
5
tests/modules/services/tomat/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
tomat-service = ./tomat.nix;
|
||||
}
|
||||
3
tests/modules/services/tomat/expected-config.toml
Normal file
3
tests/modules/services/tomat/expected-config.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[timer]
|
||||
break = 10
|
||||
work = 60
|
||||
11
tests/modules/services/tomat/expected.service
Normal file
11
tests/modules/services/tomat/expected.service
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@tomat@/bin/tomat daemon run
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Unit]
|
||||
After=graphical.target
|
||||
Description=Tomat Pomodoro server
|
||||
25
tests/modules/services/tomat/tomat.nix
Normal file
25
tests/modules/services/tomat/tomat.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
services.tomat = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
timer = {
|
||||
break = 10;
|
||||
work = 60;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
serviceFile = "home-files/.config/systemd/user/tomat.service";
|
||||
configFile = "home-files/.config/tomat/config.toml";
|
||||
in
|
||||
''
|
||||
assertFileExists "${serviceFile}"
|
||||
assertFileExists "${configFile}"
|
||||
|
||||
assertFileContent "${serviceFile}" ${./expected.service}
|
||||
assertFileContent "${configFile}" ${./expected-config.toml}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue