1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/programs/amoco.nix
2025-10-07 11:06:11 -05:00

38 lines
838 B
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
types
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.amoco;
in
{
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
options.programs.amoco = {
enable = mkEnableOption "amoco";
package = mkPackageOption pkgs "amoco" { nullable = true; };
config = mkOption {
type = with types; either str path;
default = "";
description = ''
Config file for amoco as a Python configuration module.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.file.".config/amoco/config" = mkIf (cfg.config != "") {
source = if lib.isPath cfg.config then cfg.config else pkgs.writeText "amoco-config" cfg.config;
};
};
}