about summary refs log tree commit diff
path: root/tools/simple_vim
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-26T22·01+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-27T16·31+0100
commiteb0e1d8c5d9cd1c1f316797f51720456a2f92f9e (patch)
treeb6cc45894f76cea37b23b69c35560a338b87cde4 /tools/simple_vim
parentea0788fd62cb48b5907f4efeafa4ac58e7fb09f4 (diff)
Prefer builtins.path
Following the advice of Domen's nix.dev anti-patterns, I'm preferring something
like...

```nix
builtins.path { path = /path/to/some.where; name = "some.where"; }
```

...to

```nix
/path/to/some/where
```

While the former is more verbose, it will fail to build when the path doesn't
exist, which I prefer.
Diffstat (limited to 'tools/simple_vim')
-rw-r--r--tools/simple_vim/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/simple_vim/default.nix b/tools/simple_vim/default.nix
index 7132a649232d..f8f965f2c024 100644
--- a/tools/simple_vim/default.nix
+++ b/tools/simple_vim/default.nix
@@ -1,8 +1,13 @@
 { pkgs, ... }:
 
 let
+  configVim = builtins.path {
+    path = ./config.vim;
+    name = "config.vim";
+  };
+
   script = pkgs.writeShellScriptBin "simple_vim" ''
-    ${pkgs.vim}/bin/vim -u ${./config.vim}
+    ${pkgs.vim}/bin/vim -u ${configVim}
   '';
 in pkgs.stdenv.mkDerivation {
   name = "simple_vim";