aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-10 12:25:43 +0200
committerMartin Fischer <martin@push-f.com>2026-10-11 14:40:57 +0200
commit9f3f23e3b20bef5a2e64356ca1d306333c978297 (patch)
tree3418afed0f8e8a782a98f4201afdbc392f6a987d /nixos
parent3050120b42a188640dd5f3fe10fbbec8d2fcab16 (diff)
tweak(workstation): use neovim instead of vim
Diffstat (limited to 'nixos')
-rw-r--r--nixos/profiles/common/basics.nix2
-rw-r--r--nixos/profiles/server/default.nix4
-rw-r--r--nixos/profiles/workstation/default.nix5
-rw-r--r--nixos/profiles/workstation/doc.nix16
-rw-r--r--nixos/profiles/workstation/pkgs/nvim.nix23
5 files changed, 45 insertions, 5 deletions
diff --git a/nixos/profiles/common/basics.nix b/nixos/profiles/common/basics.nix
index 7facee9..afbeb7b 100644
--- a/nixos/profiles/common/basics.nix
+++ b/nixos/profiles/common/basics.nix
@@ -3,8 +3,6 @@
{
environment.systemPackages = with pkgs; [
git
- # lowPrio because we use vim-full in the workstation profile
- (lib.lowPrio vim)
file
htop
diff --git a/nixos/profiles/server/default.nix b/nixos/profiles/server/default.nix
index 6e744a6..fbdb9da 100644
--- a/nixos/profiles/server/default.nix
+++ b/nixos/profiles/server/default.nix
@@ -6,6 +6,10 @@
./detect-hostname-change.nix
];
+ environment.systemPackages = with pkgs; [
+ vim
+ ];
+
services = {
openssh = {
enable = true;
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix
index d77d67d..cf1f883 100644
--- a/nixos/profiles/workstation/default.nix
+++ b/nixos/profiles/workstation/default.nix
@@ -4,6 +4,7 @@ let
cfg = config.workstation;
sources = import <top/npins>;
cmd50 = pkgs.callPackage (sources.my-cmd50 { inherit pkgs; }) {};
+ nvim = import ./pkgs/nvim.nix { inherit pkgs; };
in
{
options.workstation = {
@@ -19,7 +20,7 @@ in
./firefox.nix
./dev.nix
./create.nix
- ./doc.nix
+ (import ./doc.nix { inherit config pkgs pkgs-unstable nvim; })
./llm.nix
];
@@ -75,7 +76,7 @@ in
(callPackage (sources.my-vdf { inherit pkgs; }) {})
nixfmt
- vim-full
+ nvim
cmd50
(writeShellScriptBin "xdg-open" ''
diff --git a/nixos/profiles/workstation/doc.nix b/nixos/profiles/workstation/doc.nix
index 1c29ed1..b8721a7 100644
--- a/nixos/profiles/workstation/doc.nix
+++ b/nixos/profiles/workstation/doc.nix
@@ -8,7 +8,7 @@
config,
pkgs,
pkgs-unstable,
- ...
+ nvim,
}:
let
@@ -18,10 +18,24 @@ let
--strip-components=2 --directory $out \
--wildcards '*/Documentation/*.adoc'
'';
+
+ nvimPluginDocs = pkgs.runCommand "nvim-plugin-docs" { } ''
+ mkdir -p $out
+ ${pkgs.lib.concatMapStringsSep "\n" (plugin: ''
+ pluginOut="$out/${pkgs.lib.getName plugin}"
+ find ${plugin} -path '*/doc/*.txt' -type f | while IFS= read -r file; do
+ mkdir -p "$pluginOut"
+ ln -s "$file" "$pluginOut/$(basename "$file")"
+ done
+ '') nvim.plugins}
+ '';
+
symlinks = {
nix = "${config.nix.package.src}/doc/manual/source";
git = "${gitDocs}";
jj = "${pkgs.jujutsu.src}/docs";
+ nvim = "${pkgs.neovim-unwrapped}/share/nvim/runtime/doc";
+ nvim-plugins = "${nvimPluginDocs}";
pi = "${pkgs-unstable.pi-coding-agent}/lib/node_modules/pi-monorepo/docs";
};
in
diff --git a/nixos/profiles/workstation/pkgs/nvim.nix b/nixos/profiles/workstation/pkgs/nvim.nix
new file mode 100644
index 0000000..0961b4d
--- /dev/null
+++ b/nixos/profiles/workstation/pkgs/nvim.nix
@@ -0,0 +1,23 @@
+{ pkgs }:
+
+# Using the unstable wrapper because it honors `wrapRc = false`,
+# which `neovim.override` and `wrapNeovim` disregard (they always set VIMINIT).
+pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped {
+ vimAlias = true;
+ wrapRc = false;
+
+ plugins = with pkgs.vimPlugins; [
+ mini-pick
+ vscode-nvim
+ # neovim has no syntax highlighting for Svelte by default
+ # and nvim-treesitter also provides good auto-indentation.
+ (nvim-treesitter.withPlugins (p: with p; [
+ css
+ html
+ javascript
+ nix
+ svelte
+ typescript
+ ]))
+ ];
+}