commiting for posterity
This commit is contained in:
parent
69e9b167cb
commit
10453abfb1
9 changed files with 266 additions and 170 deletions
28
flake.nix
28
flake.nix
|
@ -39,13 +39,15 @@
|
|||
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = {
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nixos-cosmic,
|
||||
darwin,
|
||||
...
|
||||
} @ inputs: let
|
||||
}@inputs:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
# TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
|
||||
|
@ -72,7 +74,8 @@
|
|||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = f:
|
||||
forAllSystems =
|
||||
f:
|
||||
builtins.listToAttrs (
|
||||
builtins.map (system: {
|
||||
name = system;
|
||||
|
@ -83,8 +86,7 @@
|
|||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
}
|
||||
);
|
||||
})
|
||||
systems
|
||||
}) systems
|
||||
);
|
||||
|
||||
mkSystem = import ./lib/mkSystem.nix {
|
||||
|
@ -96,9 +98,15 @@
|
|||
;
|
||||
};
|
||||
mkNeovim = import ./lib/mkNeovim.nix {
|
||||
inherit self overlays nixpkgs inputs;
|
||||
inherit
|
||||
self
|
||||
overlays
|
||||
nixpkgs
|
||||
inputs
|
||||
;
|
||||
};
|
||||
in rec {
|
||||
in
|
||||
rec {
|
||||
inherit self;
|
||||
# "nix fmt"
|
||||
formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
|
||||
|
@ -146,9 +154,11 @@
|
|||
# generate checks for "nix flake check --all-systems --no-build"
|
||||
checks.aarch64-darwin = builtins.listToAttrs (
|
||||
builtins.map (
|
||||
name: let
|
||||
name:
|
||||
let
|
||||
d = darwinConfigurations.${name}.system;
|
||||
in {
|
||||
in
|
||||
{
|
||||
name = "darwinConfiguration-" + d.name;
|
||||
value = d;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
};
|
||||
filetree = {
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
tabline = {
|
||||
|
@ -133,7 +133,6 @@
|
|||
indent = 2;
|
||||
padding = 1;
|
||||
}
|
||||
{section = "startup";}
|
||||
];
|
||||
};
|
||||
image.enable = true;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
{inputs, ...}: {
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
nixPath = [ "nixpkgs = ${inputs.nixpkgs}" ];
|
||||
# nixPath = ["nixpkgs = ${inputs.nixpkgs}"];
|
||||
extraOptions = ''
|
||||
warn-dirty = false
|
||||
'';
|
||||
channel.enable = false;
|
||||
|
||||
optimise = {
|
||||
automatic = true;
|
||||
|
@ -19,6 +19,7 @@
|
|||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
extra-nix-path = "nixpkgs=flake:nixpkgs";
|
||||
substituters = [
|
||||
"https://cache.nixos.org/?priority=10"
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# Packages installed with home-manager
|
||||
{pkgs, ...}:
|
||||
with pkgs;
|
||||
[
|
||||
with pkgs; [
|
||||
#general development
|
||||
just
|
||||
pkg-config
|
||||
|
@ -83,7 +82,6 @@ with pkgs;
|
|||
lua51Packages.lua
|
||||
lua51Packages.luarocks-nix
|
||||
codespell
|
||||
typst
|
||||
tree-sitter
|
||||
|
||||
#python
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
};
|
||||
hideSearchHighlight = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,5 +2,7 @@
|
|||
imports = [
|
||||
./keybinds.nix
|
||||
./languages.nix
|
||||
./latex.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -10,25 +10,16 @@
|
|||
in {
|
||||
vim = {
|
||||
keymaps = [
|
||||
(mkKeymap "n" "<leader>e" "<cmd>lua require('snacks').explorer()<cr>" "File Explorer")
|
||||
(mkKeymap "n" "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
|
||||
|
||||
# Snacks Picker Replaces Telescope!?
|
||||
(mkKeymap "n" "<leader><space>" "<cmd>lua require('snacks').picker.smart()" "Smart Find Files")
|
||||
(mkKeymap "n" "<leader>ff" "<cmd>lua require('snacks').picker.files()<cr>" "Find File")
|
||||
# (mkKeymap "n" "<leader>fr" "<cmd>lua require('snacks').picker.recent()<cr>" "Open Recent File")
|
||||
(mkKeymap "n" "<leader>fg" "<cmd>lua require('snacks').picker.grep()<cr>" "Grep Files")
|
||||
# (mkKeymap "n" "<leader>fb" "<cmd>lua require('snacks').picker.buffers()<cr>" "Grep Buffers")
|
||||
# (mkKeymap "n" "<leader>fh" "<cmd>lua require('snacks').picker.help()<cr>" "Grep Help Tags")
|
||||
# (mkKeymap "n" "<leader>fg" "<cmd>lua require('snacks').picker.git_files()<cr>" "Grep Git Files")
|
||||
# (mkKeymap "n" "<leader>fd" "<cmd>lua require('snacks').picker.diagnostics()<cr>" "Grep Diagnostics")
|
||||
# (mkKeymap "n" "<leader>fc" "<cmd>lua require('aerial').snacks_picker()<cr>" "Code Outline")
|
||||
|
||||
(mkKeymap "n" "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files")
|
||||
(mkKeymap "n" "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")
|
||||
(mkKeymap "n" "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
|
||||
# Lsp
|
||||
(mkKeymap "n" "gd" "<cmd>lua require('snacks').picker.lsp_definitions<cr>" "Goto Definition")
|
||||
(mkKeymap "n" "gD" "<cmd>lua require('snacks').picker.lsp_declarations<cr>" "Goto Declarations")
|
||||
(mkKeymap "n" "gI" "<cmd>lua require('snacks').picker.lsp_implementations<cr>" "Goto Implementation")
|
||||
(mkKeymap "n" "gr" "<cmd>lua require('snacks').picker.lsp_references<cr>" "Goto References")
|
||||
(mkKeymap "n" "gy" "<cmd>lua require('snacks').picker.lsp_type_definitions<cr>" "Goto T[y]pe Definition")
|
||||
(mkKeymap "n" "K" ":lua vim.lsp.buf.hover()<CR>" "Hover docs")
|
||||
(mkKeymap "n" "lr" ":lua vim.lsp.buf.rename()<CR>" "Rename")
|
||||
# (mkKeymap "n" "<leader>th" ":lua function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end<CR>" "Toggle Inlay Hints")
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,54 +1,61 @@
|
|||
{flake, ...}: {
|
||||
{
|
||||
flake,
|
||||
userConfig,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
vim = {
|
||||
lsp.servers.nixd.settings = {
|
||||
nixd.nixpkgs.expr = "import '${flake.inputs.nixpkgs}' { }";
|
||||
extraPackages = with pkgs; [
|
||||
python312Packages.pylatexenc
|
||||
];
|
||||
lsp = {
|
||||
nvim-docs-view.enable = true;
|
||||
inlayHints.enable = true;
|
||||
servers.nixd.settings = {
|
||||
nixd.nixpkgs.expr = ''import "${flake.inputs.nixpkgs}" { }'';
|
||||
options = {
|
||||
nixos = {
|
||||
expr = ''
|
||||
(let pkgs = import "${flake.inputs.nixpkgs}" {}; inherit (pkgs) lib; in (lib.evalModules { modules = (import "${flake.inputs.nixpkgs}/nixos/modules/module-list.nix"); check = false;})).options'';
|
||||
};
|
||||
nix_darwin = {
|
||||
expr = ''
|
||||
(let pkgs = import "${flake.inputs.nixpkgs}" {}; inherit (pkgs) lib; in (lib.evalModules { modules = import ("${flake.inputs.darwin}/modules/module-list.nix"); check = false;})).options'';
|
||||
};
|
||||
home_manager = {
|
||||
expr = ''
|
||||
(let pkgs = import "${flake.inputs.nixpkgs}" {}; lib = import "${flake.inputs.home-manager}/modules/lib/stdlib-extended.nix" pkgs.lib; in (lib.evalModules { modules = (import "${flake.inputs.home-manager}/modules/modules.nix") { inherit lib pkgs; check = false; };})).options'';
|
||||
};
|
||||
};
|
||||
mappings = {
|
||||
codeAction = "<leader>ca";
|
||||
goToDeclaration = "gD";
|
||||
goToDefinition = "gd";
|
||||
listReferences = "gr";
|
||||
goToType = "gy";
|
||||
hover = "K";
|
||||
nextDiagnostic = "<leader>d";
|
||||
openDiagnosticFloat = "<leader>df";
|
||||
renameSymbol = "rn";
|
||||
documentHighlight = null;
|
||||
listDocumentSymbols = null;
|
||||
listImplementations = null;
|
||||
listWorkspaceFolders = null;
|
||||
previousDiagnostic = null;
|
||||
removeWorkspaceFolder = null;
|
||||
signatureHelp = null;
|
||||
toggleFormatOnSave = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
languages = {
|
||||
enableDAP = true;
|
||||
haskell.enable = true;
|
||||
# haskell.enable = true;
|
||||
lua.enable = true;
|
||||
python.enable = true;
|
||||
python.format.type = "ruff";
|
||||
# markdown.extensions.markview-nvim = {
|
||||
# enable = true;
|
||||
# setupOpts = {
|
||||
# };
|
||||
# };
|
||||
nix = {
|
||||
lsp = {
|
||||
server = "nixd";
|
||||
options = {
|
||||
nixos = {
|
||||
expr = "(let
|
||||
pkgs = import '${flake.inputs.nixpkgs}' {};
|
||||
inherit (pkgs) lib;
|
||||
in (lib.evalModules {
|
||||
modules = import '${flake.inputs.nixpkgs}/nixos/modules/module-list.nix';
|
||||
check = false;
|
||||
})).options";
|
||||
};
|
||||
nix_darwin = {
|
||||
expr = "(let
|
||||
pkgs = import ''${flake.inputs.nixpkgs}' {};
|
||||
inherit (pkgs) lib;
|
||||
in (lib.evalModules {
|
||||
modules = import '${flake.inputs.darwin}/modules/module-list.nix';
|
||||
check = false;
|
||||
})).options";
|
||||
};
|
||||
home_manager = {
|
||||
expr = "(let
|
||||
pkgs = import '${flake.inputs.nixpkgs}' {};
|
||||
lib = import '${flake.inputs.home-manager}/modules/lib/stdlib-extended.nix' pkgs.lib;
|
||||
in (lib.evalModules {
|
||||
modules = (import '${flake.inputs.home-manager}/modules/modules.nix') {
|
||||
inherit lib pkgs;
|
||||
check = false;
|
||||
};
|
||||
})).options";
|
||||
};
|
||||
};
|
||||
};
|
||||
markdown.extensions.render-markdown-nvim = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
formatter.conform-nvim = {
|
||||
|
@ -69,5 +76,37 @@
|
|||
haskell = ["hlint"];
|
||||
};
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
fold = true;
|
||||
addDefaultGrammars = true;
|
||||
highlight = {
|
||||
additionalVimRegexHighlighting = true;
|
||||
};
|
||||
|
||||
context.enable = true;
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
};
|
||||
|
||||
visuals = {
|
||||
fidget-nvim = {
|
||||
setupOpts = {
|
||||
logger.level = "trace";
|
||||
};
|
||||
};
|
||||
};
|
||||
autocomplete.blink-cmp = {
|
||||
enable = true;
|
||||
# mappings = {
|
||||
# };
|
||||
|
||||
setupOpts = {
|
||||
completion = {
|
||||
ghost_text.enabled = false;
|
||||
list.selection.preselect = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
55
users/natalie/vim/latex.nix
Normal file
55
users/natalie/vim/latex.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{pkgs, ...}: {
|
||||
vim = {
|
||||
lazy.plugins.vimtex = {
|
||||
enabled = true;
|
||||
package = pkgs.vimPlugins.vimtex;
|
||||
lazy = true;
|
||||
ft = "tex";
|
||||
};
|
||||
|
||||
globals = {
|
||||
tex_flavor = "latex";
|
||||
maplocalleader = "\\";
|
||||
vimtex_compiler_method = "latexmk";
|
||||
vimtex_view_method = "zathura";
|
||||
vimtex_compiler_latexmk = {
|
||||
callback = 1;
|
||||
continuous = 1;
|
||||
executable = "latexmk";
|
||||
hooks = [];
|
||||
options = [
|
||||
"-verbose"
|
||||
"-file-line-error"
|
||||
"-synctex=1"
|
||||
"-interaction=nonstopmode"
|
||||
"-shell-escape"
|
||||
];
|
||||
};
|
||||
vimtex_log_ignore = [
|
||||
"Underfull"
|
||||
"Overfull"
|
||||
"specifier changed to"
|
||||
"Token not allowed in a PDF string"
|
||||
];
|
||||
vimtex_quickfix_ignore_filters = [
|
||||
"Underfull"
|
||||
"Overfull"
|
||||
];
|
||||
};
|
||||
|
||||
lsp = {
|
||||
servers = {
|
||||
texlab = {
|
||||
enable = true;
|
||||
cmd = ["${pkgs.texlab}/bin/texlab"];
|
||||
filetypes = ["tex"];
|
||||
};
|
||||
};
|
||||
};
|
||||
treesitter = {
|
||||
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
latex
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue