mirror of
https://github.com/youwen5/site.git
synced 2024-11-24 09:23:50 -08:00
add nix stuff
This commit is contained in:
parent
41eeac67b0
commit
588c584be4
2 changed files with 45 additions and 0 deletions
21
default.nix
Normal file
21
default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "pnpm-project";
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [
|
||||
pkgs.nodejs
|
||||
pkgs.nodePackages.pnpm
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
pnpm install
|
||||
pnpm build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r dist/* $out/
|
||||
'';
|
||||
}
|
24
flake.nix
Normal file
24
flake.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
description = "Flake for building pnpm project";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
defaultPackage = pkgs.callPackage ./default.nix {};
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.nodejs
|
||||
pkgs.nodePackages.pnpm
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue