1
0
Fork 0
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:
Austin Horstman 2025-07-14 22:00:11 -05:00
parent cec4c1be7e
commit 1a8b119e60
3 changed files with 33 additions and 0 deletions

View file

@ -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

View 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}
'';
};
}

View file

@ -0,0 +1,5 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
caffeine-basic-service = ./basic-service.nix;
}