Added nix flake with frontend & backend packages

This commit is contained in:
Игорь Брылёв 2024-12-11 20:05:00 +03:00
parent 3658a105b2
commit 1831ebfabf
2 changed files with 98 additions and 0 deletions

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733935512,
"narHash": "sha256-beDnPaHubnwcsbVPC3rIVtQM3QVFDMmc0dtfHCW5UrA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d55cc4608dae1b42a0ef5c0cf701b501fc7bae58",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View file

@ -0,0 +1,37 @@
{
description = "Robossembler Development Environments on Nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; overlays = []; };
in
{
packages = {
frontend = pkgs.writeShellApplication {
name = "frontend";
runtimeInputs = [ pkgs.nodejs ];
text = ''
cd ui && npm i && npm run dev
'';
};
backend = pkgs.writeShellApplication {
name = "frontend";
runtimeInputs = [ pkgs.nodejs ];
text = ''
cd server && npm i && npm run dev
'';
};
};
devShells = {
default = pkgs.mkShell { packages = with pkgs; [ nodejs ]; };
};
}
);
}