Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7cfd7367c185
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dca0b7187619
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Apr 13, 2020

  1. nixos/build-vms: propagate file location

    When trying to build a VM using `nixos-build-vms` with a configuration
    that doesn't evaluate, an error "at `<unknown-file>`" is usually shown.
    
    This happens since the `build-vms.nix` creates a VM-network of
    NixOS-configurations that are attr-sets or functions and don't contain
    any file information. This patch manually adds the `_file`-attribute to
    tell the module-system which file contained broken configuration:
    
    ```
    $ cat vm.nix
    { vm.invalid-option = 1; }
    
    $ nixos-build-vms vm.nix
    error: The option `invalid-option' defined in `/home/ma27/Projects/nixpkgs/vm.nix@node-vm' does not exist.
    (use '--show-trace' to show detailed location information)
    ```
    Ma27 committed Apr 13, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    Mic92 Jörg Thalheim
    Copy the full SHA
    ec6bac9 View commit details

Commits on Apr 15, 2020

  1. Merge pull request #85162 from Ma27/build-vms-file-loc

    nixos/build-vms: propagate file location
    Ma27 authored Apr 15, 2020
    Copy the full SHA
    dca0b71 View commit details
Showing with 6 additions and 1 deletion.
  1. +6 −1 nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
7 changes: 6 additions & 1 deletion nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,12 @@
, networkExpr
}:

let nodes = import networkExpr; in
let
nodes = builtins.mapAttrs (vm: module: {
_file = "${networkExpr}@node-${vm}";
imports = [ module ];
}) (import networkExpr);
in

with import ../../../../lib/testing-python.nix {
inherit system;