linkedin_blog/shoblog/vuejs/shoblog_code.nix
shobu aa7fec3b1b initial commit
added previous posts source files
2025-09-11 01:21:31 +02:00

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'';
};
});
};
}