add lotte-art
This commit is contained in:
parent
b89c139750
commit
ef3394a6c8
17 changed files with 95 additions and 79 deletions
|
@ -1,3 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
lotte-art = pkgs.callPackage ./source.nix {};
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "blobfox";
|
name = "blobfox";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "blobfox_flip";
|
name = "blobfox_flip";
|
||||||
manifest = ./blobfox.json;
|
manifest = ./blobfox.json;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "bunhd";
|
name = "bunhd";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "bunhd_flip";
|
name = "bunhd_flip";
|
||||||
manifest = ./bunhd.json;
|
manifest = ./bunhd.json;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "drgn";
|
name = "drgn";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "fox";
|
name = "fox";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "raccoon";
|
name = "raccoon";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ callPackage }: callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
{callPackage}:
|
||||||
|
callPackage ../../../lib/mkPleromaEmoji.nix {} rec {
|
||||||
name = "vlpn";
|
name = "vlpn";
|
||||||
manifest = ./${name}.json;
|
manifest = ./${name}.json;
|
||||||
passthru.updateScript = [
|
passthru.updateScript = [
|
||||||
|
|
22
art/lotte/default.nix
Normal file
22
art/lotte/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ stdenv, fetchgit, lib }: let
|
||||||
|
src = builtins.fromJSON (builtins.readFile ./source.json);
|
||||||
|
in stdenv.mkDerivation {
|
||||||
|
pname = "lotte-art";
|
||||||
|
version = src.date;
|
||||||
|
src = fetchgit {
|
||||||
|
inherit (src) url rev sha256 fetchLFS fetchSubmodules deepClone leaveDotGit;
|
||||||
|
};
|
||||||
|
preferLocalBuild = true;
|
||||||
|
passthru.updateScript = [
|
||||||
|
../../scripts/update-git.sh
|
||||||
|
"https://git.chir.rs/darkkirb/lotte-art"
|
||||||
|
"art/lotte/source.json"
|
||||||
|
"--fetch-lfs"
|
||||||
|
];
|
||||||
|
meta = {
|
||||||
|
description = "Art I commissioned (mostly)";
|
||||||
|
license = lib.licenses.cc-by-nc-sa-40;
|
||||||
|
};
|
||||||
|
buildPhase = "true";
|
||||||
|
installPhase = "cp -r $src $out";
|
||||||
|
}
|
11
art/lotte/source.json
Normal file
11
art/lotte/source.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"url": "https://git.chir.rs/darkkirb/lotte-art",
|
||||||
|
"rev": "28da5b860c7d604aee5889ede4ee7985b4386ba5",
|
||||||
|
"date": "2022-08-16T08:46:58+01:00",
|
||||||
|
"path": "/nix/store/ivwrhckcfijiclwybv57igqw6m0rl7zx-lotte-art",
|
||||||
|
"sha256": "113wdw922n43q3y6p55mih2nnqsjz2asy7rmz1ak2fgd8pfd7yl1",
|
||||||
|
"fetchLFS": true,
|
||||||
|
"fetchSubmodules": false,
|
||||||
|
"deepClone": false,
|
||||||
|
"leaveDotGit": false
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
{fetchgit}:
|
|
||||||
fetchgit {
|
|
||||||
url = "https://git.chir.rs/darkkirb/lotte-art";
|
|
||||||
rev = "28da5b860c7d604aee5889ede4ee7985b4386ba5";
|
|
||||||
sha256 = "113wdw922n43q3y6p55mih2nnqsjz2asy7rmz1ak2fgd8pfd7yl1";
|
|
||||||
fetchLFS = true;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p nix-prefetch-git jq git git-lfs
|
|
||||||
|
|
||||||
WORK_DIR=$(mktemp -d)
|
|
||||||
URL=https://git.chir.rs/darkkirb/lotte-art
|
|
||||||
TARGET_DIR="$PWD"
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
grep "fatal" $WORK_DIR/nix-prefetch-git.out >/dev/stderr || true
|
|
||||||
rm -rf "$WORK_DIR"
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
echo "Fetching source code $REVISION from $URL"
|
|
||||||
JSON=$(nix-prefetch-git --url "$URL" --fetch-lfs 2> $WORK_DIR/nix-prefetch-git.out | grep -v " Git" | grep -v "Git ")
|
|
||||||
REVISION=$(echo "$JSON" | jq -r .rev)
|
|
||||||
SHA=$(echo "$JSON" | jq -r .sha256)
|
|
||||||
|
|
||||||
cat > source.nix << EOF
|
|
||||||
{fetchgit}:
|
|
||||||
fetchgit {
|
|
||||||
url = "$URL";
|
|
||||||
rev = "$REVISION";
|
|
||||||
sha256 = "$SHA";
|
|
||||||
fetchLFS = true;
|
|
||||||
}
|
|
||||||
EOF
|
|
|
@ -22,4 +22,5 @@
|
||||||
emoji-volpeon-fox = pkgs.callPackage ./art/emoji/volpeon/fox.nix {};
|
emoji-volpeon-fox = pkgs.callPackage ./art/emoji/volpeon/fox.nix {};
|
||||||
emoji-volpeon-raccoon = pkgs.callPackage ./art/emoji/volpeon/raccoon.nix {};
|
emoji-volpeon-raccoon = pkgs.callPackage ./art/emoji/volpeon/raccoon.nix {};
|
||||||
emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {};
|
emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {};
|
||||||
|
lotte-art = pkgs.callPackage ./art/lotte {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{ pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
mkPleromaEmoji = pkgs.callPackage ./mkPleromaEmoji.nix {};
|
mkPleromaEmoji = pkgs.callPackage ./mkPleromaEmoji.nix {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,44 @@
|
||||||
{ stdenv, fetchurl, oxipng, lib, libarchive }: { name, manifest, ... } @ args:
|
{
|
||||||
let manifestData = (builtins.fromJSON (builtins.readFile manifest)).${name};
|
stdenv,
|
||||||
src = fetchurl {
|
fetchurl,
|
||||||
url = manifestData.src;
|
oxipng,
|
||||||
sha256 = manifestData.src_sha256;
|
lib,
|
||||||
};
|
libarchive,
|
||||||
brokenLicenses = {
|
}: {
|
||||||
"CC BY-NC-SA 4.0" = lib.licenses.cc-by-nc-sa-20;
|
name,
|
||||||
"Apache 2.0" = lib.licenses.asl20;
|
manifest,
|
||||||
};
|
...
|
||||||
fixLicense = license: brokenLicenses.${license} or license;
|
} @ args: let
|
||||||
in
|
manifestData = (builtins.fromJSON (builtins.readFile manifest)).${name};
|
||||||
stdenv.mkDerivation ({
|
src = fetchurl {
|
||||||
inherit name src;
|
url = manifestData.src;
|
||||||
nativeBuildInputs = [
|
sha256 = manifestData.src_sha256;
|
||||||
oxipng
|
|
||||||
libarchive
|
|
||||||
];
|
|
||||||
unpackPhase = ''
|
|
||||||
bsdtar -xf $src
|
|
||||||
'';
|
|
||||||
buildPhase = ''
|
|
||||||
find . -type f -name '*.png' -execdir oxipng -o max -t $NIX_BUILD_CORES {} \;
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
mkdir $out
|
|
||||||
cp -r * $out
|
|
||||||
'';
|
|
||||||
meta = with lib; {
|
|
||||||
inherit (manifestData) description homepage;
|
|
||||||
license = fixLicense manifestData.license;
|
|
||||||
};
|
};
|
||||||
} // args)
|
brokenLicenses = {
|
||||||
|
"CC BY-NC-SA 4.0" = lib.licenses.cc-by-nc-sa-20;
|
||||||
|
"Apache 2.0" = lib.licenses.asl20;
|
||||||
|
};
|
||||||
|
fixLicense = license: brokenLicenses.${license} or license;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation ({
|
||||||
|
inherit name src;
|
||||||
|
nativeBuildInputs = [
|
||||||
|
oxipng
|
||||||
|
libarchive
|
||||||
|
];
|
||||||
|
unpackPhase = ''
|
||||||
|
bsdtar -xf $src
|
||||||
|
'';
|
||||||
|
buildPhase = ''
|
||||||
|
find . -type f -name '*.png' -execdir oxipng -o max -t $NIX_BUILD_CORES {} \;
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r * $out
|
||||||
|
'';
|
||||||
|
meta = with lib; {
|
||||||
|
inherit (manifestData) description homepage;
|
||||||
|
license = fixLicense manifestData.license;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// args)
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
URL=$1
|
URL=$1
|
||||||
WRITE_PATH=$2
|
WRITE_PATH=$2
|
||||||
|
|
||||||
nix-prefetch-git $URL > $WRITE_PATH
|
nix-prefetch-git $3 $URL | grep -v "Git " > $WRITE_PATH
|
Reference in a new issue