feat: update and gitea tweaks

This commit is contained in:
winston 2024-03-03 00:24:08 +01:00
parent 277b9178f7
commit 96974e2331
8 changed files with 75 additions and 56 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"nix.formatterPath": "alejandra"
}

View file

@ -25,17 +25,6 @@ in {
extraOptions = ["--pull=always"];
};
pepperjack = {
image = "ghcr.io/phasecorex/red-discordbot:core-audio";
environment = {
PREFIX = "~";
OWNER = "505490445468696576";
};
environmentFiles = [config.age.secrets."containers/pepperjack.env".path];
volumes = ["/srv/data-pepperjack:/data"];
extraOptions = ["--pull=always"];
};
website = {
image = "ghcr.io/nekowinston/winston.sh/winston-sh:latest";
login = ghcrLogin;

View file

@ -3,13 +3,7 @@
lib,
pkgs,
...
}: let
theme = pkgs.fetchzip {
url = "https://github.com/catppuccin/gitea/releases/download/v0.4.1/catppuccin-gitea.tar.gz";
sha256 = "sha256-14XqO1ZhhPS7VDBSzqW55kh6n5cFZGZmvRCtMEh8JPI=";
stripRoot = false;
};
in {
}: {
services.gitea = {
enable = true;
@ -22,7 +16,7 @@ in {
lfs.enable = true;
appName = "nekowinston's Gitea";
appName = "winston's gitea";
settings = {
actions.ENABLED = true;
@ -55,30 +49,30 @@ in {
SAME_SITE = "strict";
};
ui = {
THEMES =
builtins.concatStringsSep
","
(["auto"]
++ (map (name: lib.removePrefix "theme-" (lib.removeSuffix ".css" name))
(builtins.attrNames (builtins.readDir theme))));
DEFAULT_THEME = "catppuccin-frappe-pink";
"ui.meta" = {
AUTHOR = "nekowinston";
DESCRIPTION = "winston's gitea instance";
};
other = {
SHOW_FOOTER_VERSION = false;
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false;
SHOW_FOOTER_BRANDING = false;
};
};
};
networking.firewall.allowedTCPPorts = [22];
systemd.services.gitea.preStart = let
inherit (config.services.gitea) stateDir;
in
lib.mkAfter ''
chmod u+w -R ${stateDir}/custom/**/*
# apply customizations
cp -Rf ${./gitea}/* ${stateDir}/custom
chmod u-w -R ${stateDir}/custom/**/*
'';
systemd.services.gitea = {
preStart = let
inherit (config.services.gitea) stateDir;
in
lib.mkAfter ''
rm -rf ${stateDir}/custom/public/assets
mkdir -p ${stateDir}/custom/public/assets
ln -sf ${theme} ${stateDir}/custom/public/assets/css
'';
};
networking.firewall.allowedTCPPorts = [22];
age.secrets."services/gitea/password-database".owner = "gitea";

View file

@ -0,0 +1,4 @@
<a class="item" href="https://github.com/nekowinston">
<svg class="svg" aria-hidden="true" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="m12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.385-1.335-1.755-1.335-1.755-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57 4.801-1.574 8.236-6.074 8.236-11.369 0-6.627-5.373-12-12-12"/></svg>
GitHub
</a>

View file

@ -0,0 +1,11 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet">
<style>
:root {
--fonts-proportional: "IBM Plex Sans", sans !important;
--fonts-monospace: "IBM Plex Mono", monospace !important;
}
</style>

View file

@ -0,0 +1,17 @@
{{template "base/head" .}}
<div role="main" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}" class="page-content home">
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}"/>
</div>
<div class="hero">
<h1 class="ui icon header title">winston's gitea</h1>
<h2>
<a href="/winston">You're probably looking for this page.</a>
</h2>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

View file

@ -44,11 +44,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1706830856,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"type": "github"
},
"original": {
@ -118,11 +118,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1708979614,
"narHash": "sha256-FWLWmYojIg6TeqxSnHkKpHu5SGnFP5um1uUjH+wRV6g=",
"lastModified": 1709309926,
"narHash": "sha256-VZFBtXGVD9LWTecGi6eXrE0hJ/mVB3zGUlHImUs2Qak=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b7ee09cf5614b02d289cd86fcfa6f24d4e078c2a",
"rev": "79baff8812a0d68e24a836df0a364c678089e2c7",
"type": "github"
},
"original": {
@ -135,11 +135,11 @@
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1706550542,
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
"lastModified": 1709237383,
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1708984720,
"narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=",
"lastModified": 1709237383,
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538",
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
"type": "github"
},
"original": {

View file

@ -7,7 +7,7 @@
overlays = [
(final: prev: rec {
atuin = unstable.atuin;
unstable = import inputs.nixpkgs-unstable {inherit (prev) system;};
unstable = inputs.nixpkgs-unstable.legacyPackages.${prev.system};
})
];
in
@ -36,9 +36,14 @@
config,
inputs',
pkgs,
self',
system,
...
}: {
_module.args.pkgs = import inputs.nixpkgs {
inherit overlays system;
};
apps = (inputs.nixinate.nixinate.${system} self).nixinate;
pre-commit = {
@ -53,11 +58,7 @@
};
devShells.default = config.pre-commit.devShell.overrideAttrs (old: {
buildInputs = [
pkgs.alejandra
pkgs.nil
inputs'.agenix.packages.agenix
];
buildInputs = with pkgs; [inputs'.agenix.packages.agenix self'.formatter nil];
});
formatter = pkgs.alejandra;