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

amoco: add module

This commit is contained in:
Aguirre Matteo 2025-10-07 09:39:21 -03:00 committed by Austin Horstman
parent 6c5025e2bb
commit c6f8669f09
4 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,38 @@
{
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;
};
};
}

View file

@ -0,0 +1 @@
print("No example config found!")

View file

@ -0,0 +1 @@
{ amoco-settings = ./settings.nix; }

View file

@ -0,0 +1,14 @@
{
programs.amoco = {
enable = true;
config = ''
print("No example config found!")
'';
};
nmt.script = ''
assertFileExists home-files/.config/amoco/config
assertFileContent home-files/.config/amoco/config \
${./config}
'';
}