mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
inori: init module (#6289)
This commit is contained in:
parent
ae84885d9b
commit
9676e8a52a
9 changed files with 179 additions and 0 deletions
|
|
@ -762,4 +762,10 @@
|
||||||
github = "LesVu";
|
github = "LesVu";
|
||||||
githubId = 66196443;
|
githubId = 66196443;
|
||||||
};
|
};
|
||||||
|
lunahd = {
|
||||||
|
name = "Miku B";
|
||||||
|
email = "lunab08@proton.me";
|
||||||
|
github = "miku4k";
|
||||||
|
githubId = 89653242;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
modules/misc/news/2025-04-18_10-58-18.nix
Normal file
9
modules/misc/news/2025-04-18_10-58-18.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
time = "2025-04-18T08:58:18+00:00";
|
||||||
|
condition = true;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.inori'.
|
||||||
|
|
||||||
|
inori is a client for the Music Player Daemon (MPD)
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -140,6 +140,7 @@ let
|
||||||
./programs/iamb.nix
|
./programs/iamb.nix
|
||||||
./programs/imv.nix
|
./programs/imv.nix
|
||||||
./programs/info.nix
|
./programs/info.nix
|
||||||
|
./programs/inori.nix
|
||||||
./programs/ion.nix
|
./programs/ion.nix
|
||||||
./programs/irssi.nix
|
./programs/irssi.nix
|
||||||
./programs/java.nix
|
./programs/java.nix
|
||||||
|
|
|
||||||
58
modules/programs/inori.nix
Normal file
58
modules/programs/inori.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkOption
|
||||||
|
mkEnableOption
|
||||||
|
mkPackageOption
|
||||||
|
literalExpression
|
||||||
|
mkIf
|
||||||
|
hm
|
||||||
|
maintainers
|
||||||
|
;
|
||||||
|
|
||||||
|
cfg = config.programs.inori;
|
||||||
|
|
||||||
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = [
|
||||||
|
hm.maintainers.lunahd
|
||||||
|
maintainers.stephen-huan
|
||||||
|
];
|
||||||
|
|
||||||
|
options.programs.inori = {
|
||||||
|
enable = mkEnableOption "inori";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "inori" { nullable = true; };
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = tomlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
seek_seconds = 10;
|
||||||
|
dvorak_keybindings = true;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to {file}`$XDG_CONFIG_HOME/inori/config.toml`.
|
||||||
|
|
||||||
|
See <https://github.com/eshrh/inori/blob/master/CONFIGURATION.md> for available options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."inori/config.toml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = tomlFormat.generate "config.toml" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -380,6 +380,7 @@ import nmtSrc {
|
||||||
./modules/programs/htop
|
./modules/programs/htop
|
||||||
./modules/programs/hyfetch
|
./modules/programs/hyfetch
|
||||||
./modules/programs/i3status
|
./modules/programs/i3status
|
||||||
|
./modules/programs/inori
|
||||||
./modules/programs/irssi
|
./modules/programs/irssi
|
||||||
./modules/programs/jujutsu
|
./modules/programs/jujutsu
|
||||||
./modules/programs/joplin-desktop
|
./modules/programs/joplin-desktop
|
||||||
|
|
|
||||||
9
tests/modules/programs/inori/default-config.nix
Normal file
9
tests/modules/programs/inori/default-config.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.inori.enable = true;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertPathNotExists home-files/.config/inori/config.toml
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
4
tests/modules/programs/inori/default.nix
Normal file
4
tests/modules/programs/inori/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
inori-default-config = ./default-config.nix;
|
||||||
|
inori-full-config = ./full-config.nix;
|
||||||
|
}
|
||||||
59
tests/modules/programs/inori/full-config.nix
Normal file
59
tests/modules/programs/inori/full-config.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.inori = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
seek_seconds = 10;
|
||||||
|
dvorak_keybindings = true;
|
||||||
|
keybindings = {
|
||||||
|
toggle_playpause = [
|
||||||
|
"p"
|
||||||
|
"<space>"
|
||||||
|
];
|
||||||
|
next_song = [
|
||||||
|
">"
|
||||||
|
"C-n"
|
||||||
|
];
|
||||||
|
previous_song = [
|
||||||
|
"<"
|
||||||
|
"C-p"
|
||||||
|
];
|
||||||
|
seek = "<right>";
|
||||||
|
seek_backwards = "<left>";
|
||||||
|
|
||||||
|
up = "k";
|
||||||
|
down = "j";
|
||||||
|
left = "h";
|
||||||
|
right = "l";
|
||||||
|
top = [
|
||||||
|
"g g"
|
||||||
|
"<home>"
|
||||||
|
];
|
||||||
|
bottom = [
|
||||||
|
"G"
|
||||||
|
"<end>"
|
||||||
|
];
|
||||||
|
quit = [
|
||||||
|
"<escape>"
|
||||||
|
"q"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
theme = {
|
||||||
|
status_artist.fg = "#fab387";
|
||||||
|
status_album.fg = "#89b4fa";
|
||||||
|
status_title = {
|
||||||
|
fg = "#cba6f7";
|
||||||
|
add_modifier = "BOLD";
|
||||||
|
};
|
||||||
|
album.fg = "#89b4fa";
|
||||||
|
playing.fg = "#a6e3a1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/inori/config.toml
|
||||||
|
assertFileContent home-files/.config/inori/config.toml ${./full-config.toml}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
32
tests/modules/programs/inori/full-config.toml
Normal file
32
tests/modules/programs/inori/full-config.toml
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
dvorak_keybindings = true
|
||||||
|
seek_seconds = 10
|
||||||
|
|
||||||
|
[keybindings]
|
||||||
|
bottom = ["G", "<end>"]
|
||||||
|
down = "j"
|
||||||
|
left = "h"
|
||||||
|
next_song = [">", "C-n"]
|
||||||
|
previous_song = ["<", "C-p"]
|
||||||
|
quit = ["<escape>", "q"]
|
||||||
|
right = "l"
|
||||||
|
seek = "<right>"
|
||||||
|
seek_backwards = "<left>"
|
||||||
|
toggle_playpause = ["p", "<space>"]
|
||||||
|
top = ["g g", "<home>"]
|
||||||
|
up = "k"
|
||||||
|
|
||||||
|
[theme.album]
|
||||||
|
fg = "#89b4fa"
|
||||||
|
|
||||||
|
[theme.playing]
|
||||||
|
fg = "#a6e3a1"
|
||||||
|
|
||||||
|
[theme.status_album]
|
||||||
|
fg = "#89b4fa"
|
||||||
|
|
||||||
|
[theme.status_artist]
|
||||||
|
fg = "#fab387"
|
||||||
|
|
||||||
|
[theme.status_title]
|
||||||
|
add_modifier = "BOLD"
|
||||||
|
fg = "#cba6f7"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue