From 6a2b1631f2a1c3aee1355b599ccbd7aeced74eac Mon Sep 17 00:00:00 2001 From: Ellis Rahhal Date: Sun, 20 Apr 2025 23:40:53 -0700 Subject: [PATCH] added custom header option --- module.nix | 8 +++++++- plugins/startify.nix | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/module.nix b/module.nix index 9c4503b..a66d95f 100644 --- a/module.nix +++ b/module.nix @@ -12,7 +12,13 @@ enable-startify-cowsay = lib.mkOption { type = lib.types.bool; default = false; - description = "Enable startify"; + description = "Enable startify cowsay"; + }; + + startify-header = lib.mkOption { + type = lib.types.nullOr (lib.types.listOf lib.types.str); + default = null; + description = "Startify text/ascii image, if cowsay disabled"; }; }; } diff --git a/plugins/startify.nix b/plugins/startify.nix index 4e297af..135a66b 100644 --- a/plugins/startify.nix +++ b/plugins/startify.nix @@ -1,16 +1,21 @@ -{ config, ... }: +{ config, lib, ... }: +let + header-space = " "; +in { programs.nixvim = { plugins.startify = { enable = true; settings = { - custom_header = if config.nixvim-config.enable-startify-cowsay then null else [ - ''. _______ ____ ____.___ _____'' - ''. \ \ ____ ___\ \ / /| | / \'' - ''. / | \_/ __ \/ _ \ Y / | |/ \ / \'' - ''. / | \ ___( <_> ) / | / Y \'' - ''. \____|__ /\___ >____/ \___/ |___\____|__ /'' - ''. \/ \/ \/'' + custom_header = if config.nixvim-config.enable-startify-cowsay then null + else if config.nixvim-config.startify-header != null + then config.nixvim-config.startify-header else [ + ''${header-space} _______ ____ ____.___ _____'' + ''${header-space} \ \ ____ ___\ \ / /| | / \'' + ''${header-space} / | \_/ __ \/ _ \ Y / | |/ \ / \'' + ''${header-space}/ | \ ___( <_> ) / | / Y \'' + ''${header-space}\____|__ /\___ >____/ \___/ |___\____|__ /'' + ''${header-space} \/ \/ \/'' ]; }; };