From cb8bb7b2665ae9e70571e8c9f526f0f8d1d35d94 Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 19 Feb 2024 15:03:29 +0900 Subject: [PATCH] Organzie nixvim, add basic alpha config --- home-manager/common/software/cli/default.nix | 4 +- home-manager/common/software/cli/nixvim.nix | 2 +- .../common/software/cli/nixvim/alpha.nix | 67 +++++++++++++++++++ .../cli/{nixvim-base.nix => nixvim/base.nix} | 1 + home-manager/small.nix | 6 +- 5 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 home-manager/common/software/cli/nixvim/alpha.nix rename home-manager/common/software/cli/{nixvim-base.nix => nixvim/base.nix} (99%) diff --git a/home-manager/common/software/cli/default.nix b/home-manager/common/software/cli/default.nix index a45d2809..06c4d583 100644 --- a/home-manager/common/software/cli/default.nix +++ b/home-manager/common/software/cli/default.nix @@ -1,4 +1,4 @@ -{ hostname, ... }: { +{ ... }: { imports = [ ./bash.nix ./btop.nix @@ -9,4 +9,4 @@ ./ssh.nix ./nixvim.nix ]; -} \ No newline at end of file +} diff --git a/home-manager/common/software/cli/nixvim.nix b/home-manager/common/software/cli/nixvim.nix index ecf0a81f..d28ae404 100644 --- a/home-manager/common/software/cli/nixvim.nix +++ b/home-manager/common/software/cli/nixvim.nix @@ -1,5 +1,5 @@ { ... }: { - imports = [ ./nixvim-base.nix ]; + imports = [ ./nixvim/base.nix ]; programs.nixvim = { plugins = { diff --git a/home-manager/common/software/cli/nixvim/alpha.nix b/home-manager/common/software/cli/nixvim/alpha.nix new file mode 100644 index 00000000..a2c89152 --- /dev/null +++ b/home-manager/common/software/cli/nixvim/alpha.nix @@ -0,0 +1,67 @@ +{...}: { + programs.nixvim.plugins.alpha = { + enable = true; + layout = [ + { + type = "padding"; + val = 2; + } + { + opts = { + hl = "Type"; + position = "center"; + }; + type = "text"; + val = [ + "███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗" + "████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║" + "██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║" + "██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║" + "██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║" + "╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" + ]; + } + { + type = "padding"; + val = 2; + } + { + type = "group"; + val = [ + { + on_press = { + __raw = "function() vim.cmd[[ene]] end"; + }; + opts = { + shortcut = "n"; + }; + type = "button"; + val = " New file"; + } + { + on_press = { + __raw = "function() vim.cmd[[qa]] end"; + }; + opts = { + shortcut = "q"; + }; + type = "button"; + val = " Quit Neovim"; + } + ]; + } + { + type = "padding"; + val = 2; + } + { + opts = { + hl = "Keyword"; + position = "center"; + }; + type = "text"; + val = "Inspiring quote here."; + } + ]; + }; +} diff --git a/home-manager/common/software/cli/nixvim-base.nix b/home-manager/common/software/cli/nixvim/base.nix similarity index 99% rename from home-manager/common/software/cli/nixvim-base.nix rename to home-manager/common/software/cli/nixvim/base.nix index 3dcf66dc..6c772ab1 100644 --- a/home-manager/common/software/cli/nixvim-base.nix +++ b/home-manager/common/software/cli/nixvim/base.nix @@ -1,5 +1,6 @@ { inputs, pkgs, lib, theme, ... }: { imports = [ + ./nixvim/alpha.nix inputs.nixvim.homeManagerModules.nixvim ] ++ lib.optional (builtins.isString theme) ../../../../stylix/${theme}/home-manager/nixvim.nix; diff --git a/home-manager/small.nix b/home-manager/small.nix index d9a71ccf..21617d02 100644 --- a/home-manager/small.nix +++ b/home-manager/small.nix @@ -1,9 +1,9 @@ -{ lib, config, pkgs, inputs, hostname, system, username, desktop, theme, hmStateVersion, ... }: { +{ lib, inputs, hostname, username, desktop, theme, hmStateVersion, ... }: { imports = [ # Common configs ./common/software/cli/bash.nix ./common/software/cli/git.nix - ./common/software/cli/nixvim-base.nix + ./common/software/cli/nixvim/base.nix ./common/software/cli/ssh.nix ./common/software/cli/btop.nix ./common/software/cli/starship.nix @@ -33,4 +33,4 @@ inputs.nur.overlay ]; }; -} \ No newline at end of file +}