1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

process-compose: add module

This commit is contained in:
Louis Orleans 2024-09-01 01:18:52 -07:00
parent c2cd2a52e0
commit c739322dec
3 changed files with 90 additions and 0 deletions

View file

@ -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";

View file

@ -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

View file

@ -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;
};
};
};
}