feat: make the result the iamge directly #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "krauterbaquette/result-as-img"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
this simplifies the consumtion in nix code, as one can go
img = assets.packages.catppuccin-latte-icoand does not have to write
img = "${assets.packages.catppuccin-latte-ico}/catppuccin-latte.ico"However this is a "breaking change" so be carefull there.
But I think the current scope of users is limited so better do it now than later
this simplifies the consumtion in nix code, as one can go `img = assets.packages.catppuccin-latte-ico` and does not have to write `img = "${assets.packages.catppuccin-latte-ico}/catppuccin-latte.ico"Everything besides the comment looks really good, thanks!
I just need more clarifications here to understand.
@ -29,17 +33,17 @@];mkNamedImageWith ={ name, cmd }:{inherit name;# dot in package names are not supported by the nix cliname = builtins.replaceStrings [ "." ] [ "-" ] name;value = pkgs.stdenv.mkDerivation {inherit name;src = inputs.self + "/logo";buildPhase = ''mkdir -p $out${cmd}'';};};in{all = pkgs.symlinkJoin {What's the motivation behind this change?
I removed the
mkdir -p $outbecause we write the resulting image files directly to$out, soresultis a direct symlink to the image file (and therefore $out is no longer a directory we have to create).To allow image tools to better "get the type" of the resulting file i therefore changed to name (of the derivation) to end in
.pngfor example and not-png(as it was previous).However the name of the package itslef shouldn't contain any dots, because it will "break" the nix command, meaning that you simply cannot build that package from cli because it wont find it:
will search for a package under
packages."${system}".catppuccin-latte.icowhich does not exists, because that package would live underpackages."${system}"."catppuccin-latte.ico"(see the").thats why i overwrite the "package location" to contain no dots
LGTM!