mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
tests/caffeine: add test coverage
- Add basic-service.nix test for caffeine service configuration - Test systemd service generation with proper graphical-session.target integration Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
cec4c1be7e
commit
1a8b119e60
3 changed files with 33 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@caffeine-ng@/bin/caffeine
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
Restart=on-failure
|
||||
Slice=session.slice
|
||||
Type=exec
|
||||
|
||||
[Unit]
|
||||
Description=caffeine
|
||||
15
tests/modules/services/caffeine/basic-service.nix
Normal file
15
tests/modules/services/caffeine/basic-service.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
services.caffeine = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/caffeine.service \
|
||||
${./basic-service-expected.service}
|
||||
'';
|
||||
};
|
||||
}
|
||||
5
tests/modules/services/caffeine/default.nix
Normal file
5
tests/modules/services/caffeine/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
caffeine-basic-service = ./basic-service.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue