2022-05-27 13:34:37 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
|
2022-05-28 18:38:31 +02:00
|
|
|
let secret = config.age.secrets."website".path;
|
|
|
|
builder = pkgs.rustPlatform.buildRustPackage.override {
|
|
|
|
rustc = (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal)).overrideAttrs (old: {
|
|
|
|
meta.platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
website = builder {
|
2022-05-27 13:34:37 +02:00
|
|
|
pname = "website";
|
2022-05-28 18:38:31 +02:00
|
|
|
version = "0.1.0";
|
|
|
|
cargoSha256 = "sha256-4v45QaZKyjifn2MGyuy+SovfFBWu55FYR9nWRWlaQOM=";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp ./links.toml $out/links.toml
|
|
|
|
cp -r ./static/ $out/static/
|
|
|
|
'';
|
2022-05-27 13:34:37 +02:00
|
|
|
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://im.badat.dev/riley/website.git";
|
|
|
|
rev = "refs/heads/mistress";
|
2022-05-28 18:38:31 +02:00
|
|
|
sha256 = "sha256-QONZR4zpgifEQByH3rtfkHQjwQVrjRy89RVvVLMciKs=";
|
2022-05-27 13:34:37 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
systemd.services."website" = {
|
|
|
|
enable = true;
|
|
|
|
description = "Run my website :)";
|
|
|
|
path = [ website ];
|
2022-05-28 18:38:31 +02:00
|
|
|
script = ''
|
|
|
|
cd ${website}
|
|
|
|
SITE_API_SECRET=$(cat ${secret}) ${website}/bin/website
|
|
|
|
'';
|
2022-05-27 13:34:37 +02:00
|
|
|
};
|
|
|
|
}
|