working nix build
This commit is contained in:
parent
8fc3685200
commit
9038bb05ef
18
flake.lock
18
flake.lock
|
@ -1,5 +1,22 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"blowfish": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1702560004,
|
||||||
|
"narHash": "sha256-6Ovd1ACYq0/NRsMbQN0Lt8xGbCKJ4EKM7qiU2Y+6pP4=",
|
||||||
|
"owner": "nunocoracao",
|
||||||
|
"repo": "blowfish",
|
||||||
|
"rev": "b6744efbf2d76023084498552a916b49d5a764d8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nunocoracao",
|
||||||
|
"repo": "blowfish",
|
||||||
|
"rev": "b6744efbf2d76023084498552a916b49d5a764d8",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"cl-nix-lite": {
|
"cl-nix-lite": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720140845,
|
"lastModified": 1720140845,
|
||||||
|
@ -67,6 +84,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"blowfish": "blowfish",
|
||||||
"cl-nix-lite": "cl-nix-lite",
|
"cl-nix-lite": "cl-nix-lite",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
|
64
flake.nix
64
flake.nix
|
@ -6,6 +6,10 @@
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
cl-nix-lite.url = "github:hraban/cl-nix-lite";
|
cl-nix-lite.url = "github:hraban/cl-nix-lite";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
|
blowfish = {
|
||||||
|
url = "github:nunocoracao/blowfish?rev=b6744efbf2d76023084498552a916b49d5a764d8";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs: with inputs;
|
outputs = inputs: with inputs;
|
||||||
|
@ -48,6 +52,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
bi = with pkgs; [
|
bi = with pkgs; [
|
||||||
|
git
|
||||||
hugo
|
hugo
|
||||||
go
|
go
|
||||||
nodejs
|
nodejs
|
||||||
|
@ -63,12 +68,36 @@
|
||||||
openssl.dev
|
openssl.dev
|
||||||
];
|
];
|
||||||
|
|
||||||
|
blowfish = inputs.blowfish;
|
||||||
|
|
||||||
nativeLibs = with pkgs; [
|
nativeLibs = with pkgs; [
|
||||||
openssl
|
openssl
|
||||||
openssl.out
|
openssl.out
|
||||||
openssl.dev
|
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
|
in
|
||||||
{
|
{
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
|
@ -78,21 +107,44 @@
|
||||||
nativeBuildInputs = nbi;
|
nativeBuildInputs = nbi;
|
||||||
buildInputs = bi;
|
buildInputs = bi;
|
||||||
nativeLibs = nativeLibs;
|
nativeLibs = nativeLibs;
|
||||||
shellHook = ''
|
|
||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath nativeLibs}"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
packages.default = pkgs.rustPlatform.buildRustPackage rec {
|
||||||
pname = "api";
|
pname = "tfcapi";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
src = src;
|
src = ./.;
|
||||||
cargoBuildFlags = "";
|
cargoBuildFlags = "";
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
};
|
};
|
||||||
nativeBuildInputs = nbi;
|
nativeBuildInputs = nbi;
|
||||||
buildInputs = bi;
|
buildInputs = bi;
|
||||||
|
fixupPhase = ''
|
||||||
|
ls -l
|
||||||
|
ls -l $out
|
||||||
|
cp -r ${site}/public $out/public
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
packages.site = pkgs.stdenv.mkDerivation rec {
|
||||||
|
name = "site";
|
||||||
|
version = "2.0.0";
|
||||||
|
src = 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 = ''
|
||||||
|
cp -r public $out
|
||||||
|
'';
|
||||||
|
buildInputs = bi;
|
||||||
|
nativeBuildInputs = nbi;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue