mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-05 16:41:04 +01:00
tests: implement auto importing for modules
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
4fca600cb1
commit
06c1392ca8
275 changed files with 752 additions and 573 deletions
11
tests/modules/services/labwc/autostart
Normal file
11
tests/modules/services/labwc/autostart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/nix/store/00000000000000000000000000000000-bash/bin/bash
|
||||
### This file was generated with Nix. Don't modify this file directly.
|
||||
|
||||
### AUTOSTART SERVICE ###
|
||||
wayvnc &
|
||||
waybar &
|
||||
swaybg -c '#113344' >/dev/null 2>&1 &
|
||||
|
||||
### SYSTEMD INTEGRATION ###
|
||||
@dbus@/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop labwc-session.target && systemctl --user start labwc-session.target
|
||||
|
||||
8
tests/modules/services/labwc/default.nix
Normal file
8
tests/modules/services/labwc/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
labwc-rc-configuration = ./labwc-rc.nix;
|
||||
labwc-menu-configuration = ./labwc-menu.nix;
|
||||
labwc-autostart-configuration = ./labwc-autostart.nix;
|
||||
labwc-environment-configuration = ./labwc-environment.nix;
|
||||
}
|
||||
3
tests/modules/services/labwc/environment
Normal file
3
tests/modules/services/labwc/environment
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
XDG_CURRENT_DESKTOP=labwc:wlroots
|
||||
XKB_DEFAULT_LAYOUT=us
|
||||
WLR_XWAYLAND=
|
||||
18
tests/modules/services/labwc/labwc-autostart.nix
Normal file
18
tests/modules/services/labwc/labwc-autostart.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
package = null;
|
||||
autostart = [
|
||||
"wayvnc &"
|
||||
"waybar &"
|
||||
"swaybg -c '#113344' >/dev/null 2>&1 &"
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
labwcAutostart=home-files/.config/labwc/autostart
|
||||
|
||||
assertFileExists "$labwcAutostart"
|
||||
assertFileContent $(normalizeStorePaths "$labwcAutostart") "${./autostart}"
|
||||
'';
|
||||
}
|
||||
18
tests/modules/services/labwc/labwc-environment.nix
Normal file
18
tests/modules/services/labwc/labwc-environment.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
package = null;
|
||||
xwayland.enable = false;
|
||||
environment = [
|
||||
"XDG_CURRENT_DESKTOP=labwc:wlroots"
|
||||
"XKB_DEFAULT_LAYOUT=us"
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
labwcEnvironment=home-files/.config/labwc/environment
|
||||
|
||||
assertFileExists "$labwcEnvironment"
|
||||
assertFileContent "$labwcEnvironment" "${./environment}"
|
||||
'';
|
||||
}
|
||||
105
tests/modules/services/labwc/labwc-menu.nix
Normal file
105
tests/modules/services/labwc/labwc-menu.nix
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
package = null;
|
||||
menu = [
|
||||
{
|
||||
label = "pipemenu";
|
||||
menuId = "menu";
|
||||
execute = "/home/user/nix/scripts/pipe.sh";
|
||||
}
|
||||
{
|
||||
menuId = "client-menu";
|
||||
label = "Client Menu";
|
||||
icon = "path";
|
||||
items = [
|
||||
{
|
||||
label = "Maximize";
|
||||
icon = "Max";
|
||||
action = {
|
||||
name = "ToggleMaximize";
|
||||
};
|
||||
}
|
||||
{
|
||||
label = "Fullscreen";
|
||||
action = {
|
||||
name = "ToggleFullscreen";
|
||||
};
|
||||
}
|
||||
{
|
||||
label = "Always on Top";
|
||||
action = {
|
||||
name = "ToggleAlwaysOnTop";
|
||||
};
|
||||
}
|
||||
{
|
||||
label = "Alacritty";
|
||||
action = {
|
||||
name = "Execute";
|
||||
command = "alacritty";
|
||||
};
|
||||
}
|
||||
{
|
||||
separator = { };
|
||||
}
|
||||
{
|
||||
label = "Workspace";
|
||||
menuId = "workspace";
|
||||
icon = "";
|
||||
items = [
|
||||
{
|
||||
label = "Move Left";
|
||||
action = {
|
||||
name = "SendToDesktop";
|
||||
to = "left";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
separator = {
|
||||
label = "sep";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
menuId = "menu-two";
|
||||
label = "Client Menu Two";
|
||||
icon = "menu-two";
|
||||
items = [
|
||||
{
|
||||
label = "Menu In Menu";
|
||||
menuId = "menu-in-menu";
|
||||
items = [
|
||||
{
|
||||
label = "Menu In Menu In Menu";
|
||||
menuId = "menu-in-menu-in-menu";
|
||||
icon = "menu-in-menu-in-menu";
|
||||
items = [
|
||||
{
|
||||
label = "Move Right";
|
||||
action = {
|
||||
name = "SendToDesktop";
|
||||
to = "right";
|
||||
};
|
||||
}
|
||||
{ menuId = "fourth"; }
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
# <!-- A submenu defined elsewhere, uses external label and icon attributes -->
|
||||
{ menuId = ""; }
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
labwcMenuConfig=home-files/.config/labwc/menu.xml
|
||||
|
||||
assertFileExists "$labwcMenuConfig"
|
||||
assertFileContent "$labwcMenuConfig" "${./menu.xml}"
|
||||
'';
|
||||
}
|
||||
81
tests/modules/services/labwc/labwc-rc.nix
Normal file
81
tests/modules/services/labwc/labwc-rc.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
package = null;
|
||||
rc = {
|
||||
theme = {
|
||||
name = "nord";
|
||||
cornerRadius = 8;
|
||||
font = {
|
||||
"@name" = "FiraCode";
|
||||
"@place" = "";
|
||||
"@size" = "11";
|
||||
};
|
||||
};
|
||||
mouse = {
|
||||
default = { };
|
||||
context = {
|
||||
"@name" = "Root";
|
||||
mousebind = [
|
||||
{
|
||||
"@button" = "Right";
|
||||
"@action" = "Press";
|
||||
action = {
|
||||
"@name" = "ShowMenu";
|
||||
"@menu" = "some-custom-menu";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
keyboard = {
|
||||
default = true;
|
||||
keybind = [
|
||||
{
|
||||
"@key" = "W-Return";
|
||||
action = {
|
||||
"@command" = "alacritty";
|
||||
"@name" = "Execute";
|
||||
};
|
||||
}
|
||||
{
|
||||
"@key" = "W-Esc";
|
||||
action = {
|
||||
"@name" = "Execute";
|
||||
"@command" = "foot";
|
||||
};
|
||||
}
|
||||
{
|
||||
"@key" = "W-1";
|
||||
action = {
|
||||
"@to" = "1";
|
||||
"@name" = "GoToDesktop";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
desktops = {
|
||||
"@number" = 10;
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
<!-- ExtraConfig -->
|
||||
<tabletTool motion="absolute" relativeMotionSensitivity="1.0" />
|
||||
<libinput>
|
||||
<device category="default">
|
||||
<naturalScroll></naturalScroll>
|
||||
<leftHanded></leftHanded>
|
||||
<pointerSpeed></pointerSpeed>
|
||||
<accelProfile></accelProfile>
|
||||
</device>
|
||||
</libinput>
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
labwcConfig=home-files/.config/labwc/rc.xml
|
||||
|
||||
assertFileExists "$labwcConfig"
|
||||
assertFileContent "$labwcConfig" "${./rc.xml}"
|
||||
'';
|
||||
}
|
||||
38
tests/modules/services/labwc/menu.xml
Normal file
38
tests/modules/services/labwc/menu.xml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- ### This file was generated with Nix. Don't modify this file directly. -->
|
||||
<openbox_menu>
|
||||
<menu id="menu" label="pipemenu" execute="/home/user/nix/scripts/pipe.sh" />
|
||||
<menu id="client-menu" label="Client Menu" icon="path">
|
||||
<item label="Maximize" icon="Max">
|
||||
<action name="ToggleMaximize" />
|
||||
</item>
|
||||
<item label="Fullscreen">
|
||||
<action name="ToggleFullscreen" />
|
||||
</item>
|
||||
<item label="Always on Top">
|
||||
<action name="ToggleAlwaysOnTop" />
|
||||
</item>
|
||||
<item label="Alacritty">
|
||||
<action name="Execute" command="alacritty" />
|
||||
</item>
|
||||
<separator />
|
||||
<menu id="workspace" label="Workspace" icon="">
|
||||
<item label="Move Left">
|
||||
<action name="SendToDesktop" to="left" />
|
||||
</item>
|
||||
</menu>
|
||||
<separator label="sep" />
|
||||
</menu>
|
||||
<menu id="menu-two" label="Client Menu Two" icon="menu-two">
|
||||
<menu id="menu-in-menu" label="Menu In Menu">
|
||||
<menu id="menu-in-menu-in-menu" label="Menu In Menu In Menu" icon="menu-in-menu-in-menu">
|
||||
<item label="Move Right">
|
||||
<action name="SendToDesktop" to="right" />
|
||||
</item>
|
||||
<menu id="fourth" />
|
||||
</menu>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu id="" />
|
||||
|
||||
</openbox_menu>
|
||||
41
tests/modules/services/labwc/rc.xml
Normal file
41
tests/modules/services/labwc/rc.xml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- ### This file was generated with Nix. Don't modify this file directly. -->
|
||||
<labwc_config>
|
||||
<desktops number="10" />
|
||||
<keyboard>
|
||||
<default />
|
||||
<keybind key="W-Return">
|
||||
<action name="Execute" command="alacritty" />
|
||||
</keybind>
|
||||
<keybind key="W-Esc">
|
||||
<action name="Execute" command="foot" />
|
||||
</keybind>
|
||||
<keybind key="W-1">
|
||||
<action name="GoToDesktop" to="1" />
|
||||
</keybind>
|
||||
</keyboard>
|
||||
<mouse>
|
||||
<default />
|
||||
<context name="Root">
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="ShowMenu" menu="some-custom-menu" />
|
||||
</mousebind>
|
||||
</context>
|
||||
</mouse>
|
||||
<theme>
|
||||
<cornerRadius>8</cornerRadius>
|
||||
<font place="" name="FiraCode" size="11" />
|
||||
<name>nord</name>
|
||||
</theme>
|
||||
<!-- ExtraConfig -->
|
||||
<tabletTool motion="absolute" relativeMotionSensitivity="1.0" />
|
||||
<libinput>
|
||||
<device category="default">
|
||||
<naturalScroll></naturalScroll>
|
||||
<leftHanded></leftHanded>
|
||||
<pointerSpeed></pointerSpeed>
|
||||
<accelProfile></accelProfile>
|
||||
</device>
|
||||
</libinput>
|
||||
|
||||
</labwc_config>
|
||||
Loading…
Add table
Add a link
Reference in a new issue