This commit is contained in:
Patrick Neff 2024-09-19 01:48:11 +02:00
parent 88a3411f76
commit e6b5e6dc7a
32 changed files with 423 additions and 132 deletions

View File

@ -1,23 +1,31 @@
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
zstyle ':completion:*' completer _extensions _complete _approximate
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:complete:*' gain-privileges 1
#zstyle ':completion:*' use-cache on
#zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
#zstyle ':completion:*' group-name ''
#zstyle ':completion:*' file-list all
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' file-list all
zstyle ':completion:complete:*' gain-privileges 1
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
zstyle ':completion:*:descriptions' format '[%d]'
#zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
#zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
#zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
zstyle ':fzf-tab:complete:(cd|lsd|eza|nvim|vim|vi):*' fzf-preview 'eza -1 --color=always --icons=always $realpath'
zstyle ':fzf-tab:*' fzf-min-height 20
#zstyle ':fzf-tab:*' popup-min-size 80 12
#zstyle ':fzf-tab:*' popup-pad 0 0
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
zmodload zsh/complist
bindkey -M menuselect 'h' vi-backward-char

View File

@ -183,11 +183,11 @@
]
},
"locked": {
"lastModified": 1725234343,
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github"
},
"original": {
@ -225,11 +225,11 @@
]
},
"locked": {
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github"
},
"original": {
@ -383,11 +383,11 @@
]
},
"locked": {
"lastModified": 1724857454,
"narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"lastModified": 1725513492,
"narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"rev": "7570de7b9b504cfe92025dd1be797bf546f66528",
"type": "github"
},
"original": {
@ -485,11 +485,11 @@
]
},
"locked": {
"lastModified": 1726142087,
"narHash": "sha256-uT4TRd3PgreUD5sJaNioVfMemdyWFLoPHqN4AFszGmw=",
"lastModified": 1726308872,
"narHash": "sha256-d4vwO5N4RsLnCY7k5tY9xbdYDWQsY3RDMeUoIa4ms2A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "da8406a6ff556b86dc368e96ca8bd81b2704a91a",
"rev": "6c1a461a444e6ccb3f3e42bb627b510c3a722a57",
"type": "github"
},
"original": {
@ -506,11 +506,11 @@
]
},
"locked": {
"lastModified": 1724435763,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
"lastModified": 1726308872,
"narHash": "sha256-d4vwO5N4RsLnCY7k5tY9xbdYDWQsY3RDMeUoIa4ms2A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
"rev": "6c1a461a444e6ccb3f3e42bb627b510c3a722a57",
"type": "github"
},
"original": {
@ -595,11 +595,11 @@
]
},
"locked": {
"lastModified": 1726113560,
"narHash": "sha256-6pXnXYAKIkAQWzfbSBMTDlw2moyvSqZiR6QltTCi4jw=",
"lastModified": 1726299205,
"narHash": "sha256-v4DneIggoLBdypeghj4rMzYngKZ1FgDtYKaYDBkfShk=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "e2aaa29736ba7200012470f818f9111e41b77c1a",
"rev": "2da0565b4fa221f7a62e9cafa019cd00b99fdb9e",
"type": "github"
},
"original": {
@ -611,11 +611,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1726086728,
"narHash": "sha256-cW8RaE7XDx95GMhWF01fGe9j1thysEMiovnDGzCH7jk=",
"lastModified": 1726271736,
"narHash": "sha256-n2kXazdrh5+IvCZFrUq4z27n+OX70S6UPHxAI0pBg0w=",
"owner": "neovim",
"repo": "neovim",
"rev": "98ba65b8be8cb2dde839502357e70916c4a3e37a",
"rev": "67d6b6f27ed3016a2daf6037879d77becc2cfa8f",
"type": "github"
},
"original": {
@ -651,11 +651,11 @@
]
},
"locked": {
"lastModified": 1724561770,
"narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
"lastModified": 1726188813,
"narHash": "sha256-Vop/VRi6uCiScg/Ic+YlwsdIrLabWUJc57dNczp0eBc=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
"rev": "21fe31f26473c180390cfa81e3ea81aca0204c80",
"type": "github"
},
"original": {
@ -724,11 +724,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1725983898,
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
"lastModified": 1726062873,
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
"type": "github"
},
"original": {
@ -812,11 +812,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1726133505,
"narHash": "sha256-5Q7Io0J98z7UOswrruOuO/jJNduSB3PKFw/sDz0NX1A=",
"lastModified": 1726335481,
"narHash": "sha256-mVVi8++ti/cApXgLLHxVUruZGDNe+rlRqacvul9BcQE=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "4697b96a0124944929ecefa09d488c7997419e43",
"rev": "908721cdbd25efb05d0975ada5d980e89bba64fa",
"type": "github"
},
"original": {
@ -868,11 +868,11 @@
},
"nur": {
"locked": {
"lastModified": 1726152386,
"narHash": "sha256-7TOsJCHL/7ZCeV6sSsLwSn8I1iKG0c+d6nWdNqyMM0o=",
"lastModified": 1726339530,
"narHash": "sha256-AMoQBwy+KLVRDYffKSwsSnbkmvzfkuO0uLfWQWoXeaM=",
"owner": "nix-community",
"repo": "NUR",
"rev": "398549de21055089cb9445cf7f666390f61930da",
"rev": "d0a76d184032e1f97cc6fe162c4b207b699ba143",
"type": "github"
},
"original": {
@ -890,11 +890,11 @@
]
},
"locked": {
"lastModified": 1724584782,
"narHash": "sha256-7FfHv7b1jwMPSu9SPY9hdxStk8E6EeSwzqdvV69U4BM=",
"lastModified": 1726208959,
"narHash": "sha256-Bq2YtXyHhDpBrqDlJysQgbhvauyiYTQXt7d6xxZdRck=",
"owner": "NuschtOS",
"repo": "search",
"rev": "5a08d691de30b6fc28d58ce71a5e420f2694e087",
"rev": "4267d5c5b51591a9553eefbd12172da050ee3433",
"type": "github"
},
"original": {
@ -1032,11 +1032,11 @@
]
},
"locked": {
"lastModified": 1724833132,
"narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
"lastModified": 1725271838,
"narHash": "sha256-VcqxWT0O/gMaeWTTjf1r4MOyG49NaNxW4GHTO3xuThE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
"rev": "9fb342d14b69aefdf46187f6bb80a4a0d97007cd",
"type": "github"
},
"original": {

View File

@ -26,7 +26,7 @@
];
domain = "odie.home.arpa";
notes = rec {
root = "${homeDirectory}/Notes/";
root = "${homeDirectory}/Notes";
workspaces = {
general = "${root}/general";
games = "${root}/games";
@ -53,7 +53,16 @@
hostName = "vm";
}
// flakeLib.mkNixosConfiguration {
inherit inputs nixpkgs outputs vars flakeLib overlays;
inherit inputs nixpkgs outputs flakeLib overlays;
vars = vars // {
notes = rec {
root = "/mnt/c/Users/odie/Sync/norg";
workspaces = {
general = "${root}/general";
games = "${root}/games";
};
};
};
system = "x86_64-linux";
hostName = "wsl-dev";
}
@ -107,6 +116,12 @@
go = {
path = ./templates/go;
};
rust = {
path = ./templates/rust;
};
cpp = {
path = ./templates/cpp;
};
};
}
// flake-utils.lib.eachDefaultSystem (system: {

View File

@ -2,4 +2,5 @@
mkPkgs = import ./mkPkgs.nix;
mkNixosConfiguration = import ./mkNixosConfiguration.nix;
mkHomeConfiguration = import ./mkHomeConfiguration.nix;
mkNixvim = import ./mkNixvim.nix;
}

16
lib/mkNixvim.nix Normal file
View File

@ -0,0 +1,16 @@
{ inputs
, pkgs
, vars
, ...
}:
let
nixvim' = inputs.nixvim.legacyPackages.${pkgs.system};
module = {
inherit pkgs;
extraSpecialArgs = {
inherit inputs vars;
};
module = import ../modules/nixvim;
};
in
nixvim'.makeNixvimWithModule module

View File

@ -1,17 +1,23 @@
{ outputs
, inputs
{ inputs
, pkgs
, config
, lib
, vars
, ...
}:
let
flakeLib = import ../../../../lib;
neovim-ide = flakeLib.mkNixvim {
inherit pkgs inputs vars;
};
in
{
options = {
programs.neovim-ide.enable = lib.mkEnableOption "neovim-ide";
};
config = lib.mkIf config.programs.neovim-ide.enable {
home = {
packages = [ outputs.packages.${pkgs.system}.neovim-ide ];
packages = [ neovim-ide ];
sessionPath = [
"/home/odie/go/bin"

View File

@ -30,12 +30,16 @@
fzf.enable = mkDefault true;
git.enable = mkDefault true;
lf.enable = mkDefault true;
lsd.enable = mkDefault true;
#lsd.enable = mkDefault true;
eza.enable = mkDefault true;
ssh.enable = mkDefault true;
starship.enable = mkDefault true;
tmux.enable = mkDefault true;
zoxide.enable = mkDefault true;
zsh.enable = mkDefault true;
tldr.enable = mkDefault true;
dircolors.enable = mkDefault true;
dircolors.enableZshIntegration = mkDefault true;
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: lib.mkIf config.programs.direnv.enable {
{ lib, config, ... }: lib.mkIf config.programs.direnv.enable {
programs.direnv = {
enableZshIntegration = true;
config = {

View File

@ -0,0 +1,7 @@
{lib, config, ...}: lib.mkIf config.programs.eza.enable {
programs = {
eza = {
enableZshIntegration = true;
};
};
}

View File

@ -6,6 +6,7 @@
defaultOptions = [
"--height 40%"
"--border"
"--tmux"
];
tmux = {
enableShellIntegration = true;

View File

@ -1,8 +1,8 @@
{ pkgs, config, lib, ... }: lib.mkIf config.programs.lf.enable {
home = {
packages = with pkgs; [
chafa
#ctpv
#chafa
ctpv
];
file = {
".config/lf/icons" = {

View File

@ -3,11 +3,8 @@
zsh = {
defaultKeymap = "emacs";
dotDir = ".config/zsh";
shellAliases = {
j = "z";
ji = "zi";
};
initExtra = builtins.readFile ../../../../configs/home-manager/zsh/zshrc.zsh;
initExtraBeforeCompInit = builtins.readFile ../../../../configs/home-manager/zsh/zshrc_before_compinit.zsh;
autosuggestion.enable = true;
completionInit = ''
autoload -U compinit bashcompinit
@ -15,8 +12,8 @@
bashcompinit'';
history = {
path = "${config.xdg.cacheHome}/zsh_history";
save = 100000;
size = 100000;
save = 10000;
size = 10000;
share = true;
extended = true;
};
@ -29,18 +26,18 @@
"^[[A"
];
};
zplug = {
antidote = {
enable = true;
plugins = [
{ name = "zdharma-continuum/fast-syntax-highlighting"; }
{ name = "nix-community/nix-zsh-completions"; }
{ name = "zsh-users/zsh-completions"; }
"Aloxaf/fzf-tab"
"zdharma-continuum/fast-syntax-highlighting"
"nix-community/nix-zsh-completions"
"zsh-users/zsh-completions"
];
};
envExtra = ''
export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
export DOOMWADDIR=$HOME/Games/doom/IWADs
'';
shellAliases = {
eza = "eza --color=always --git --icons=always";
};
};
};
}

View File

@ -5,6 +5,8 @@
stateVersion = "23.11";
sessionVariables = {
EDITOR = "vim";
DIRENV_LOG_FORMAT = "$(tput setaf 7)$(tput dim)%s$(tput sgr0)";
DOOMWADDIR = "$HOME/Games/doom/IWADs";
};
};
}

View File

@ -39,6 +39,22 @@ _: {
expr = true;
};
}
{
key = "<M-h>";
action = ":vertical resize -1<CR>";
}
{
key = "<M-l>";
action = ":vertical resize +1<CR>";
}
{
key = "<M-j>";
action = ":resize +1<CR>";
}
{
key = "<M-k>";
action = ":resize -1<CR>";
}
{
key = "<M-K>";
action = ":m -2<CR>";

View File

@ -157,6 +157,7 @@ in
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
require('dap.ext.vscode').load_launchjs()
require('lspconfig').asm_lsp.setup({})

View File

@ -1,4 +1,8 @@
{pkgs, ...}: {
{ pkgs, ... }:
let
debuggers = { c = "lldb"; };
in
{
plugins.dap = {
enable = true;
extensions = {
@ -10,8 +14,17 @@
adapters = {
executables = {
gdb = {
id = "gdb";
command = "${pkgs.gdb}/bin/gdb";
args = ["--interpreter=dap" "--eval-command" "set pretty print on"];
args = [ "--interpreter=dap" "--quiet" "--eval-command" "set pretty print on" ];
};
cppdbg = {
id = "cppdbg";
command = "${pkgs.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7";
};
lldb = {
id = "lldb";
command = "${pkgs.llvmPackages.lldb}/bin/lldb-dap";
};
};
};
@ -22,9 +35,9 @@
{
name = "Launch";
request = "launch";
type = "gdb";
type = debuggers.c;
cwd = "\${workspaceFolder}";
stopOnEntry = false;
stopOnEntry = true;
runInTerminal = true;
program = {
__raw = ''
@ -35,9 +48,9 @@
{
name = "Launch with Arguments";
request = "launch";
type = "gdb";
type = debuggers.c;
cwd = "\${workspaceFolder}";
stopOnEntry = false;
stopOnEntry = true;
runInTerminal = true;
program = {
__raw = ''
@ -62,6 +75,7 @@
key = "<leader>db";
options = {
silent = true;
desc = "[dap] Toggle Breakpoint";
};
}
{
@ -69,6 +83,7 @@
key = "<leader>du";
options = {
silent = true;
desc = "[dap] Toggle UI";
};
}
{
@ -76,6 +91,7 @@
key = "<leader>dc";
options = {
silent = true;
desc = "[dap] Continue / Run Debug";
};
}
{
@ -83,6 +99,7 @@
key = "<leader>dC";
options = {
silent = true;
desc = "[dap] Rerun Last";
};
}
{
@ -90,6 +107,7 @@
key = "<leader>do";
options = {
silent = true;
desc = "[dap] Step over";
};
}
{
@ -97,6 +115,7 @@
key = "<leader>di";
options = {
silent = true;
desc = "[dap] Step in";
};
}
{
@ -104,6 +123,7 @@
key = "<leader>dO";
options = {
silent = true;
desc = "[dap] Step out";
};
}
{
@ -111,6 +131,7 @@
key = "<leader>dT";
options = {
silent = true;
desc = "[dap] Terminate Process";
};
}
{
@ -118,6 +139,7 @@
key = "<leader>dr";
options = {
silent = true;
desc = "[dap] Toggle REPL";
};
}
];

View File

@ -28,6 +28,16 @@
todo-comments.enable = true;
transparent.enable = true;
which-key.enable = true;
zen-mode.enable = true;
web-devicons.enable = true;
lazygit.enable = true;
cmake-tools = {
enable = true;
settings = {
cmake_build_directory = "build/\${variant:buildtype}";
};
};
};
extraPlugins = with pkgs.vimPlugins;

View File

@ -0,0 +1,6 @@
{
plugins.lsp.servers = {
clangd.enable = true;
#ccls.enable = true;
};
}

View File

@ -0,0 +1,5 @@
{
plugins.lsp.servers.cmake = {
enable = true;
};
}

View File

@ -5,11 +5,11 @@
./html.nix
./nix.nix
./rust.nix
./c.nix
./cmake.nix
];
plugins.lsp.servers = {
clangd.enable = true;
cmake.enable = true;
eslint.enable = true;
htmx.enable = true;
jsonls.enable = true;

View File

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: {
{ pkgs, lib, ... }: {
plugins.lualine = {
enable = true;
settings = {
@ -80,7 +80,6 @@
left = "";
right = "";
};
};
disabled_filetypes = {
statusline = [ ];
winbar = [
@ -98,6 +97,7 @@
};
};
};
};
extraPlugins = with pkgs.vimPlugins; [
lualine-lsp-progress
];

View File

@ -50,6 +50,7 @@
action = "<cmd>Neotree toggle<CR>";
options = {
silent = true;
desc = "[neotree] Toggle File Tree";
};
}
];

View File

@ -1,4 +1,4 @@
{vars, lib, inputs, ...}: {
{ vars, lib, ... }: {
plugins.neorg = {
enable = true;
modules = {
@ -30,9 +30,23 @@
author = vars.name;
};
};
"core.todo-introspector" = lib.nixvim.emptyTable;
"core.qol.todo_items" = {
config = {
create_todo_parents = true;
};
};
"core.presenter" = {
config = {
zen_mode = "zen-mode";
};
};
"core.integrations.nvim-cmp" = lib.nixvim.emptyTable;
"core.export.markdown" = lib.nixvim.emptyTable;
"core.summary" = lib.nixvim.emptyTable;
"core.tangle" = lib.nixvim.emptyTable;
"core.text-objects" = lib.nixvim.emptyTable;
"core.integrations.telescope" = lib.nixvim.emptyTable;
"core.ui.calendar" = lib.nixvim.emptyTable;
};
@ -41,18 +55,58 @@
{
key = "<leader>ni";
action = ":Neorg index<CR>";
options = {
silent = true;
desc = "[neorg] Index";
};
}
{
key = "<leader>nt";
key = "<localleader>nt";
action = ":Neorg toc<CR>";
options = {
silent = true;
desc = "[neorg] TOC";
};
}
{
key = "<leader>nw";
key = "<localleader>nw";
action = ":Telescope neorg switch-workspace<CR>";
options = {
silent = true;
desc = "[neorg] Switch Workspace";
};
}
{
key = "<leader>nc";
key = "<localleader>nc";
action = ":Neorg toggle-concealer<CR>";
options = {
silent = true;
desc = "[neorg] Toggle Concealer";
};
}
{
key = "<localleader>npn";
action = "<Plug>(neorg.presenter.next-page)";
options = {
silent = true;
desc = "[neorg] Presenter Next Page";
};
}
{
key = "<localleader>pp";
action = "<Plug>(neorg.presenter.previous-page)";
options = {
silent = true;
desc = "[neorg] Presenter Previous Page";
};
}
{
key = "<localleader>pc";
action = "<Plug>(neorg.presenter.close)";
options = {
silent = true;
desc = "[neorg] Presenter Close";
};
}
];
}

View File

@ -3,12 +3,25 @@
enable = true;
sources = {
code_actions = {
gitrebase.enable = true;
gitsigns.enable = true;
statix.enable = true;
};
diagnostics = {
statix.enable = true;
commitlint.enable = true;
cppcheck.enable = true;
cppcheck = {
enable = true;
settings = {
args = [
"--enable=warning,style,performance,portability"
"--template=gcc"
"--check-level=exhaustive"
"$FILENAME"
];
};
};
cmake_lint.enable = true;
};
formatting = {
phpcbf.enable = true;

View File

@ -28,6 +28,7 @@
action = "<cmd>Trouble workspace-diagnostics toggle<CR>";
options = {
silent = true;
desc = "[trouble] Toggle workspace diagnostics";
};
}
{
@ -35,6 +36,7 @@
action = "<cmd>TroubleToggle quickfix toggle<CR>";
options = {
silent = true;
desc = "[trouble] Toggle quickfix diagnostics";
};
}
];

View File

@ -6,6 +6,7 @@
action = "<cmd>UndotreeToggle<CR>";
options = {
silent = true;
desc = "[undotree] Toggle";
};
}
];

View File

@ -1,22 +0,0 @@
{
nixpkgs,
system,
inputs,
flakeLib,
vars,
overlays,
...
}: let
nixvim' = inputs.nixvim.legacyPackages.${system};
pkgs = flakeLib.mkPkgs {
inherit system nixpkgs overlays;
};
module = {
inherit pkgs;
extraSpecialArgs = {
inherit inputs vars;
};
module = import ../../modules/nixvim;
};
in
nixvim'.makeNixvimWithModule module

19
templates/cpp/default.nix Normal file
View File

@ -0,0 +1,19 @@
{ lib
, stdenv
, cmake
, ...
}:
stdenv.mkDerivation {
pname = "testing_app";
version = "0.0.0";
src = lib.cleanSource ./.;
nativeBuildInputs = [ cmake ];
buildInputs = [ ];
installPhase = ''
mkdir -p $out/bin
mv src/testing_app/testing_app $out/bin
'';
}

27
templates/cpp/flake.nix Normal file
View File

@ -0,0 +1,27 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/x86_64-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
};
outputs =
{ flake-utils
, nixpkgs
, ...
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
pkg = pkgs.callPackage ./. { };
shell = pkgs.callPackage ./shell.nix { inherit pkg; };
in
{
devShells.default = shell;
packages.default = pkg;
});
}

12
templates/cpp/shell.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs
, pkg
, gdb
, lldb
, python3Packages
, cmakeCurses
, ...
}: pkgs.mkShell {
name = "shell";
inputsFrom = [ pkg ];
packages = [ lldb gdb python3Packages.six cmakeCurses ];
}

67
templates/rust/flake.nix Normal file
View File

@ -0,0 +1,67 @@
{
outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ cargo2nix.overlays.default rust-overlay.overlays.default ];
};
rustPkgs = pkgs.rustBuilder.makePackageSet {
rustToolchain =pkgs.rust-bin.stable.latest.default;
packageFun = import ./Cargo.nix;
};
inherit (self.outputs.checks.${system}) pre-commit-check;
workspaceShell = rustPkgs.workspaceShell {
inherit (pre-commit-check) shellHook;
buildInputs = pre-commit-check.enabledPackages;
};
in
{
packages = rec {
hello-world = rustPkgs.workspace.cargo_test_flake { };
default = hello-world;
};
checks = {
pre-commit-check = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
cargo-check.enable = true;
clippy.enable = true;
rustfmt.enable = true;
};
};
};
formatter = pkgs.nixpkgs-fmt;
devShells = {
default = workspaceShell;
inherit (inputs.cargo2nix.outputs.devShells.${system}) bootstrap;
};
}
);
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
cargo2nix = {
url = "github:cargo2nix/cargo2nix";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.gitignore.follows = "gitignore";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}