mirror of
https://github.com/nix-community/home-manager
synced 2024-06-13 02:03:38 +02:00
Merge 5256fd07ba
into 6d3b6dc922
This commit is contained in:
commit
2b692db29f
|
@ -269,7 +269,9 @@ let
|
|||
checkPhase = lib.optionalString cfg.checkConfig ''
|
||||
export DBUS_SESSION_BUS_ADDRESS=/dev/null
|
||||
export XDG_RUNTIME_DIR=$(mktemp -d)
|
||||
${pkgs.xvfb-run}/bin/xvfb-run ${swayPackage}/bin/sway --config "$target" --validate --unsupported-gpu
|
||||
cp "$target" sway.conf
|
||||
${cfg.preCheckConfig}
|
||||
${pkgs.xvfb-run}/bin/xvfb-run ${swayPackage}/bin/sway --config sway.conf --validate --unsupported-gpu
|
||||
'';
|
||||
|
||||
text = concatStringsSep "\n"
|
||||
|
@ -478,6 +480,22 @@ in {
|
|||
description = "Sway configuration options.";
|
||||
};
|
||||
|
||||
preCheckConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
sed 's/foo/bar/g' -i sway.conf
|
||||
export HOME=$(mktemp -d)
|
||||
touch ~/background.png
|
||||
'';
|
||||
description = ''
|
||||
Script to run before running `sway --validate` on the generated config
|
||||
file. The config file is available as `sway.conf`, and can be
|
||||
manipulated without affecting the build output. Only used if
|
||||
`checkConfig = true`.
|
||||
'';
|
||||
};
|
||||
|
||||
checkConfig = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
sway-followmouse = ./sway-followmouse.nix;
|
||||
sway-followmouse-legacy = ./sway-followmouse-legacy.nix;
|
||||
sway-check-config = ./sway-check-config.nix;
|
||||
sway-check-config-precheck = ./sway-check-config-precheck.nix;
|
||||
sway-modules = ./sway-modules.nix;
|
||||
sway-no-xwayland = ./sway-no-xwayland.nix;
|
||||
sway-null-config = ./sway-null-config.nix;
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
{ 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'
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user