mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
fuzzel: add module
This commit is contained in:
parent
9384997717
commit
e0026e16a5
9 changed files with 109 additions and 0 deletions
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -117,6 +117,9 @@ Makefile @thiagokokada
|
|||
/modules/services/fusuma.nix @iosmanthus
|
||||
/tests/modules/services/fusuma @iosmanthus
|
||||
|
||||
/modules/programs/fuzzel.nix @Scrumplex
|
||||
/tests/modules/programs/fuzzel @Scrumplex
|
||||
|
||||
/modules/programs/gallery-dl.nix @marsam
|
||||
/tests/modules/programs/gallery-dl @marsam
|
||||
|
||||
|
|
|
@ -1015,6 +1015,14 @@ in
|
|||
A new module is available: 'programs.translate-shell'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-05-13T13:51:18+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.fuzzel'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ let
|
|||
./programs/firefox.nix
|
||||
./programs/fish.nix
|
||||
./programs/foot.nix
|
||||
./programs/fuzzel.nix
|
||||
./programs/fzf.nix
|
||||
./programs/gallery-dl.nix
|
||||
./programs/getmail.nix
|
||||
|
|
52
modules/programs/fuzzel.nix
Normal file
52
modules/programs/fuzzel.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib) literalExpression mkEnableOption mkPackageOption mkOption mkIf;
|
||||
|
||||
cfg = config.programs.fuzzel;
|
||||
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ lib.maintainers.Scrumplex ];
|
||||
|
||||
options.programs.fuzzel = {
|
||||
enable = mkEnableOption "fuzzel";
|
||||
|
||||
package = mkPackageOption pkgs "fuzzel" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
main = {
|
||||
terminal = "''${pkgs.foot}/bin/foot";
|
||||
layer = "overlay";
|
||||
};
|
||||
colors.background = "ffffffff";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration for fuzzel written to
|
||||
<filename>$XDG_CONFIG_HOME/fuzzel/fuzzel.ini</filename>. See
|
||||
<citerefentry><refentrytitle>fuzzel.ini</refentrytitle>
|
||||
<manvolnum>5</manvolnum></citerefentry> for a list of available options.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.fuzzel" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."fuzzel/fuzzel.ini" = mkIf (cfg.settings != { }) {
|
||||
source = iniFormat.generate "fuzzel.ini" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -157,6 +157,7 @@ import nmt {
|
|||
./modules/programs/borgmatic
|
||||
./modules/programs/firefox
|
||||
./modules/programs/foot
|
||||
./modules/programs/fuzzel
|
||||
./modules/programs/getmail
|
||||
./modules/programs/gnome-terminal
|
||||
./modules/programs/hexchat
|
||||
|
|
4
tests/modules/programs/fuzzel/default.nix
Normal file
4
tests/modules/programs/fuzzel/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
fuzzel-example-settings = ./example-settings.nix;
|
||||
fuzzel-empty-settings = ./empty-settings.nix;
|
||||
}
|
11
tests/modules/programs/fuzzel/empty-settings.nix
Normal file
11
tests/modules/programs/fuzzel/empty-settings.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.fuzzel.enable = true;
|
||||
|
||||
test.stubs.fuzzel = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/fuzzel
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
[border]
|
||||
width=6
|
||||
|
||||
[main]
|
||||
dpi-aware=yes
|
||||
font=Fira Code:size=11
|
23
tests/modules/programs/fuzzel/example-settings.nix
Normal file
23
tests/modules/programs/fuzzel/example-settings.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.fuzzel = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
|
||||
settings = {
|
||||
main = {
|
||||
font = "Fira Code:size=11";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
|
||||
border = { width = 6; };
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/fuzzel/fuzzel.ini \
|
||||
${./example-settings-expected.ini}
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue