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-14 07:02:21 +0200
commit14b1b79d01ab39b9c4bb08258162be7d3da506c2 (patch)
tree4feacbb357ae0d7da4ab6ca34d4ddc1b7ebe4d8d /nixos
parentd52ba0d225c018df64d32b4840549e3a8cf1ee3b (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.nix15
-rw-r--r--nixos/profiles/workstation/pkgs/nvim.nix23
5 files changed, 44 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 d57318b..2c8ccc0 100644
--- a/nixos/profiles/workstation/doc.nix
+++ b/nixos/profiles/workstation/doc.nix
@@ -8,7 +8,7 @@
config,
pkgs,
pkgs-unstable,
- ...
+ nvim,
}:
let
@@ -26,10 +26,23 @@ let
cp -f ${pkgs.jujutsu.src}/CHANGELOG.md $out/changelog.md
'';
+ 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 = "${jjDocs}";
+ 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
+ ]))
+ ];
+}