foot: add module
Foot is a fast terminal emulator for Wayland. It can optionally be run in a client-server configuration. There are three unit tests to handle an empty configuration, the default configuration, and systemd service file generation.
This commit is contained in:
parent
73ecbd3722
commit
ff616b2734
11 changed files with 180 additions and 0 deletions
5
tests/modules/programs/foot/default.nix
Normal file
5
tests/modules/programs/foot/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
foot-example-settings = ./example-settings.nix;
|
||||
foot-empty-settings = ./empty-settings.nix;
|
||||
foot-systemd-user-service = ./systemd-user-service.nix;
|
||||
}
|
||||
16
tests/modules/programs/foot/empty-settings.nix
Normal file
16
tests/modules/programs/foot/empty-settings.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.foot.enable = true;
|
||||
|
||||
nixpkgs.overlays =
|
||||
[ (self: super: { foot = pkgs.writeScriptBin "dummy-foot" ""; }) ];
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/foot
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[main]
|
||||
dpi-aware=yes
|
||||
font=Fira Code:size=11
|
||||
term=xterm-256color
|
||||
|
||||
[mouse]
|
||||
hide-when-typing=yes
|
||||
29
tests/modules/programs/foot/example-settings.nix
Normal file
29
tests/modules/programs/foot/example-settings.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
package = pkgs.writeShellScriptBin "dummy-foot" "";
|
||||
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
||||
font = "Fira Code:size=11";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
|
||||
mouse = { hide-when-typing = "yes"; };
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/foot/foot.ini \
|
||||
${./example-settings-expected.ini}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@foot@/bin/foot --server
|
||||
Restart=on-failure
|
||||
|
||||
[Unit]
|
||||
After=graphical-session.target
|
||||
Description=Fast, lightweight and minimalistic Wayland terminal emulator.
|
||||
Documentation=man:foot(1)
|
||||
PartOf=graphical-session.target
|
||||
21
tests/modules/programs/foot/systemd-user-service.nix
Normal file
21
tests/modules/programs/foot/systemd-user-service.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
package = pkgs.writeShellScriptBin "dummy-foot" "" // { outPath = "@foot@"; };
|
||||
in {
|
||||
config = {
|
||||
programs.foot = {
|
||||
inherit package;
|
||||
enable = true;
|
||||
server.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/foot/foot.ini
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/foot.service \
|
||||
${./systemd-user-service-expected.service}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue