Compare commits

..

6 Commits

Author SHA1 Message Date
Martin Pander
38083b9af4 Move nvim config 2026-02-11 08:03:13 +01:00
Martin Pander
9b0b1f76f9 Fix things 2026-02-10 22:22:54 +01:00
Martin Pander
4460f57073 Fix things 2026-02-10 22:18:47 +01:00
Martin Pander
2fbabfb771 Fix things 2026-02-10 22:14:17 +01:00
Martin Pander
6250ccbf11 Fix things 2026-02-10 22:03:35 +01:00
Martin Pander
65cc61773f Refactore nvim config 2026-02-10 22:00:42 +01:00
33 changed files with 264 additions and 165 deletions

View File

@@ -20,6 +20,24 @@
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
@@ -96,6 +114,27 @@
"type": "github" "type": "github"
} }
}, },
"nixos-vscode-server": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770124655,
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-vscode-server",
"type": "github"
}
},
"nixos-wsl": { "nixos-wsl": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@@ -104,11 +143,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770494267, "lastModified": 1770657009,
"narHash": "sha256-LBKeSntmhCBj0tHFVFGfT4+KBmKi57gAnr240/F1Qkc=", "narHash": "sha256-v/LA5ZSJ+JQYzMSKB4sySM0wKfsAqddNzzxLLnbsV/E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "843582709028607bf112d7cdc99af825e224a29b", "rev": "5b50ea1aaa14945d4794c80fcc99c4aa1db84d2d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -135,11 +174,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1770464364, "lastModified": 1770617025,
"narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=", "narHash": "sha256-1jZvgZoAagZZB6NwGRv2T2ezPy+X6EFDsJm+YSlsvEs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457", "rev": "2db38e08fdadcc0ce3232f7279bab59a15b94482",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -165,11 +204,27 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-wsl": "home-manager-wsl", "home-manager-wsl": "home-manager-wsl",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixos-vscode-server": "nixos-vscode-server",
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
@@ -185,11 +240,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770526836, "lastModified": 1770683991,
"narHash": "sha256-xbvX5Ik+0inJcLJtJ/AajAt7xCk6FOCrm5ogpwwvVDg=", "narHash": "sha256-xVfPvXDf9QN3Eh9dV+Lw6IkWG42KSuQ1u2260HKvpnc=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "d6e0e666048a5395d6ea4283143b7c9ac704720d", "rev": "8b89f44c2cc4581e402111d928869fe7ba9f7033",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -213,23 +268,37 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tasksquire": { "tasksquire": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": "nixpkgs_2"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1770493706, "lastModified": 1770735271,
"narHash": "sha256-r8tbD+K3skUd3nDD+M6FIZ82azewnDYdhyLfFAEkCFs=", "narHash": "sha256-Vt1di5EUPq6ijBX0h8aaRVnSkCDpI5Myd2tXjQlK3Tw=",
"ref": "refs/heads/dev", "ref": "dev",
"rev": "e3effe8b2570a815c9710d94a1e9541b9532bfb6", "rev": "6e606985267d438f6d30a117863812347960694b",
"revCount": 46, "revCount": 48,
"type": "git", "type": "git",
"url": "ssh://git@git.pander.me/martin/tasksquire.git" "url": "ssh://git@git.pander.me/martin/tasksquire.git"
}, },
"original": { "original": {
"ref": "dev",
"type": "git", "type": "git",
"url": "ssh://git@git.pander.me/martin/tasksquire.git" "url": "ssh://git@git.pander.me/martin/tasksquire.git"
} }

View File

@@ -29,18 +29,23 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# individual packages
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
tasksquire = { nixos-vscode-server = {
url = "git+ssh://git@git.pander.me/martin/tasksquire.git"; url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
tasksquire = {
url = "git+ssh://git@git.pander.me/martin/tasksquire.git?ref=dev";
};
}; };
outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixos-wsl, home-manager, home-manager-wsl, nix-darwin, sops-nix, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixos-wsl, home-manager, home-manager-wsl, nix-darwin, ... }@inputs:
let let
linuxSystem = "x86_64-linux"; linuxSystem = "x86_64-linux";
linuxAarchSystem = "aarch64-linux"; linuxAarchSystem = "aarch64-linux";
@@ -73,6 +78,10 @@
}; };
home-manager.users.pan = import ./hosts/work/nixos/home.nix; home-manager.users.pan = import ./hosts/work/nixos/home.nix;
} }
inputs.nixos-vscode-server.nixosModules.default
({ pkgs, ... }: {
services.vscode-server.enable = true;
})
]; ];
}; };

View File

@@ -22,4 +22,5 @@
}; };
dot.tmux.workMode = true; dot.tmux.workMode = true;
dot.nvim.workMode = true;
} }

59
modules/home/common.nix Normal file
View File

@@ -0,0 +1,59 @@
{ config, pkgs, lib, ... }:
{
options.dot = {
dotfilesPath = lib.mkOption {
type = lib.types.str;
default = "${config.home.homeDirectory}/dev/dot";
description = "Absolute path to the dotfiles repository on the local machine.";
};
};
imports = [
./secrets.nix
./sh.nix
./tmux.nix
./git.nix
./dev.nix
./nvim.nix
./task.nix
];
config = {
home.packages = with pkgs; [
nerd-fonts.fira-code
nil # Nix LSP
# Language servers
yaml-language-server
marksman
pkgs.unstable.dockerfile-language-server # Use unstable for latest LSP features
# Secrets management
sops
age
];
programs.ssh = {
enable = true;
enableDefaultConfig = false;
includes = [ "config.local" ];
matchBlocks = {
"*" = {
addKeysToAgent = "yes";
};
"git.pander.me" = {
hostname = "git.pander.me";
user = "git";
identityFile = "~/.ssh/private_git";
port = 2222;
};
};
};
news.display = "silent";
programs.home-manager.enable = true;
};
}

100
modules/home/nvim.nix Normal file
View File

@@ -0,0 +1,100 @@
{ config, pkgs, lib, ... }:
let
cfg = config.dot.nvim;
in
{
options.dot.nvim = {
workMode = lib.mkEnableOption "work-specific neovim configuration";
};
config = {
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-repeat
vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim
mini-pairs
mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap
plenary-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim
lualine-nvim
undotree
luasnip
nvim-cmp
cmp_luasnip
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp_yanky
cmp-git
nvim-lspconfig
lspkind-nvim
copilot-lua
copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim
img-clip-nvim
vim-nix
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
];
extraLuaConfig = ''
_G.is_work = ${if cfg.workMode then "true" else "false"}
_G.is_home = ${if pkgs.stdenv.isDarwin then "true" else "false"}
require('base')
require('keymaps')
require('plugins')
require('filetype')
'';
};
# Allow for editing the lua modules without a nix rebuild
xdg.configFile."nvim/lua".source = config.lib.file.mkOutOfStoreSymlink "${config.dot.dotfilesPath}/modules/nvim/lua";
home.packages = with pkgs; [
nodejs-slim
];
};
}

View File

@@ -62,7 +62,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
taskwarrior-tui taskwarrior-tui
timewarrior unstable.timewarrior
inputs.tasksquire.packages.${pkgs.system}.default inputs.tasksquire.packages.${pkgs.system}.default
]; ];

View File

@@ -22,6 +22,7 @@
programs.zsh.enable = true; programs.zsh.enable = true;
programs.ssh.startAgent = true; programs.ssh.startAgent = true;
programs.nix-ld.enable = true;
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];

View File

@@ -133,7 +133,7 @@ vim.api.nvim_create_user_command('TrimWhiteSpace', function()
vim.cmd('%s/\\s\\+$//e') vim.cmd('%s/\\s\\+$//e')
end, {}) end, {})
local function ToggleDiagnostics() function ToggleDiagnostics()
vim.diagnostic.enable(not vim.diagnostic.is_enabled()) vim.diagnostic.enable(not vim.diagnostic.is_enabled())
if vim.diagnostic.is_enabled() then if vim.diagnostic.is_enabled() then
print("Diagnostics enabled") print("Diagnostics enabled")

View File

@@ -10,10 +10,6 @@ require('mini.move').setup()
require('flash').setup() require('flash').setup()
require('ts-comments').setup() require('ts-comments').setup()
local function is_wsl_env()
return os.getenv("WSL_DISTRO_NAME") ~= nil or os.getenv("WSL_INTEROP") ~= nil
end
vim.g.tagbar_left=1 vim.g.tagbar_left=1
vim.g.tagbar_autoclose=1 vim.g.tagbar_autoclose=1
vim.g.tagbar_autofocus=1 vim.g.tagbar_autofocus=1
@@ -381,7 +377,7 @@ dap.configurations.zig = {
}, },
} }
if vim.fn.has("mac") then if _G.is_home then
workspaces = { workspaces = {
{ {
name = "privat", name = "privat",
@@ -400,7 +396,7 @@ if vim.fn.has("mac") then
} }
end end
if is_wsl_env() then if _G.is_work then
workspaces = { workspaces = {
{ {
name = "work", name = "work",

View File

@@ -1,49 +0,0 @@
{ config, pkgs, lib, ... }:
{
imports = [
./secrets.nix
./sh.nix
./tmux.nix
./git.nix
./dev.nix
./nvim.nix
./task.nix
];
home.packages = with pkgs; [
nerd-fonts.fira-code
nil # Nix LSP
# Language servers
yaml-language-server
marksman
pkgs.unstable.dockerfile-language-server # Use unstable for latest LSP features
# Secrets management
sops
age
];
programs.ssh = {
enable = true;
enableDefaultConfig = false;
includes = [ "config.local" ];
matchBlocks = {
"*" = {
addKeysToAgent = "yes";
};
"git.pander.me" = {
hostname = "git.pander.me";
user = "git";
identityFile = "~/.ssh/private_git";
port = 2222;
};
};
};
news.display = "silent";
programs.home-manager.enable = true;
}

View File

@@ -1,87 +0,0 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-repeat
vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim
mini-pairs
mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap
plenary-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim
lualine-nvim
undotree
luasnip
nvim-cmp
cmp_luasnip
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp_yanky
cmp-git
nvim-lspconfig
lspkind-nvim
copilot-lua
copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim
img-clip-nvim
vim-nix
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
];
# Use extraLuaConfig for home-manager 25.11 compatibility
# (initLua was renamed from extraLuaConfig in later versions)
extraLuaConfig = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
};
home.packages = with pkgs; [
nodejs-slim
];
}