diff options
author | Artturin <Artturin@artturin.com> | 2022-11-05 23:53:41 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-11-06 00:00:39 +0200 |
commit | 66cf79f28218d47f076826001198b849366504de (patch) | |
tree | b4a52050a09115e9d2520872a072a107dac6ed90 /lib/trivial.nix | |
parent | c4b49b957bfd008a77be9188be0b43a34d5fd01e (diff) |
lib,doc: remove obvious usages of toString on paths
It gives a warning on the lazy-trees branch of Nix (NixOS/nix#6530) one of these was also giving me an error (the one in lib/trivial probably) ``` $ nix build warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/installer/sd-card/sd -image-aarch64.nix' and then accessing it is deprecated, at /home/artturin/nixgits/my-nixpkgs/lib/modules. nix:349:99 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/.git' and then accessing it is dep recated, at /home/artturin/nixgits/my-nixpkgs/lib/sources.nix:35:32 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/system/etc/etc.nix' and then accessing it is deprecated, at «stdin»:0 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/system/etc/etc-activ ation.nix' and then accessing it is deprecated, at «stdin»:0 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/installer/sd-card/sd -image-aarch64.nix' and then accessing it is deprecated, at «stdin»:0 error: cannot decode virtual path '/nix/store/virtual0000000000000000000000005-source' (use '--show-trace' to show detailed location information) ```
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r-- | lib/trivial.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index 5d4fad8266bc9..8f2023caaf8e2 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -213,8 +213,8 @@ rec { # Default value to return if revision can not be determined default: let - revisionFile = "${toString ./..}/.git-revision"; - gitRepo = "${toString ./..}/.git"; + revisionFile = ./.. + "/.git-revision"; + gitRepo = ./.. + "/.git"; in if lib.pathIsGitRepo gitRepo then lib.commitIdFromGitRepo gitRepo else if lib.pathExists revisionFile then lib.fileContents revisionFile |