1
0
Fork 0
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:
aabccd021 2022-09-09 07:42:53 +07:00 committed by Robert Helgesson
parent 342a1d6823
commit 5828309542
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
8 changed files with 88 additions and 1 deletions

View file

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

View file

@ -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.
'';
}
];
};
}

View file

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

View file

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

View file

@ -0,0 +1,4 @@
{
vifm-example-settings = ./example-settings.nix;
vifm-empty-settings = ./empty-settings.nix;
}

View file

@ -0,0 +1,11 @@
{ ... }:
{
programs.vifm.enable = true;
test.stubs.vifm = { };
nmt.script = ''
assertPathNotExists home-files/.config/vifm
'';
}

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