fix: Configure Neovim using a wrappers
This commit is contained in:
27
README.org
27
README.org
@@ -15,6 +15,23 @@ A second try at NixOS, now that I have a better idea of what I'm doing. The effo
|
|||||||
|
|
||||||
Modules, but lightweight.
|
Modules, but lightweight.
|
||||||
|
|
||||||
|
* Principles
|
||||||
|
|
||||||
|
** User configuration
|
||||||
|
|
||||||
|
In order of descending preference, user programs should be configured by...
|
||||||
|
|
||||||
|
1. Wrappers, with config files optionally living somewhere under =/persist/dots=.
|
||||||
|
2. home-manager's modules.
|
||||||
|
3. ~home.file~ and similar.
|
||||||
|
4. Mutable symlinks using ~home.file~ and ~mkOutOfStoreSymlink~.
|
||||||
|
|
||||||
|
* Conventions
|
||||||
|
|
||||||
|
** Impermanence and persistence
|
||||||
|
|
||||||
|
- Persistent files to be linked into ~/~ go under ~/persist/root~
|
||||||
|
|
||||||
* Tasks
|
* Tasks
|
||||||
|
|
||||||
** Emacs
|
** Emacs
|
||||||
@@ -166,6 +183,10 @@ Or Qtile
|
|||||||
|
|
||||||
Or Niri
|
Or Niri
|
||||||
|
|
||||||
|
** TODO Convenient way to wrap programs
|
||||||
|
|
||||||
|
[[https://github.com/viperML/wrapper-manager][wrapper-manager]] looks like it will be really annoying to integrate into my config without a NixOS/HM module.
|
||||||
|
|
||||||
** TODO tf2.nix
|
** TODO tf2.nix
|
||||||
|
|
||||||
- declaratively configure tf2
|
- declaratively configure tf2
|
||||||
@@ -228,10 +249,6 @@ https://discourse.nixos.org/t/what-to-do-with-a-full-boot-partition/2049
|
|||||||
|
|
||||||
Remove a given host from =~/.ssh/known_hosts=. Something like =sed -i -e '/192.168.122.54/d' .ssh/known_hosts=.
|
Remove a given host from =~/.ssh/known_hosts=. Something like =sed -i -e '/192.168.122.54/d' .ssh/known_hosts=.
|
||||||
|
|
||||||
* Impermanence and persistence
|
|
||||||
|
|
||||||
- Persistent files to be linked into ~/~ go under ~/persist/root~
|
|
||||||
|
|
||||||
* References
|
* References
|
||||||
|
|
||||||
Following is a subset of the many places I've learnt from.
|
Following is a subset of the many places I've learnt from.
|
||||||
@@ -242,3 +259,5 @@ Following is a subset of the many places I've learnt from.
|
|||||||
- [[https://github.com/hlissner/dotfiles/][hlissner/dotfiles]]
|
- [[https://github.com/hlissner/dotfiles/][hlissner/dotfiles]]
|
||||||
- [[https://github.com/Shawn8901/nix-configuration/tree/af71d51998a6772a300f842795b947e27202fa73][Shawn8901/nix-configuration]]
|
- [[https://github.com/Shawn8901/nix-configuration/tree/af71d51998a6772a300f842795b947e27202fa73][Shawn8901/nix-configuration]]
|
||||||
- [cite:@christensen2020erase]
|
- [cite:@christensen2020erase]
|
||||||
|
- [cite:@ayats2024dropping]
|
||||||
|
- [cite:@zaynetdinov2024you]
|
||||||
|
|||||||
@@ -1,12 +1,31 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
home.file.".vimrc".text = ''
|
my-vimrc =
|
||||||
imap jk <ESC>
|
pkgs.writeTextFile {
|
||||||
xmap JK <ESC>
|
name = "vimrc";
|
||||||
'';
|
text = ''
|
||||||
|
imap jk <ESC>
|
||||||
|
xmap JK <ESC>
|
||||||
|
set number
|
||||||
|
set relativenumber
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
xdg.configFile."nvim/init.vim".text = ''
|
my-neovim =
|
||||||
so ~/.vimrc
|
pkgs.symlinkJoin {
|
||||||
'';
|
name = "neovim";
|
||||||
|
paths = [ pkgs.neovim ];
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/nvim \
|
||||||
|
--add-flags "-u ${my-vimrc}"
|
||||||
|
# Symlink {v,vi,vim} to nvim.
|
||||||
|
for i in {v,vi,vim}; do
|
||||||
|
ln -s $out/bin/nvim $out/bin/$i
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
home.packages = [ my-neovim ];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user