From 0d37af4eba374c41a9ad3fa8d2f2251ddb6b58c5 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 3 Apr 2020 16:43:51 -0700 Subject: Rename Serval to Prod --- Com/Simatime/Prod/configuration.nix | 11 +++++++++++ Com/Simatime/Prod/hardware.nix | 6 ++++++ Com/Simatime/Prod/networking.nix | 28 ++++++++++++++++++++++++++++ Com/Simatime/Serval/Test.scm | 11 ----------- Com/Simatime/Serval/configuration.nix | 11 ----------- Com/Simatime/Serval/hardware.nix | 6 ------ Com/Simatime/Serval/networking.nix | 28 ---------------------------- Com/Simatime/buildOS.nix | 6 +++--- default.nix | 19 +++++++++---------- push-all | 18 +++++++----------- 10 files changed, 64 insertions(+), 80 deletions(-) create mode 100644 Com/Simatime/Prod/configuration.nix create mode 100755 Com/Simatime/Prod/hardware.nix create mode 100755 Com/Simatime/Prod/networking.nix delete mode 100644 Com/Simatime/Serval/Test.scm delete mode 100644 Com/Simatime/Serval/configuration.nix delete mode 100755 Com/Simatime/Serval/hardware.nix delete mode 100755 Com/Simatime/Serval/networking.nix diff --git a/Com/Simatime/Prod/configuration.nix b/Com/Simatime/Prod/configuration.nix new file mode 100644 index 0000000..d5ad02f --- /dev/null +++ b/Com/Simatime/Prod/configuration.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: +{ + networking.firewall.allowedTCPPorts = [ 22 80 443 ]; + services.que-server = { + enable = true; + domain = "que.run"; + port = 3000; + package = pkgs.biz.que-server; + }; + services.nginx.enable = true; +} diff --git a/Com/Simatime/Prod/hardware.nix b/Com/Simatime/Prod/hardware.nix new file mode 100755 index 0000000..8c88cb7 --- /dev/null +++ b/Com/Simatime/Prod/hardware.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ ]; + boot.loader.grub.device = "/dev/vda"; + fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; }; +} diff --git a/Com/Simatime/Prod/networking.nix b/Com/Simatime/Prod/networking.nix new file mode 100755 index 0000000..79fbe27 --- /dev/null +++ b/Com/Simatime/Prod/networking.nix @@ -0,0 +1,28 @@ +{ lib, ... }: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ + "67.207.67.2" + "67.207.67.3" + ]; + defaultGateway = "157.245.160.1"; + defaultGateway6 = ""; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce true; + interfaces = { + eth0 = { + ipv4.addresses = [ + { address="157.245.167.217"; prefixLength=20; } + { address="10.46.0.8"; prefixLength=16; } + ]; + ipv6.addresses = [ + { address="fe80::242a:8bff:feb7:6afb"; prefixLength=64; } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="26:2a:8b:b7:6a:fb", NAME="eth0" + ''; +} diff --git a/Com/Simatime/Serval/Test.scm b/Com/Simatime/Serval/Test.scm deleted file mode 100644 index 44e88c0..0000000 --- a/Com/Simatime/Serval/Test.scm +++ /dev/null @@ -1,11 +0,0 @@ -(define-module (Com Simatime Serval Test) - #:use-module (Com Simatime Serval) - #:use-module (Com Simatime core) - #:use-module (Com Simatime Test)) - -(comment - ;; TODO: make this a real test - (let ((kit (Kit "test-kit" "/nix/path" "/nix/config" - "123.456.0.0" 80 "127.0.0.1" #t))) - (testing "ser-deser are opposite functions" - (equal? kit (deserialize (serialize kit)))))) diff --git a/Com/Simatime/Serval/configuration.nix b/Com/Simatime/Serval/configuration.nix deleted file mode 100644 index d5ad02f..0000000 --- a/Com/Simatime/Serval/configuration.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: -{ - networking.firewall.allowedTCPPorts = [ 22 80 443 ]; - services.que-server = { - enable = true; - domain = "que.run"; - port = 3000; - package = pkgs.biz.que-server; - }; - services.nginx.enable = true; -} diff --git a/Com/Simatime/Serval/hardware.nix b/Com/Simatime/Serval/hardware.nix deleted file mode 100755 index 8c88cb7..0000000 --- a/Com/Simatime/Serval/hardware.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ ]; - boot.loader.grub.device = "/dev/vda"; - fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; }; -} diff --git a/Com/Simatime/Serval/networking.nix b/Com/Simatime/Serval/networking.nix deleted file mode 100755 index 79fbe27..0000000 --- a/Com/Simatime/Serval/networking.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, ... }: { - # This file was populated at runtime with the networking - # details gathered from the active system. - networking = { - nameservers = [ - "67.207.67.2" - "67.207.67.3" - ]; - defaultGateway = "157.245.160.1"; - defaultGateway6 = ""; - dhcpcd.enable = false; - usePredictableInterfaceNames = lib.mkForce true; - interfaces = { - eth0 = { - ipv4.addresses = [ - { address="157.245.167.217"; prefixLength=20; } - { address="10.46.0.8"; prefixLength=16; } - ]; - ipv6.addresses = [ - { address="fe80::242a:8bff:feb7:6afb"; prefixLength=64; } - ]; - }; - }; - }; - services.udev.extraRules = '' - ATTR{address}=="26:2a:8b:b7:6a:fb", NAME="eth0" - ''; -} diff --git a/Com/Simatime/buildOS.nix b/Com/Simatime/buildOS.nix index b2fc928..eb20d88 100644 --- a/Com/Simatime/buildOS.nix +++ b/Com/Simatime/buildOS.nix @@ -7,9 +7,9 @@ nixos: , deps ? {} # added under pkgs.biz , configuration # see: configuration.nix(5) }: -assert enableVpn -> builtins.isString ipAddress; -assert enableVpn -> builtins.isString vpnRsaPrivateKeyFile; -assert enableVpn -> builtins.isString vpnEd25519PrivateKeyFile; +# assert enableVpn -> builtins.isString ipAddress; +# assert enableVpn -> builtins.isString vpnRsaPrivateKeyFile; +# assert enableVpn -> builtins.isString vpnEd25519PrivateKeyFile; let vpnExtraConfig = if enableVpn then '' ConnectTo = ${vpnConnectTo} diff --git a/default.nix b/default.nix index 753483d..60b67b3 100644 --- a/default.nix +++ b/default.nix @@ -17,8 +17,6 @@ in rec { Com.Simatime.Cloud = buildOS { enableVpn = true; ipAddress = "159.89.128.69"; - vpnRsaPrivateKeyFile = "/etc/tinc/rsa_key.priv"; - vpnEd25519PrivateKeyFile = "/etc/tinc/ed25519_key.priv"; configuration = { imports = [ ./Com/Simatime/packages.nix @@ -40,7 +38,7 @@ in rec { # Com.Simatime.Dev = buildOS { enableVpn = true; - ipAddress = "69.181.254.154"; + ipAddress = "73.222.221.63"; configuration = { imports = [ ./Com/Simatime/packages.nix @@ -52,20 +50,21 @@ in rec { networking.domain = "dev.simatime.com"; }; }; - # Serval is the production server for apps + # The production server for apps # - Com.Simatime.Serval = buildOS { + Com.Simatime.Prod = buildOS { deps = { que-server = Run.Que.Server; }; configuration = { imports = [ ./Com/Simatime/packages.nix - ./Com/Simatime/Serval/hardware.nix - ./Com/Simatime/Serval/networking.nix - ./Com/Simatime/Serval/configuration.nix + ./Com/Simatime/users.nix + ./Com/Simatime/Prod/hardware.nix + ./Com/Simatime/Prod/networking.nix + ./Com/Simatime/Prod/configuration.nix ./Run/Que/service.nix ]; - networking.hostName = "serval"; - networking.domain = "serval.simatime.com"; + networking.hostName = "prod"; + networking.domain = "prod.simatime.com"; boot.enableContainers = true; }; }; diff --git a/push-all b/push-all index cc89338..32d0c5a 100755 --- a/push-all +++ b/push-all @@ -1,15 +1,11 @@ #!/usr/bin/env bash +set -ex -./bild Com.Simatime.Cloud -./push Com.Simatime.Cloud simatime.com +bild Com.Simatime.Cloud +push Com.Simatime.Cloud simatime.com -./bild Com.Simatime.Dev -./push Com.Simatime.Dev dev.simatime.com +bild Com.Simatime.Dev +push Com.Simatime.Dev dev.simatime.com -# these are todos: - -#bild Com.InfluencedByBooks -#push Com.InfluencedByBooks influencedbybooks.com - -#bild Com.MusicMeetsComics -#push Com.MusicMeetsComics musicmeetscomics.com +bild Com.Simatime.Prod +push Com.Simatime.Prod prod.simatime.com -- cgit v1.2.3