update flake, add frontend package

This commit is contained in:
Vinzenz Schroeter 2025-09-26 00:14:47 +02:00
parent ded0293b13
commit 0d82e4444a
5 changed files with 57 additions and 18 deletions

8
flake.lock generated
View file

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1731797254,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
"lastModified": 1758589230,
"narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -2,24 +2,64 @@
description = "Dev shell flake for servicepoint-tanks";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
};
outputs =
{ self, nixpkgs }:
let
lib = nixpkgs.lib;
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
supported-systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems =
f:
nixpkgs.lib.genAttrs supported-systems (
system:
f rec {
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
inherit system;
selfPkgs = self.packages.${system};
}
);
in
{
devShells = forAllSystems (system: {
default = import ./shell.nix {
inherit nixpkgs;
pkgs = nixpkgs.legacyPackages."${system}";
lib = nixpkgs.lib;
};
});
devShells = forAllSystems (
{
pkgs,
lib,
selfPkgs,
...
}:
{
frontend = pkgs.mkShell {
inputsFrom = [ selfPkgs.servicepoint-tanks-frontend ];
};
default = import ./shell.nix {
inherit pkgs lib;
};
}
);
formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style);
packages = forAllSystems (
{ pkgs, lib, ... }:
{
servicepoint-tanks-frontend = pkgs.buildNpmPackage (finalAttrs: {
pname = "tank-frontend";
version = "0.0.0";
src = ./tank-frontend;
npmDepsHash = "sha256-HvwoSeKHBDkM/5OHDkgSOxfHx1gbnKif/3QfDb6r5mE=";
installPhase = ''
cp -rv dist/ $out
'';
});
}
);
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree);
};
}

View file

@ -20,7 +20,7 @@ pkgs.mkShell {
pkg-config
xe
lzma
xz
cargo-tarpaulin
gnumake
iconv

View file

@ -3,12 +3,10 @@ import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig(() => {
const isContainer = process.env.CONTAINERMODE;
return {
plugins: [react()],
build: {
outDir: isContainer ? undefined : '../tanks-backend/TanksServer/client',
emptyOutDir: true
}
};

View file

@ -16,6 +16,7 @@
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CA1805,CA1848</NoWarn>
<WarningsNotAsErrors>NU1903,NU1902</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>