foot, vintage fonts, scope operator

This commit is contained in:
atagen 2025-08-12 15:47:26 +10:00
parent 8d77e96d89
commit 5575604452
46 changed files with 803 additions and 702 deletions

76
pkgs/gtk-theme.nix Normal file
View file

@ -0,0 +1,76 @@
{
pkgs,
palette ? { },
}:
let
rendersvg = pkgs.runCommand "rendersvg" { } ''
mkdir -p $out/bin
ln -s ${pkgs.resvg}/bin/resvg $out/bin/rendersvg
'';
in
pkgs.stdenv.mkDerivation {
name = "generated-gtk-theme-nix-rice";
src = pkgs.fetchFromGitHub {
owner = "nana-4";
repo = "materia-theme";
rev = "d7f59a37ef51f893c28b55dc344146e04b2cd52c";
sha256 = "sha256-PnpFAmKEpfg3wBwShLYviZybWQQltcw7fpsQkTUZtww=";
};
buildInputs = builtins.attrValues {
inherit (pkgs)
sassc
bc
which
meson
optipng
ninja
;
inherit (pkgs.nodePackages)
sass
;
inherit (pkgs.gtk4) dev;
inherit rendersvg;
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase = ''
HOME=/build
chmod 777 -R .
patchShebangs .
mkdir -p $out/share/themes
mkdir bin
sed -e 's/handle-horz-.*//' -e 's/handle-vert-.*//' -i ./src/gtk-2.0/assets.txt
cat > /build/gtk-colors << EOF
BTN_BG=${palette.util.bg}
BTN_FG=${palette.bright.yellow}
FG=${palette.util.fg}
BG=${palette.util.bg}
HDR_BTN_BG=${palette.util.bg}
HDR_BTN_FG=${palette.util.fg}
ACCENT_BG=${palette.normal.cyan}
ACCENT_FG=${palette.normal.yellow}
HDR_FG=${palette.bright.yellow}
HDR_BG=${palette.util.bg}
MATERIA_SURFACE=${palette.normal.black}
MATERIA_VIEW=${palette.bright.black}
MENU_BG=${palette.util.bg}
MENU_FG=${palette.util.fg}
SEL_BG=${palette.normal.yellow}
SEL_FG=${palette.normal.cyan}
TXT_BG=${palette.util.bg}
TXT_FG=${palette.util.fg}
WM_BORDER_FOCUS=${palette.normal.yellow}
WM_BORDER_UNFOCUS=${palette.normal.black}
UNITY_DEFAULT_LAUNCHER_STYLE=False
NAME="nix-rice"
MATERIA_STYLE_COMPACT=False
EOF
echo "Changing colours:"
./change_color.sh -o nix-rice /build/gtk-colors -i False -t "$out/share/themes"
chmod 555 -R .
'';
}

23
pkgs/metropolis-font.nix Normal file
View file

@ -0,0 +1,23 @@
{
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation {
pname = "metropolis-font";
version = "5.2.5";
src = fetchzip {
name = "metropolis-font-base";
url = "https://api.fontsource.org/v1/download/metropolis";
extension = "zip";
hash = "sha256-BH8iiJE7One2HXxVE9/VgQaxi+hWKujTNErELMvT4mw=";
stripRoot = false;
};
installPhase = ''
runHook preInstall
install -m644 --target $out/share/fonts/truetype/ -D $src/ttf/*.ttf
runHook postInstall
'';
}

21
pkgs/ms-w98-ui-font.nix Normal file
View file

@ -0,0 +1,21 @@
{
stdenvNoCC,
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation {
pname = "ms-w98-ui-font";
version = "1.0";
src = fetchFromGitHub {
owner = "MARTYR-X-LTD";
repo = "ms-w98-ui";
rev = "1333c17aa54f547025679ea05a37eee5a2a26429";
hash = "sha256-yEbq8Hef4odL3pjGHxjDVE9lRCeiw7eekvUL5SbJ1Zw=";
};
installPhase = ''
runHook preInstall
install -m644 --target $out/share/fonts/truetype/ -D $src/TTF/*.ttf
runHook postInstall
'';
}

View file

@ -0,0 +1,44 @@
{
lib,
stdenvNoCC,
fetchzip,
style ? "mixed",
baseVersion ? "2.2",
}:
let
styles = builtins.mapAttrs (_: v: lib.escape [ " " "(" ")" ] v) {
"bitmap" = "otb - Bm (linux bitmap)";
"aspect" = "ttf - Ac (aspect-corrected)";
"mixed" = "ttf - Mx (mixed outline+bitmap)";
"pixel" = "ttf - Px (pixel outline)";
};
selectedStyle = styles.${style};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "oldschool-pc-font-pack";
version = "${baseVersion}-${style}";
src = fetchzip {
name = "oldschool-pc-font-pack-base";
url = "https://int10h.org/oldschool-pc-fonts/download/oldschool_pc_font_pack_v${baseVersion}_linux.zip";
hash = "sha256-54U8tZzvivTSOgmGesj9QbIgkSTm9w4quMhsuEc0Xy4=";
stripRoot = false;
};
installPhase = ''
runHook preInstall
''
+ (
if (style == "bitmap") then
''
install -m644 --target $out/share/fonts/ -D $src/${selectedStyle}/*.otb
''
else
''
install -m644 --target $out/share/fonts/truetype/ -D $src/${selectedStyle}/*.ttf
''
)
+ ''
runHook postInstall
'';
})

44
pkgs/rbw-helper.nix Normal file
View file

@ -0,0 +1,44 @@
{ pkgs, ... }:
pkgs.writeTextFile {
name = "rbw-helper";
text = ''
declare -A params
if [ "x$1" == "xget" ]; then
read line
while [ -n "$line" ]; do
key=$\{line%%=*}
value=$\{line#*=}
params[$key]=$value
read line
done
if [ "x$\{params['protocol']}" != "xhttps" ]; then
exit
fi
if [ -z "$\{params["host"]}" ]; then
exit
fi
rbw ls > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Please login to rbw to use git credential helper" > /dev/stderr
exit
fi
user=`rbw get --full $\{params["host"]} | grep "Username:" | cut -d' ' -f2-`
pass=`rbw get $\{params["host"]}`
if [ "x$user" == "x" ] || [ "x$pass" == "x" ]; then
echo "Couldn't find host in rbw DB." > /dev/stderr
exit
fi
echo username=$user
echo password=$pass
fi
'';
executable = true;
destination = "/bin/git-credential-rw";
}