anup: add module
This commit is contained in:
parent
e4c7df3a95
commit
55091079d6
4 changed files with 81 additions and 0 deletions
39
modules/programs/anup.nix
Normal file
39
modules/programs/anup.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.anup;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
options.programs.anup = {
|
||||
enable = mkEnableOption "anup";
|
||||
package = mkPackageOption pkgs "anup" { nullable = true; };
|
||||
config = mkOption {
|
||||
type = with types; either str path;
|
||||
default = "";
|
||||
description = ''
|
||||
Config file for anup in RON (Rusty Object Notation) format.
|
||||
Available options can be found by looking at ~/.config/anup/config.ron.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
home.file.".config/anup/config.ron" = mkIf (cfg.config != "") {
|
||||
source = if lib.isPath cfg.config then cfg.config else pkgs.writeText "anup-config.ron" cfg.config;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue