mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
vifm: add module
This commit is contained in:
parent
342a1d6823
commit
5828309542
8 changed files with 88 additions and 1 deletions
|
@ -7,6 +7,12 @@
|
|||
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1
|
||||
|
||||
{
|
||||
aabccd021 = {
|
||||
name = "Muhamad Abdurahman";
|
||||
email = "aabccd021@gmail.com";
|
||||
github = "aabccd021";
|
||||
githubId = 33031950;
|
||||
};
|
||||
abayomi185 = {
|
||||
name = "Yomi";
|
||||
email = "yomi+nix@yomitosh.com";
|
||||
|
|
|
@ -1760,6 +1760,16 @@ in {
|
|||
Eyes in i3, lxde or mate.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2024-10-11T08:23:19+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.vifm'.
|
||||
|
||||
Vifm is a curses based Vim-like file manager extended with some useful
|
||||
ideas from mutt.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -241,8 +241,9 @@ let
|
|||
./programs/translate-shell.nix
|
||||
./programs/urxvt.nix
|
||||
./programs/vdirsyncer.nix
|
||||
./programs/vim.nix
|
||||
./programs/vifm.nix
|
||||
./programs/vim-vint.nix
|
||||
./programs/vim.nix
|
||||
./programs/vscode.nix
|
||||
./programs/vscode/haskell.nix
|
||||
./programs/pywal.nix
|
||||
|
|
33
modules/programs/vifm.nix
Normal file
33
modules/programs/vifm.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
cfg = config.programs.vifm;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ lib.hm.maintainers.aabccd021 ];
|
||||
|
||||
options.programs.vifm = {
|
||||
enable = lib.mkEnableOption "vifm, a Vim-like file manager";
|
||||
|
||||
package = lib.mkPackageOption pkgs "vifm" { };
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = "mark h ~/";
|
||||
description = ''
|
||||
Extra lines added to the {file}`$XDG_CONFIG_HOME/vifm/vifmrc` file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."vifm/vifmrc" =
|
||||
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
||||
};
|
||||
}
|
|
@ -155,6 +155,7 @@ in import nmtSrc {
|
|||
./modules/programs/tmux
|
||||
./modules/programs/topgrade
|
||||
./modules/programs/translate-shell
|
||||
./modules/programs/vifm
|
||||
./modules/programs/vim-vint
|
||||
./modules/programs/vscode
|
||||
./modules/programs/watson
|
||||
|
|
4
tests/modules/programs/vifm/default.nix
Normal file
4
tests/modules/programs/vifm/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
vifm-example-settings = ./example-settings.nix;
|
||||
vifm-empty-settings = ./empty-settings.nix;
|
||||
}
|
11
tests/modules/programs/vifm/empty-settings.nix
Normal file
11
tests/modules/programs/vifm/empty-settings.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.vifm.enable = true;
|
||||
|
||||
test.stubs.vifm = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/vifm
|
||||
'';
|
||||
}
|
21
tests/modules/programs/vifm/example-settings.nix
Normal file
21
tests/modules/programs/vifm/example-settings.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.vifm = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
extraConfig = ''
|
||||
mark h ~/
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/vifm/vifmrc \
|
||||
${
|
||||
builtins.toFile "vifm-expected.conf" ''
|
||||
mark h ~/
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue