133 lines
3.3 KiB
Nix
133 lines
3.3 KiB
Nix
{
|
|
description = "TFC Website";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
cl-nix-lite.url = "github:hraban/cl-nix-lite";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
blowfish = {
|
|
url = "github:nunocoracao/blowfish?rev=b6744efbf2d76023084498552a916b49d5a764d8";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = inputs: with inputs;
|
|
flake-utils.lib.eachDefaultSystem
|
|
(system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
src = ./.;
|
|
|
|
sbcl' = pkgs.sbcl.withPackages (ps: with ps; [
|
|
hunchentoot
|
|
dexador
|
|
jzon
|
|
serapeum
|
|
deploy
|
|
spinneret
|
|
lass
|
|
cl-smtp
|
|
log4cl
|
|
cl_plus_ssl
|
|
fiveam
|
|
slite
|
|
clack
|
|
woo
|
|
ningle
|
|
pkgs.openssl
|
|
pkgs.openssl.out
|
|
pkgs.openssl.dev
|
|
]);
|
|
nbi = with pkgs; [
|
|
gcc
|
|
stdenv
|
|
gnumake
|
|
gdb
|
|
pkg-config
|
|
makeWrapper
|
|
openssl
|
|
openssl.out
|
|
openssl.dev
|
|
];
|
|
|
|
bi = with pkgs; [
|
|
git
|
|
hugo
|
|
go
|
|
nodejs
|
|
sbcl'
|
|
clippy
|
|
rustc
|
|
cargo
|
|
rustfmt
|
|
rust-analyzer
|
|
just
|
|
openssl
|
|
openssl.out
|
|
openssl.dev
|
|
];
|
|
|
|
blowfish = inputs.blowfish;
|
|
|
|
nativeLibs = with pkgs; [
|
|
openssl
|
|
openssl.out
|
|
openssl.dev
|
|
];
|
|
|
|
site = pkgs.stdenv.mkDerivation rec {
|
|
name = "site";
|
|
version = "2.0.0";
|
|
src = ./.;
|
|
configurePhase = ''
|
|
ls
|
|
mkdir -p themes
|
|
cp -r ${blowfish} themes/blowfish
|
|
ls themes/blowfish
|
|
'';
|
|
buildPhase = ''
|
|
NODE_ENV=production ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --gc --minify
|
|
${pkgs.hugo}/bin/hugo --minify
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/public
|
|
cp -r public $out/public
|
|
'';
|
|
buildInputs = bi;
|
|
nativeBuildInputs = nbi;
|
|
};
|
|
|
|
in
|
|
{
|
|
devShell = pkgs.mkShell {
|
|
name = "tfc-api";
|
|
version = "0.0.1";
|
|
src = src;
|
|
nativeBuildInputs = nbi;
|
|
buildInputs = bi;
|
|
nativeLibs = nativeLibs;
|
|
};
|
|
packages.default = pkgs.rustPlatform.buildRustPackage rec {
|
|
pname = "tfcapi";
|
|
version = "0.0.1";
|
|
src = ./.;
|
|
cargoBuildFlags = "";
|
|
doCheck = false;
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
nativeBuildInputs = nbi;
|
|
buildInputs = bi;
|
|
fixupPhase = ''
|
|
ls -l
|
|
ls -l $out
|
|
cp -r ${site}/public $out/public
|
|
'';
|
|
};
|
|
packages.site = site;
|
|
}
|
|
);
|
|
}
|