From ed305126a23f7e27e28e157b6d47ff13fb9ab58b Mon Sep 17 00:00:00 2001 From: marc Date: Sun, 22 Dec 2024 16:15:46 +0100 Subject: [PATCH] Added quinto host --- data/nomad/cua-quinto.nomad | 46 +++++++++++++++++++++++++++++++ hosts/quinto/default.nix | 55 +++++++++++++++++++++++++++++++++++++ hosts/quinto/hardware.nix | 36 ++++++++++++++++++++++++ hosts/quinto/quinto.org | 2 ++ hosts/quinto/secrets.nix | 6 ++++ 5 files changed, 145 insertions(+) create mode 100644 data/nomad/cua-quinto.nomad create mode 100644 hosts/quinto/default.nix create mode 100644 hosts/quinto/hardware.nix create mode 100644 hosts/quinto/quinto.org create mode 100644 hosts/quinto/secrets.nix diff --git a/data/nomad/cua-quinto.nomad b/data/nomad/cua-quinto.nomad new file mode 100644 index 0000000..82fbc76 --- /dev/null +++ b/data/nomad/cua-quinto.nomad @@ -0,0 +1,46 @@ +job "cua-quinto" { + region = "global" + datacenters = ["samfelag"] + type = "service" + + group "cua-quinto" { + count = 1 + + restart { + attempts = 5 + delay = "15s" + } + + network { + port "http" { + to = 80 + } + } + + # CUA-QUINTO APP + task "cua-quinto" { + driver = "docker" + + env { + API_PREFIX = "/cua-quinto" + API_SCHEME = "https" + } + + config { + image = "marc.sastre.cat/quinto-cua:latest" + ports = ["http"] + } + + resources { + cpu = 50 + memory = 64 + } + + service { + name = "cua-quinto" + port = "http" + } + } + } +} + diff --git a/hosts/quinto/default.nix b/hosts/quinto/default.nix new file mode 100644 index 0000000..11191ca --- /dev/null +++ b/hosts/quinto/default.nix @@ -0,0 +1,55 @@ +{ config, pkgs, lib, inputs, ... }: + +with lib; +{ + imports = [ + ./hardware.nix + ./secrets.nix + ]; + + # - Basic -------------------------------------- + + user.name = "marc"; + user.shell = pkgs.zsh; + networking = { + hostName = "quinto"; + firewall = { + enable = false; + allowedUDPPorts = [ + ]; + }; + }; + + # - Bootloader --------------------------------- + + boot.loader.grub = { + enable = true; + device = "/dev/vda"; + }; + + # - Agenix --------------------------------- + + age.identityPaths = [ + "/home/marc/.ssh/id_ed25519" + ]; + + # - Modules ------------------------------------ + + samfelag.modules = { + # - Common ----------------------------------- + # See modules/common.nix for common packages installed + + # - System ----------------------------------- + system.utils.enable = true; + system.ssh.enable = true; + + # - Server ---------------------------------- + + # - Editors and development ------------------ + dev.git.userName = "marc"; + dev.git.userEmail = "marc@sastre.cat"; + + dev.docker.enable = true; + dev.docker.users = ["marc"]; + }; +} diff --git a/hosts/quinto/hardware.nix b/hosts/quinto/hardware.nix new file mode 100644 index 0000000..8d24782 --- /dev/null +++ b/hosts/quinto/hardware.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ ]; + + boot = { + initrd = { + availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + kernelModules = [ ]; + }; + kernelModules = [ ]; + extraModulePackages = [ ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; + + networking = { + useDHCP = lib.mkDefault true; + interfaces = { + ens3.useDHCP = lib.mkDefault true; + }; + nameservers = [ "108.61.10.10" ]; + }; + + virtualisation.hypervGuest.enable = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/quinto/quinto.org b/hosts/quinto/quinto.org new file mode 100644 index 0000000..1a49f49 --- /dev/null +++ b/hosts/quinto/quinto.org @@ -0,0 +1,2 @@ +* Quinto +Servidor a Vultr per a la cua del quinto diff --git a/hosts/quinto/secrets.nix b/hosts/quinto/secrets.nix new file mode 100644 index 0000000..36ff274 --- /dev/null +++ b/hosts/quinto/secrets.nix @@ -0,0 +1,6 @@ +{ ... }: + +{ + age.secrets = { + }; +}