1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00
home-manager/tests/modules/services/window-managers/sway/sway-check-config-precheck.nix
Andrew Marshall 5256fd07ba sway: make it possible to alter conf in preCheckConfig
Some situations may require altering the config file itself to remove or
adjust things. While this of course reduces the correctness of the
check, it may be better to lose a little than be forced to disable the
check altogether.
2024-04-21 12:16:21 -04:00

21 lines
533 B
Nix

{ config, lib, ... }:
lib.mkIf config.test.enableBig {
wayland.windowManager.sway = {
enable = true;
checkConfig = true;
preCheckConfig = ''
export HOME=$(mktemp -d)
sed 's/mybg/otherbg/g' -i sway.conf
touch ~/otherbg.png
'';
config.output."*".background = "~/mybg.png fill";
};
nmt.script = ''
assertFileExists home-files/.config/sway/config
assertFileRegex home-files/.config/sway/config 'mybg\.png'
assertFileNotRegex home-files/.config/sway/config 'otherbg\.png'
'';
}