2021-11-30 18:50:21 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
2021-12-11 16:55:18 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
|
2021-11-30 18:50:21 +01:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2021-11-30 19:17:20 +01:00
|
|
|
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
|
|
|
|
in
|
|
|
|
rec {
|
2021-12-11 17:35:21 +01:00
|
|
|
packages = rec {
|
2021-11-30 19:17:20 +01:00
|
|
|
bulma = pkgs.fetchzip {
|
|
|
|
url = "https://github.com/jgthms/bulma/releases/download/0.9.0/bulma-0.9.0.zip";
|
|
|
|
sha256 = "sha256-FKWdkq6pRukCzR2IQ88OHlPkIJbeeEz7NdIWv44k8TM=";
|
|
|
|
};
|
|
|
|
|
|
|
|
podlove-subscribe-button = pkgs.fetchzip {
|
|
|
|
url = "https://github.com/podlove/podlove-subscribe-button/releases/download/v17/podlove-subscribe-button-v17.zip";
|
|
|
|
sha256 = "sha256-N+lxzDpw2mNOg0i+pOFuvwNMi5Q7rZK4H9WEzf5/1us=";
|
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
podlove-web-player = pkgs.fetchzip {
|
|
|
|
url = "https://registry.npmjs.org/@podlove/web-player/-/web-player-4.5.13.tgz";
|
|
|
|
sha256 = "sha256-U7REkg0FwBaMO25M4lHRRWcNNhgZPPjx/AR48usPqCU=";
|
|
|
|
};
|
|
|
|
|
|
|
|
schulischer-schabernack = pkgs.callPackage
|
|
|
|
({ stdenv
|
|
|
|
, ffmpeg-full
|
|
|
|
, python3
|
|
|
|
, zola
|
2021-12-11 17:35:21 +01:00
|
|
|
, staging ? false
|
2021-11-30 19:17:20 +01:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
linkVendor = ''
|
|
|
|
mkdir -p vendor static/vendor
|
|
|
|
ln -sfT ${packages.bulma} vendor/bulma
|
|
|
|
# !!! XXX hack
|
|
|
|
# copying is required at least with interactive shell, because zola does not copy symlinks to output directory
|
|
|
|
# to keep it up to date, it is removed before that
|
|
|
|
rm -rf static/vendor/{podlove-subscribe-button,podlove-web-player}
|
|
|
|
cp --reflink=auto --no-preserve=mode,ownership -rf ${packages.podlove-subscribe-button} static/vendor/podlove-subscribe-button
|
|
|
|
cp --reflink=auto --no-preserve=mode,ownership -rf ${packages.podlove-web-player} static/vendor/podlove-web-player
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "schulischer-schabernack";
|
|
|
|
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
(ffmpeg-full.override { nonfreeLicensing = true; fdkaacExtlib = true; })
|
|
|
|
(python3.withPackages (ps: with ps; [ mutagen ]))
|
|
|
|
zola
|
|
|
|
];
|
|
|
|
|
2021-12-11 17:35:21 +01:00
|
|
|
SCHABERNACK_ENV = if staging then "staging" else "production";
|
|
|
|
|
2021-11-30 19:17:20 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
${linkVendor}
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
./build.sh
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
cp -r public $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${linkVendor}
|
|
|
|
export NIXOPS_DEPLOYMENT=schulischer-schabernack-hcloud
|
|
|
|
export NIX_PATH=nixpkgs=${nixpkgs}
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
{ };
|
2021-12-11 17:35:21 +01:00
|
|
|
|
|
|
|
schulischer-schabernack-staging = schulischer-schabernack.override { staging = true; };
|
2021-11-30 19:17:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
defaultPackage = packages.schulischer-schabernack;
|
|
|
|
});
|
2021-11-30 18:50:21 +01:00
|
|
|
}
|