mirror of
https://github.com/NixOS/nixos-artwork
synced 2024-10-18 00:06:24 -04:00
Merge pull request #123 from samueldr/feature/build-logos
logo: Provide an easy path to optimized SVGs and exported PNGs
This commit is contained in:
commit
c68a508b95
|
@ -28,4 +28,5 @@
|
||||||
makeFlags = [ "prefix=$(out)" ];
|
makeFlags = [ "prefix=$(out)" ];
|
||||||
}
|
}
|
||||||
) {};
|
) {};
|
||||||
|
logo = pkgs.callPackage ./logo/package.nix {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,17 @@ white, keeping the spacing exact.
|
||||||
This variant is monochrome, with the shadow gradients baked-in as opacity
|
This variant is monochrome, with the shadow gradients baked-in as opacity
|
||||||
changes.
|
changes.
|
||||||
|
|
||||||
|
### Optimized version
|
||||||
|
|
||||||
|
The SVG files in this directory are the authoring files.
|
||||||
|
|
||||||
|
In other words, they are busy with inkscape-specific properties, used when
|
||||||
|
editing the files.
|
||||||
|
|
||||||
|
If what is needed is a file optimized for size, and for using as an asset,
|
||||||
|
the Nix expression in this directory can be used to produce optimized SVGs.
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
1
logo/default.nix
Normal file
1
logo/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(import ../. {}).logo
|
38
logo/package.nix
Normal file
38
logo/package.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ runCommand
|
||||||
|
, lib
|
||||||
|
, inkscape
|
||||||
|
, nodePackages
|
||||||
|
}:
|
||||||
|
|
||||||
|
runCommand "nixos-artwork-logos" {
|
||||||
|
logos = [
|
||||||
|
# The snowflake-only variants
|
||||||
|
"nix-snowflake-colours"
|
||||||
|
"nix-snowflake-white"
|
||||||
|
|
||||||
|
# The horizontal variants
|
||||||
|
"nixos"
|
||||||
|
"nixos-white"
|
||||||
|
|
||||||
|
# The vertical variant
|
||||||
|
"nixos-text-below"
|
||||||
|
];
|
||||||
|
src = lib.cleanSource ./.;
|
||||||
|
nativeBuildInputs = [
|
||||||
|
inkscape
|
||||||
|
nodePackages.svgo
|
||||||
|
];
|
||||||
|
} ''
|
||||||
|
PS4=" $ "
|
||||||
|
for f in $logos; do
|
||||||
|
mkdir -p $out
|
||||||
|
printf ":: ⇒ %s\n" "$f"
|
||||||
|
(set -x
|
||||||
|
inkscape --export-background-opacity=0 --export-plain-svg --export-filename=$out/$f.svg "$src/$f.svg"
|
||||||
|
inkscape --export-background-opacity=0 --export-filename=$out/$f.png "$src/$f.svg"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
(set -x
|
||||||
|
svgo --pretty --multipass --folder "$out"
|
||||||
|
)
|
||||||
|
''
|
Loading…
Reference in a new issue