mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 22:33:00 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
33 lines
757 B
Nix
33 lines
757 B
Nix
{ 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" { nullable = true; };
|
|
|
|
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 = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."vifm/vifmrc" =
|
|
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
|
};
|
|
}
|