|
| 1 | +# Release 2.26.0 (2025-01-22) |
| 2 | + |
| 3 | +- Support for relative path inputs [#10089](https://github.com/NixOS/nix/pull/10089) |
| 4 | + |
| 5 | + Flakes can now refer to other flakes in the same repository using relative paths, e.g. |
| 6 | + ```nix |
| 7 | + inputs.foo.url = "path:./foo"; |
| 8 | + ``` |
| 9 | + uses the flake in the `foo` subdirectory of the referring flake. For more information, see the documentation on [the `path` flake input type](@docroot@/command-ref/new-cli/nix3-flake.md#path-fetcher). |
| 10 | + |
| 11 | + This feature required a change to the lock file format. Previous Nix versions will not be able to use lock files that have locks for relative path inputs in them. |
| 12 | + |
| 13 | +- Flake lock file generation now ignores local registries [#12019](https://github.com/NixOS/nix/pull/12019) |
| 14 | + |
| 15 | + When resolving indirect flake references like `nixpkgs` in `flake.nix` files, Nix will no longer use the system and user flake registries. It will only use the global flake registry and overrides given on the command line via `--override-flake`. |
| 16 | + |
| 17 | + This avoids accidents where users have local registry overrides that map `nixpkgs` to a `path:` flake in the local file system, which then end up in committed lock files pushed to other users. |
| 18 | + |
| 19 | + In the future, we may remove the use of the registry during lock file generation altogether. It's better to explicitly specify the URL of a flake input. For example, instead of |
| 20 | + ```nix |
| 21 | + { |
| 22 | + outputs = { self, nixpkgs }: { ... }; |
| 23 | + } |
| 24 | + ``` |
| 25 | + write |
| 26 | + ```nix |
| 27 | + { |
| 28 | + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; |
| 29 | + outputs = { self, nixpkgs }: { ... }; |
| 30 | + } |
| 31 | + ``` |
| 32 | + |
| 33 | +- `nix copy` supports `--profile` and `--out-link` [#11657](https://github.com/NixOS/nix/pull/11657) |
| 34 | + |
| 35 | + The `nix copy` command now has flags `--profile` and `--out-link`, similar to `nix build`. `--profile` makes a profile point to the |
| 36 | + top-level store path, while `--out-link` create symlinks to the top-level store paths. |
| 37 | + |
| 38 | + For example, when updating the local NixOS system profile from a NixOS system closure on a remote machine, instead of |
| 39 | + ``` |
| 40 | + # nix copy --from ssh://server $path |
| 41 | + # nix build --profile /nix/var/nix/profiles/system $path |
| 42 | + ``` |
| 43 | + you can now do |
| 44 | + ``` |
| 45 | + # nix copy --from ssh://server --profile /nix/var/nix/profiles/system $path |
| 46 | + ``` |
| 47 | + The advantage is that this avoids a time window where *path* is not a garbage collector root, and so could be deleted by a concurrent `nix store gc` process. |
| 48 | + |
| 49 | +- `nix-instantiate --eval` now supports `--raw` [#12119](https://github.com/NixOS/nix/pull/12119) |
| 50 | + |
| 51 | + The `nix-instantiate --eval` command now supports a `--raw` flag, when used |
| 52 | + the evaluation result must be a string, which is printed verbatim without |
| 53 | + quotation marks or escaping. |
| 54 | + |
| 55 | +- Improved `NIX_SSHOPTS` parsing for better SSH option handling [#5181](https://github.com/NixOS/nix/issues/5181) [#12020](https://github.com/NixOS/nix/pull/12020) |
| 56 | + |
| 57 | + The parsing of the `NIX_SSHOPTS` environment variable has been improved to handle spaces and quotes correctly. |
| 58 | + Previously, incorrectly split SSH options could cause failures in commands like `nix-copy-closure`, |
| 59 | + especially when using complex SSH invocations such as `-o ProxyCommand="ssh -W %h:%p ..."`. |
| 60 | + |
| 61 | + This change introduces a `shellSplitString` function to ensure |
| 62 | + that `NIX_SSHOPTS` is parsed in a manner consistent with shell |
| 63 | + behavior, addressing common parsing errors. |
| 64 | + |
| 65 | + For example, the following now works as expected: |
| 66 | + |
| 67 | + ```bash |
| 68 | + export NIX_SSHOPTS='-o ProxyCommand="ssh -W %h:%p ..."' |
| 69 | + ``` |
| 70 | + |
| 71 | + This update improves the reliability of SSH-related operations using `NIX_SSHOPTS` across Nix CLIs. |
| 72 | + |
| 73 | +# Contributors |
| 74 | + |
| 75 | +Querying GitHub API for f0c209fb14cb511370ea2b7787d9a8dd90070162, to get handle for [email protected] |
0 commit comments