asxpio/flake.nix
Sergei Poljanski 7b344540fe
Some checks failed
Tests / test (push) Successful in 46s
Build and Deploy to Production / test (push) Successful in 21s
Build and Deploy to Production / build (push) Successful in 1m0s
Build and Deploy to Production / deploy (push) Failing after 2m3s
Ruby 4.0.9, in the image and the flake
Move the production image to ruby:4.0.9-slim-bookworm (same distro, so
native gems build against the same libraries) and the dev shell to
nixpkgs' ruby_4_0, also 4.0.9, so the tests run on the Ruby that ships.

Ruby 4's Bundler 4 dropped `bundle install --without`; set
BUNDLE_WITHOUT instead, which Bundler 2 reads too. The lockfile stays
BUNDLED WITH 2.7.2 (nixpkgs' bundler; Bundler 4 switches to it).

Checked before merging: the image builds, keeps the test gems out, and
boots Puma 8.0.2 on Ruby 4.0.9 through to opening the database.

Rollback: revert this commit and redeploy (or re-tag the previous image).

Assisted-by: Claude:opus-5-5
2026-11-13 03:34:46 +04:00

46 lines
1.1 KiB
Nix

{
description = "asxp.io — IE Sergei Poljanski website";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
pkgs.ruby_4_0
pkgs.bundler
pkgs.openssl
pkgs.zlib
pkgs.libyaml
pkgs.postgresql.lib
pkgs.postgresql
];
shellHook = ''
export GEM_HOME="$PWD/.gems"
export PATH="$GEM_HOME/bin:$PATH"
export BUNDLE_PATH="$GEM_HOME"
if [ -f .env ]; then
set -a
source .env
set +a
fi
if [ ! -f .gems/.bundled ] || [ Gemfile -nt .gems/.bundled ]; then
echo "Installing gems..."
bundle install --quiet && mkdir -p .gems && touch .gems/.bundled
fi
echo "asxpio dev shell ready"
echo " bundle exec rerun -- rackup -p 3000 - start with auto-reload"
'';
};
};
}