This gives people some flexibility when they need a path type, and
prevents a "combinatorial explosion" of various path stops.
I've re-implemented our existing `path` and `pathInStore` types using
`pathWith`. Our existing `package` type is potentially a candidate for
similar treatment, but it's a little quirkier (there's some stuff with
`builtins.hasContext` and `toDerivation` that I don't completely
understand), and I didn't want to muddy this PR with that.
As a happy side effect of this work, we get a new feature: the ability
to create a type for paths *not* in the store. This is useful for when a
module needs a path to a file, and wants to protect people from
accidentally leaking that file into the nix store.
Reverts #344407
This has broken nixos-rebuild switch so that it no longer updates the profile, which has bad consequences including not updating the systemd-boot menu with new generations.
`pkgs.testers.runNixOSTest` is the latest and best way to run NixOS Tests
outside of nixpkgs as it also improves evaluation performance by
injecting the host pkgs into all the guests.
It seems no one uses it because it is not mentioned at the right places.
This gets rid of a potentially confusing behavior that doesn't need to
be in NixOS, and nobody ever bothered to add a test for it.
Let's keep things simple!
The suggested snippet is better than this feature ever was, and will be
in the user's face, where it belongs, kindly.
Tested with
nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel
NIXOS_EXTRA_MODULE_PATH=$HOME/whatever.nix nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel
verified with following minimal test, embedded in a flake for ease of
execution:
```nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
outputs = { nixpkgs, ... }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
{
nixosTests.x86_64-linux.internet = pkgs.nixosTest {
name = "internet";
nodes.machine = { };
# only succeeds in interactive mode
testScript = ''
machine.wait_for_unit("default.target")
print(machine.succeed("curl -4 https://nixos.org"))
'';
};
};
}
```
Launch this test interactively as described in the manual & run
`test_script()` to verify that the VM has Internet access.
* Fix test in writing-nixos-tests.section.md
That paren couldn't possibly have been in the right place.
(I do not have nix set up to generate `writing-nixos-tests.section.xml` or verify the test or anything, please do whatever is appropriate with this trivial change)
* doc: fix numpy example test value
Making the test test the right thing made it fail
see PR discussion
The new format is based on the existing wrapper and generates an INI file with an unnamed global section at the top as is used by *stunnel* for instance.
Technically the INI format is a subset of this however testing, type checking, and API guarantees profit from two separate generators.
Co-authored-by: tim-tx <tim-tx@users.noreply.github.com>
Signed-off-by: benaryorg <binary@benary.org>