Eelco Dolstra
c73a7584fb
Fix path display
2022-07-22 15:11:15 +02:00
Eelco Dolstra
7edacb6248
Fix case
2022-07-21 16:06:22 +02:00
Eelco Dolstra
e17a619106
Improve display of GitHub input filenames in error messages
...
E.g.
… while evaluating the attribute 'buildCommand' of the derivation 'vm-test-run-github-flakes'
at «github:NixOS/nixpkgs/2fa57ed190fd6c7c746319444f34b5917666e5c1»/pkgs/stdenv/generic/make-derivation.nix:278:7:
2022-07-14 16:53:41 +02:00
Eelco Dolstra
9a9b03b8d6
Fix showing attributes in traces
2022-07-14 16:49:55 +02:00
Eelco Dolstra
b4c354b013
Fix unsafeGetAttrPos test
2022-07-14 16:15:35 +02:00
Eelco Dolstra
53b7407041
Simplify the check for overrides on non-existent inputs
2022-07-13 13:39:06 +02:00
Eelco Dolstra
934f317250
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-07-13 12:50:03 +02:00
Ikko Ashimine
694a9dc282
Fix typo in flake.cc
...
non-existant -> non-existent
2022-07-13 01:10:32 +09:00
Théophane Hufschmitt
2dbd5ed0b4
Merge pull request #6663 from Ma27/follows-invalid-input
...
flakes: throw an error if `follows`-declaration for an input is invalid
2022-07-12 16:44:22 +02:00
Eelco Dolstra
f6a434c8a4
Fix debug message
2022-07-12 11:53:34 +02:00
Maximilian Bosch
1f771065f1
Move follows-check into its own function
2022-07-12 11:25:33 +02:00
Maximilian Bosch
411111a3bc
Turn error for non-existant follows into a warning
2022-07-12 11:22:35 +02:00
Maximilian Bosch
c1c37f3200
flakes: throw an error if follows-declaration for an input is invalid
...
I recently got fairly confused why the following expression didn't have
any effect
{
description = "Foobar";
inputs.sops-nix = {
url = github:mic92/sops-nix;
inputs.nixpkgs_22_05.follows = "nixpkgs";
};
}
until I found out that the input was called `nixpkgs-22_05` (please note
the dash vs. underscore).
IMHO it's not a good idea to not throw an error in that case and
probably leave end-users rather confused, so I implemented a small check
for that which basically checks whether `follows`-declaration from
overrides actually have corresponding inputs in the transitive flake.
In fact this was done by accident already in our own test-suite where
the removal of a `follows` was apparently forgotten[1].
Since the key of the `std::map` that holds the `overrides` is a vector
and we have to find the last element of each vector (i.e. the override)
this has to be done with a for loop in O(n) complexity with `n` being
the total amount of overrides (which shouldn't be that large though).
Please note that this doesn't work with nested expressions, i.e.
inputs.fenix.inputs.nixpkgs.follows = "...";
which is a known problem[2].
For the expression demonstrated above, an error like this will be
thrown:
error: sops-nix has a `follows'-declaration for a non-existant input nixpkgs_22_05!
[1] 2664a216e5
[2] https://github.com/NixOS/nix/issues/5790
2022-07-12 10:18:38 +02:00
Théophane Hufschmitt
f071eb3702
Merge pull request #6693 from ncfavier/complete-flake-inputs
...
Improve shell completion of flake inputs
2022-07-12 09:12:00 +02:00
Ben Burdette
cdcc349072
Merge branch 'master' into ignore-try
2022-07-11 11:29:22 -06:00
Ben Burdette
a3629ab0cc
move ignore-try to EvalSettings
2022-07-11 10:47:09 -06:00
Ben Burdette
6ac8200ff5
use util.hh class instead of local
2022-07-11 10:21:40 -06:00
Ben Burdette
69ea265fd2
'tryEval' not 'try clause'
2022-07-11 10:21:12 -06:00
Naïm Favier
711b2e1f48
Fix flake input completion for InstallablesCommands
...
Defers completion of flake inputs until the whole command line is parsed
so that we know what flakes we need to complete the inputs of.
Previously, `nix build flake --update-input <Tab>` always behaved like
`nix build . --update-input <Tab>`.
2022-07-11 15:13:51 +02:00
Eelco Dolstra
78232889c0
Use corepkgsFS for derivation.nix
2022-07-07 14:29:58 +02:00
Eelco Dolstra
a18b3c665a
Store a ref to InputAccessor in SourcePath
2022-07-06 17:25:15 +02:00
Eelco Dolstra
72dffd6c6c
Connect AbstractPos with Pos
2022-07-05 20:45:29 +02:00
Eelco Dolstra
9e9170a92e
Introduce AbstractPos
2022-07-05 20:45:29 +02:00
Gytis Ivaskevicius
b2703c73a4
builtins.traceVerbose: Post rebase fixes
2022-07-05 19:56:39 +03:00
Gytis Ivaskevicius
ba1fe85b65
Add builtins.traceVerbose
...
Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
Add builtins.traceVerbose tests
2022-07-05 19:44:26 +03:00
Théophane Hufschmitt
d63cd77549
Merge pull request #6664 from Ma27/innixshell-backwards-compat
...
nix-shell: restore backwards-compat with old nixpkgs
2022-07-05 15:57:20 +02:00
Eelco Dolstra
a04ca0a522
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-07-05 10:53:44 +02:00
Eelco Dolstra
5c2603d9c7
Improve subflake handling
...
Relative 'path:' inputs are now handled correctly in
call-flake.nix. This does require the lock file to record what the
'parent' is relative to which a node's source should be fetched.
2022-06-30 14:22:35 +02:00
Théophane Hufschmitt
b7eb4ac169
Merge pull request #6699 from tennox/better-flake-new-error-message
...
flakes: apply templates partially on conflicts
2022-06-29 18:21:07 +02:00
Théophane Hufschmitt
4c8210095e
Merge pull request #6233 from flox/nix-repl-flakes
...
Nix repl flakes
2022-06-29 17:59:22 +02:00
Théophane Hufschmitt
3b18058969
Merge pull request #6674 from virusdave/dnicponski/scratch/dont_capture_stdout_in_nix_repl_master
...
Don't capture `stdout` when launching subshells in `nix repl`
2022-06-29 17:54:41 +02:00
Eelco Dolstra
4248174e71
Merge pull request #6702 from ncfavier/develop-prepend-vars
...
nix develop: save XDG_DATA_DIRS for loadable completion
2022-06-29 14:49:31 +02:00
Théophane Hufschmitt
f8fea9075c
Merge remote-tracking branch 'origin/master' into better-flake-new-error-message
2022-06-29 13:44:14 +02:00
Eelco Dolstra
7633764342
Merge pull request #6739 from edolstra/ignore-chroot-error
...
Don't fail if we can't create ~/.local/share/nix/root
2022-06-29 13:06:35 +02:00
Eelco Dolstra
6cab528461
Don't fail if we can't create ~/.local/share/nix/root
...
https://hydra.nixos.org/build/182135943
2022-06-29 12:16:51 +02:00
Eelco Dolstra
455177cbe0
src/libexpr/tests/primops.cc: Quote Nix expressions
...
Otherwise they don't survive reformatting, see the failure in
https://github.com/NixOS/nix/pull/6721 .
2022-06-29 11:37:25 +02:00
Eelco Dolstra
3c1814423b
Merge pull request #6737 from centromere/fix-typo
...
doc: Fix typo
2022-06-29 11:02:46 +02:00
Théophane Hufschmitt
56cf96a1b9
Merge pull request #6706 from lheckemann/cache-info-cache-invalidation
...
nar-info-disk-cache: refresh nix-cache-info weekly
2022-06-29 07:56:27 +02:00
Alex Wied
cd361b31fa
doc: Fix typo
2022-06-28 22:43:37 -04:00
Eelco Dolstra
0d14ffbcba
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-06-28 16:29:42 +02:00
Manu [tennox]
ae4c9ef8e2
#6699 flake init: fix trying to add unchanged file
...
After skipping because of being of identical content it tried to git add it.
2022-06-26 21:35:21 +01:00
Manu [tennox]
4374e3ec67
#6699 flake init: Apply suggestions of @thufschmitt
2022-06-26 18:12:30 +01:00
Manuel
58cbbdc5e7
Update src/nix/flake.cc
...
https://github.com/NixOS/nix/pull/6699#discussion_r904097147
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-06-26 18:00:57 +01:00
Manuel
117baee1b7
Update src/nix/flake.cc
...
https://github.com/NixOS/nix/pull/6699#discussion_r904096906
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-06-26 18:00:34 +01:00
Guillaume Girol
e8109cf405
fetchGit: document shallow argument
2022-06-26 12:00:00 +00:00
Eelco Dolstra
49c4a37efc
Merge pull request #6717 from edolstra/move-flake-registry
...
Fetch flake-registry.json from channels.nixos.org
2022-06-25 21:17:57 +02:00
Eelco Dolstra
586fa707fc
Merge pull request #6714 from edolstra/auto-chroot-store
...
Automatically use a chroot store if /nix doesn't exist
2022-06-25 00:03:35 +02:00
Eelco Dolstra
30d4aa5dd6
Only do the auto chroot store on Linux
2022-06-24 23:35:21 +02:00
Théophane Hufschmitt
f06b6fa4fa
Merge pull request #6698 from tweag/forbid-tilde-paths-in-pure-mode
...
Forbid the tilde expansion in pure eval mode
2022-06-24 10:02:40 +02:00
Dave Nicponski
c6f7726f48
Don't capture stdout when launching subshells in nix repl
2022-06-23 22:45:13 -04:00