From 1f6f0e87a0d3e67d8339f4d2151c38b7bfb5be4b Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 16 Jan 2025 14:37:33 -0600 Subject: [PATCH] adding option for default colorscheme --- config/default.nix | 4 ++-- flake.nix | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/default.nix b/config/default.nix index d083b87..74325df 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, options, ... }: { # Import all your configuration modules here imports = [ ./bufferline.nix ]; @@ -185,5 +185,5 @@ ]; - colorscheme = "pywal"; + colorscheme = if options.pywal then "pywal" else "tokyonight-storm"; } diff --git a/flake.nix b/flake.nix index 7cb3279..b78de04 100644 --- a/flake.nix +++ b/flake.nix @@ -22,25 +22,36 @@ let nixvimLib = nixvim.lib.${system}; nixvim' = nixvim.legacyPackages.${system}; - nixvimModule = { + nixvimModule = options: { inherit pkgs; module = import ./config; # import the module directly # You can use `extraSpecialArgs` to pass additional arguments to your module files extraSpecialArgs = { inherit pkgs; + inherit options; }; }; - nvim = nixvim'.makeNixvimWithModule nixvimModule; + nvim = options: nixvim'.makeNixvimWithModule (nixvimModule options); in { checks = { # Run `nix flake check .` to verify that your config is not broken - default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; + default = nixvimLib.check.mkTestDerivationFromNixvimModule (nixvimModule { options = { pywal = false; }; }); }; packages = { # Lets you run `nix run .` to start nixvim - default = nvim; + default = nvim { + options = { + pywal = false; + }; + }; + + pywal = nvim { + options = { + pywal = true; + }; + }; }; }; };