Allow configuring oh-my-posh
This commit is contained in:
parent
cf60f5f88e
commit
0021245415
55
lib/modules/packages/oh-my-posh.nix
Normal file
55
lib/modules/packages/oh-my-posh.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkOption
|
||||||
|
types
|
||||||
|
;
|
||||||
|
|
||||||
|
themeType = types.submodule (
|
||||||
|
{ config, ... }: {
|
||||||
|
options = {
|
||||||
|
path = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = "The path to the oh-my-posh theme to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
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.path));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
ompType = types.submodule (
|
||||||
|
{ config, ... }: {
|
||||||
|
options = {
|
||||||
|
theme = mkOption {
|
||||||
|
type = types.nullOr (types.either types.str themeType);
|
||||||
|
description = "The default theme.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
additionalThemes = mkOption {
|
||||||
|
type = types.listOf themeType;
|
||||||
|
description = "A set of additional themes to install.";
|
||||||
|
default = [];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
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 = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./packages/git.nix
|
./packages/git.nix
|
||||||
|
./packages/oh-my-posh.nix
|
||||||
./packages/rclone.nix
|
./packages/rclone.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./i18n.nix
|
./i18n.nix
|
||||||
|
|
Loading…
Reference in a new issue