mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-20 08:57:53 +01:00
Compare commits
4 Commits
main
...
9d7cadbcbe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d7cadbcbe | ||
|
|
9048261756 | ||
|
|
7ba8b47d7d | ||
|
|
f88b81672a |
@@ -43,7 +43,7 @@ revert the changes on the next nightly rebuild (tends to happen when everybody i
|
|||||||
| [kommode][kom] | Virtual | Gitea + Gitea pages |
|
| [kommode][kom] | Virtual | Gitea + Gitea pages |
|
||||||
| [lupine][lup] | Physical | Gitea CI/CD runners |
|
| [lupine][lup] | Physical | Gitea CI/CD runners |
|
||||||
| shark | Virtual | Test host for authentication, absolutely horrendous |
|
| shark | Virtual | Test host for authentication, absolutely horrendous |
|
||||||
| [skrot/skrott][skr] | Physical | Kiosk, snacks and soda |
|
| [skrott][skr] | Physical | Kiosk, snacks and soda |
|
||||||
| [wenche][wen] | Virtual | Nix-builders, general purpose compute |
|
| [wenche][wen] | Virtual | Nix-builders, general purpose compute |
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "acme-drift@pvv.ntnu.no";
|
defaults.email = "drift@pvv.ntnu.no";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Let's not spam LetsEncrypt in `nixos-rebuild build-vm` mode:
|
# Let's not spam LetsEncrypt in `nixos-rebuild build-vm` mode:
|
||||||
|
|||||||
8
flake.lock
generated
8
flake.lock
generated
@@ -195,11 +195,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770960722,
|
"lastModified": 1767906352,
|
||||||
"narHash": "sha256-IdhPsWFZUKSJh/nLjGLJvGM5d5Uta+k1FlVYPxTZi0E=",
|
"narHash": "sha256-wYsH9MMAPFG3XTL+3DwI39XMG0F2fTmn/5lt265a3Es=",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"rev": "c2e4aca7e1ba27cd09eeaeab47010d32a11841b2",
|
"rev": "d054c5d064b8ed6d53a0adb0cf6c0a72febe212e",
|
||||||
"revCount": 15,
|
"revCount": 13,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ in
|
|||||||
keyFile = config.sops.templates."matrix-livekit-keyfile".path;
|
keyFile = config.sops.templates."matrix-livekit-keyfile".path;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.lk-jwt-service.environment.LIVEKIT_FULL_ACCESS_HOMESERVERS = lib.mkIf cfg.enable (builtins.concatStringsSep "," [ "pvv.ntnu.no" "dodsorf.as" ]);
|
systemd.services.lk-jwt-service.environment.LIVEKIT_FULL_ACCESS_HOMESERVERS = lib.mkIf cfg.enable matrixDomain;
|
||||||
|
|
||||||
services.nginx.virtualHosts.${matrixDomain} = lib.mkIf cfg.enable {
|
services.nginx.virtualHosts.${matrixDomain} = lib.mkIf cfg.enable {
|
||||||
locations."^~ /livekit/jwt/" = {
|
locations."^~ /livekit/jwt/" = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, lib, values, fp, ... }:
|
{ config, pkgs, fp, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.services.matrix-ooye;
|
cfg = config.services.matrix-ooye;
|
||||||
in
|
in
|
||||||
@@ -28,23 +28,6 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.rsync-pull-targets = lib.mkIf cfg.enable {
|
|
||||||
enable = true;
|
|
||||||
locations."/var/lib/private/matrix-ooye" = {
|
|
||||||
user = "root";
|
|
||||||
rrsyncArgs.ro = true;
|
|
||||||
authorizedKeysAttrs = [
|
|
||||||
"restrict"
|
|
||||||
"from=\"principal.pvv.ntnu.no,${values.hosts.principal.ipv6},${values.hosts.principal.ipv4}\""
|
|
||||||
"no-agent-forwarding"
|
|
||||||
"no-port-forwarding"
|
|
||||||
"no-pty"
|
|
||||||
"no-X11-forwarding"
|
|
||||||
];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE5koYfor5+kKB30Dugj3dAWvmj8h/akQQ2XYDvLobFL matrix_ooye rsync backup";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.matrix-ooye = {
|
services.matrix-ooye = {
|
||||||
enable = true;
|
enable = true;
|
||||||
homeserver = "https://matrix.pvv.ntnu.no";
|
homeserver = "https://matrix.pvv.ntnu.no";
|
||||||
|
|||||||
@@ -10,59 +10,6 @@ in
|
|||||||
catppuccin = pkgs.gitea-theme-catppuccin;
|
catppuccin = pkgs.gitea-theme-catppuccin;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gitea.settings = {
|
|
||||||
ui = {
|
|
||||||
DEFAULT_THEME = "gitea-auto";
|
|
||||||
REACTIONS = lib.concatStringsSep "," [
|
|
||||||
"+1"
|
|
||||||
"-1"
|
|
||||||
"laugh"
|
|
||||||
"confused"
|
|
||||||
"heart"
|
|
||||||
"hooray"
|
|
||||||
"rocket"
|
|
||||||
"eyes"
|
|
||||||
"100"
|
|
||||||
"anger"
|
|
||||||
"astonished"
|
|
||||||
"no_good"
|
|
||||||
"ok_hand"
|
|
||||||
"pensive"
|
|
||||||
"pizza"
|
|
||||||
"point_up"
|
|
||||||
"sob"
|
|
||||||
"skull"
|
|
||||||
"upside_down_face"
|
|
||||||
"shrug"
|
|
||||||
"huh"
|
|
||||||
"bruh"
|
|
||||||
"okiedokie"
|
|
||||||
"grr"
|
|
||||||
];
|
|
||||||
|
|
||||||
CUSTOM_EMOJIS = lib.concatStringsSep "," [
|
|
||||||
"bruh"
|
|
||||||
"grr"
|
|
||||||
"huh"
|
|
||||||
"ohyeah"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"ui.meta" = {
|
|
||||||
AUTHOR = "Programvareverkstedet";
|
|
||||||
DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
|
||||||
KEYWORDS = lib.concatStringsSep "," [
|
|
||||||
"git"
|
|
||||||
"hackerspace"
|
|
||||||
"nix"
|
|
||||||
"open source"
|
|
||||||
"foss"
|
|
||||||
"organization"
|
|
||||||
"software"
|
|
||||||
"student"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.gitea-customization = lib.mkIf cfg.enable {
|
systemd.services.gitea-customization = lib.mkIf cfg.enable {
|
||||||
description = "Install extra customization in gitea's CUSTOM_DIR";
|
description = "Install extra customization in gitea's CUSTOM_DIR";
|
||||||
wantedBy = [ "gitea.service" ];
|
wantedBy = [ "gitea.service" ];
|
||||||
@@ -110,11 +57,6 @@ in
|
|||||||
install -Dm444 ${extraLinksFooter} ${cfg.customDir}/templates/custom/extra_links_footer.tmpl
|
install -Dm444 ${extraLinksFooter} ${cfg.customDir}/templates/custom/extra_links_footer.tmpl
|
||||||
install -Dm444 ${project-labels} ${cfg.customDir}/options/label/project-labels.yaml
|
install -Dm444 ${project-labels} ${cfg.customDir}/options/label/project-labels.yaml
|
||||||
|
|
||||||
install -Dm644 ${./emotes/bruh.png} ${cfg.customDir}/public/assets/img/emoji/bruh.png
|
|
||||||
install -Dm644 ${./emotes/huh.gif} ${cfg.customDir}/public/assets/img/emoji/huh.png
|
|
||||||
install -Dm644 ${./emotes/grr.png} ${cfg.customDir}/public/assets/img/emoji/grr.png
|
|
||||||
install -Dm644 ${./emotes/okiedokie.jpg} ${cfg.customDir}/public/assets/img/emoji/okiedokie.png
|
|
||||||
|
|
||||||
"${lib.getExe pkgs.rsync}" -a "${customTemplates}/" ${cfg.customDir}/templates/
|
"${lib.getExe pkgs.rsync}" -a "${customTemplates}/" ${cfg.customDir}/templates/
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 206 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 145 KiB |
@@ -83,24 +83,11 @@ in {
|
|||||||
AUTO_WATCH_NEW_REPOS = false;
|
AUTO_WATCH_NEW_REPOS = false;
|
||||||
};
|
};
|
||||||
admin.DEFAULT_EMAIL_NOTIFICATIONS = "onmention";
|
admin.DEFAULT_EMAIL_NOTIFICATIONS = "onmention";
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
security = {
|
security = {
|
||||||
SECRET_KEY = lib.mkForce "";
|
SECRET_KEY = lib.mkForce "";
|
||||||
SECRET_KEY_URI = "file:${config.sops.secrets."gitea/secret-key".path}";
|
SECRET_KEY_URI = "file:${config.sops.secrets."gitea/secret-key".path}";
|
||||||
};
|
};
|
||||||
cache = {
|
|
||||||
ADAPTER = "redis";
|
|
||||||
HOST = "redis+socket://${config.services.redis.servers.gitea.unixSocket}?db=0";
|
|
||||||
ITEM_TTL = "72h";
|
|
||||||
};
|
|
||||||
session = {
|
|
||||||
COOKIE_SECURE = true;
|
|
||||||
PROVIDER = "redis";
|
|
||||||
PROVIDER_CONFIG = "redis+socket://${config.services.redis.servers.gitea.unixSocket}?db=1";
|
|
||||||
};
|
|
||||||
queue = {
|
|
||||||
TYPE = "redis";
|
|
||||||
CONN_STR = "redis+socket://${config.services.redis.servers.gitea.unixSocket}?db=2";
|
|
||||||
};
|
|
||||||
database.LOG_SQL = false;
|
database.LOG_SQL = false;
|
||||||
repository = {
|
repository = {
|
||||||
PREFERRED_LICENSES = lib.concatStringsSep "," [
|
PREFERRED_LICENSES = lib.concatStringsSep "," [
|
||||||
@@ -141,6 +128,31 @@ in {
|
|||||||
AVATAR_MAX_ORIGIN_SIZE = 1024 * 1024 * 2;
|
AVATAR_MAX_ORIGIN_SIZE = 1024 * 1024 * 2;
|
||||||
};
|
};
|
||||||
actions.ENABLED = true;
|
actions.ENABLED = true;
|
||||||
|
ui = {
|
||||||
|
REACTIONS = lib.concatStringsSep "," [
|
||||||
|
"+1"
|
||||||
|
"-1"
|
||||||
|
"laugh"
|
||||||
|
"confused"
|
||||||
|
"heart"
|
||||||
|
"hooray"
|
||||||
|
"rocket"
|
||||||
|
"eyes"
|
||||||
|
"100"
|
||||||
|
"anger"
|
||||||
|
"astonished"
|
||||||
|
"no_good"
|
||||||
|
"ok_hand"
|
||||||
|
"pensive"
|
||||||
|
"pizza"
|
||||||
|
"point_up"
|
||||||
|
"sob"
|
||||||
|
"skull"
|
||||||
|
"upside_down_face"
|
||||||
|
"shrug"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"ui.meta".DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
||||||
};
|
};
|
||||||
|
|
||||||
dump = {
|
dump = {
|
||||||
@@ -152,26 +164,12 @@ in {
|
|||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.services.gitea = lib.mkIf cfg.enable {
|
systemd.services.gitea.serviceConfig.CPUSchedulingPolicy = "batch";
|
||||||
wants = [ "redis-gitea.service" ];
|
|
||||||
after = [ "redis-gitea.service" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
systemd.services.gitea.serviceConfig.CacheDirectory = "gitea/repo-archive";
|
||||||
CPUSchedulingPolicy = "batch";
|
systemd.services.gitea.serviceConfig.BindPaths = [
|
||||||
CacheDirectory = "gitea/repo-archive";
|
"%C/gitea/repo-archive:${cfg.stateDir}/data/repo-archive"
|
||||||
BindPaths = [
|
];
|
||||||
"%C/gitea/repo-archive:${cfg.stateDir}/data/repo-archive"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.redis.servers.gitea = lib.mkIf cfg.enable {
|
|
||||||
enable = true;
|
|
||||||
user = config.services.gitea.user;
|
|
||||||
save = [ ];
|
|
||||||
openFirewall = false;
|
|
||||||
port = 5698;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."${domain}" = {
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
values,
|
values,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -14,8 +15,6 @@
|
|||||||
(fp /base)
|
(fp /base)
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.consoleLogLevel = 0;
|
|
||||||
|
|
||||||
sops.defaultSopsFile = fp /secrets/skrot/skrot.yaml;
|
sops.defaultSopsFile = fp /secrets/skrot/skrot.yaml;
|
||||||
|
|
||||||
systemd.network.networks."enp2s0" = values.defaultNetworkConfig // {
|
systemd.network.networks."enp2s0" = values.defaultNetworkConfig // {
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
|
|
||||||
services.dibbler = {
|
services.dibbler = {
|
||||||
enable = true;
|
enable = true;
|
||||||
kioskMode = true;
|
kioskMode = false;
|
||||||
limitScreenWidth = 80;
|
limitScreenWidth = 80;
|
||||||
limitScreenHeight = 42;
|
limitScreenHeight = 42;
|
||||||
|
|
||||||
@@ -47,17 +46,11 @@
|
|||||||
username = "pvv_vv";
|
username = "pvv_vv";
|
||||||
dbname = "pvv_vv";
|
dbname = "pvv_vv";
|
||||||
host = "postgres.pvv.ntnu.no";
|
host = "postgres.pvv.ntnu.no";
|
||||||
password_file = config.sops.secrets."dibbler/postgresql/password".path;
|
password = config.sops.secrets."dibbler/postgresql/password".path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."serial-getty@ttyUSB0" = lib.mkIf (!config.virtualisation.isVmVariant) {
|
|
||||||
enable = true;
|
|
||||||
wantedBy = [ "getty.target" ]; # to start at boot
|
|
||||||
serviceConfig.Restart = "always"; # restart when session is closed
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "25.11"; # Did you read the comment? Nah bro
|
system.stateVersion = "25.11"; # Did you read the comment? Nah bro
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
# zramSwap.enable = true;
|
# zramSwap.enable = true;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "skrott";
|
hostName = "skrot";
|
||||||
defaultGateway = values.hosts.gateway;
|
defaultGateway = values.hosts.gateway;
|
||||||
defaultGateway6 = values.hosts.gateway6;
|
defaultGateway6 = values.hosts.gateway6;
|
||||||
interfaces.eth0 = {
|
interfaces.eth0 = {
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ in {
|
|||||||
(mkConnection "demiurgen" "eno1")
|
(mkConnection "demiurgen" "eno1")
|
||||||
(mkConnection "sanctuary" "ethernet_0")
|
(mkConnection "sanctuary" "ethernet_0")
|
||||||
(mkConnection "torskas" "eth0")
|
(mkConnection "torskas" "eth0")
|
||||||
(mkConnection "skrott" "eth0")
|
(mkConnection "skrot" "eth0")
|
||||||
(mkConnection "homeassistant" "eth0")
|
(mkConnection "homeassistant" "eth0")
|
||||||
(mkConnection "orchid" "eth0")
|
(mkConnection "orchid" "eth0")
|
||||||
(mkConnection "principal" "em0")
|
(mkConnection "principal" "em0")
|
||||||
|
|||||||
Reference in New Issue
Block a user