terraform dummy server improvement

This commit is contained in:
Ingolf Wagner 2020-11-12 23:50:09 +01:00
parent bd930e20c8
commit 5821402d13
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 35 additions and 7 deletions

View file

@ -19,3 +19,17 @@ nixos-generate -f vmware -c config.nix
``` ```
nixos-generate --run -c config.nix nixos-generate --run -c config.nix
``` ```
## how to install nixos-generators
```
nix-shell -I nixpkgs=channel:nixos-unstable -p nixos-generators
```
## how to start download service
```
iptables -F # kill firewall
python -m http.server 80 # nix-shell -p python3Full
```

View file

@ -2,9 +2,15 @@
let let
hcloud-modules = pkgs.fetchgit { hcloud-modules = pkgs.fetchgit {
url = "https://github.com/mrVanDalo/terranix-hcloud.git"; url = "https://github.com/mrVanDalo/terranix-hcloud.git";
rev = "c3571f76664e1813f90d97b8c194a1e0149e895e"; rev = "5fa359a482892cd973dcc6ecfc607f4709f24495";
sha256 = "0plld74wincyy3c5gdfqh78pzrqibxh6r839dm0c717fajr9imwb"; sha256 = "0smgmdiklj98y71fmcdjsqjq8l41i66hs8msc7k4m9dpkphqk86p";
}; };
#nixosInfect = pkgs.fetchgit {
# "url" = "https://github.com/elitak/nixos-infect.git";
# rev = "928f9e5e1d63e77a91f2ca57ffa2be1fef3078ec";
#sha256 = "0rs84c549l863vbnnqgnx7v6m2zlq0wz46jbhm4v1l1a25d966s1";
#};
in { in {
imports = [ (toString hcloud-modules) ]; imports = [ (toString hcloud-modules) ];
@ -20,6 +26,17 @@ in {
hcloud.nixserver = { hcloud.nixserver = {
playground = { playground = {
enable = true; enable = true;
channel = "nixos-20.09";
provisioners = [
#{
# file.source = "${nixosInfect}/nixos-infect";
# file.destination = "/root/nixos-infect";
#}
{
file.source = "${toString ./../../images/translate-setup}";
file.destination = "/root/translate-setup";
}
];
configurationFile = pkgs.writeText "configuration.nix" '' configurationFile = pkgs.writeText "configuration.nix" ''
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ environment.systemPackages = [ pkgs.git ]; } { environment.systemPackages = [ pkgs.git ]; }
@ -27,6 +44,4 @@ in {
}; };
}; };
hcloud.export.nix = null;
} }

View file

@ -1,10 +1,9 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
let let
terranix = pkgs.callPackage (pkgs.fetchgit { terranix = pkgs.callPackage (pkgs.fetchgit {
url = "https://github.com/mrVanDalo/terranix.git"; url = "https://github.com/mrVanDalo/terranix.git";
rev = "dfbf4d1fae08da8052ff880c5d02b2eb5857d54c"; rev = "2.3.0";
sha256 = "1qilbvldlq7ybxa3yx99hb8vbmj0sk5x9qqxa4f1czpzj2mja0fn"; sha256 = "030067h3gjc02llaa7rx5iml0ikvw6szadm0nrss2sqzshsfimm4";
}) { }; }) { };
terraform = pkgs.writers.writeBashBin "terraform" '' terraform = pkgs.writers.writeBashBin "terraform" ''