2024-08-23 17:39:18 +00:00
|
|
|
{ lib, ... }:
|
2024-10-06 19:25:34 +00:00
|
|
|
let
|
|
|
|
inherit (lib) mkOption types;
|
2024-08-23 17:39:18 +00:00
|
|
|
|
2024-10-06 19:25:34 +00:00
|
|
|
themeType = types.submodule (
|
|
|
|
{ config, ... }: {
|
|
|
|
options = {
|
|
|
|
source = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
description = "The path to the oh-my-posh theme to use.";
|
|
|
|
};
|
2024-08-23 17:39:18 +00:00
|
|
|
|
2024-10-06 19:25:34 +00:00
|
|
|
name = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
description = "The name of the theme.";
|
|
|
|
default = lib.strings.removeSuffix ".omp" (lib.strings.removeSuffix ".json" (builtins.baseNameOf config.source));
|
2024-08-23 17:39:18 +00:00
|
|
|
};
|
2024-10-06 19:25:34 +00:00
|
|
|
};
|
|
|
|
});
|
2024-08-23 17:39:18 +00:00
|
|
|
|
2024-10-06 19:25:34 +00:00
|
|
|
ompType = types.submodule (
|
|
|
|
{ config, ... }: {
|
|
|
|
options = {
|
|
|
|
theme = mkOption {
|
|
|
|
type = types.nullOr (types.either types.str themeType);
|
|
|
|
description = "The default theme.";
|
|
|
|
default = null;
|
|
|
|
};
|
2024-08-23 17:39:18 +00:00
|
|
|
|
2024-10-06 19:25:34 +00:00
|
|
|
additionalThemes = mkOption {
|
|
|
|
type = types.listOf themeType;
|
|
|
|
description = "A set of additional themes to install.";
|
|
|
|
default = [ ];
|
2024-08-23 17:39:18 +00:00
|
|
|
};
|
|
|
|
};
|
2024-10-06 19:25:34 +00:00
|
|
|
});
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
valhalla.users = mkOption {
|
|
|
|
type = types.attrsOf (types.submodule (
|
|
|
|
{ ... }: {
|
|
|
|
options = {
|
|
|
|
oh-my-posh = mkOption {
|
|
|
|
type = ompType;
|
|
|
|
description = "The Oh My Posh configuration to apply.";
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}));
|
2024-08-23 17:39:18 +00:00
|
|
|
};
|
2024-10-06 19:25:34 +00:00
|
|
|
};
|
|
|
|
}
|