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-18 07:26:20 +0200
commitd76cc3f0e939bc07dbf414252527db2a53ab67ac (patch)
treefcff2d59cef23ac7f1176b64b14775f9412ce73c /nixos
parent765be3a1b1285adfc625553571d29f13ebf2418d (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 3e917c2..7899a82 100644
--- a/nixos/profiles/server/default.nix
+++ b/nixos/profiles/server/default.nix
@@ -8,6 +8,10 @@
./prometheus-storagebox-exporter.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 fad152d..b8d563b 100644
--- a/nixos/profiles/workstation/default.nix
+++ b/nixos/profiles/workstation/default.nix
@@ -12,6 +12,7 @@
let
cfg = config.workstation;
cmd50 = pkgs.callPackage (sources.my-cmd50 { inherit pkgs; }) {};
+ nvim = import ./pkgs/nvim.nix { inherit pkgs; };
in
{
options.workstation = {
@@ -27,7 +28,7 @@ in
./firefox.nix
./dev.nix
./create.nix
- ./doc.nix
+ (import ./doc.nix { inherit config pkgs pkgs-unstable nvim; })
];
config = {
@@ -82,7 +83,7 @@ in
(callPackage (sources.my-vdf { inherit pkgs; }) {})
nixfmt
- vim-full
+ nvim
(callPackage ./pkgs/pi.nix { inherit (pkgs-unstable) pi-coding-agent; })
(callPackage ./pkgs/scripts/package.nix {})
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
+ ]))
+ ];
+}