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

treewide: implement auto importing for modules

Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-06-20 14:39:55 -05:00
parent fefeb0e928
commit 4fca600cb1
461 changed files with 72 additions and 474 deletions

View file

@ -1,66 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.lazydocker;
yamlFormat = pkgs.formats.yaml { };
inherit (pkgs.stdenv.hostPlatform) isDarwin;
in
{
meta.maintainers = [ lib.maintainers.hausken ];
options.programs.lazydocker = {
enable = lib.mkEnableOption "lazydocker, a simple terminal UI for both docker and docker compose";
package = lib.mkPackageOption pkgs "lazydocker" { nullable = true; };
settings = lib.mkOption {
type = yamlFormat.type;
default = {
commandTemplates.dockerCompose = "docker compose"; # Lazydocker uses docker-compose by default which will not work
};
example = lib.literalExpression ''
{
gui.theme = {
activeBorderColor = ["red" "bold"];
inactiveBorderColor = ["blue"];
};
commandTemplates.dockerCompose = "docker compose compose -f docker-compose.yml";
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/lazydocker/config.yml`
on Linux or on Darwin if [](#opt-xdg.enable) is set, otherwise
{file}`~/Library/Application Support/jesseduffield/lazydocker/config.yml`.
See
<https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md>
for supported values.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."Library/Application Support/jesseduffield/lazydocker/config.yml" =
lib.mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable))
{
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
xdg.configFile."lazydocker/config.yml" =
lib.mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
{
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
};
}