diff --git a/flake/perSystem.nix b/flake/perSystem.nix index 57dd4d6..51b052e 100644 --- a/flake/perSystem.nix +++ b/flake/perSystem.nix @@ -11,6 +11,7 @@ system, lib, self', + inputs', ... }: let inherit (inputs) nixpkgs; @@ -20,6 +21,7 @@ config = { allowUnfree = true; }; + overlays = [(_final: _prev: {inherit lib;})]; }; devShells.default = pkgs.mkShell { name = "nixos-shell"; @@ -36,6 +38,7 @@ inputsScope = lib.makeScope pkgs.newScope (self: { inherit inputs rootPath; srcs = self.callPackage (rootPath + "/_sources/generated.nix") {}; + inherit (inputs'.nixvim.legacyPackages) makeNixvim makeNixvimWithModule; }); in lib.packagesFromDirectoryRecursive { diff --git a/nixos/configurations/Akun/default.nix b/nixos/configurations/Akun/default.nix index d85239d..4c6df44 100644 --- a/nixos/configurations/Akun/default.nix +++ b/nixos/configurations/Akun/default.nix @@ -59,6 +59,7 @@ localsend zulip wechat + nixvim ]; environment.variables.EDITOR = "hx"; diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index e6ec0d6..22112ea 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -37,7 +37,6 @@ }; programs = { bash.enable = true; - nixvim.enable = true; guix.enable = true; dae.enable = true; openssh.enable = true; @@ -91,6 +90,7 @@ waypipe wineWow64Packages.waylandFull iperf3 + nixvim sbctl ]; diff --git a/nixos/modules/programs/nixvim/default.nix b/nixos/modules/programs/nixvim/default.nix deleted file mode 100644 index a86ca40..0000000 --- a/nixos/modules/programs/nixvim/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - lib, - config, - ... -}: let - cfg = config.youthlic.programs.nixvim; -in { - imports = lib.youthlic.loadImports ./.; - options = { - youthlic.programs.nixvim = { - enable = lib.mkEnableOption "nixvim"; - }; - }; - config = lib.mkIf cfg.enable { - programs.nixvim = { - enable = true; - enableMan = true; - colorschemes.gruvbox-material = { - enable = true; - autoLoad = true; - }; - plugins.lualine.enable = true; - }; - }; -} diff --git a/nixos/modules/programs/nixvim/option.nix b/nixos/modules/programs/nixvim/option.nix deleted file mode 100644 index cee4335..0000000 --- a/nixos/modules/programs/nixvim/option.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - config, - ... -}: let - cfg = config.youthlic.programs.nixvim; -in { - config = lib.mkIf cfg.enable { - programs.nixvim = { - opts = { - backspace = ["indent" "eol" "start"]; - tabstop = 4; - shiftwidth = 4; - expandtab = true; - shiftround = true; - autoindent = true; - nu = true; - rnu = true; - wildmenu = true; - hlsearch = false; - ignorecase = true; - smartcase = true; - completeopt = ["menu" "noselect"]; - cursorline = true; - termguicolors = true; - signcolumn = "yes"; - autoread = true; - title = true; - swapfile = false; - backup = false; - updatetime = 50; - mouse = "a"; - undofile = true; - exrc = true; - scrolloff = 5; - wrap = true; - splitright = true; - splitbelow = true; - }; - }; - }; -} diff --git a/overlays/additions/default.nix b/overlays/additions/default.nix index 4825574..32fbc04 100644 --- a/overlays/additions/default.nix +++ b/overlays/additions/default.nix @@ -9,6 +9,7 @@ in ./wallpapers.nix ./waydroid-script.nix ./rime-yuhaostar.nix + ./nixvim.nix ./pkgsNoCuda.nix ] diff --git a/overlays/additions/nixvim.nix b/overlays/additions/nixvim.nix new file mode 100644 index 0000000..43cd9ae --- /dev/null +++ b/overlays/additions/nixvim.nix @@ -0,0 +1,5 @@ +{outputs, ...}: _final: prev: let + inherit (prev.stdenv.hostPlatform) system; +in { + inherit (outputs.packages.${system}) nixvim; +} diff --git a/pkgs/nixvim/package.nix b/pkgs/nixvim/package.nix new file mode 100644 index 0000000..c01cf6b --- /dev/null +++ b/pkgs/nixvim/package.nix @@ -0,0 +1,13 @@ +{ + makeNixvimWithModule, + pkgs, + lib, +}: +makeNixvimWithModule { + inherit pkgs; + module = { + imports = with lib; youthlic.loadImports' ./. (filter (name: !hasSuffix "/package.nix" (toString name))); + enableMan = true; + plugins.lualine.enable = true; + }; +}