mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-19 14:53: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.
36 lines
780 B
Nix
36 lines
780 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.vim-vint;
|
|
|
|
yamlFormat = pkgs.formats.yaml { };
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.tomodachi94 ];
|
|
|
|
options = {
|
|
programs.vim-vint = {
|
|
enable = mkEnableOption "the Vint linter for Vimscript";
|
|
package = mkPackageOption pkgs "vim-vint" { nullable = true; };
|
|
|
|
settings = mkOption {
|
|
type = yamlFormat.type;
|
|
default = { };
|
|
description = ''
|
|
Configuration written to
|
|
{file}`$XDG_CONFIG_HOME/.vintrc.yaml`
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile.".vintrc.yaml".source =
|
|
yamlFormat.generate "vim-vint-config" cfg.settings;
|
|
};
|
|
}
|