chore: flake wip

This commit is contained in:
C4illin
2025-05-15 22:11:30 +02:00
parent 74df47531c
commit bba420386f
2 changed files with 44 additions and 45 deletions

View File

@@ -8,55 +8,53 @@
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
appSrc = ./.;
let pkgs = import nixpkgs { inherit system; };
appSrc = ./.;
app = pkgs.dockerTools.buildLayeredImage {
name = "convertx";
tag = "latest";
app = pkgs.dockerTools.buildLayeredImage {
name = "convertx";
tag = "latest";
contents = [
pkgs.bun
pkgs.resvg
pkgs.ffmpeg
pkgs.graphicsmagick
pkgs.ghostscript
pkgs.vips
pkgs.pandoc
pkgs.texlive.combined.scheme-full
pkgs.calibre
pkgs.inkscape
pkgs.poppler_utils
pkgs.assimp
pkgs.jxrlib
pkgs.libheif
pkgs.libjxl
pkgs.python3Packages.numpy
contents = [
pkgs.bun
pkgs.resvg
pkgs.ffmpeg
pkgs.graphicsmagick
pkgs.ghostscript
pkgs.vips
pkgs.pandoc
pkgs.texlive.combined.scheme-full
pkgs.calibre
pkgs.inkscape
pkgs.poppler_utils
pkgs.assimp
pkgs.jxrlib
pkgs.libheif
pkgs.libjxl
pkgs.python3Packages.numpy
];
config = {
Env = [
"NODE_ENV=production"
"PATH=/bin:/usr/bin"
];
config = {
Env = [
"NODE_ENV=production"
"PATH=/bin:/usr/bin"
];
WorkingDir = "/app";
Cmd = [ "bun" "run" "./src/index.tsx" ];
ExposedPorts = {
"3000/tcp" = {};
};
WorkingDir = "/app";
Cmd = [ "bun" "run" "./src/index.tsx" ];
ExposedPorts = {
"3000/tcp" = {};
};
extraCommands = ''
export PATH=${pkgs.bun}/bin:$PATH
mkdir -p app
cp -r ${appSrc}/* app/
cd app
bun install --frozen-lockfile --production
bun run build
'';
};
extraCommands = ''
export PATH=${pkgs.bun}/bin:$PATH
mkdir -p /app
cp -r ${./dist}/* /app/
'';
};
in {
packages.default = app;
});
}
);
}

View File

@@ -4,6 +4,7 @@
"scripts": {
"dev": "bun run --watch src/index.tsx",
"hot": "bun run --hot src/index.tsx",
"start": "bun run src/index.tsx",
"format": "eslint --fix .",
"build": "bunx @tailwindcss/cli -i ./src/main.css -o ./public/generated.css",
"lint": "run-p 'lint:*'",
@@ -51,4 +52,4 @@
"typescript": "^5.8.3",
"typescript-eslint": "^8.32.0"
}
}
}