diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 9793d5c3f..0ee4ce036 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -101,6 +101,12 @@ github = "diniamo"; githubId = 55629891; }; + dudeofawesome = { + name = "Louis Orleans"; + email = "louis@orleans.io"; + github = "dudeofawesome"; + githubId = 1683595; + }; dwagenk = { email = "dwagenk@mailbox.org"; github = "dwagenk"; diff --git a/modules/modules.nix b/modules/modules.nix index dbeebfbf7..f48d8972c 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -193,6 +193,7 @@ let ./programs/poetry.nix ./programs/powerline-go.nix ./programs/pqiv.nix + ./programs/process-compose.nix ./programs/pubs.nix ./programs/pyenv.nix ./programs/pylint.nix diff --git a/modules/programs/process-compose.nix b/modules/programs/process-compose.nix new file mode 100644 index 000000000..902bd502c --- /dev/null +++ b/modules/programs/process-compose.nix @@ -0,0 +1,83 @@ +{ config, lib, pkgs, ... }: +let + inherit (lib) mkEnableOption mkPackageOption mkIf mkOption types; + + cfg = config.programs.process-compose; + + settingsFormat = pkgs.formats.yaml { }; +in { + meta.maintainers = [ lib.hm.maintainers.dudeofawesome ]; + + options.programs.process-compose = { + enable = mkEnableOption "process-compose"; + + package = mkPackageOption pkgs "process-compose" { }; + + configDir = mkOption { + type = types.str; + default = if (pkgs.stdenv.targetPlatform.isDarwin) then + "Library/Application Support/process-compose/" + else + "$XDG_CONFIG_HOME/process-compose/"; + description = '' + The path to the config directory. + ''; + }; + + settings = mkOption { + type = settingsFormat.type; + default = null; + description = '' + Specify the configuration for process-compose. + + See https://f1bonacc1.github.io/process-compose/tui/#tui-state-settings for available options. + ''; + }; + + shortcuts = mkOption { + type = settingsFormat.type; + default = null; + description = '' + Specify shortcuts for process-compose. + + See https://f1bonacc1.github.io/process-compose/tui/#shortcuts-configuration for available options. + ''; + }; + + theme = mkOption { + type = settingsFormat.type; + default = null; + description = '' + Specify a theme for process-compose. + + See https://f1bonacc1.github.io/process-compose/tui/#tui-themes for available options. + ''; + }; + }; + + config = mkIf cfg.enable { + home = { + packages = [ cfg.package ]; + + file.process-compose-settings = { + enable = !builtins.isNull cfg.settings; + target = "${cfg.configDir}/settings.yaml"; + source = settingsFormat.generate "settings.yaml" cfg.settings; + }; + + file.process-compose-shortcuts = { + enable = !builtins.isNull cfg.shortcuts; + target = "${cfg.configDir}/shortcuts.yaml"; + source = settingsFormat.generate "shortcuts.yaml" { + shortcuts = cfg.shortcuts; + }; + }; + + file.process-compose-theme = { + enable = !builtins.isNull cfg.theme; + target = "${cfg.configDir}/theme.yaml"; + source = settingsFormat.generate "theme.yaml" cfg.theme; + }; + }; + }; +}