diff --git a/nix-system-configs/modules/styling/forgejo/Jost/LICENSE.md b/nix-system-configs/modules/styling/forgejo/Jost/LICENSE.md new file mode 100755 index 0000000..70a5f00 --- /dev/null +++ b/nix-system-configs/modules/styling/forgejo/Jost/LICENSE.md @@ -0,0 +1,79 @@ +SIL OPEN FONT LICENSE +===================== + +Version 1.1 - 26 February 2007 + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting — in part or in whole — any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +4) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-Hairline.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-Hairline.otf new file mode 100644 index 0000000..72b189e Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-Hairline.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-HairlineItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-HairlineItalic.otf new file mode 100644 index 0000000..5945c18 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-100-HairlineItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-Thin.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-Thin.otf new file mode 100644 index 0000000..7362df9 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-Thin.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-ThinItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-ThinItalic.otf new file mode 100644 index 0000000..6a627fe Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-200-ThinItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-Light.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-Light.otf new file mode 100644 index 0000000..0c1ac51 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-Light.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-LightItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-LightItalic.otf new file mode 100644 index 0000000..fc9e28f Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-300-LightItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-Book.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-Book.otf new file mode 100644 index 0000000..cbc8e84 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-Book.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-BookItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-BookItalic.otf new file mode 100644 index 0000000..2e80a98 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-400-BookItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-Medium.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-Medium.otf new file mode 100644 index 0000000..783c743 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-Medium.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-MediumItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-MediumItalic.otf new file mode 100644 index 0000000..66e4825 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-500-MediumItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-Semi.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-Semi.otf new file mode 100644 index 0000000..2de075a Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-Semi.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-SemiItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-SemiItalic.otf new file mode 100644 index 0000000..13a4444 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-600-SemiItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-Bold.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-Bold.otf new file mode 100644 index 0000000..ea91ef9 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-Bold.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-BoldItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-BoldItalic.otf new file mode 100644 index 0000000..493a0d7 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-700-BoldItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-Hevy.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-Hevy.otf new file mode 100644 index 0000000..ec643c6 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-Hevy.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-HevyItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-HevyItalic.otf new file mode 100644 index 0000000..ada4cc0 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-800-HevyItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-Black.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-Black.otf new file mode 100644 index 0000000..5e7ee03 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-Black.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-BlackItalic.otf b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-BlackItalic.otf new file mode 100644 index 0000000..cbb63e5 Binary files /dev/null and b/nix-system-configs/modules/styling/forgejo/Jost/OpenType/Jost-900-BlackItalic.otf differ diff --git a/nix-system-configs/modules/styling/forgejo/theme-custom.css b/nix-system-configs/modules/styling/forgejo/theme-custom.css index ff5554f..7601f50 100644 --- a/nix-system-configs/modules/styling/forgejo/theme-custom.css +++ b/nix-system-configs/modules/styling/forgejo/theme-custom.css @@ -7,6 +7,14 @@ font-display: swap; } +@font-face { + font-family: 'Jost Book'; + src: url('/assets/fonts/Jost-400-Book.otf') format('opentype'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + /* import base Forgejo theme so we only override what we need */ @import "./theme-forgejo-auto.css"; diff --git a/nix-system-configs/modules/system/forgejo.nix b/nix-system-configs/modules/system/forgejo.nix index 0108c14..fe3f141 100644 --- a/nix-system-configs/modules/system/forgejo.nix +++ b/nix-system-configs/modules/system/forgejo.nix @@ -25,6 +25,14 @@ mkdir -p $out/fonts cp "$f" $out/fonts/MapleMonoNerd.ttf ''; + + # Package local Jost OTF files from the repository into the Nix store so + # they can be installed into the Forgejo custom assets directory. + jostFonts = pkgs.runCommand "jost-fonts" { } '' + mkdir -p $out/fonts + # copy all OpenType files from the repository styling folder + cp -a ${toString ../styling/forgejo/Jost/OpenType}/*.otf $out/fonts/ || true + ''; in { options.local = { hostname = lib.mkOption { @@ -139,13 +147,13 @@ in { "d '${config.services.forgejo.customDir}/public/assets/css' - forgejo forgejo - -" # install the TTF from the Nix store into the Forgejo customDir "C+ '${config.services.forgejo.customDir}/public/assets/fonts/MapleMonoNerd.ttf' - forgejo forgejo - ${mapleFonts}/fonts/MapleMonoNerd.ttf" - "C+ '${config.services.forgejo.customDir}/templates/home.tmpl' - forgejo forgejo - ${ - ../styling/forgejo/home.tmpl - }" + #"C+ '${config.services.forgejo.customDir}/templates/home.tmpl' - forgejo forgejo - ${ + # ../styling/forgejo/home.tmpl + #}" # copy header.tmpl into templates/custom so we can inject custom CSS into the - "C+ '${config.services.forgejo.customDir}/templates/custom/header.tmpl' - forgejo forgejo - ${ - ../styling/forgejo/header.tmpl - }" + #"C+ '${config.services.forgejo.customDir}/templates/custom/header.tmpl' - forgejo forgejo - ${ + # ../styling/forgejo/header.tmpl + #}" # copy your theme CSS into the public assets so Forgejo serves it directly "C+ '${config.services.forgejo.customDir}/public/assets/css/theme-custom.css' - forgejo forgejo - ${ ../styling/forgejo/theme-custom.css @@ -167,6 +175,7 @@ in { cp -a ${toString ../styling/forgejo/header.tmpl} ${config.services.forgejo.customDir}/templates/custom/header.tmpl; \ cp -a ${toString ../styling/forgejo/home.tmpl} ${config.services.forgejo.customDir}/templates/home.tmpl; \ cp -a ${toString ../styling/forgejo/theme-custom.css} ${config.services.forgejo.customDir}/public/assets/css/theme-custom.css; \ + cp -a ${jostFonts}/fonts/* ${config.services.forgejo.customDir}/public/assets/fonts/ || true; \ chown -R forgejo:forgejo ${config.services.forgejo.customDir}"''; }; wantedBy = [ "multi-user.target" ];