Compare commits
1 Commits
debug_mode
...
vaultwarde
| Author | SHA1 | Date | |
|---|---|---|---|
|
96af871f70
|
@@ -1,110 +0,0 @@
|
|||||||
name: Weekly Flake Update
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 4"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_and_check_flake:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
NIXPKGS_ALLOW_UNFREE: 1
|
|
||||||
steps:
|
|
||||||
- name: Install sudo
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y sudo
|
|
||||||
- name: Install Tea
|
|
||||||
env:
|
|
||||||
TEA_DL_URL: "https://dl.gitea.com/tea/0.9.2/tea-0.9.2-linux-amd64"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
TEA_DIR=$(mktemp -d -t tmp.XXXX)
|
|
||||||
pushd $TEA_DIR
|
|
||||||
wget "$TEA_DL_URL"
|
|
||||||
wget "${TEA_DL_URL}.sha256"
|
|
||||||
if $(sha256sum --quiet -c "tea-0.9.2-linux-amd64.sha256"); then
|
|
||||||
mv "tea-0.9.2-linux-amd64" /usr/bin/tea
|
|
||||||
chmod +x /usr/bin/tea
|
|
||||||
popd
|
|
||||||
rm -rf $TEA_DIR
|
|
||||||
else
|
|
||||||
popd
|
|
||||||
rm -rf $TEA_DIR
|
|
||||||
echo "::error title=⛔ error hint::Tea v0.9.2 Checksum Failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v6
|
|
||||||
- name: Set up Nix
|
|
||||||
uses: https://github.com/cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
github_access_token: ${{ secrets.AHTLONS_GITHUB_TOKEN }} #Fuck github
|
|
||||||
|
|
||||||
- name: Run nix flake update
|
|
||||||
run: nix flake update
|
|
||||||
|
|
||||||
- name: Commit flake.lock
|
|
||||||
run: |
|
|
||||||
git config user.name "malobot"
|
|
||||||
git config user.email "malobot@systemli.org"
|
|
||||||
git stash push
|
|
||||||
git branch nixpkgs_bump_$(date +%Y%m%d)
|
|
||||||
git checkout nixpkgs_bump_$(date +%Y%m%d)
|
|
||||||
git stash pop
|
|
||||||
git add flake.lock
|
|
||||||
git diff --staged --quiet || git commit -m "Update flake.lock"
|
|
||||||
|
|
||||||
- name: Check for eval warnings
|
|
||||||
id: commit
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
{
|
|
||||||
echo "COMMIT_DESC<<EOF"
|
|
||||||
echo "Date: $(date)"
|
|
||||||
echo "Evaluation warnings:"
|
|
||||||
nix flake check --all-systems --no-build 2>&1 | grep evaluation | awk '!seen[$0]++' || echo "None :)"
|
|
||||||
echo EOF
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Login to Gitea
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GIT_SERVER_URL: https://git.dynamicdiscord.de
|
|
||||||
GIT_SERVER_TOKEN: ${{ secrets.AHTLONS_GITEA_TOKEN }}
|
|
||||||
run: >-
|
|
||||||
tea login add
|
|
||||||
-u "$GIT_SERVER_URL"
|
|
||||||
-t "$GIT_SERVER_TOKEN"
|
|
||||||
- name: Check for existing pull request
|
|
||||||
id: no-pr
|
|
||||||
continue-on-error: true
|
|
||||||
shell: bash
|
|
||||||
run: >-
|
|
||||||
tea pr -f head -o simple |
|
|
||||||
grep -q ${{ github.ref_name }} &&
|
|
||||||
exit 1 ||
|
|
||||||
exit 0
|
|
||||||
- name: Force push branch
|
|
||||||
run: git push --force -u origin nixpkgs_bump_$(date +%Y%m%d)
|
|
||||||
- name: Create pull request
|
|
||||||
if: steps.no-pr.outcome == 'success'
|
|
||||||
env:
|
|
||||||
COMMIT_MSG: Automatic Nixpkgs update
|
|
||||||
COMMIT_DESC: ${{ steps.commit.outputs.COMMIT_DESC }}
|
|
||||||
shell: bash
|
|
||||||
run: >-
|
|
||||||
tea pr create
|
|
||||||
-L "bump"
|
|
||||||
-t "$COMMIT_MSG"
|
|
||||||
-d "$COMMIT_DESC"
|
|
||||||
- name: Skip pull request
|
|
||||||
if: steps.no-pr.outcome == 'failure'
|
|
||||||
shell: bash
|
|
||||||
run: >
|
|
||||||
echo "::error title=⛔ error hint::
|
|
||||||
A PR already exists for this branch: ${{ github.ref_name }}"
|
|
||||||
39
flake.lock
generated
39
flake.lock
generated
@@ -21,27 +21,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dns": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1768143854,
|
|
||||||
"narHash": "sha256-E5/kyPz4zAZn/lZdvqlF83jMgCWNxmqYjjWuadngCbk=",
|
|
||||||
"owner": "kirelagin",
|
|
||||||
"repo": "dns.nix",
|
|
||||||
"rev": "a97cf4156e9f044fe4bed5be531061000dfabb07",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "kirelagin",
|
|
||||||
"repo": "dns.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ep3-bs": {
|
"ep3-bs": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -64,21 +43,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1614513358,
|
|
||||||
"narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_3"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
@@ -138,7 +102,7 @@
|
|||||||
},
|
},
|
||||||
"microvm": {
|
"microvm": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
@@ -261,7 +225,6 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"dns": "dns",
|
|
||||||
"ep3-bs": "ep3-bs",
|
"ep3-bs": "ep3-bs",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mfsync": "mfsync",
|
"mfsync": "mfsync",
|
||||||
|
|||||||
@@ -13,11 +13,6 @@
|
|||||||
disko.url = "github:nix-community/disko/latest";
|
disko.url = "github:nix-community/disko/latest";
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
dns = {
|
|
||||||
url = "github:kirelagin/dns.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
utils = {
|
utils = {
|
||||||
url = "github:numtide/flake-utils";
|
url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ with lib;
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = true;
|
logNginx = true;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.malobeo-tasklist.enable = true;
|
services.malobeo-tasklist.enable = true;
|
||||||
|
|||||||
@@ -43,6 +43,20 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."cloud.malobeo.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME= true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.0.0.10";
|
||||||
|
extraConfig = ''
|
||||||
|
client_max_body_size 10G;
|
||||||
|
client_body_timeout 3600s;
|
||||||
|
send_timeout 3600s;
|
||||||
|
fastcgi_buffers 64 4K;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."keys.malobeo.org" = {
|
services.nginx.virtualHosts."keys.malobeo.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME= true;
|
enableACME= true;
|
||||||
@@ -53,6 +67,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."grafana.malobeo.org" = {
|
services.nginx.virtualHosts."grafana.malobeo.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME= true;
|
enableACME= true;
|
||||||
@@ -73,6 +88,24 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."zines.malobeo.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME= true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.0.0.10";
|
||||||
|
extraConfig = ''
|
||||||
|
client_body_in_file_only clean;
|
||||||
|
client_body_buffer_size 32K;
|
||||||
|
|
||||||
|
client_max_body_size 500M;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
send_timeout 300s;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."status.malobeo.org" = {
|
services.nginx.virtualHosts."status.malobeo.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME= true;
|
enableACME= true;
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
{ inputs, config, lib, ... }:
|
{ inputs, config, ... }:
|
||||||
let
|
let
|
||||||
sshKeys = import ../ssh_keys.nix;
|
sshKeys = import ../ssh_keys.nix;
|
||||||
peers = import ../modules/malobeo/peers.nix;
|
peers = import ../modules/malobeo/peers.nix;
|
||||||
hosts = import ../hosts.nix {};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
sops.secrets.wg_private = {};
|
sops.secrets.wg_private = {};
|
||||||
sops.secrets.shop_auth = {};
|
sops.secrets.shop_auth = {};
|
||||||
sops.secrets.njala_api_key = {};
|
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
@@ -23,7 +21,6 @@ in
|
|||||||
inputs.self.nixosModules.malobeo.metrics
|
inputs.self.nixosModules.malobeo.metrics
|
||||||
inputs.self.nixosModules.malobeo.users
|
inputs.self.nixosModules.malobeo.users
|
||||||
inputs.self.nixosModules.malobeo.backup
|
inputs.self.nixosModules.malobeo.backup
|
||||||
./dyndns.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
virtualisation.vmVariantWithDisko = {
|
virtualisation.vmVariantWithDisko = {
|
||||||
@@ -37,7 +34,7 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = true;
|
logNginx = true;
|
||||||
lokiHost = hosts.malobeo.hosts.overwatch.network.address;
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
malobeo.autoUpdate = {
|
malobeo.autoUpdate = {
|
||||||
@@ -47,10 +44,6 @@ in
|
|||||||
jobset = "infrastructure";
|
jobset = "infrastructure";
|
||||||
cacheurl = "https://cache.dynamicdiscord.de";
|
cacheurl = "https://cache.dynamicdiscord.de";
|
||||||
};
|
};
|
||||||
specialisation."NOAUTOUPDATE".configuration = {
|
|
||||||
system.nixos.tags = [ "NOAUTOUPDATE" ];
|
|
||||||
malobeo.autoUpdate.enable = lib.mkForce false;
|
|
||||||
};
|
|
||||||
|
|
||||||
malobeo.backup = {
|
malobeo.backup = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -135,13 +128,7 @@ in
|
|||||||
privateKeyFile = config.sops.secrets.wg_private.path;
|
privateKeyFile = config.sops.secrets.wg_private.path;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.malobeo.microvm = {
|
services.malobeo.microvm.enableHostBridge = true;
|
||||||
enableHostBridge = true;
|
|
||||||
interface = "enp1s0";
|
|
||||||
gateway = "192.168.1.1";
|
|
||||||
address = "192.168.1.103/24";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.malobeo.microvm.deployHosts = [
|
services.malobeo.microvm.deployHosts = [
|
||||||
"overwatch"
|
"overwatch"
|
||||||
"infradocs"
|
"infradocs"
|
||||||
@@ -159,17 +146,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ 80 443 ];
|
allowedTCPPorts = [ 80 ];
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults.email = "malobeo@systemli.org";
|
|
||||||
defaults = {
|
|
||||||
dnsProvider = "njalla";
|
|
||||||
credentialsFile = config.sops.secrets.njala_api_key.path;
|
|
||||||
dnsPropagationCheck = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -177,34 +154,16 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts."docs.malobeo.org" = {
|
virtualHosts."docs.malobeo.org" = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.infradocs.network.address}:9000";
|
proxyPass = "http://10.0.0.11:9000";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualHosts."cloud.hq.malobeo.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
acmeRoot = null;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.nextcloud.network.address}";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
|
||||||
client_body_timeout 3600s;
|
|
||||||
send_timeout 3600s;
|
|
||||||
fastcgi_buffers 64 4K;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."cloud.malobeo.org" = {
|
virtualHosts."cloud.malobeo.org" = {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.nextcloud.network.address}";
|
proxyPass = "http://10.0.0.13";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
||||||
@@ -217,7 +176,7 @@ in
|
|||||||
|
|
||||||
virtualHosts."keys.malobeo.org" = {
|
virtualHosts."keys.malobeo.org" = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.vaultwarden.network.address}";
|
proxyPass = "http://10.0.0.16";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
'';
|
'';
|
||||||
@@ -226,7 +185,7 @@ in
|
|||||||
|
|
||||||
virtualHosts."grafana.malobeo.org" = {
|
virtualHosts."grafana.malobeo.org" = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.overwatch.network.address}";
|
proxyPass = "http://10.0.0.14";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
'';
|
'';
|
||||||
@@ -235,38 +194,19 @@ in
|
|||||||
|
|
||||||
virtualHosts."tasklist.malobeo.org" = {
|
virtualHosts."tasklist.malobeo.org" = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.durruti.network.address}:8080";
|
proxyPass = "http://10.0.0.5:8080";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualHosts."zines.hq.malobeo.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
acmeRoot = null;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.zineshop.network.address}:8080";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
client_body_in_file_only clean;
|
|
||||||
client_body_buffer_size 32K;
|
|
||||||
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
send_timeout 300s;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."zines.malobeo.org" = {
|
virtualHosts."zines.malobeo.org" = {
|
||||||
forceSSL = true;
|
# created with: nix-shell --packages apacheHttpd --run 'htpasswd -B -c foo.txt malobeo'
|
||||||
enableACME = true;
|
# then content of foo.txt put into sops
|
||||||
|
# basicAuthFile = config.sops.secrets.shop_auth.path;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${hosts.malobeo.hosts.zineshop.network.address}:8080";
|
proxyPass = "http://10.0.0.15:8080";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
wg_private: ENC[AES256_GCM,data:YEmIfgtyHE9msYijva0Ye2w7shVmYBPZ3mcKRF7Cy20xa6yHEUQ0kC2OWnM=,iv:ouK6fHcrxrEtsmiPmtCz9Ca8Ec1algOifrgZSBNHi74=,tag:524e/SQt++hwVyeWruCsLg==,type:str]
|
wg_private: ENC[AES256_GCM,data:YEmIfgtyHE9msYijva0Ye2w7shVmYBPZ3mcKRF7Cy20xa6yHEUQ0kC2OWnM=,iv:ouK6fHcrxrEtsmiPmtCz9Ca8Ec1algOifrgZSBNHi74=,tag:524e/SQt++hwVyeWruCsLg==,type:str]
|
||||||
njala_api_key: ENC[AES256_GCM,data:uEzx7KeI7ZZP63Igu5vHmuvASVxJai8bezM40UZVobQMr7r6opjnVTc0BPyIGfnG2mx/6Bo=,iv:lch04oGn6bkqtBGVzYlz6B97FGXlGOoxkiT1IplSxm4=,tag:bzXx2jSqFBv1hgJO1r5i+w==,type:str]
|
|
||||||
njalacloud: ENC[AES256_GCM,data:Xg85D9LMMYd8po8vrpxHZA==,iv:L5Gsm3bX61WW1PAdWswFNrScFoBipS2qDGU7iTubt1U=,tag:M2PCfE1h4IkW/iFq8XeIrA==,type:str]
|
|
||||||
njalazines: ENC[AES256_GCM,data:ooDRj4HqKVFrgRyzgFGQjg==,iv:9X8r1eY+6FqXv19mO0uMRd5A2tpvtmT11P77t9BQaCk=,tag:4BE55c8x66/UxyTCpCmdUg==,type:str]
|
|
||||||
sops:
|
sops:
|
||||||
|
kms: []
|
||||||
|
gcp_kms: []
|
||||||
|
azure_kv: []
|
||||||
|
hc_vault: []
|
||||||
age:
|
age:
|
||||||
- recipient: age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
- recipient: age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
||||||
enc: |
|
enc: |
|
||||||
@@ -22,8 +23,8 @@ sops:
|
|||||||
NjJ5cFdTVS9NZmVWMjcrcHo2WDZEZDgKiDwkuUn90cDmidwYGZBb5qp+4R1HafV0
|
NjJ5cFdTVS9NZmVWMjcrcHo2WDZEZDgKiDwkuUn90cDmidwYGZBb5qp+4R1HafV0
|
||||||
vMQfjT9GrwB5K/O1GumOmvbzLNhvO2vRZJhfVHzyHLzQK64abQgF5Q==
|
vMQfjT9GrwB5K/O1GumOmvbzLNhvO2vRZJhfVHzyHLzQK64abQgF5Q==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2026-02-20T19:26:21Z"
|
lastmodified: "2025-01-19T22:46:09Z"
|
||||||
mac: ENC[AES256_GCM,data:D8ZOgcDCY+I2rFc6+GSRj53QjnhZP0oz5wPgG2x4dOfVRWYMEgR2pnb/IIF95Dq0XR6ja9PLgw42PfdI1dS7vITb1jW5IExcnkB/Pa/RjB3GFeXPFTV6QCAQcK9cLct6yhB/pPbHdt8qHQt7kddiN162RlMHDyR6BAh4gO0Rf3w=,iv:f1RWrxbqNNUdANDR6V+OFuEYJ2ZLVde+5GTcFmSXYSQ=,tag:IBEdkSEz/w4Rxwb6uSBpTw==,type:str]
|
mac: ENC[AES256_GCM,data:eU3SIqAGrgbO2tz4zH1tgYcif7oe5j+/wmdYl2xXXI+D6IhiKrTJGvzE3rd3ElEpb+Bg0UQId952U2Ut0yPTfxGLtdlbJA66CmhLAksByoJ8lOXUcp/qDyA4yMRSuwYG2v7uF2crvue9fyRfZ7hl7abE/Q7Z2UjOKqhSZC5cO3U=,iv:NmCVvtBWZRzhpr5nMLy+98VuQZWoUms7xFSxq8PMvBA=,tag:UWjA7oqoNWh4wb0myNg7FA==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2025-01-19T22:45:26Z"
|
- created_at: "2025-01-19T22:45:26Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
@@ -64,4 +65,4 @@ sops:
|
|||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.11.0
|
version: 3.9.2
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
{pkgs, ...}:
|
|
||||||
{
|
|
||||||
sops.secrets.njalacloud = {};
|
|
||||||
sops.secrets.njalazines = {};
|
|
||||||
systemd.services."dyndns" = {
|
|
||||||
script = ''
|
|
||||||
KEYCLOUD=$(cat /run/secrets/njalacloud)
|
|
||||||
KEYZINES=$(cat /run/secrets/njalazines)
|
|
||||||
${pkgs.curl}/bin/curl --fail --silent --show-error "https://njal.la/update/?h=cloud.malobeo.org&k="$KEYCLOUD"&auto"
|
|
||||||
${pkgs.curl}/bin/curl --fail --silent --show-error "https://njal.la/update/?h=zines.malobeo.org&k="$KEYZINES"&auto"
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.timers."dyndns" = {
|
|
||||||
wantedBy = ["timers.target"];
|
|
||||||
timerConfig = {
|
|
||||||
OnBootSec = "100s";
|
|
||||||
OnUnitActiveSec = "10m";
|
|
||||||
Unit = "dyndns.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
wg_private: ENC[AES256_GCM,data:kFuLzZz9lmtUccQUIYiXvJRf7WBg5iCq1xxCiI76J3TaIBELqgbEmUtPR4g=,iv:0S0uzX4OVxQCKDOl1zB6nDo8152oE7ymBWdVkPkKlro=,tag:gg1n1BsnjNPikMBNB60F5Q==,type:str]
|
wg_private: ENC[AES256_GCM,data:kFuLzZz9lmtUccQUIYiXvJRf7WBg5iCq1xxCiI76J3TaIBELqgbEmUtPR4g=,iv:0S0uzX4OVxQCKDOl1zB6nDo8152oE7ymBWdVkPkKlro=,tag:gg1n1BsnjNPikMBNB60F5Q==,type:str]
|
||||||
shop_cleartext: ENC[AES256_GCM,data:sifpX/R6JCcNKgwN2M4Dbflgnfs5CqB8ez5fULPohuFS6k36BLemWzEk,iv:1lRYausj7V/53sfSO9UnJ2OC/Si94JXgIo81Ld74BE8=,tag:5osQU/67bvFeUGA90BSiIA==,type:str]
|
shop_cleartext: ENC[AES256_GCM,data:sifpX/R6JCcNKgwN2M4Dbflgnfs5CqB8ez5fULPohuFS6k36BLemWzEk,iv:1lRYausj7V/53sfSO9UnJ2OC/Si94JXgIo81Ld74BE8=,tag:5osQU/67bvFeUGA90BSiIA==,type:str]
|
||||||
shop_auth: ENC[AES256_GCM,data:0NDIRjmGwlSFls12sCb5OlgyGTCHpPQIjycEJGhYlZsWKhEYXV2u3g1RHMkF8Ny913jarjf0BgwSq5pBD9rgPL9t8X8=,iv:3jgCv/Gg93Mhdm4eYzwF9QrK14QL2bcC4wwSajCA88o=,tag:h8dhMK46hABv9gYW4johkA==,type:str]
|
shop_auth: ENC[AES256_GCM,data:0NDIRjmGwlSFls12sCb5OlgyGTCHpPQIjycEJGhYlZsWKhEYXV2u3g1RHMkF8Ny913jarjf0BgwSq5pBD9rgPL9t8X8=,iv:3jgCv/Gg93Mhdm4eYzwF9QrK14QL2bcC4wwSajCA88o=,tag:h8dhMK46hABv9gYW4johkA==,type:str]
|
||||||
njalacloud: ENC[AES256_GCM,data:sp79Ij1vd9pQZuPUR1phmw==,iv:AWKZoOfBA/n16pWQCfA0dZmH1KajCztnLvYItoZZbgA=,tag:BIUrobBoO96pxUz1sjIYIw==,type:str]
|
|
||||||
njalazines: ENC[AES256_GCM,data:fnObUEnXYvdj9HtkZNzXVA==,iv:0Zj2n2we9w4fj/n7e1ayd9XgFEMAGCHk4QLTu1IlRnQ=,tag:zeOLAB0oE6XbxqdqhdRNxw==,type:str]
|
|
||||||
njala_api_key: ENC[AES256_GCM,data:ohSVzQUvFjia/s9WceqnZCdLyk3N1Lm2BCBmXeBlkWD2dyrohKCnd9GiJ499IORpuYcOXyM=,iv:Uczk8op5mgqe8gefxgU9YuTqOsYvjzHCKvzA7GDsgio=,tag:XA7JRq/LsGkpHcQSO36Whg==,type:str]
|
|
||||||
sops:
|
sops:
|
||||||
|
kms: []
|
||||||
|
gcp_kms: []
|
||||||
|
azure_kv: []
|
||||||
|
hc_vault: []
|
||||||
age:
|
age:
|
||||||
- recipient: age136sz3lzhxf74ryruvq34d4tmmxnezkqkgu6zqa3dm582c22fgejqagrqxk
|
- recipient: age136sz3lzhxf74ryruvq34d4tmmxnezkqkgu6zqa3dm582c22fgejqagrqxk
|
||||||
enc: |
|
enc: |
|
||||||
@@ -24,8 +25,8 @@ sops:
|
|||||||
QVZyNWVOMTh3ejBha21Qb2xCRkFERGMKH9nMQUoS5bGcLUx2T1dOmKd9jshttTrP
|
QVZyNWVOMTh3ejBha21Qb2xCRkFERGMKH9nMQUoS5bGcLUx2T1dOmKd9jshttTrP
|
||||||
SKFx7MXcjFRLKS2Ij12V8ftjL3Uod6be5zoMibkxK19KmXY/514Jww==
|
SKFx7MXcjFRLKS2Ij12V8ftjL3Uod6be5zoMibkxK19KmXY/514Jww==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2026-02-20T19:25:05Z"
|
lastmodified: "2025-04-14T10:34:55Z"
|
||||||
mac: ENC[AES256_GCM,data:g+bFYqJN1X8F52tpIO60S2WKxLG27ZrP399fsfE6o7rPtIMimZou/4oUo7i+kpNtygEuCr3+suP8TPas4x5zMXhRjnjJuwJwL/NwdciHZU0O3rPJgucCEWqr9OdAtxezDM9c2vv+jzqZxWT9t0fIpB9RxO5oy1pHZs0RCgjAJR4=,iv:v6RdTMeQUxSdjIVNFbx2HtxCsdVgFTQTzMXS5Fj62is=,tag:pLoZMBRIXYElO5rY+xX9zg==,type:str]
|
mac: ENC[AES256_GCM,data:vcDXtTi0bpqhHnL6XanJo+6a8f5LAE628HazDVaNO34Ll3eRyhi95eYGXQDDkVk2WUn9NJ5oCMPltnU82bpLtskzTfQDuXHaPZJq5gtOuMH/bAKrY0dfShrdyx71LkA4AFlcI1P5hchpbyY1FK3iqe4D0miBv+Q8lCMgQMVrfxI=,iv:1lMzH899K0CnEtm16nyq8FL/aCkSYJVoj7HSKCyUnPg=,tag:mEbkmFNg5VZtSKqq80NrCw==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2025-02-11T18:32:49Z"
|
- created_at: "2025-02-11T18:32:49Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
@@ -66,4 +67,4 @@ sops:
|
|||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.11.0
|
version: 3.9.4
|
||||||
|
|||||||
@@ -1,107 +1,90 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
|
|
||||||
let
|
|
||||||
createMaloNet = hostId: mac: {
|
|
||||||
local = true;
|
|
||||||
hostId = hostId;
|
|
||||||
address = "192.168.1.${hostId}";
|
|
||||||
gateway = "192.168.1.1";
|
|
||||||
nameservers = [ "192.168.1.1" "1.1.1.1" ]; #setting ns1 as nameserver
|
|
||||||
mac = mac;
|
|
||||||
};
|
|
||||||
|
|
||||||
createOffsiteNet = hostId: mac: {
|
|
||||||
local = false;
|
|
||||||
hostId = hostId;
|
|
||||||
address = "10.0.0.${hostId}";
|
|
||||||
gateway = "10.0.0.1";
|
|
||||||
nameservers = [ "1.1.1.1" ];
|
|
||||||
mac = mac;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
#TODO: fix local 192.168.1.0/24 addresses they are just palceholders!
|
|
||||||
malobeo = {
|
malobeo = {
|
||||||
hosts = {
|
hosts = {
|
||||||
louise = {
|
louise = {
|
||||||
type = "host";
|
type = "host";
|
||||||
network = {
|
|
||||||
local = true;
|
|
||||||
hostId = "11";
|
|
||||||
address = "192.168.1.101";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bakunin = {
|
bakunin = {
|
||||||
type = "host";
|
type = "host";
|
||||||
network = {
|
|
||||||
local = true;
|
|
||||||
hostId = "12";
|
|
||||||
address = "192.168.1.102";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fanny = {
|
fanny = {
|
||||||
type = "host";
|
type = "host";
|
||||||
network = {
|
|
||||||
local = true;
|
|
||||||
hostId = "13";
|
|
||||||
address = "192.168.1.103";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
lucia = {
|
lucia = {
|
||||||
type = "rpi";
|
type = "rpi";
|
||||||
network = {
|
|
||||||
local = true;
|
|
||||||
hostId = "15";
|
|
||||||
address = "192.168.1.105";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
durruti = {
|
durruti = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "5" "52:DA:0D:F9:EF:F9";
|
network = {
|
||||||
|
address = "10.0.0.5";
|
||||||
|
mac = "52:DA:0D:F9:EF:F9";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
vpn = {
|
vpn = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createOffsiteNet "10" "52:DA:0D:F9:EF:E6";
|
network = {
|
||||||
|
address = "10.0.0.10";
|
||||||
|
mac = "D0:E5:CA:F0:D7:E6";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
infradocs = {
|
infradocs = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "11" "52:DA:0D:F9:EF:E7";
|
network = {
|
||||||
|
address = "10.0.0.11";
|
||||||
|
mac = "D0:E5:CA:F0:D7:E7";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
uptimekuma = {
|
uptimekuma = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createOffsiteNet "12" "52:DA:0D:F9:EF:E8";
|
network = {
|
||||||
|
address = "10.0.0.12";
|
||||||
|
mac = "D0:E5:CA:F0:D7:E8";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "13" "52:DA:0D:F9:EF:E9";
|
network = {
|
||||||
|
address = "10.0.0.13";
|
||||||
|
mac = "D0:E5:CA:F0:D7:E9";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
overwatch = {
|
overwatch = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "14" "52:DA:0D:F9:EF:E0";
|
network = {
|
||||||
|
address = "10.0.0.14";
|
||||||
|
mac = "D0:E5:CA:F0:D7:E0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
zineshop = {
|
zineshop = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "15" "52:DA:0D:F9:EF:F1";
|
network = {
|
||||||
|
address = "10.0.0.15";
|
||||||
|
mac = "D0:E5:CA:F0:D7:F1";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
vaultwarden = {
|
vaultwarden = {
|
||||||
type = "microvm";
|
type = "microvm";
|
||||||
network = createMaloNet "16" "D0:E5:CA:F0:D7:F2";
|
network = {
|
||||||
|
address = "10.0.0.16";
|
||||||
|
mac = "D0:E5:CA:F0:D7:F2";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
ns1 = {
|
testvm = {
|
||||||
type = "microvm";
|
type = "host";
|
||||||
network = createMaloNet "17" "52:DA:0D:F9:EF:F3";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ with lib;
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = true;
|
logNginx = true;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ rec {
|
|||||||
];
|
];
|
||||||
defaultModules = baseModules;
|
defaultModules = baseModules;
|
||||||
|
|
||||||
makeMicroVM = hostName: network: modules: [
|
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
||||||
{
|
{
|
||||||
microvm = {
|
microvm = {
|
||||||
hypervisor = "cloud-hypervisor";
|
hypervisor = "cloud-hypervisor";
|
||||||
@@ -83,7 +83,7 @@ rec {
|
|||||||
{
|
{
|
||||||
type = "tap";
|
type = "tap";
|
||||||
id = "vm-${hostName}";
|
id = "vm-${hostName}";
|
||||||
mac = "${network.mac}";
|
mac = "${macAddr}";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -93,9 +93,9 @@ rec {
|
|||||||
systemd.network.networks."20-lan" = {
|
systemd.network.networks."20-lan" = {
|
||||||
matchConfig.Type = "ether";
|
matchConfig.Type = "ether";
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
Address = [ "${network.address}/24" ];
|
Address = [ "${ipv4Addr}/24" ];
|
||||||
Gateway = "${network.gateway}";
|
Gateway = "10.0.0.1";
|
||||||
DNS = network.nameservers;
|
DNS = ["1.1.1.1"];
|
||||||
DHCP = "no";
|
DHCP = "no";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -165,16 +165,6 @@ rec {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network.networks."20-lan" = pkgs.lib.mkForce {
|
|
||||||
matchConfig.Type = "ether";
|
|
||||||
networkConfig = {
|
|
||||||
Address = [ "10.0.0.${hosts.malobeo.hosts.${hostname}.network.hostId}/24" ];
|
|
||||||
Gateway = "10.0.0.1";
|
|
||||||
DNS = [ "1.1.1.1" ];
|
|
||||||
DHCP = "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.isContainer = pkgs.lib.mkForce false;
|
boot.isContainer = pkgs.lib.mkForce false;
|
||||||
services.timesyncd.enable = false;
|
services.timesyncd.enable = false;
|
||||||
users.users.root.password = "";
|
users.users.root.password = "";
|
||||||
@@ -220,7 +210,8 @@ rec {
|
|||||||
specialArgs.self = self;
|
specialArgs.self = self;
|
||||||
config = {
|
config = {
|
||||||
imports = (makeMicroVM "${name}"
|
imports = (makeMicroVM "${name}"
|
||||||
hosts.malobeo.hosts.${name}.network [
|
"${hosts.malobeo.hosts.${name}.network.address}"
|
||||||
|
"${hosts.malobeo.hosts.${name}.network.mac}" [
|
||||||
../${name}/configuration.nix
|
../${name}/configuration.nix
|
||||||
(vmMicroVMOverwrites name {
|
(vmMicroVMOverwrites name {
|
||||||
withNetworking = true;
|
withNetworking = true;
|
||||||
@@ -259,7 +250,7 @@ rec {
|
|||||||
modules = (if (settings.type != "microvm") then
|
modules = (if (settings.type != "microvm") then
|
||||||
defaultModules ++ [ ../${host}/configuration.nix ]
|
defaultModules ++ [ ../${host}/configuration.nix ]
|
||||||
else
|
else
|
||||||
makeMicroVM "${host}" settings.network [
|
makeMicroVM "${host}" "${settings.network.address}" "${settings.network.mac}" [
|
||||||
inputs.microvm.nixosModules.microvm
|
inputs.microvm.nixosModules.microvm
|
||||||
../${host}/configuration.nix
|
../${host}/configuration.nix
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.malobeo.metrics;
|
cfg = config.malobeo.metrics;
|
||||||
hosts = import ../../hosts.nix {};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.malobeo.metrics = {
|
options.malobeo.metrics = {
|
||||||
@@ -22,7 +21,7 @@ in
|
|||||||
};
|
};
|
||||||
lokiHost = lib.mkOption {
|
lokiHost = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = hosts.malobeo.hosts.overwatch.network.address;
|
default = "10.0.0.14";
|
||||||
description = "Address of loki host";
|
description = "Address of loki host";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,26 +14,6 @@ in
|
|||||||
description = lib.mdDoc "Setup bridge device for microvms.";
|
description = lib.mdDoc "Setup bridge device for microvms.";
|
||||||
};
|
};
|
||||||
|
|
||||||
interface = mkOption {
|
|
||||||
default = "eno1";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
gateway = mkOption {
|
|
||||||
default = "10.0.0.1";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
address = mkOption {
|
|
||||||
default = "10.0.0.1/24";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
dns = mkOption {
|
|
||||||
default = [ "1.1.1.1" ];
|
|
||||||
type = types.listOf types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
enableHostBridgeUnstable = mkOption {
|
enableHostBridgeUnstable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
@@ -67,29 +47,29 @@ in
|
|||||||
|
|
||||||
systemd.network = mkIf (cfg.enableHostBridge || cfg.enableHostBridgeUnstable) {
|
systemd.network = mkIf (cfg.enableHostBridge || cfg.enableHostBridgeUnstable) {
|
||||||
enable = true;
|
enable = true;
|
||||||
networks."10-lan" = {
|
# create a bride device that all the microvms will be connected to
|
||||||
matchConfig.Name = [ "${cfg.interface}" "vm-*"];
|
netdevs."10-microvm".netdevConfig = {
|
||||||
networkConfig = {
|
|
||||||
Bridge = "malobeo0";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
netdevs."malobeo0" = {
|
|
||||||
netdevConfig = {
|
|
||||||
Name = "malobeo0";
|
|
||||||
Kind = "bridge";
|
Kind = "bridge";
|
||||||
};
|
Name = "microvm";
|
||||||
};
|
};
|
||||||
|
|
||||||
networks."10-lan-bridge" = {
|
networks."10-microvm" = {
|
||||||
matchConfig.Name = "malobeo0";
|
matchConfig.Name = "microvm";
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
Address = [ "${cfg.address}" ];
|
DHCPServer = true;
|
||||||
Gateway = "${cfg.gateway}";
|
IPv6SendRA = true;
|
||||||
DNS = cfg.dns;
|
|
||||||
IPv6AcceptRA = true;
|
|
||||||
};
|
};
|
||||||
linkConfig.RequiredForOnline = "routable";
|
addresses = if cfg.enableHostBridgeUnstable then [
|
||||||
|
{ Address = "10.0.0.1/24"; }
|
||||||
|
] else [
|
||||||
|
{ Address = "10.0.0.1/24"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# connect the vms to the bridge
|
||||||
|
networks."11-microvm" = {
|
||||||
|
matchConfig.Name = "vm-*";
|
||||||
|
networkConfig.Bridge = "microvm";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,7 +81,7 @@ in
|
|||||||
# under nixosConfigurations
|
# under nixosConfigurations
|
||||||
flake = inputs.malobeo;
|
flake = inputs.malobeo;
|
||||||
# Specify from where to let `microvm -u` update later on
|
# Specify from where to let `microvm -u` update later on
|
||||||
updateFlake = "git+https://git.dynamicdiscord.de/malobeo/infrastructure";
|
updateFlake = "git+https://git.dynamicdiscord.de/kalipso/infrastructure";
|
||||||
}; };
|
}; };
|
||||||
in
|
in
|
||||||
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
|
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
{ inputs }:
|
|
||||||
|
|
||||||
let
|
|
||||||
vpnNS = "vpn";
|
|
||||||
localNS = "hq";
|
|
||||||
peers = import ./peers.nix;
|
|
||||||
hosts = ((import ../../hosts.nix ) {}).malobeo.hosts;
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
SOA = {
|
|
||||||
nameServer = "ns1";
|
|
||||||
adminEmail = "admin@malobeo.org";
|
|
||||||
serial = 2019030801;
|
|
||||||
};
|
|
||||||
useOrigin = false;
|
|
||||||
|
|
||||||
NS = [
|
|
||||||
"ns1.malobeo.org."
|
|
||||||
];
|
|
||||||
|
|
||||||
subdomains = {
|
|
||||||
ns1 = {
|
|
||||||
A = [ hosts.ns1.network.address ];
|
|
||||||
};
|
|
||||||
|
|
||||||
${localNS} = {
|
|
||||||
A = [ hosts.fanny.network.address ];
|
|
||||||
subdomains = builtins.mapAttrs (name: value: if value.network.local == true then {
|
|
||||||
A = [ value.network.address ];
|
|
||||||
} else {}) hosts;
|
|
||||||
};
|
|
||||||
|
|
||||||
${vpnNS} = {
|
|
||||||
A = [ peers.vpn.address ];
|
|
||||||
subdomains = builtins.mapAttrs (name: value: if value.role != "server" then {
|
|
||||||
A = [ value.address ];
|
|
||||||
} else {}) peers;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
hosts = import ../hosts.nix {};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
@@ -31,6 +28,7 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = true;
|
logNginx = true;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.postgresqlBackup = {
|
services.postgresqlBackup = {
|
||||||
@@ -61,8 +59,8 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
trusted_domains = [ "cloud.malobeo.org" "cloud.hq.malobeo.org" ];
|
trusted_domains = ["10.0.0.13"];
|
||||||
trusted_proxies = [ hosts.malobeo.hosts.fanny.network.address ];
|
trusted_proxies = [ "10.0.0.1" ];
|
||||||
"maintenance_window_start" = "1";
|
"maintenance_window_start" = "1";
|
||||||
"default_phone_region" = "DE";
|
"default_phone_region" = "DE";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
{ config, self, lib, inputs, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
with inputs;
|
|
||||||
|
|
||||||
let
|
|
||||||
dns = inputs.dns;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
networking = {
|
|
||||||
hostName = mkDefault "ns1";
|
|
||||||
useDHCP = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
../modules/malobeo_user.nix
|
|
||||||
../modules/sshd.nix
|
|
||||||
../modules/minimal_tools.nix
|
|
||||||
../modules/autoupdate.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.firewall = {
|
|
||||||
enable = true;
|
|
||||||
allowedTCPPorts = [ 53 ];
|
|
||||||
allowedUDPPorts = [ 53 ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.bind = {
|
|
||||||
enable = true;
|
|
||||||
forwarders = [
|
|
||||||
"1.1.1.1"
|
|
||||||
"1.0.0.1"
|
|
||||||
];
|
|
||||||
|
|
||||||
cacheNetworks = [
|
|
||||||
"127.0.0.0/24"
|
|
||||||
"10.0.0.0/24"
|
|
||||||
"192.168.1.0/24"
|
|
||||||
"10.100.0.0/24"
|
|
||||||
];
|
|
||||||
|
|
||||||
zones = {
|
|
||||||
"malobeo.org" = {
|
|
||||||
master = true;
|
|
||||||
file = pkgs.writeText "zone-malobeo.org" (dns.lib.toString "malobeo.org" (import ../modules/malobeo/zones.nix { inherit inputs; }));
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
hosts = import ../hosts.nix {};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
@@ -32,6 +29,7 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = false;
|
logNginx = false;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
@@ -123,31 +121,31 @@ in
|
|||||||
{
|
{
|
||||||
job_name = "durruti";
|
job_name = "durruti";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hosts.malobeo.hosts.durruti.network.address}:9002" ];
|
targets = [ "10.0.0.5:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
job_name = "infradocs";
|
job_name = "infradocs";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hosts.malobeo.hosts.infradocs.network.address}:9002" ];
|
targets = [ "10.0.0.11:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
job_name = "nextcloud";
|
job_name = "nextcloud";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hosts.malobeo.hosts.nextcloud.network.address}:9002" ];
|
targets = [ "10.0.0.13:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
job_name = "zineshop";
|
job_name = "zineshop";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hosts.malobeo.hosts.zineshop.network.address}:9002" ];
|
targets = [ "10.0.0.15:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
job_name = "fanny";
|
job_name = "fanny";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hosts.malobeo.hosts.fanny.network.address}:9002" ];
|
targets = [ "10.0.0.1:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
# add vpn - check how to reach it first. most probably 10.100.0.1
|
# add vpn - check how to reach it first. most probably 10.100.0.1
|
||||||
|
|||||||
@@ -23750,8 +23750,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"current": {
|
"current": {
|
||||||
"text": "192.168.1.13:9002",
|
"text": "10.0.0.13:9002",
|
||||||
"value": "192.168.1.13:9002"
|
"value": "10.0.0.13:9002"
|
||||||
},
|
},
|
||||||
"datasource": {
|
"datasource": {
|
||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ positions:
|
|||||||
filename: /tmp/positions.yaml
|
filename: /tmp/positions.yaml
|
||||||
|
|
||||||
clients:
|
clients:
|
||||||
- url: http://192.168.1.13:3100/loki/api/v1/push
|
- url: http://10.0.0.13:3100/loki/api/v1/push
|
||||||
|
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ with lib;
|
|||||||
backupDir = "/var/local/vaultwarden/backup";
|
backupDir = "/var/local/vaultwarden/backup";
|
||||||
environmentFile = config.sops.secrets.vaultwarden_env.path;
|
environmentFile = config.sops.secrets.vaultwarden_env.path;
|
||||||
config = {
|
config = {
|
||||||
DOMAIN = "https://keys.malobeo.org";
|
DOMAIN = "http://keys.malobeo.org";
|
||||||
SIGNUPS_ALLOWED = true;
|
SIGNUPS_ALLOWED = true;
|
||||||
#WEBSERVER
|
#WEBSERVER
|
||||||
ROCKET_ADDRESS = "127.0.0.1";
|
ROCKET_ADDRESS = "127.0.0.1";
|
||||||
|
|||||||
@@ -40,6 +40,19 @@ with lib;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualHosts."cloud.malobeo.org" = {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.100.0.101";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
||||||
|
client_body_timeout 3600s;
|
||||||
|
send_timeout 3600s;
|
||||||
|
fastcgi_buffers 64 4K;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
virtualHosts."keys.malobeo.org" = {
|
virtualHosts."keys.malobeo.org" = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.100.0.101";
|
proxyPass = "http://10.100.0.101";
|
||||||
@@ -66,6 +79,28 @@ with lib;
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualHosts."zines.malobeo.org" = {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.100.0.101";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Authorization $http_authorization; # Pass the Authorization header
|
||||||
|
proxy_pass_header Authorization;
|
||||||
|
|
||||||
|
client_body_in_file_only clean;
|
||||||
|
client_body_buffer_size 32K;
|
||||||
|
|
||||||
|
client_max_body_size 500M;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
send_timeout 300s;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ with lib;
|
|||||||
enable = true;
|
enable = true;
|
||||||
enablePromtail = true;
|
enablePromtail = true;
|
||||||
logNginx = true;
|
logNginx = true;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user