From 41ea217558fe2bb8c0c907de1fffedd51cf8c300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Tue, 15 Oct 2024 21:06:17 +0200 Subject: [PATCH] lsd: add support for icons.yaml This update introduces support for icons.yaml in the lsd module, enhancing the customization options for file icons. --- modules/programs/lsd.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/programs/lsd.nix b/modules/programs/lsd.nix index 0053a494f..beefef8c2 100644 --- a/modules/programs/lsd.nix +++ b/modules/programs/lsd.nix @@ -65,6 +65,30 @@ in { automatically set to `"custom"`. ''; }; + + icons = mkOption { + type = yamlFormat.type; + default = { }; + example = { + name = { + ".trash" = ""; + ".cargo" = ""; + }; + extension = { + "go" = ""; + "hs" = ""; + }; + filetype = { + "dir" = "📂"; + "file" = "📄"; + }; + }; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/lsd/icons.yaml`. See + for + details. + ''; + }; }; config = mkIf cfg.enable { @@ -91,6 +115,10 @@ in { source = yamlFormat.generate "lsd-colors" cfg.colors; }; + xdg.configFile."lsd/icons.yaml" = mkIf (cfg.icons != { }) { + source = yamlFormat.generate "lsd-icons" cfg.icons; + }; + xdg.configFile."lsd/config.yaml" = mkIf (cfg.settings != { }) { source = yamlFormat.generate "lsd-config" cfg.settings; };