You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let
# Pin the deployment package-set to a specific version of nixpkgs
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/98d9589819218971a95fd64c172fe5996a9734f5.tar.gz";
sha256 = "0blscxj13qbcnlxkzwjsyqa80ssnx9wm0wz0bg6gkc1fa412w4f9";
}) {};
in
{
network = {
inherit pkgs;
description = "simple hosts";
};
"web01.example.com" = { config, pkgs, ... }: {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nixpkgs.overlays = [(self: super: {
my_hello = (if super?my_hello then throw "fail" else super.hello);
})];
environment.systemPackages = with pkgs; [ my_hello ];
fileSystems = {
"/" = { label = "nixos"; fsType = "ext4"; };
"/boot" = { label = "boot"; fsType = "vfat"; };
};
};
}
morph build fails to build this derivation because the throw is triggered. This means that the overlay is applied twice.
This causes real world issues when for example you use an overlay to apply a patch to a package: patches = old.patches ++ [ ./mypatch ]; will end up appending the patch twice, causing build failures.
Both nixops and the normal nixos-config handle this case correctly and apply the overlay only once.
cc @Shados (again, sorry :P I'm working through the issues trying to migrate my small network from nixops to morph)
The text was updated successfully, but these errors were encountered:
Example repro:
morph build
fails to build this derivation because thethrow
is triggered. This means that the overlay is applied twice.This causes real world issues when for example you use an overlay to apply a patch to a package:
patches = old.patches ++ [ ./mypatch ];
will end up appending the patch twice, causing build failures.Both nixops and the normal nixos-config handle this case correctly and apply the overlay only once.
cc @Shados (again, sorry :P I'm working through the issues trying to migrate my small network from nixops to morph)
The text was updated successfully, but these errors were encountered: