aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-29 13:28:02 -0300
committerEuAndreh <eu@euandre.org>2021-07-29 13:28:02 -0300
commit011d702cce8c112b30fc21333fe5d91f1ae888ef (patch)
treef63f92f6389dcfbbd0e80b50b245cf2028946a60
parentscripts/deploy: Follow symlinks on rsync (diff)
downloadtoph-011d702cce8c112b30fc21333fe5d91f1ae888ef.tar.gz
toph-011d702cce8c112b30fc21333fe5d91f1ae888ef.tar.xz
mv servers{ => /active}/nixvps
-rw-r--r--servers/active/nixvps/hostname.txt (renamed from servers/nixvps/hostname.txt)0
-rw-r--r--servers/active/nixvps/infrastructure.tf (renamed from servers/nixvps/infrastructure.tf)0
-rw-r--r--servers/active/nixvps/tld.txt (renamed from servers/nixvps/tld.txt)0
-rw-r--r--servers/nixvps/configuration.nix156
l---------servers/nixvps/envsubst-configuration.nix1
5 files changed, 0 insertions, 157 deletions
diff --git a/servers/nixvps/hostname.txt b/servers/active/nixvps/hostname.txt
index fbab93b..fbab93b 100644
--- a/servers/nixvps/hostname.txt
+++ b/servers/active/nixvps/hostname.txt
diff --git a/servers/nixvps/infrastructure.tf b/servers/active/nixvps/infrastructure.tf
index 2721c56..2721c56 100644
--- a/servers/nixvps/infrastructure.tf
+++ b/servers/active/nixvps/infrastructure.tf
diff --git a/servers/nixvps/tld.txt b/servers/active/nixvps/tld.txt
index 0cb8b8b..0cb8b8b 100644
--- a/servers/nixvps/tld.txt
+++ b/servers/active/nixvps/tld.txt
diff --git a/servers/nixvps/configuration.nix b/servers/nixvps/configuration.nix
deleted file mode 100644
index 0a51b68..0000000
--- a/servers/nixvps/configuration.nix
+++ /dev/null
@@ -1,156 +0,0 @@
-{ config, pkgs, ... }:
-
-let
- envsubstConfiguration =
- pkgs.callPackage /etc/nixos/envsubst-configuration.nix { };
- config = rec {
- TLD = envsubstConfiguration.TLD;
- openSSHPort = 23841;
- };
-in {
- imports = [ ./hardware-configuration.nix ];
-
- boot.loader.grub = {
- enable = true;
- version = 2;
- device = "/dev/vda";
- };
-
- networking = {
- interfaces.ens3.useDHCP = true;
- };
-
- nix = {
- gc = {
- automatic = true;
- options = "--delete-older-than 7d";
- };
- # min-free 1G
- extraOptions = ''
- min-free = ${toString (1024 * 1024 * 1024)}
- '';
- };
-
- environment = {
- systemPackages = let
- c99 = pkgs.tinycc.overrideAttrs (oldAttrs: {
- postInstall = ''
- ln -s $out/bin/tcc $out/bin/c99
- '';
- });
- in with pkgs; [ vim git gitAndTools.git-annex gnumake gnum4 c99 bpytop ];
- shellAliases = { l = "ls -lahF"; };
- };
-
- networking.firewall.allowedTCPPorts = [
- # SSH: OpenSSH
- config.openSSHPort
-
- # HTTP and HTPPS: NGINX
- 80
- 443
- ];
-
- security = {
- acme = {
- acceptTerms = true;
- email = "eu@euandre.org";
- };
- sudo.enable = false;
- doas = {
- enable = true;
- extraConfig = ''
- permit nopass setenv { NIX_PATH } :wheel
- '';
- };
- };
-
- services = {
- openssh = {
- enable = true;
- permitRootLogin = "no";
- passwordAuthentication = false;
- ports = [ config.openSSHPort ];
- };
-
- nginx = {
- enable = true;
- recommendedGzipSettings = true;
- recommendedOptimisation = true;
- recommendedProxySettings = true;
- recommendedTlsSettings = true;
- virtualHosts = {
- "${config.TLD}" = {
- forceSSL = true;
- enableACME = true;
- root = "/srv/http/";
- extraConfig = ''
- # Allow <script type="module" src=""> 3rd-party HTML pages
- add_header 'Access-Control-Allow-Origin' '*';
- autoindex on;
- '';
- };
- };
- };
-
- cron = {
- enable = true;
- systemCronJobs = [
- "30 1 * * 1 root /opt/bin/gc.sh"
- "30 0 * * * root /opt/bin/backup.sh"
- ];
- };
- };
-
- users = {
- # Improve: make mutable
- mutableUsers = false;
- extraUsers = let
- andrehUser = {
- andreh = {
- uid = 1000;
- isNormalUser = true;
- extraGroups = [ "wheel" ];
- hashedPassword = envsubstConfiguration.hashedPassword;
- openssh.authorizedKeys.keys = [
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDF+uy407LKZAFnfFkJPRiOBzwV98qIEcKhITnLYhqfITfrJvcFVOY0/YDCrs6WHXyLdM29AoywVWsQ1qXiB7xQCwknPV8YZoCnJQcn0gvH8jbCk+C8Po0Rx846wbhL49qYolnmlhe+Uoy30j7XIJSDtPVO9d/hZqt2GPwGVJ98HLyY2ak+j4i1YkHr+mPFgnCaqCAzA374d1Bop18+YENYtMMU0k8hCsomwZny/7qNo4V8mjLxQAS8FvTuljxlthEpOM4Jsjl07yDLgE69kLvU7mmFi8EeC26e50N18Ouse82dZigtVhAMeLBhbJnQbDff4WfUBzSjpKjZPGcxoRaej3qSRbIkcMMqCOSlww6GcjRi+COvlpA4c1i4hKI15wHceoiKghDLA6jbaHfOqEMldflYl5gCVUIYzJ5XehZppH6L7PzO+L4suNs+aFjWPDZ0jqEtcyTmgTMea40p7wwz086ExnBDorbG79oDiJrWc+swJjXuVakS+fQjb3mPsCC/FgUhsxEtqiVfvLo2mphp47pOYvs64aUp3RV9muqQNuS4tEuP9V1urGTLtgPL26LEjF0oLu1ag0H+VZY5O/T9KRYvWre8IWbj/KkZYo1tJaGJyEVr0plmyzLBEy8b3Hu/6Wtq7yB0Eii60fxqFWC24nEkvs1V0cxDa+o6I2iA9w== eu@euandre.org"
- ];
- };
- };
- buildUser = (i: {
- "guixbuilder${i}" = {
- group = "guixbuild";
- extraGroups = [ "guixbuild" ];
- home = "/var/empty";
- shell = pkgs.nologin;
- description = "Guix build user ${i}";
- isSystemUser = true;
- };
- });
- in pkgs.lib.fold (str: acc: acc // buildUser str) andrehUser
- (map (pkgs.lib.fixedWidthNumber 2) (builtins.genList (n: n + 1) 10));
- extraGroups.guixbuild = { name = "guixbuild"; };
- };
-
- systemd = {
- services = {
- guix-daemon = {
- enable = true;
- description = "Build daemon for GNU Guix";
- serviceConfig = {
- ExecStart =
- "/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild";
- };
- wantedBy = [ "multi-user.target" ];
- };
- };
- };
-
- system = {
- stateVersion = "20.09";
- autoUpgrade = {
- enable = true;
- allowReboot = true;
- };
- };
-}
diff --git a/servers/nixvps/envsubst-configuration.nix b/servers/nixvps/envsubst-configuration.nix
deleted file mode 120000
index ab7c446..0000000
--- a/servers/nixvps/envsubst-configuration.nix
+++ /dev/null
@@ -1 +0,0 @@
-../../secrets/nixvps/envsubst-configuration.nix \ No newline at end of file