From f0d59f6c9796bffbcba7c8aa1b5e6350bdfa1402 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 26 Oct 2024 22:51:24 +0800 Subject: [PATCH] devcontainers: update to use custom buildEnv step --- devcontainers/js-backend.nix | 19 +++++++++++++------ devcontainers/rust-backend.nix | 23 ++++++----------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/devcontainers/js-backend.nix b/devcontainers/js-backend.nix index fbc46d40..f375a971 100644 --- a/devcontainers/js-backend.nix +++ b/devcontainers/js-backend.nix @@ -1,13 +1,20 @@ -{ dockerTools, buildEnv, nodejs, bun, pnpm }: +{ dockerTools, foodogsquaredLib, nodejs, bun, pnpm }: dockerTools.buildImage { - name = "js-backend"; + name = "fds-js-backend"; - copyToRoot = buildEnv { - name = "js-backend-root"; + copyToRoot = foodogsquaredLib.buildFDSEnv { + name = "fds-js-backend-root"; paths = [ nodejs bun pnpm ]; - pathsToLink = [ "/bin" "/share" "/etc" "/lib" ]; }; - config.Cmd = [ "/bin/bash" ]; + runAsRoot = '' + mkdir -p /data + ''; + + config = { + Cmd = [ "/bin/bash" ]; + WorkingDir = "/data"; + Volumes."/data" = { }; + }; } diff --git a/devcontainers/rust-backend.nix b/devcontainers/rust-backend.nix index a88ec6ac..0934acc8 100644 --- a/devcontainers/rust-backend.nix +++ b/devcontainers/rust-backend.nix @@ -1,23 +1,12 @@ -{ dockerTools, buildEnv, rustc, cargo, rust-bindgen, rust-analyzer, nodejs, bash -, meson, ninja, pkg-config }: +{ dockerTools, foodogsquaredLib, rustc, cargo, rust-bindgen, rust-analyzer +, nodejs }: dockerTools.buildImage { - name = "rust-backend"; + name = "fds-rust-backend"; - copyToRoot = buildEnv { - name = "rust-backend-root"; - paths = [ - bash - cargo - rust-bindgen - rust-analyzer - rustc - nodejs - meson - ninja - pkg-config - ]; - pathsToLink = [ "/bin" "/etc" "/lib" "/share" ]; + copyToRoot = foodogsquaredLib.buildFDSEnv { + name = "fds-rust-backend-root"; + paths = [ cargo rust-bindgen rust-analyzer rustc nodejs ]; }; runAsRoot = ''