0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/vivid: init module (#345656)

This commit is contained in:
Arne Keller 2024-12-29 16:07:07 +01:00 committed by GitHub
commit e9d640eaf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 0 deletions

View file

@ -67,6 +67,8 @@
- [agorakit](https://github.com/agorakit/agorakit), an organization tool for citizens' collectives. Available with [services.agorakit](options.html#opt-services.agorakit.enable). - [agorakit](https://github.com/agorakit/agorakit), an organization tool for citizens' collectives. Available with [services.agorakit](options.html#opt-services.agorakit.enable).
- [vivid](https://github.com/sharkdp/vivid), a generator for LS_COLOR. Available as [programs.vivid](#opt-programs.vivid.enable).
- [waagent](https://github.com/Azure/WALinuxAgent), the Microsoft Azure Linux Agent (waagent) manages Linux provisioning and VM interaction with the Azure Fabric Controller. Available with [services.waagent](options.html#opt-services.waagent.enable). - [waagent](https://github.com/Azure/WALinuxAgent), the Microsoft Azure Linux Agent (waagent) manages Linux provisioning and VM interaction with the Azure Fabric Controller. Available with [services.waagent](options.html#opt-services.waagent.enable).
- [duckdns](https://www.duckdns.org), free dynamic DNS. Available with [services.duckdns](options.html#opt-services.duckdns.enable) - [duckdns](https://www.duckdns.org), free dynamic DNS. Available with [services.duckdns](options.html#opt-services.duckdns.enable)

View file

@ -317,6 +317,7 @@
./programs/usbtop.nix ./programs/usbtop.nix
./programs/vim.nix ./programs/vim.nix
./programs/virt-manager.nix ./programs/virt-manager.nix
./programs/vivid.nix
./programs/wavemon.nix ./programs/wavemon.nix
./programs/wayland/cardboard.nix ./programs/wayland/cardboard.nix
./programs/wayland/hyprlock.nix ./programs/wayland/hyprlock.nix

View file

@ -0,0 +1,63 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.programs.vivid;
in
{
options = {
programs.vivid = {
enable = lib.mkOption {
default = false;
description = "Whether to configure LS_COLORS with vivid.";
type = lib.types.bool;
};
package = lib.mkPackageOption pkgs "vivid" { example = "vivid"; };
theme = lib.mkOption {
default = "gruvbox-dark-soft";
description = "Theme to be used (see `vivid themes`)";
example = "solarized-dark";
type = lib.types.str;
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
programs =
let
interactiveShellInit = lib.mkAfter ''
export LS_COLORS="$(${lib.getExe cfg.package} generate ${cfg.theme})"
'';
enableLsColors = lib.mkOverride 999 false;
in
{
bash = {
inherit interactiveShellInit enableLsColors;
};
zsh = {
inherit interactiveShellInit enableLsColors;
};
};
assertions = [
{
assertion = !config.programs.bash.enableLsColors;
message = "`programs.vivid.enable` is incompatible with `programs.bash.enableLsColors`.";
}
{
assertion = !config.programs.zsh.enableLsColors;
message = "`programs.vivid.enable` is incompatible with `programs.zsh.enableLsColors`.";
}
];
};
meta.maintainers = with lib.maintainers; [ blackheaven ];
}