48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{
|
|
description = "developpement and deployment flake for shoblog";
|
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
|
|
|
outputs = { self, nixpkgs }:
|
|
let
|
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
|
|
});
|
|
in
|
|
{
|
|
devShells = forEachSupportedSystem ({ pkgs }: {
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [ nodejs yarn jetbrains.webstorm yarn2nix ];
|
|
};
|
|
});
|
|
|
|
packages = forEachSupportedSystem ({ pkgs }: {
|
|
default = pkgs.mkYarnPackage {
|
|
name = "shoblog-front";
|
|
src = ./.;
|
|
|
|
packageJSON = ./package.json;
|
|
yarnLock = ./yarn.lock;
|
|
yarnNix = ./yarn.nix;
|
|
|
|
buildPhase = ''
|
|
runHook preBuild;
|
|
mkdir $TEMPDIR/dist
|
|
yarn run build --outDir $TEMPDIR/dist;
|
|
runHook postBuild;
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/
|
|
cp -r $TEMPDIR/dist/ $out/
|
|
runHook postInstall
|
|
'';
|
|
|
|
distPhase = ''true'';
|
|
};
|
|
});
|
|
};
|
|
}
|