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, ... }: outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs { inherit system; }; appSrc = ./.;
appSrc = ./.;
app = pkgs.dockerTools.buildLayeredImage { app = pkgs.dockerTools.buildLayeredImage {
name = "convertx"; name = "convertx";
tag = "latest"; tag = "latest";
contents = [ contents = [
pkgs.bun pkgs.bun
pkgs.resvg pkgs.resvg
pkgs.ffmpeg pkgs.ffmpeg
pkgs.graphicsmagick pkgs.graphicsmagick
pkgs.ghostscript pkgs.ghostscript
pkgs.vips pkgs.vips
pkgs.pandoc pkgs.pandoc
pkgs.texlive.combined.scheme-full pkgs.texlive.combined.scheme-full
pkgs.calibre pkgs.calibre
pkgs.inkscape pkgs.inkscape
pkgs.poppler_utils pkgs.poppler_utils
pkgs.assimp pkgs.assimp
pkgs.jxrlib pkgs.jxrlib
pkgs.libheif pkgs.libheif
pkgs.libjxl pkgs.libjxl
pkgs.python3Packages.numpy pkgs.python3Packages.numpy
];
config = {
Env = [
"NODE_ENV=production"
"PATH=/bin:/usr/bin"
]; ];
WorkingDir = "/app";
config = { Cmd = [ "bun" "run" "./src/index.tsx" ];
Env = [ ExposedPorts = {
"NODE_ENV=production" "3000/tcp" = {};
"PATH=/bin:/usr/bin"
];
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 { in {
packages.default = app; packages.default = app;
}); }
);
} }

View file

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