Add tetris flake

This commit is contained in:
Charlotte Van Petegem 2022-01-11 20:56:03 +01:00
parent 773d6585f5
commit 224de7ccbc
No known key found for this signature in database
GPG key ID: 019E764B7184435A
3 changed files with 34 additions and 29 deletions

View file

@ -1,26 +1,5 @@
{ config, lib, pkgs, ... }:
let
tetris = pkgs.mkYarnPackage rec {
pname = "tetris";
version = "unstable";
src = pkgs.fetchFromGitHub {
owner = "chvp";
repo = "tetris";
rev = "main";
sha256 = "lH7LV03pRCJnY4ZjklWpmNuWjrQUiy1LwuByQlA1nTg=";
};
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
buildPhase = "yarn run build";
installPhase = ''
cp -r deps/tetris/dist $out
rm $out/*.map
'';
distPhase = "true";
};
in
{
options.chvp.games.tetris.server = lib.mkOption {
default = false;
@ -31,7 +10,7 @@ in
chvp.services.nginx.hosts = [{
fqdn = "tetris.vanpetegem.me";
options = {
root = "${tetris}";
root = "${pkgs.tetris}";
locations."/".index = "index.html";
};
}];