build(flake): enable for all systems

This commit is contained in:
iofq 2025-03-15 00:47:23 -05:00
parent 9028ed4893
commit 7e87ede672
5 changed files with 39 additions and 24 deletions

1
.envrc
View file

@ -1 +1,2 @@
watch_file nix/*
use flake . -Lv use flake . -Lv

View file

@ -19,15 +19,12 @@
gen-luarc, gen-luarc,
... ...
}: let }: let
supportedSystems = [ systems = builtins.attrNames nixpkgs.legacyPackages;
"x86_64-linux"
"aarch64-linux" # This is where the Neovim derivation is built.
"x86_64-darwin"
"aarch64-darwin"
];
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;}; neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
in in
flake-utils.lib.eachSystem supportedSystems (system: let flake-utils.lib.eachSystem systems (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
@ -43,9 +40,12 @@
nil nil
stylua stylua
luajitPackages.luacheck luajitPackages.luacheck
nvim-dev
]; ];
shellHook = '' shellHook = ''
ln -fs ${pkgs.nvim-luarc-json} .luarc.json ln -fs ${pkgs.nvim-luarc-json} .luarc.json
# allow quick iteration of lua configs
ln -Tfns $PWD/nvim ~/.config/nvim-dev
''; '';
}; };
in { in {

View file

@ -34,6 +34,7 @@ with lib;
# if the appName is something different than "nvim" # if the appName is something different than "nvim"
viAlias ? appName == "nvim", # Add a "vi" binary to the build output as an alias? viAlias ? appName == "nvim", # Add a "vi" binary to the build output as an alias?
vimAlias ? appName == "nvim", # Add a "vim" binary to the build output as an alias? vimAlias ? appName == "nvim", # Add a "vim" binary to the build output as an alias?
wrapRc ? true,
}: let }: let
# This is the structure of a plugin definition. # This is the structure of a plugin definition.
# Each plugin in the `plugins` argument list can also be defined as this attrset # Each plugin in the `plugins` argument list can also be defined as this attrset
@ -176,7 +177,7 @@ with lib;
+ extraMakeWrapperLuaCArgs + extraMakeWrapperLuaCArgs
+ " " + " "
+ extraMakeWrapperLuaArgs; + extraMakeWrapperLuaArgs;
wrapRc = true; wrapRc = wrapRc;
}); });
isCustomAppName = appName != null && appName != "nvim"; isCustomAppName = appName != null && appName != "nvim";

View file

@ -21,6 +21,7 @@ with final.pkgs.lib; let
eyeliner-nvim eyeliner-nvim
friendly-snippets friendly-snippets
gitsigns-nvim gitsigns-nvim
hunk-nvim
lazy-nvim lazy-nvim
luasnip luasnip
mini-nvim mini-nvim
@ -83,6 +84,17 @@ in {
]; ];
}; };
# This is meant to be used within a devshell.
# Instead of loading the lua Neovim configuration from
# the Nix store, it is loaded from $XDG_CONFIG_HOME/nvim-dev
nvim-dev = mkNeovim {
plugins = all-plugins;
extraPackages = basePackages ++ extraPackages;
appName = "nvim-dev";
wrapRc = false;
};
# This can be symlinked in the devShell's shellHook
nvim-luarc-json = final.mk-luarc-json { nvim-luarc-json = final.mk-luarc-json {
plugins = all-plugins; plugins = all-plugins;
}; };

View file

@ -38,22 +38,22 @@ return {
{ '<leader>nb', vim.cmd.DiffviewOpen, noremap = true, desc = 'diffview open' } { '<leader>nb', vim.cmd.DiffviewOpen, noremap = true, desc = 'diffview open' }
}, },
}, },
{ -- {
'NeogitOrg/neogit', -- 'NeogitOrg/neogit',
opts = { -- opts = {
disable_builtin_notifications = true, -- disable_builtin_notifications = true,
integrations = { -- integrations = {
diffview = true, -- diffview = true,
}, -- },
}, -- },
keys = { -- keys = {
{ -- {
'<leader>ng', -- '<leader>ng',
function() require('neogit').open() end, -- function() require('neogit').open() end,
{ noremap = true, silent = true, desc = 'Neogit' }, -- { noremap = true, silent = true, desc = 'Neogit' },
}, -- },
}, -- },
}, -- },
{ {
'EdenEast/nightfox.nvim', 'EdenEast/nightfox.nvim',
lazy = false, lazy = false,
@ -123,6 +123,7 @@ return {
end, end,
}, },
}, },
{ '/julienvincent/hunk.nvim', event = 'VeryLazy', opts = {} },
{ {
'gbprod/yanky.nvim', 'gbprod/yanky.nvim',
opts = { opts = {