infra/nix/ops/nanos@kn.nix

26 lines
722 B
Nix
Raw Normal View History

2023-02-07 18:24:28 +01:00
{
nixpkgs ? import <nixpkgs> {},
nrNanos ? 1, # Number of nanos
}: let
2015-10-23 01:26:53 +02:00
pkgs = nixpkgs;
2022-10-31 11:04:38 +01:00
webserver = {
services.httpd.enable = true;
services.httpd.adminAddr = "mail@stefanjunker.de";
services.httpd.documentRoot = "${pkgs.nixops}/share/doc/nixops/";
2023-02-07 18:24:28 +01:00
networking.firewall.allowedTCPPorts = [80];
2015-10-23 01:26:53 +02:00
};
2023-02-07 18:24:28 +01:00
mkNano = {n}: {
2022-10-31 11:04:38 +01:00
imports = [
2023-02-07 18:24:28 +01:00
(import ./nano/configuration.nix {inherit pkgs n;})
2022-10-31 11:04:38 +01:00
../configuration/common/user/root.nix
];
deployment.targetEnv = "none";
deployment.targetHost = "nano${toString n}";
2015-10-23 01:26:53 +02:00
};
2022-10-31 11:04:38 +01:00
mkNanos = n:
2023-02-07 18:24:28 +01:00
nixpkgs.lib.nameValuePair "nano${toString n}" (mkNano {inherit n;});
in
nixpkgs.lib.listToAttrs (map mkNanos (nixpkgs.lib.range 0 (nrNanos - 1)))