Created
October 3, 2020 08:11
-
-
Save johanot/164ace22de35ccad8259edfcae26ec07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
p = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-20.03.tar.gz"; | |
common = { pkgs, config, ... }: { | |
fileSystems."/" = { device = "/dev/null"; fsType = "ext4"; }; | |
boot.loader.grub.devices = ["/dev/null"]; | |
environment.systemPackages = [pkgs.ngrok]; | |
nixpkgs.pkgs = import p { # set pkgs globally, kind of the same way as "network.pkgs" does transiently | |
config.allowUnfree = true; | |
}; | |
}; | |
in | |
{ | |
host1 = { lib, ... }: { # this host will refuse to eval, because ngrok | |
imports = [ common ]; | |
nixpkgs.pkgs = lib.mkForce (import p { # overrides "common" | |
config.allowUnfree = false; | |
}); | |
}; | |
host2 = { ... }: { | |
imports = [ common ]; | |
}; | |
host3 = { ... }: { | |
imports = [ common ]; | |
}; | |
network = { # set morph dependencies, so that they don't leak in from environment | |
lib = import "${p}/lib"; | |
evalConfig = "${p}/nixos/lib/eval-config.nix"; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment