mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-04-11 16:31:23 +02:00
Compare commits
No commits in common. "a3c88b786907257fd8054d1bdbcd5e7135e663fa" and "94d73b34ad1228e1f401b9edd70a95be8b5947bc" have entirely different histories.
a3c88b7869
...
94d73b34ad
@ -1,52 +0,0 @@
|
|||||||
{ 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,11 +1,10 @@
|
|||||||
{ config, values, lib, ... }:
|
{ config, values, fp, pkgs, 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
|
||||||
@ -131,11 +130,6 @@ 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 ];
|
||||||
@ -162,4 +156,40 @@ 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user