feat: Add a flake

This commit is contained in:
PapaTutuWawa 2022-05-14 17:06:27 +02:00
parent 00e3ef6987
commit de5a0ba39f
4 changed files with 78 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1638239011,
"narHash": "sha256-AjhmbT4UBlJWqxY0ea8a6GU2C2HdKUREkG43oRr3TZg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View File

@ -0,0 +1,21 @@
{
description = "The website hosted at https://polynom.me";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/21.11";
};
outputs = {
self,
nixpkgs
}: let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.attrsets.genAttrs supportedSystems;
in {
packages = forAllSystems (system: let
pkgs = import nixpkgs { inherit system; };
in {
default = pkgs.callPackage ./pkgs/shared-assets.nix {};
});
};
}

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
import re
import sys
import subprocess

28
pkgs/shared-assets.nix Normal file
View File

@ -0,0 +1,28 @@
{
lib, stdenv
, python3 # for makesite.py and pgp-sign.py
}:
stdenv.mkDerivation {
pname = "shared-assets";
version = "202205120-01";
src = ../.;
propagatedBuildInputs = [ python3 python3.pkgs.markdown ];
installPhase = ''
mkdir -p $out/bin
cp -v makesite.py pgp-sign.py $out/bin
cp -vr assets/ $out/
'';
doCheck = false;
meta = with lib; {
description = "Shared assets for polynom.me web pages";
homepage = "https://git.polynom.me/polynom.me/shared-assets";
maintainers = [];
license = licenses.gpl3;
};
}