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:
Pierre Labadens 2021-05-14 22:42:00 +02:00 committed by Robert Helgesson
parent 73ecbd3722
commit ff616b2734
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
11 changed files with 180 additions and 0 deletions

View 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;
}

View 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
'';
};
}

View file

@ -0,0 +1,7 @@
[main]
dpi-aware=yes
font=Fira Code:size=11
term=xterm-256color
[mouse]
hide-when-typing=yes

View 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}
'';
};
}

View file

@ -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

View 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}
'';
};
}