Skip to content

chore: add build targets to nix flake #13186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
kylecarbs committed May 6, 2024
commit eff4eaf24838cb35fdf73b7f38f202151c086549
33 changes: 17 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# to update the lock file if packages are out-of-date.

# From https://nixos.wiki/wiki/Google_Cloud_SDK
gdk = pkgs.google-cloud-sdk.withExtraComponents ([pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin]);
gdk = pkgs.google-cloud-sdk.withExtraComponents ([ pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin ]);

# The minimal set of packages to build Coder.
devShellPackages = with pkgs; [
Expand Down Expand Up @@ -102,32 +102,33 @@
src = ./.;
nativeBuildInputs = with pkgs; [ getopt openssl zstd ];
preBuild = ''
# Replaces /usr/bin/env with an absolute path to the interpreter.
patchShebangs ./scripts
# Replaces /usr/bin/env with an absolute path to the interpreter.
patchShebangs ./scripts
'';
buildPhase = ''
runHook preBuild
runHook preBuild

# Unpack the site contents.
mkdir -p ./site/out
cp -r ${buildSite.out}/* ./site/out
# Unpack the site contents.
mkdir -p ./site/out
cp -r ${buildSite.out}/* ./site/out

# Build and copy the binary!
export CODER_FORCE_VERSION=${version}
make -j build/coder_${osArch}
# Build and copy the binary!
export CODER_FORCE_VERSION=${version}
make -j build/coder_${osArch}
'';
installPhase = ''
mkdir -p $out/bin
cp -r ./build/coder_${osArch} $out/bin/coder
mkdir -p $out/bin
cp -r ./build/coder_${osArch} $out/bin/coder
'';
};
in
{
devShell = pkgs.mkShell {
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
buildInputs = devShellPackages;
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
};
packages = {
all = pkgs.buildEnv {
Expand Down
Loading