This commit is contained in:
Patrick Neff 2024-09-12 22:22:26 +02:00
parent 5a4b306097
commit 14b2b85b0b
31 changed files with 8954 additions and 485 deletions

8413
flake.lock

File diff suppressed because it is too large Load Diff

139
flake.nix
View File

@ -1,12 +1,13 @@
{ {
description = "My Nix Configs"; description = "My Nix Configs";
outputs = { outputs =
self, { self
nixpkgs, , nixpkgs
flake-utils, , flake-utils
... , ...
}: let }:
let
inherit (self) inputs outputs; inherit (self) inputs outputs;
flakeLib = import ./lib; flakeLib = import ./lib;
@ -32,30 +33,9 @@
}; };
}; };
}; };
overlays = [ overlays = import ./overlays { inherit inputs; };
inputs.nixvim.overlays.default
inputs.nur.overlay
inputs.nixgl.overlay
outputs.overlays.kodi
];
in in
{ {
overlays = {
kodi = final: prev: {
kodi-standalone =
final.kodi-wayland.withPackages
(kodiPkgs:
with kodiPkgs; [
youtube
pvr-iptvsimple
keymap
inputstream-adaptive
inputstream-ffmpegdirect
requests-cache
inputstreamhelper
]);
};
};
nixosModules = { nixosModules = {
base = import ./modules/nixos/base; base = import ./modules/nixos/base;
desktop = import ./modules/nixos/desktop; desktop = import ./modules/nixos/desktop;
@ -66,7 +46,8 @@
server = import ./modules/nixos/server; server = import ./modules/nixos/server;
}; };
nixosConfigurations = nixosConfigurations =
flakeLib.mkNixosConfiguration { flakeLib.mkNixosConfiguration
{
inherit inputs nixpkgs outputs vars flakeLib overlays; inherit inputs nixpkgs outputs vars flakeLib overlays;
system = "x86_64-linux"; system = "x86_64-linux";
hostName = "vm"; hostName = "vm";
@ -98,7 +79,8 @@
binary-cache = import ./modules/home-manager/binary-cache; binary-cache = import ./modules/home-manager/binary-cache;
}; };
homeConfigurations = homeConfigurations =
flakeLib.mkHomeConfiguration { flakeLib.mkHomeConfiguration
{
inherit inputs outputs nixpkgs flakeLib overlays; inherit inputs outputs nixpkgs flakeLib overlays;
vars = vars // { hostName = "wanaheim"; }; vars = vars // { hostName = "wanaheim"; };
system = "x86_64-linux"; system = "x86_64-linux";
@ -118,16 +100,24 @@
}; };
system = "x86_64-linux"; system = "x86_64-linux";
}; };
templates = {
empty = {
path = ./templates/empty;
};
go = {
path = ./templates/go;
};
};
} }
// flake-utils.lib.eachDefaultSystem (system: { // flake-utils.lib.eachDefaultSystem (system: {
packages = { packages = {
neovim-ide = import ./pkgs/nixvim {inherit inputs system flakeLib nixpkgs vars;}; neovim-ide = import ./pkgs/nixvim { inherit inputs system flakeLib nixpkgs vars overlays; };
}; };
}); });
inputs = { inputs = {
# System
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
treesitter-grammars.url = "github:viperML/tree-sitter";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
nix-colors.url = "github:misterio77/nix-colors"; nix-colors.url = "github:misterio77/nix-colors";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
@ -137,18 +127,6 @@
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems";
@ -157,6 +135,72 @@
url = "github:nix-community/NixOS-WSL"; url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
flakelight = {
url = "github:nix-community/flakelight";
inputs.nixpkgs.follows = "nixpkgs";
};
# Neovim
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nvim-spell-de-utf8-dictionary = {
url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl";
flake = false;
};
nvim-spell-de-utf8-suggestions = {
url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.sug";
flake = false;
};
nvim-spell-de-latin1-dictionary = {
url = "http://ftp.vim.org/vim/runtime/spell/de.latin1.spl";
flake = false;
};
nvim-spell-de-latin1-suggestions = {
url = "http://ftp.vim.org/vim/runtime/spell/de.latin1.sug";
flake = false;
};
guihua = {
url = "github:ray-x/guihua.lua";
flake = false;
};
/*
neorg-overlay = {
url = "github:nvim-neorg/nixpkgs-neorg-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
*/
treesitter-grammars = {
url = "github:ratson/nix-treesitter";
inputs.flakelight.follows = "flakelight";
};
norg.url = "github:nvim-neorg/tree-sitter-norg/dev";
norg-meta.url = "github:nvim-neorg/tree-sitter-norg-meta";
neorg = {
url = "github:nvim-neorg/neorg";
flake = false;
};
neorg-telescope = {
url = "github:nvim-neorg/neorg-telescope";
flake = false;
};
# Misc
csleeptimer = { csleeptimer = {
url = "git+ssh://gitea@git.niederkassel.neff-steindesign.de/odie/csleeptimer.git"; url = "git+ssh://gitea@git.niederkassel.neff-steindesign.de/odie/csleeptimer.git";
inputs = { inputs = {
@ -165,12 +209,5 @@
systems.follows = "systems"; systems.follows = "systems";
}; };
}; };
neorg-overlay = {
url = "github:nvim-neorg/nixpkgs-neorg-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
}; };
} }

View File

@ -1,12 +1,13 @@
_: { {lib, ...}: {
imports = [ imports = [
./gitea ./gitea
./neovim-ide ./neovim-ide
./ghidra
]; ];
programs = { programs = {
lazygit.enable = true; lazygit.enable = lib.mkDefault true;
gitea-cli.enable = true; gitea-cli.enable = lib.mkDefault true;
neovim-ide.enable = true; neovim-ide.enable = lib.mkDefault true;
}; };
} }

View File

@ -0,0 +1,11 @@
{ pkgs, lib, config, ... }:
{
options = {
programs.ghidra.enable = lib.mkEnableOption "ghidra";
};
config = lib.mkIf config.programs.ghidra.enable {
home.packages = [
pkgs.ghidra
];
};
}

View File

@ -1,16 +1,28 @@
{ outputs
, inputs
, pkgs
, config
, lib
, ...
}:
{ {
outputs,
pkgs,
config,
lib,
...
}: {
options = { options = {
programs.neovim-ide.enable = lib.mkEnableOption "neovim-ide"; programs.neovim-ide.enable = lib.mkEnableOption "neovim-ide";
}; };
config = lib.mkIf config.programs.neovim-ide.enable { config = lib.mkIf config.programs.neovim-ide.enable {
home = { home = {
packages = [ outputs.packages.${pkgs.system}.neovim-ide ]; packages = [ outputs.packages.${pkgs.system}.neovim-ide ];
sessionPath = [
"/home/odie/go/bin"
];
file = {
"${config.xdg.configHome}/nvim/spell/de.utf-8.spl".source = inputs.nvim-spell-de-utf8-dictionary;
"${config.xdg.configHome}/nvim/spell/de.utf-8.sug".source = inputs.nvim-spell-de-utf8-suggestions;
"${config.xdg.configHome}/nvim/spell/de.latin1.spl".source = inputs.nvim-spell-de-latin1-dictionary;
"${config.xdg.configHome}/nvim/spell/de.latin1.sug".source = inputs.nvim-spell-de-latin1-suggestions;
};
}; };
}; };
} }

View File

@ -20,5 +20,11 @@
upower.enable = lib.mkDefault true; upower.enable = lib.mkDefault true;
gvfs.enable = lib.mkDefault true; gvfs.enable = lib.mkDefault true;
}; };
qt = {
enable = true;
platformTheme = "qt5ct";
style= "kvantum";
};
}; };
} }

View File

@ -13,6 +13,4 @@ lib.mkIf config.desktop.enable {
pulse.enable = true; pulse.enable = true;
wireplumber.enable = true; wireplumber.enable = true;
}; };
sound.enable = true;
} }

View File

@ -1,9 +1,8 @@
{ { lib
lib, , config
config, , vars
vars, , pkgs
pkgs, , ...
...
}: { }: {
imports = [ imports = [
./i18n.nix ./i18n.nix
@ -29,6 +28,7 @@
vicious vicious
]; ];
}; };
};
libinput = { libinput = {
enable = true; enable = true;
@ -44,5 +44,4 @@
}; };
}; };
}; };
};
} }

View File

@ -4,7 +4,12 @@ let
pattern, pattern,
indentSize ? 4, indentSize ? 4,
expandTab ? true, expandTab ? true,
spell ? false,
}: let }: let
spell =
if expandTab
then "true"
else "false";
expandtab = expandtab =
if expandTab if expandTab
then "true" then "true"
@ -19,6 +24,7 @@ let
setlocal.expandtab = ${expandtab} setlocal.expandtab = ${expandtab}
setlocal.shiftwidth = ${builtins.toString indentSize} setlocal.shiftwidth = ${builtins.toString indentSize}
setlocal.tabstop = ${builtins.toString indentSize} setlocal.tabstop = ${builtins.toString indentSize}
setlocal.spell = ${spell}
end end
''; '';
}; };
@ -39,5 +45,9 @@ in {
expandTab = false; expandTab = false;
indentSize = 4; indentSize = 4;
}) })
(mkFileTypeOptions {
pattern = ["*.norg"];
spell = true;
})
]; ];
} }

View File

@ -9,8 +9,62 @@
config = { config = {
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
performance = {
byteCompileLua = {
enable = true;
configs = true;
initLua = true;
nvimRuntime = true;
plugins = true;
};
combinePlugins = {
enable = false;
standalonePlugins = [
"nvim-treesitter"
];
};
};
#package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
extraPackages = with pkgs; [
fd
ripgrep
iferr
fswatch
reftools
libxcrypt
xz
icu74
nixpkgs-fmt
python3Packages.six
asm-lsp
];
extraPlugins = with pkgs.vimPlugins; [
{
plugin = go-nvim;
config = ''lua require("go").setup()'';
}
{
plugin = nvim-dap-go;
config = ''lua require("dap-go").setup()'';
}
{
plugin = telescope-dap-nvim;
config = ''lua require("telescope").load_extension("dap")'';
}
{
plugin = neorg-telescope;
}
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "guihua";
src = inputs.guihua;
};
}
];
}; };
} }

View File

@ -1,10 +1,10 @@
{ { lib
pkgs, , ...
lib, }:
... let
}: let
indentSize = 4; indentSize = 4;
in { in
{
options = { options = {
programs.nixvim.ai = { programs.nixvim.ai = {
enable = lib.mkEnableOption "AI functions"; enable = lib.mkEnableOption "AI functions";
@ -50,8 +50,7 @@ in {
mousemoveevent = true; mousemoveevent = true;
timeoutlen = 300; timeoutlen = 300;
list = true; list = true;
#spell = true; spelllang = [ "de" "en_us" ];
#spelllang = ["de" "en_us"];
helplang = "de"; helplang = "de";
laststatus = 3; laststatus = 3;
conceallevel = 0; conceallevel = 0;
@ -59,41 +58,7 @@ in {
signcolumn = "yes"; signcolumn = "yes";
foldlevel = 999; foldlevel = 999;
}; };
extraPackages = with pkgs; [
fd
ripgrep
iferr
fswatch
reftools
golines
richgo
gofumpt
govulncheck
mockgen
ginkgo
gotestsum
libxcrypt
xz
icu74
alejandra
vscode-extensions.ms-vscode.cpptools
nixpkgs-fmt
asm-lsp
];
extraPlugins = with pkgs.vimPlugins; [
{
plugin = go-nvim;
config = ''lua require("go").setup()'';
}
{
plugin = nvim-dap-go;
config = ''lua require("dap-go").setup()'';
}
{
plugin = telescope-dap-nvim;
config = ''lua require("telescope").load_extension("dap")'';
}
];
extraConfigLua = '' extraConfigLua = ''
vim.opt.undodir = vim.fn.stdpath("state") .. "/undo" vim.opt.undodir = vim.fn.stdpath("state") .. "/undo"
vim.opt.backupdir = vim.fn.stdpath("state") .. "/backup" vim.opt.backupdir = vim.fn.stdpath("state") .. "/backup"
@ -127,6 +92,9 @@ in {
''; '';
extraConfigLuaPre = '' extraConfigLuaPre = ''
vim.opt.runtimepath:prepend(',~/.config/nvim')
vim.opt.runtimepath:append(',~/.config/nvim/after')
local colors = require("catppuccin.palettes").get_palette("mocha") local colors = require("catppuccin.palettes").get_palette("mocha")
local pickers = require("telescope.pickers") local pickers = require("telescope.pickers")
local finders = require("telescope.finders") local finders = require("telescope.finders")

View File

@ -9,15 +9,9 @@
}; };
adapters = { adapters = {
executables = { executables = {
lldb = { gdb = {
command = "${pkgs.llvmPackages.lldb}/bin/lldb-vscode"; command = "${pkgs.gdb}/bin/gdb";
}; args = ["--interpreter=dap" "--eval-command" "set pretty print on"];
};
servers.codelldb = rec {
port = 13000;
executable = {
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
args = ["--port" (builtins.toString port)];
}; };
}; };
}; };
@ -28,10 +22,10 @@
{ {
name = "Launch"; name = "Launch";
request = "launch"; request = "launch";
type = "codelldb"; type = "gdb";
cwd = "\${workspaceFolder}"; cwd = "\${workspaceFolder}";
stopOnEntry = false; stopOnEntry = false;
runInTerminal = false; runInTerminal = true;
program = { program = {
__raw = '' __raw = ''
get_program get_program
@ -41,10 +35,10 @@
{ {
name = "Launch with Arguments"; name = "Launch with Arguments";
request = "launch"; request = "launch";
type = "codelldb"; type = "gdb";
cwd = "\${workspaceFolder}"; cwd = "\${workspaceFolder}";
stopOnEntry = false; stopOnEntry = false;
runInTerminal = false; runInTerminal = true;
program = { program = {
__raw = '' __raw = ''
get_program get_program

View File

@ -17,6 +17,7 @@
./treesitter.nix ./treesitter.nix
./trouble.nix ./trouble.nix
./undotree.nix ./undotree.nix
./notify.nix
]; ];
plugins = { plugins = {

View File

@ -1,6 +1,7 @@
{pkgs, ...}: { { pkgs, config, lib, ... }: {
plugins.lualine = { plugins.lualine = {
enable = true; enable = true;
settings = {
sections = { sections = {
lualine_a = [ "" "mode" ]; lualine_a = [ "" "mode" ];
lualine_b = [ lualine_b = [
@ -9,14 +10,13 @@
]; ];
lualine_c = [ lualine_c = [
{ {
name = "filetype"; __unkeyed-1 = "filetype";
extraConfig = {icon_only = true;}; icon_only = true;
} }
"filename" "filename"
"diagnostics" "diagnostics"
{ {
name = "lsp_progress"; __unkeyed-1 = "lsp_progress";
extraConfig = {
display_components = [ display_components = [
"lsp_client_name" "lsp_client_name"
[ [
@ -27,12 +27,11 @@
]; ];
colors = { colors = {
use = true; use = true;
lsp_client_name = { __raw = "colors.sapphire"; }; lsp_client_name = lib.nixvim.mkRaw "colors.sapphire";
percentage = { __raw = "colors.blue"; }; percentage = lib.nixvim.mkRaw "colors.blue";
spinner = { __raw = "colors.blue"; }; spinner = lib.nixvim.mkRaw "colors.blue";
title = { __raw = "colors.subtext1"; }; title = lib.nixvim.mkRaw "colors.subtext1";
message = { __raw = "colors.subtext0"; }; message = lib.nixvim.mkRaw "colors.subtext0";
};
}; };
} }
]; ];
@ -48,39 +47,41 @@
winbar = { winbar = {
lualine_x = [ lualine_x = [
{ {
name = "filename"; __unkeyed-1 = "filename";
extraConfig = {path = 1;}; path = 1;
} }
{ {
name = "filetype"; __unkeyed-1 = "filetype";
extraConfig = {icon_only = true;}; icon_only = true;
} }
]; ];
}; };
inactiveWinbar = { inactive_winbar = {
lualine_x = [ lualine_x = [
"diagnostics" "diagnostics"
{ {
name = "filename"; __unkeyed-1 = "filename";
extraConfig = {path = 1;}; path = 1;
} }
{ {
name = "filetype"; __unkeyed-1 = "filetype";
extraConfig = {icon_only = true;}; icon_only = true;
} }
]; ];
}; };
extensions = [ "fugitive" "lazy" "man" "neo-tree" "nvim-dap-ui" "quickfix" ]; extensions = [ "fugitive" "lazy" "man" "neo-tree" "nvim-dap-ui" "quickfix" ];
componentSeparators = { options = {
theme = "catppuccin";
component_separators = {
left = ""; left = "";
right = ""; right = "";
}; };
sectionSeparators = { section_separators = {
left = ""; left = "";
right = ""; right = "";
}; };
theme = "catppuccin"; };
disabledFiletypes = { disabled_filetypes = {
statusline = [ ]; statusline = [ ];
winbar = [ winbar = [
"help" "help"
@ -96,6 +97,7 @@
]; ];
}; };
}; };
};
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
lualine-lsp-progress lualine-lsp-progress
]; ];

View File

@ -1,52 +1,40 @@
{vars, ...}: { {vars, lib, inputs, ...}: {
plugins.neorg = { plugins.neorg = {
enable = true; enable = true;
modules = { modules = {
"core.defaults" = { "core.defaults" = lib.nixvim.emptyTable;
__empty = null;
};
"core.concealer" = {
config = {
init_open_folds = "auto";
};
};
"core.dirman" = { "core.dirman" = {
config = { config = {
inherit (vars.notes) workspaces; inherit (vars.notes) workspaces;
default_workspace = "general"; default_workspace = "general";
}; };
}; };
"core.concealer" = {
config = {
init_open_folds = "auto";
};
};
"core.completion" = { "core.completion" = {
config = { config = {
engine = "nvim-cmp"; engine = "nvim-cmp";
}; };
}; };
"core.summary" = {
__empty = null;
};
"core.tangle" = {
__empty = null;
};
"core.export" = { "core.export" = {
config = { config = {
export_dir = "~/Sync/notes-export"; export_dir = "~/Sync/notes-export";
}; };
}; };
"core.export.markdown" = {
__empty = null;
};
"core.esupports.metagen" = { "core.esupports.metagen" = {
config = { config = {
type = "auto"; type = "auto";
author = vars.name; author = vars.name;
}; };
}; };
"core.integrations.telescope" = { "core.export.markdown" = lib.nixvim.emptyTable;
__empty = null; "core.summary" = lib.nixvim.emptyTable;
}; "core.tangle" = lib.nixvim.emptyTable;
"core.ui.calendar" = { "core.integrations.telescope" = lib.nixvim.emptyTable;
__empty = null; "core.ui.calendar" = lib.nixvim.emptyTable;
};
}; };
}; };
keymaps = [ keymaps = [

View File

@ -13,7 +13,7 @@
formatting = { formatting = {
phpcbf.enable = true; phpcbf.enable = true;
goimports.enable = true; goimports.enable = true;
asmfmt.enable = true; #asmfmt.enable = true;
}; };
}; };
}; };

View File

@ -0,0 +1,6 @@
{ lib, ... }: {
plugins.notify = {
enable = true;
render = lib.nixvim.mkRaw "'wrapped-compact'";
};
}

View File

@ -4,9 +4,13 @@
enable = true; enable = true;
settings = { settings = {
indent.enable = true; indent.enable = true;
highlight.enable = true;
}; };
folding = true; folding = true;
grammarPackages = [ inputs.treesitter-grammars.packages.${pkgs.system}.nvim-grammar-bundle ]; nixGrammars = true;
grammarPackages = [
inputs.treesitter-grammars.packages.${pkgs.system}.default
];
}; };
treesitter-context.enable = true; treesitter-context.enable = true;
ts-autotag.enable = true; ts-autotag.enable = true;

8
overlays/default.nix Normal file
View File

@ -0,0 +1,8 @@
{ inputs, ... }: [
(import ./neorg.nix { inherit inputs; })
(import ./kodi.nix { })
inputs.neovim-nightly-overlay.overlays.default
inputs.nixvim.overlays.default
inputs.nur.overlay
inputs.nixgl.overlay
]

14
overlays/kodi.nix Normal file
View File

@ -0,0 +1,14 @@
_: final: prev: {
kodi-standalone =
final.kodi-wayland.withPackages
(kodiPkgs:
with kodiPkgs; [
youtube
pvr-iptvsimple
keymap
inputstream-adaptive
inputstream-ffmpegdirect
requests-cache
inputstreamhelper
]);
}

64
overlays/neorg.nix Normal file
View File

@ -0,0 +1,64 @@
{inputs,...}: final: prev:
let
inherit (inputs) norg norg-meta neorg neorg-telescope;
inherit (final.lib) attrValues elem filter filterAttrs isDerivation;
in
{
vimPlugins = prev.vimPlugins.extend (f: p: {
nvim-treesitter =
let
norgGrammars = {
tree-sitter-norg = norg.defaultPackage.${final.system};
tree-sitter-norg-meta = norg-meta.defaultPackage.${final.system};
};
builtGrammars = (filterAttrs (_: isDerivation) p.nvim-treesitter.builtGrammars) // norgGrammars;
allGrammars = attrValues builtGrammars;
withPlugins = grammarFn:
p.nvim-treesitter.withPlugins (
_:
let
plugins = grammarFn builtGrammars;
in
plugins ++ (filter (p: !(elem p plugins)) (attrValues norgGrammars))
);
withAllGrammars = withPlugins (_: allGrammars);
in
p.nvim-treesitter.overrideAttrs (a: {
passthru = a.passthru // {
inherit builtGrammars allGrammars withPlugins withAllGrammars;
grammarPlugins = a.passthru.grammarPlugins // {
norg = norgGrammars.tree-sitter-norg;
norg-meta = norgGrammars.tree-sitter-norg-meta;
};
};
});
lua-utils-nvim = final.vimUtils.buildVimPlugin {
inherit (prev.luaPackages.lua-utils-nvim) pname version src;
};
pathlib-nvim = final.vimUtils.buildVimPlugin {
inherit (prev.luaPackages.pathlib-nvim) pname version src;
};
neorg = final.vimUtils.buildVimPlugin {
pname = "neorg";
version = neorg.rev;
src = neorg;
dependencies = [
#(f.nvim-treesitter.withPlugins (_: [ ]))
f.lua-utils-nvim
f.nui-nvim
f.nvim-nio
f.pathlib-nvim
f.plenary-nvim
];
};
neorg-telescope = final.vimUtils.buildVimPlugin {
pname = "neorg-telescope";
version = neorg-telescope.rev;
src = neorg-telescope;
dependencies = [
f.telescope-nvim
f.neorg
];
};
});
}

View File

@ -4,15 +4,12 @@
inputs, inputs,
flakeLib, flakeLib,
vars, vars,
overlays,
... ...
}: let }: let
nixvim' = inputs.nixvim.legacyPackages.${system}; nixvim' = inputs.nixvim.legacyPackages.${system};
pkgs = flakeLib.mkPkgs { pkgs = flakeLib.mkPkgs {
inherit system nixpkgs; inherit system nixpkgs overlays;
overlays = [
inputs.neovim-nightly-overlay.overlays.default
inputs.neorg-overlay.overlays.default
];
}; };
module = { module = {
inherit pkgs; inherit pkgs;

View File

@ -9,6 +9,10 @@
outputs.homeManagerModules.development outputs.homeManagerModules.development
]; ];
programs = {
ghidra.enable = false;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
go go
]; ];

View File

@ -1,7 +1,6 @@
{ { outputs
outputs, , vars
vars, , ...
...
}: { }: {
imports = [ imports = [
outputs.nixosModules.home-manager outputs.nixosModules.home-manager

View File

@ -0,0 +1,25 @@
{ pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix gitignore;
in
import (fetchTree nixpkgs.locked) {
overlays = [
(import "${fetchTree gomod2nix.locked}/overlay.nix")
(final: prev: (import "${fetchTree gitignore.locked}/default.nix") {
inherit (prev) lib;
})
];
}
)
, gitignoreSource ? pkgs.gitignoreSource
, name
, version
}:
pkgs.mkDerivation {
inherit version;
pname = name;
pwd = ./.;
src = gitignoreSource ./.;
modules = ./gomod2nix.toml;
}

57
templates/empty/flake.nix Normal file
View File

@ -0,0 +1,57 @@
{
outputs =
{ self
, nixpkgs
, flake-utils
, gitignore
, git-hooks
, ...
}:
let
name = "project";
version = "0.0.0";
in
{ }
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
gitignore.overlay
];
};
in
{
devShells.default = pkgs.callPackage ./shell.nix {
inherit (self.outputs.checks.${system}) pre-commit-check;
inherit name version;
};
packages.default = pkgs.callPackage ./. { inherit name version; };
checks = {
pre-commit-check = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
};
};
};
formatter = pkgs.nixpkgs-fmt;
});
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/x86_64-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
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";
};
};
}

11
templates/empty/shell.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs
, name
, pre-commit-check
, ...
}:
pkgs.mkShell {
inherit (pre-commit-check) shellHook;
buildInputs = pre-commit-check.enabledPackages;
name = "${name}-dev";
packages = [ ];
}

31
templates/go/.gitignore vendored Normal file
View File

@ -0,0 +1,31 @@
# Direnv
.direnv
# Created by https://www.toptal.com/developers/gitignore/api/go
# Edit at https://www.toptal.com/developers/gitignore?templates=go
### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
vendor/
# Go workspace file
go.work
# End of https://www.toptal.com/developers/gitignore/api/go

29
templates/go/default.nix Normal file
View File

@ -0,0 +1,29 @@
{ pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix gitignore;
in
import (fetchTree nixpkgs.locked) {
overlays = [
(import "${fetchTree gomod2nix.locked}/overlay.nix")
(final: prev: (import "${fetchTree gitignore.locked}/default.nix") {
inherit (prev) lib;
})
];
}
)
, buildGoApplication ? pkgs.buildGoApplication
, gitignoreSource ? pkgs.gitignoreSource
, name
, version
}:
buildGoApplication {
inherit version;
pname = name;
pwd = ./.;
src = gitignoreSource ./.;
modules = ./gomod2nix.toml;
ldflags = [
"-w -s"
];
}

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

@ -0,0 +1,67 @@
{
outputs =
{ self
, nixpkgs
, flake-utils
, gomod2nix
, gitignore
, git-hooks
, ...
}:
let
name = "project";
version = "0.0.0";
in
{ }
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
gitignore.overlay
];
};
in
{
devShells.default = pkgs.callPackage ./shell.nix {
inherit (self.outputs.checks.${system}) pre-commit-check;
inherit name version;
};
packages.default = pkgs.callPackage ./. { inherit name version; };
checks = {
pre-commit-check = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
gofmt.enable = true;
govet.enable = true;
golangci-lint.enable = true;
};
};
};
formatter = pkgs.nixpkgs-fmt;
});
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/x86_64-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
gomod2nix = {
url = "github:marksisson/gomod2nix?ref=patches/fix-mkgoenv-to-allow-passing-more-attributes";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
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";
};
};
}

49
templates/go/shell.nix Normal file
View File

@ -0,0 +1,49 @@
{ pkgs
, name
, mkGoEnv
, gomod2nix
, pre-commit-check
, go
, gotools
, go-tools
, delve
, golines
, richgo
, gotestsum
, golangci-lint
, gotests
, gomodifytags
, gofumpt
, govulncheck
, mockgen
, ginkgo
, ...
}:
let
goEnv = mkGoEnv {
inherit go;
pwd = ./.;
};
in
pkgs.mkShell {
inherit (pre-commit-check) shellHook;
buildInputs = pre-commit-check.enabledPackages;
name = "${name}-dev";
packages = [
goEnv
gomod2nix
gotools
go-tools
golines
richgo
gotestsum
gotests
delve
golangci-lint
gomodifytags
gofumpt
govulncheck
mockgen
ginkgo
];
}