2021-05-14 22:42:00 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.foot;
|
|
|
|
iniFormat = pkgs.formats.ini { };
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = with lib.maintainers; [ plabadens ];
|
|
|
|
|
|
|
|
options.programs.foot = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "Foot terminal";
|
2021-05-14 22:42:00 +02:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.foot;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.foot";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = "The foot package to install";
|
2021-05-14 22:42:00 +02:00
|
|
|
};
|
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
server.enable = mkEnableOption "Foot terminal server";
|
2021-05-14 22:42:00 +02:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = iniFormat.type;
|
|
|
|
default = { };
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2021-05-14 22:42:00 +02:00
|
|
|
Configuration written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{file}`$XDG_CONFIG_HOME/foot/foot.ini`. See <https://codeberg.org/dnkl/foot/src/branch/master/foot.ini>
|
2021-05-14 22:42:00 +02:00
|
|
|
for a list of available options.
|
|
|
|
'';
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2021-05-14 22:42:00 +02:00
|
|
|
{
|
|
|
|
main = {
|
|
|
|
term = "xterm-256color";
|
|
|
|
|
|
|
|
font = "Fira Code:size=11";
|
|
|
|
dpi-aware = "yes";
|
|
|
|
};
|
|
|
|
|
|
|
|
mouse = {
|
|
|
|
hide-when-typing = "yes";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions =
|
|
|
|
[ (hm.assertions.assertPlatform "programs.foot" pkgs platforms.linux) ];
|
|
|
|
|
2021-05-14 22:42:00 +02:00
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
2021-07-01 20:05:37 +02:00
|
|
|
xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) {
|
2021-05-14 22:42:00 +02:00
|
|
|
source = iniFormat.generate "foot.ini" cfg.settings;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services = mkIf cfg.server.enable {
|
|
|
|
foot = {
|
|
|
|
Unit = {
|
|
|
|
Description =
|
|
|
|
"Fast, lightweight and minimalistic Wayland terminal emulator.";
|
|
|
|
Documentation = "man:foot(1)";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
ExecStart = "${cfg.package}/bin/foot --server";
|
|
|
|
Restart = "on-failure";
|
2022-02-22 20:15:28 +01:00
|
|
|
OOMPolicy = "continue";
|
2021-05-14 22:42:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|