add codeberg-themes to forgejo
This commit is contained in:
parent
b938a41bee
commit
aff4e4599d
5 changed files with 120 additions and 27 deletions
30
flake.lock
generated
30
flake.lock
generated
|
@ -8,11 +8,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1746849806,
|
||||
"narHash": "sha256-6vJX4DnhDlWNtOOh3v08YqPgjJblfgHnV9562nPHNEo=",
|
||||
"lastModified": 1747022610,
|
||||
"narHash": "sha256-d6SvA0gTHDrOqt4tZRVD0Gm5G4w6jAFJ6lis79PjSPw=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "e2408d3f94a6b658e12f135501aa7fd38efabc72",
|
||||
"rev": "d4b3ffe3e719e42b175ccdef13598516f0a8025d",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
@ -118,11 +118,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1746798521,
|
||||
"narHash": "sha256-axfz/jBEH9XHpS7YSumstV7b2PrPf7L8bhWUtLBv3nA=",
|
||||
"lastModified": 1747021744,
|
||||
"narHash": "sha256-IDsM/9/tHQBlhG3tXI2fTM84AUN1uRa7JDPT1LMlGes=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "e95a7c5b6fa93304cd2fd78cf676c4f6d23c422c",
|
||||
"rev": "fb061f555f821fe4fb49f8f6f2a0cc3d5728bd52",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -189,11 +189,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746663147,
|
||||
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=",
|
||||
"lastModified": 1746904237,
|
||||
"narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||
"rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -260,11 +260,11 @@
|
|||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1746852864,
|
||||
"narHash": "sha256-4pE761eSft4GUboGMdseBC7WvfY81CMHuCuxnVy9PwI=",
|
||||
"lastModified": 1746940940,
|
||||
"narHash": "sha256-ASB3QVEoFK5//280uedYdt8jyDLhFa9zgj8qfc0S7Sk=",
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"rev": "fee3bbe536b5bf484aedebafa5130b485068b64f",
|
||||
"rev": "815ed49d3693346122ef61da6d7443cd3cc21752",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -373,11 +373,11 @@
|
|||
},
|
||||
"stable": {
|
||||
"locked": {
|
||||
"lastModified": 1746557022,
|
||||
"narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=",
|
||||
"lastModified": 1746810718,
|
||||
"narHash": "sha256-VljtYzyttmvkWUKTVJVW93qAsJsrBbgAzy7DdnJaQfI=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860",
|
||||
"rev": "0c0bf9c057382d5f6f63d54fd61f1abd5e1c2f63",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -26,12 +26,6 @@ in
|
|||
default = 3001;
|
||||
};
|
||||
|
||||
ssh_user = mkOption {
|
||||
description = "The ssh user to use Forgejo as.";
|
||||
type = types.nullOr types.str;
|
||||
default = "forgejo";
|
||||
};
|
||||
|
||||
domain = mkOption {
|
||||
description = "The domain to serve Forgejo on.";
|
||||
type = types.nullOr types.str;
|
||||
|
@ -56,16 +50,33 @@ in
|
|||
cfg.port
|
||||
];
|
||||
|
||||
systemd.services.codeberg-themes = {
|
||||
description = "Codeberg Themes Setup";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment.PATH = lib.mkDefault "${pkgs.coreutils}/bin:${pkgs.bash}/bin";
|
||||
|
||||
serviceConfig.ExecStart = ''
|
||||
${pkgs.bash}/bin/bash -c "mkdir -p /var/lib/forgejo/custom/public/assets/css /var/lib/forgejo/custom/public/assets/img && \
|
||||
cp -r ${pkgs.awesome-flake.codeberg-themes}/var/lib/forgejo/custom/public/assets/css/* /var/lib/forgejo/custom/public/assets/css/ && \
|
||||
chown -R forgejo:forgejo /var/lib/forgejo/custom"
|
||||
'';
|
||||
};
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
package = cfg.package;
|
||||
database.type = "postgres";
|
||||
settings.server = {
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = cfg.domain;
|
||||
HTTP_PORT = cfg.port;
|
||||
ROOT_URL = "https://git.monapona.dev";
|
||||
SSH_DOMAIN = cfg.ssh_domain;
|
||||
BUILTIN_SSH_SERVER_USER = cfg.ssh_user;
|
||||
};
|
||||
ui = {
|
||||
THEMES = "gitea,dark-arc,codeberg-dark";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
40
packages/codeberg-themes/default.nix
Normal file
40
packages/codeberg-themes/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitea,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "codeberg-themes";
|
||||
version = "1.0";
|
||||
src = fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "Codeberg-Infrastructure";
|
||||
repo = "forgejo";
|
||||
rev = "codeberg-11";
|
||||
sha256 = "sha256-iPPj7Hz+Jp+lnAa0N5rjSIXWYiTvjPQ8pMQB3SetdYA=";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
# We clone the repo and only extract the folder we need
|
||||
mkdir -p $out
|
||||
cp -r $src/web_src/css/themes $out/themes
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
# Create the required directories for installation
|
||||
mkdir -p $out/var/lib/forgejo/custom/public/assets/css
|
||||
mkdir -p $out/var/lib/forgejo/custom/public/assets/img
|
||||
|
||||
# Move theme files
|
||||
cp -r $out/themes/* $out/var/lib/forgejo/custom/public/assets/css/
|
||||
|
||||
# Install logo
|
||||
cp ${./logo.svg} $out/var/lib/forgejo/custom/public/assets/img/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Codeberg themes and logo for Forgejo";
|
||||
maintainers = with maintainers; [ spaenny ];
|
||||
};
|
||||
}
|
41
packages/codeberg-themes/logo.svg
Normal file
41
packages/codeberg-themes/logo.svg
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
version="1.1"
|
||||
viewBox="0 0 97 97"
|
||||
xml:space="preserve"
|
||||
id="svg2"
|
||||
sodipodi:docname="logo.svg"
|
||||
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs2" /><sodipodi:namedview
|
||||
id="namedview2"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:zoom="11.948454"
|
||||
inkscape:cx="48.625538"
|
||||
inkscape:cy="48.416306"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1368"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" /><script
|
||||
id="script1" /><div
|
||||
id="__jumpCutterBridgeElement" />
|
||||
|
||||
<path
|
||||
d="m92.71 44.408-40.119-40.117c-2.31-2.311-6.057-2.311-8.369 0l-8.33 8.332v4.092h-4.094l-27.51 27.507c-2.311 2.313-2.311 6.06 0 8.371l40.121 40.118c2.31 2.311 6.056 2.311 8.369 0l39.932-39.932c2.311-2.311 2.311-6.06 0-8.371z"
|
||||
fill="#609926"
|
||||
id="path1"
|
||||
style="fill:#677e8d;fill-opacity:1" /><path
|
||||
d="m44.2227 4.29102c-4.14072 4.14159-8.28256 8.28277-12.4238 12.4238l10.416 10.4199c-1.068 2.558-0.567373 5.61527 1.51562 7.69726 0.681999 0.684 1.46664 1.19311 2.30664 1.53711v25.2305c-0.839999 0.344-1.62664 0.85811-2.30664 1.53711-2.75 2.749-2.75 7.20499 0 9.95898 2.748 2.749 7.20703 2.749 9.95703 0 2.75-2.753 2.75-7.20899 0-9.95898-0.557999-0.558-1.19133-1.00003-1.86133-1.33203v-24.998l9.5 9.5c-1.049 2.548-0.536748 5.5882 1.53125 7.6582 2.753 2.751 7.20894 2.751 9.96094 0 2.75-2.752 2.75-7.20899 0-9.95898-1.968-1.971-4.80844-2.51992-7.27344-1.66992l-10.1875-10.1855c0.850999-2.465 0.299076-5.30539-1.66992-7.27539-1.957-1.958-4.77252-2.51555-7.22852-1.68555l-10.5664-10.5664z"
|
||||
fill="#fff"
|
||||
id="path2" /></svg>
|
After Width: | Height: | Size: 2 KiB |
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue