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.
This commit is contained in:
William Carroll 2020-08-26 23:01:35 +01:00
parent ea0788fd62
commit eb0e1d8c5d
2 changed files with 32 additions and 6 deletions

View file

@ -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";