Compare commits

...

15 commits

Author SHA1 Message Date
Fiona Grzebien 94e279094a Create mas database in postgres initialScript 2024-11-08 01:22:57 +01:00
Fiona Grzebien c6913d2be5 Install matrix-authentication-service package on matrix host 2024-11-08 01:03:10 +01:00
Fiona Grzebien 35b9a0ceda Format nginx matrix .well-known json 2024-11-08 00:51:33 +01:00
Fiona Grzebien 42b11fc05e Remove paperless from hosts as vm host is not online anymore 2024-11-07 23:49:07 +01:00
Fiona Grzebien 88cdbcf49e Update paperless host stateVersion to 24.05 2024-11-07 23:43:58 +01:00
Fiona Grzebien a778d5ff64 Switch torrent host to nixpkgs unstable since qbittorrent-nox 4.6.4 is insecure 2024-11-07 23:17:34 +01:00
Fiona Grzebien ab301ab8e6 Remove matrix sliding sync options as it is now part of matrix-synapse 2024-11-07 23:12:07 +01:00
Fiona Grzebien 154c98a25f Set matrix host nixpkgs to unstable 2024-11-07 23:04:52 +01:00
Fiona Grzebien 9a5345276b flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c128e44a249d6180740d0a979b6480d5b795c013?narHash=sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4%3D' (2024-11-06)
  → 'github:NixOS/nixpkgs/83fb6c028368e465cd19bb127b86f971a5e41ebc?narHash=sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0%3D' (2024-11-07)
• Updated input 'nixpkgs-master':
    'github:NixOS/nixpkgs/7cf19f381114cfbd5f1347848efcbf34aec73066?narHash=sha256-kOAok3imaFaor4jCFcpM16h/epnhsMp1TbzGfRF2xfk%3D' (2024-11-06)
  → 'github:NixOS/nixpkgs/f7516232a6bf821825c2bd114abcaec1bcd1e54d?narHash=sha256-u8U89hPPbGu627UNtd3H9/CPifDOrmsNGm2y83C9A0A%3D' (2024-11-07)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/1c07b97d2d4302baca8c61fa2d0d4632427972a7?narHash=sha256-OrCMJZ8qZftRplhoB%2BBksvoPLBOZQpH8mnACgPKNuMc%3D' (2024-11-06)
  → 'github:NixOS/nixpkgs/3aea494127aae5d08c4c501ea4ba27e6c185b822?narHash=sha256-5R9m921OhgOUNHVIxTS8%2BjZJokkZRsH7UOecxlchqZ8%3D' (2024-11-07)
2024-11-07 23:01:21 +01:00
Fiona Grzebien 137e263c9b flake.lock: Update
Flake lock file updates:

• Updated input 'pterodactyl':
    'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=ae698225308107d243f76dc45d1f6fab7ff95120' (2024-11-06)
  → 'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=1eff87119f6e48b6b1d1afef468ee4ff1aebe333' (2024-11-06)
2024-11-07 22:59:37 +01:00
Fiona Grzebien 9c7e396a09 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs-master':
    'github:NixOS/nixpkgs/d4d2ec47f6fd0eb521f1d14a34c811e1f514de89?narHash=sha256-MP5UtDIWS4KbtM90Ho33UF1RUjQTGbw/ub8JJZuToMg%3D' (2024-11-06)
  → 'github:NixOS/nixpkgs/7cf19f381114cfbd5f1347848efcbf34aec73066?narHash=sha256-kOAok3imaFaor4jCFcpM16h/epnhsMp1TbzGfRF2xfk%3D' (2024-11-06)
• Updated input 'pterodactyl':
    'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=c155ae111fb75532b6e8ac7dd7de538f23b51a95' (2024-11-06)
  → 'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=ae698225308107d243f76dc45d1f6fab7ff95120' (2024-11-06)
2024-11-06 18:44:58 +01:00
Fiona Grzebien 9bd9ca6584 flake.lock: Update
Flake lock file updates:

• Updated input 'pterodactyl':
    'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=49d7a9adeb44a295f48cd84d8e7c638ef4be703d' (2024-11-06)
  → 'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=c155ae111fb75532b6e8ac7dd7de538f23b51a95' (2024-11-06)
2024-11-06 18:39:29 +01:00
Fiona Grzebien c2c21ecf45 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs-master':
    'github:NixOS/nixpkgs/a40c3f1a5a8d3fa81fc4edc9dfa4719f8908b1d8?narHash=sha256-JTpBZcKpiz0/Fm5saVrTdPRsywNlBFz5pSdwMaVKwH8%3D' (2024-11-06)
  → 'github:NixOS/nixpkgs/d4d2ec47f6fd0eb521f1d14a34c811e1f514de89?narHash=sha256-MP5UtDIWS4KbtM90Ho33UF1RUjQTGbw/ub8JJZuToMg%3D' (2024-11-06)
• Updated input 'pterodactyl':
    'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=67dbbc01133790a3a1e892cc4cb147413f5238ee' (2024-10-29)
  → 'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=49d7a9adeb44a295f48cd84d8e7c638ef4be703d' (2024-11-06)
2024-11-06 18:34:55 +01:00
Fiona Grzebien fd6bf13e45 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/dd6d18bf8d291daca03a444973bd4f9aa5c1f681?narHash=sha256-O2/v/ocUL0KsACqEIK5eD5XeX46duRIgKdOu6uCKarw%3D' (2024-10-28)
  → 'github:NixOS/nixpkgs/c128e44a249d6180740d0a979b6480d5b795c013?narHash=sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4%3D' (2024-11-06)
• Updated input 'nixpkgs-master':
    'github:NixOS/nixpkgs/ec7caabec9679b1a9008e0cbcfa4b14a2b600774?narHash=sha256-WPGVR8NW9ctqwLMtYV23b94ExQulTFoTKqD21WI3fbg%3D' (2024-10-29)
  → 'github:NixOS/nixpkgs/a40c3f1a5a8d3fa81fc4edc9dfa4719f8908b1d8?narHash=sha256-JTpBZcKpiz0/Fm5saVrTdPRsywNlBFz5pSdwMaVKwH8%3D' (2024-11-06)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/75e28c029ef2605f9841e0baa335d70065fe7ae2?narHash=sha256-P8wF4ag6Srmpb/gwskYpnIsnspbjZlRvu47iN527ABQ%3D' (2024-10-28)
  → 'github:NixOS/nixpkgs/1c07b97d2d4302baca8c61fa2d0d4632427972a7?narHash=sha256-OrCMJZ8qZftRplhoB%2BBksvoPLBOZQpH8mnACgPKNuMc%3D' (2024-11-06)
• Added input 'pterodactyl':
    'git+https://git.nekover.se/fi/pterodactyl.git?ref=refs/heads/main&rev=67dbbc01133790a3a1e892cc4cb147413f5238ee' (2024-10-29)
• Added input 'pterodactyl/nixpkgs':
    'github:NixOS/nixpkgs/ccc0c2126893dd20963580b6478d1a10a4512185?narHash=sha256-4HQI%2B6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo%3D' (2024-10-18)
2024-11-06 18:11:43 +01:00
Fiona Grzebien b380a09560 Add gameserver-node-1 host 2024-11-06 16:38:20 +01:00
12 changed files with 118 additions and 38 deletions

View file

@ -0,0 +1,26 @@
{ pterodactyl, ... }:
{
boot.loader.grub = {
enable = true;
device = "/dev/vda";
};
networking = {
hostName = "gameserver-node-1";
};
#environment.systemPackages = [
# pterodactyl.packages."x86_64-linux".pterodactyl-wings
#];
imports = [
pterodactyl.nixosModules.pterodactyl-wings
];
services.wings = {
enable = false;
configuration = "";
};
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,6 @@
{ ... }:
{
imports = [
./configuration.nix
];
}

View file

@ -3,6 +3,7 @@
imports = [ imports = [
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix
./mas.nix
./postgresql.nix ./postgresql.nix
./matrix-synapse.nix ./matrix-synapse.nix
./nginx.nix ./nginx.nix

View file

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
matrix-authentication-service
];
}

View file

@ -1,4 +1,4 @@
{ config, ... }: { ... }:
{ {
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
@ -55,12 +55,4 @@
"/secrets/matrix-keycloak-client-secret.secret" "/secrets/matrix-keycloak-client-secret.secret"
]; ];
}; };
services.matrix-sliding-sync = {
enable = true;
settings = {
SYNCV3_SERVER = config.services.matrix-synapse.settings.public_baseurl;
};
environmentFile = "/secrets/matrix-SYNCV3_SECRET.secret";
};
} }

View file

@ -8,6 +8,11 @@
TEMPLATE template0 TEMPLATE template0
LC_COLLATE = "C" LC_COLLATE = "C"
LC_CTYPE = "C"; LC_CTYPE = "C";
CREATE ROLE "mas_user" WITH LOGIN PASSWORD 'mas';
CREATE DATABASE "mas" WITH OWNER "mas_user"
TEMPLATE template0
LC_COLLATE = "C"
LC_CTYPE = "C";
''; '';
}; };
} }

View file

@ -33,14 +33,6 @@
permissions = "0640"; permissions = "0640";
uploadAt = "pre-activation"; uploadAt = "pre-activation";
}; };
"matrix-SYNCV3_SECRET.secret" = {
keyCommand = keyCommandEnv ++ [ "pass" "matrix/SYNCV3_SECRET" ];
destDir = "/secrets";
user = "matrix-synapse";
group = "matrix-synapse";
permissions = "0640";
uploadAt = "pre-activation";
};
"matrix-keycloak-client-secret.secret" = { "matrix-keycloak-client-secret.secret" = {
keyCommand = keyCommandEnv ++ [ "pass" "matrix/keycloak-client-secret" ]; keyCommand = keyCommandEnv ++ [ "pass" "matrix/keycloak-client-secret" ];
destDir = "/secrets"; destDir = "/secrets";

View file

@ -13,5 +13,5 @@
}; };
}; };
system.stateVersion = "23.05"; system.stateVersion = "24.05";
} }

View file

@ -16,7 +16,22 @@
''; '';
}; };
locations."/.well-known/matrix/client" = { locations."/.well-known/matrix/client" = {
return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.nekover.se\"}, \"m.identity_server\": {\"base_url\": \"https://vector.im\"}, \"org.matrix.msc3575.proxy\": {\"url\": \"https://matrix.nekover.se\"}, \"org.matrix.msc2965.authentication\": {\"issuer\": \"https://id.nekover.se/realms/nekoverse\", \"account\": \"https://id.nekover.se/realms/nekoverse/account/\"}}'"; return = "200 '
{
\"m.homeserver\": {
\"base_url\": \"https://matrix.nekover.se\"
},
\"m.identity_server\": {
\"base_url\": \"https://vector.im\"
},
\"org.matrix.msc3575.proxy\": {
\"url\": \"https://matrix.nekover.se\"
},
\"org.matrix.msc2965.authentication\": {
\"issuer\": \"https://nekover.se/\",
\"account\": \"https://matrix-auth.nekover.se/account\"
}
}'";
extraConfig = '' extraConfig = ''
default_type application/json; default_type application/json;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;

View file

@ -70,11 +70,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1730142757, "lastModified": 1730963269,
"narHash": "sha256-O2/v/ocUL0KsACqEIK5eD5XeX46duRIgKdOu6uCKarw=", "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dd6d18bf8d291daca03a444973bd4f9aa5c1f681", "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -101,11 +101,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1730209337, "lastModified": 1731015792,
"narHash": "sha256-WPGVR8NW9ctqwLMtYV23b94ExQulTFoTKqD21WI3fbg=", "narHash": "sha256-u8U89hPPbGu627UNtd3H9/CPifDOrmsNGm2y83C9A0A=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ec7caabec9679b1a9008e0cbcfa4b14a2b600774", "rev": "f7516232a6bf821825c2bd114abcaec1bcd1e54d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -117,11 +117,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1730157240, "lastModified": 1730989260,
"narHash": "sha256-P8wF4ag6Srmpb/gwskYpnIsnspbjZlRvu47iN527ABQ=", "narHash": "sha256-5R9m921OhgOUNHVIxTS8+jZJokkZRsH7UOecxlchqZ8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "75e28c029ef2605f9841e0baa335d70065fe7ae2", "rev": "3aea494127aae5d08c4c501ea4ba27e6c185b822",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -132,6 +132,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1729265718,
"narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ccc0c2126893dd20963580b6478d1a10a4512185",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1717602782, "lastModified": 1717602782,
"narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
@ -146,12 +162,31 @@
"type": "indirect" "type": "indirect"
} }
}, },
"pterodactyl": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1730915158,
"narHash": "sha256-qQvhHUbC5yKD6x/G0P2tvHoRf92Nd/QWB76CRnV5oyI=",
"ref": "refs/heads/main",
"rev": "1eff87119f6e48b6b1d1afef468ee4ff1aebe333",
"revCount": 3,
"type": "git",
"url": "https://git.nekover.se/fi/pterodactyl.git"
},
"original": {
"type": "git",
"url": "https://git.nekover.se/fi/pterodactyl.git"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"pterodactyl": "pterodactyl",
"simple-nixos-mailserver": "simple-nixos-mailserver" "simple-nixos-mailserver": "simple-nixos-mailserver"
} }
}, },
@ -159,7 +194,7 @@
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-24_05": "nixpkgs-24_05", "nixpkgs-24_05": "nixpkgs-24_05",
"utils": "utils" "utils": "utils"
}, },

View file

@ -8,9 +8,12 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
pterodactyl = {
url = "git+https://git.nekover.se/fi/pterodactyl.git";
};
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, nixos-generators, simple-nixos-mailserver, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, nixos-generators, simple-nixos-mailserver, pterodactyl, ... }@inputs:
let let
hosts = import ./hosts.nix inputs; hosts = import ./hosts.nix inputs;
helper = import ./helper.nix inputs; helper = import ./helper.nix inputs;
@ -28,7 +31,7 @@
nodeNixpkgs = builtins.mapAttrs (name: host: host.pkgs) hosts; nodeNixpkgs = builtins.mapAttrs (name: host: host.pkgs) hosts;
specialArgs = { specialArgs = {
inherit nixpkgs-unstable nixpkgs-master hosts simple-nixos-mailserver; inherit nixpkgs-unstable nixpkgs-master hosts simple-nixos-mailserver pterodactyl;
# Provide environment for secret key command # Provide environment for secret key command
keyCommandEnv = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" ]; keyCommandEnv = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" ];

View file

@ -26,9 +26,10 @@ let
}) hosts; }) hosts;
in in
generateDefaults { generateDefaults {
#fee = { gameserver-node-1 = {
# site = "wg"; site = "vs";
#}; environment = "proxmox";
};
hydra = { hydra = {
site = "vs"; site = "vs";
environment = "proxmox"; environment = "proxmox";
@ -70,6 +71,7 @@ in
environment = "proxmox"; environment = "proxmox";
}; };
matrix = { matrix = {
hostNixpkgs = nixpkgs-unstable;
site = "vs"; site = "vs";
environment = "proxmox"; environment = "proxmox";
}; };
@ -94,10 +96,6 @@ in
site = "vs"; site = "vs";
environment = "proxmox"; environment = "proxmox";
}; };
paperless = {
site = "wg";
environment = "proxmox";
};
coturn = { coturn = {
site = "vs"; site = "vs";
environment = "proxmox"; environment = "proxmox";
@ -108,6 +106,7 @@ in
environment = "proxmox"; environment = "proxmox";
}; };
torrent = { torrent = {
hostNixpkgs = nixpkgs-unstable;
site = "vs"; site = "vs";
environment = "proxmox"; environment = "proxmox";
}; };