mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-12 18:38:23 +01:00
Compare commits
5 Commits
gitea-navb
...
faea6e80d4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faea6e80d4 | ||
|
|
a3c88b7869 | ||
|
|
4aa994e7a3 | ||
|
|
fc64139739 | ||
|
|
75b0c00212 |
8
flake.lock
generated
8
flake.lock
generated
@@ -196,11 +196,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737151758,
|
"lastModified": 1741724612,
|
||||||
"narHash": "sha256-yZBsefIarFUEhFRj+rCGMp9Zvag3MCafqV/JfGVRVwc=",
|
"narHash": "sha256-sIEO/+dk1+jUtZQ6ZRQy7RZnCL5EnP1RXHWRzHx4qNU=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "a4ebe6ded0c8c124561a41cb329ff30891914b5e",
|
"rev": "d5c28d4e0fd826760436f5e7f8ef1bb01d4ddfc6",
|
||||||
"revCount": 475,
|
"revCount": 477,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
||||||
},
|
},
|
||||||
|
|||||||
52
hosts/bekkalokk/services/gitea/customization.nix
Normal file
52
hosts/bekkalokk/services/gitea/customization.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{ config, pkgs, lib, fp, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.gitea;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.gitea-themes.monokai = pkgs.gitea-theme-monokai;
|
||||||
|
|
||||||
|
systemd.services.gitea-customization = lib.mkIf cfg.enable {
|
||||||
|
description = "Install extra customization in gitea's CUSTOM_DIR";
|
||||||
|
wantedBy = [ "gitea.service" ];
|
||||||
|
requiredBy = [ "gitea.service" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
};
|
||||||
|
|
||||||
|
script = let
|
||||||
|
logo-svg = fp /assets/logo_blue_regular.svg;
|
||||||
|
logo-png = fp /assets/logo_blue_regular.png;
|
||||||
|
extraLinks = pkgs.writeText "gitea-extra-links.tmpl" ''
|
||||||
|
<a class="item" href="https://www.pvv.ntnu.no/">PVV</a>
|
||||||
|
<a class="item" href="https://wiki.pvv.ntnu.no/">Wiki</a>
|
||||||
|
<a class="item" href="https://git.pvv.ntnu.no/Drift/-/projects/4">Tokyo Drift Issues</a>
|
||||||
|
'';
|
||||||
|
|
||||||
|
project-labels = (pkgs.formats.yaml { }).generate "gitea-project-labels.yaml" {
|
||||||
|
labels = lib.importJSON ./labels/projects.json;
|
||||||
|
};
|
||||||
|
|
||||||
|
customTemplates = pkgs.runCommandLocal "gitea-templates" {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
gnused
|
||||||
|
];
|
||||||
|
} ''
|
||||||
|
# Bigger icons
|
||||||
|
install -Dm444 "${cfg.package.src}/templates/repo/icon.tmpl" "$out/repo/icon.tmpl"
|
||||||
|
sed -i -e 's/24/48/g' "$out/repo/icon.tmpl"
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
|
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg
|
||||||
|
install -Dm444 ${logo-png} ${cfg.customDir}/public/assets/img/logo.png
|
||||||
|
install -Dm444 ${./loading.apng} ${cfg.customDir}/public/assets/img/loading.png
|
||||||
|
install -Dm444 ${extraLinks} ${cfg.customDir}/templates/custom/extra_links.tmpl
|
||||||
|
install -Dm444 ${project-labels} ${cfg.customDir}/options/label/project-labels.yaml
|
||||||
|
|
||||||
|
"${lib.getExe pkgs.rsync}" -a "${customTemplates}/" ${cfg.customDir}/templates/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
{ config, values, fp, pkgs, lib, ... }:
|
{ config, values, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.services.gitea;
|
cfg = config.services.gitea;
|
||||||
domain = "git.pvv.ntnu.no";
|
domain = "git.pvv.ntnu.no";
|
||||||
sshPort = 2222;
|
sshPort = 2222;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
./customization.nix
|
||||||
./gpg.nix
|
./gpg.nix
|
||||||
./import-users
|
./import-users
|
||||||
./web-secret-provider
|
./web-secret-provider
|
||||||
@@ -130,6 +131,11 @@ in {
|
|||||||
};
|
};
|
||||||
"ui.meta".DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
"ui.meta".DESCRIPTION = "Bokstavelig talt programvareverkstedet";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dump = {
|
||||||
|
enable = true;
|
||||||
|
type = "tar.gz";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
@@ -156,40 +162,4 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ sshPort ];
|
networking.firewall.allowedTCPPorts = [ sshPort ];
|
||||||
|
|
||||||
# Extra customization
|
|
||||||
|
|
||||||
services.gitea-themes.monokai = pkgs.gitea-theme-monokai;
|
|
||||||
|
|
||||||
systemd.services.install-gitea-customization = {
|
|
||||||
description = "Install extra customization in gitea's CUSTOM_DIR";
|
|
||||||
wantedBy = [ "gitea.service" ];
|
|
||||||
requiredBy = [ "gitea.service" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = cfg.user;
|
|
||||||
Group = cfg.group;
|
|
||||||
};
|
|
||||||
|
|
||||||
script = let
|
|
||||||
logo-svg = fp /assets/logo_blue_regular.svg;
|
|
||||||
logo-png = fp /assets/logo_blue_regular.png;
|
|
||||||
extraLinks = pkgs.writeText "gitea-extra-links.tmpl" ''
|
|
||||||
<a class="item" href="https://www.pvv.ntnu.no/">PVV</a>
|
|
||||||
<a class="item" href="https://wiki.pvv.ntnu.no/">Wiki</a>
|
|
||||||
<a class="item" href="https://git.pvv.ntnu.no/Drift/-/projects/4">Tokyo Drift Issues</a>
|
|
||||||
'';
|
|
||||||
|
|
||||||
project-labels = (pkgs.formats.yaml { }).generate "gitea-project-labels.yaml" {
|
|
||||||
labels = lib.importJSON ./labels/projects.json;
|
|
||||||
};
|
|
||||||
in ''
|
|
||||||
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg
|
|
||||||
install -Dm444 ${logo-png} ${cfg.customDir}/public/assets/img/logo.png
|
|
||||||
install -Dm444 ${./loading.apng} ${cfg.customDir}/public/assets/img/loading.png
|
|
||||||
install -Dm444 ${extraLinks} ${cfg.customDir}/templates/custom/extra_links.tmpl
|
|
||||||
install -Dm444 ${project-labels} ${cfg.customDir}/options/label/project-labels.yaml
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user