summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNick Hu <me@nickhu.co.uk>2024-10-13 12:52:55 +0100
committerNick Hu <me@nickhu.co.uk>2024-10-16 22:50:44 +0100
commit72e93853c2d16d1ce04a5e8eee6695e2493ca80d (patch)
tree63477f37a160ac40b9dbfb8b709dd4040e8f51e0 /tests
parenta60ac02f9466f85f092e576fd8364dfc4406b5a6 (diff)
module: add aerospace service
Diffstat (limited to 'tests')
-rw-r--r--tests/services-aerospace.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/services-aerospace.nix b/tests/services-aerospace.nix
new file mode 100644
index 0000000..7656caf
--- /dev/null
+++ b/tests/services-aerospace.nix
@@ -0,0 +1,36 @@
+{ config, pkgs, ... }:
+
+let
+ aerospace = pkgs.runCommand "aerospace-0.0.0" { } "mkdir $out";
+in
+
+{
+ services.aerospace.enable = true;
+ services.aerospace.package = aerospace;
+ services.aerospace.settings = {
+ gaps = {
+ outer.left = 8;
+ outer.bottom = 8;
+ outer.top = 8;
+ outer.right = 8;
+ };
+ mode.main.binding = {
+ alt-h = "focus left";
+ alt-j = "focus down";
+ alt-k = "focus up";
+ alt-l = "focus right";
+ };
+ };
+
+ test = ''
+ echo >&2 "checking aerospace service in ~/Library/LaunchAgents"
+ grep "org.nixos.aerospace" ${config.out}/user/Library/LaunchAgents/org.nixos.aerospace.plist
+ grep "${aerospace}/Applications/AeroSpace.app/Contents/MacOS/AeroSpace" ${config.out}/user/Library/LaunchAgents/org.nixos.aerospace.plist
+
+ conf=`sed -En '/<string>--config-path<\/string>/{n; s/\s+?<\/?string>//g; p;}' \
+ ${config.out}/user/Library/LaunchAgents/org.nixos.aerospace.plist`
+
+ echo >&2 "checking config in $conf"
+ if [ `cat $conf | wc -l` -eq "27" ]; then echo "aerospace.toml config correctly contains 27 lines"; else return 1; fi
+ '';
+}