Skip to content

Instantly share code, notes, and snippets.

@danderson
Created October 24, 2020 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danderson/8fb37571768945456df8801d8e9aee18 to your computer and use it in GitHub Desktop.
Save danderson/8fb37571768945456df8801d8e9aee18 to your computer and use it in GitHub Desktop.
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03";
inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.hydra.url = "github:NixOS/hydra";
outputs = { self, nixpkgs, nixpkgs-unstable, hydra }: {
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[ ./test.nix # tries to reference stuff in `hydra` from above
({ pkgs, ... }: {
boot.isContainer = true;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs-unstable.lib.mkIf (self ? rev) self.rev;
# Network configuration.
networking.useDHCP = false;
networking.firewall.allowedTCPPorts = [ 80 ];
# Enable a web server.
services.httpd = {
enable = true;
adminAddr = "morty@example.org";
};
})
];
};
};
}
{ hydra, ... }: {
require =[ hydra.nixosModules.hydraTest ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment