Add ability to be imported as flake input

This commit is contained in:
2025-08-19 21:44:28 +03:00
parent 44d51f2059
commit 0dc4eb8eb3
2 changed files with 24 additions and 47 deletions

View File

@@ -1,20 +1,31 @@
{
description = "nothing.run website";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem
(
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs;[nodejs];
};
}
);
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.x86_64-linux.default = pkgs.mkShell {
packages = with pkgs; [ nodejs ];
};
website = ./dist;
packages.x86_64-linux.default = pkgs.stdenv.mkDerivation {
pname = "website";
version = "0.1.0";
src = ./.;
buildPhase = ''
npm --version
echo 'Running "npm install"'
npm install
echo 'Running "npm run build"'
npm run build
'';
buildInputs = [ pkgs.nodejs ];
};
};
}