Cannot change nixpkgsArchive hash from railway.toml
alaanor
HOBBYOP

2 years ago

Hello, seems like I can't change the nixpkgs archive version from railway.toml

[build]
builder = "NIXPACKS"

[deploy]
startCommand = "./api"
healthcheckPath = "/health"
healthcheckTimeout = 100

[build.nixpacksPlan.phases.setup]
nixpkgsArchive = 'a459b363de387c078080b719b30c54d8a79b4a3e'
nixPkgs = ["ffmpeg"]

Here's the full railway.toml I'm using.

In the build log it sucessfully recognize that ffmpeg need to be installed and it does ! but no matter what it seems to use 5148520bfab61f99fd25fb9ff7bfbb50dad3c9db as nixpkg version

7 [3/5] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix

The reason I want to check to another version is because 5148520bfab61f99fd25fb9ff7bfbb50dad3c9db contains ffmpeg 5.1.3 and I'd like to get ffmpeg 6.1.1

19 Replies

alaanor
HOBBYOP

2 years ago

8bccf693-4059-4ef3-9dd0-55493979fdb7


2 years ago

I've noticed this too, you can't set archives for phases in either a railway.json or railway.toml file, you'd have to specify the nixpacks stuff in a nixpacks.toml file


alaanor
HOBBYOP

2 years ago

Is there somewhere a documentation where it explain how I can use a nixpacks.toml with railway ?


alaanor
HOBBYOP

2 years ago

I'm in a monorepo so it can't just be at root


alaanor
HOBBYOP

2 years ago

(and thanks <:PraygeW:1104087111239471235> , glad to see I'm not alone on this)


2 years ago

first remove the phase stuff from your railway.toml
then add this to a nixpacks.toml file that i assume you'd want located in the same location as the railway.toml file -

[phases.setup]
  nixpkgsArchive = 'a459b363de387c078080b719b30c54d8a79b4a3e'
  nixPkgs = ['...', 'ffmpeg']

and finally set a NIXPACKS_CONFIG_FILE service variable to the applicable path of your new nixpacks.toml file


alaanor
HOBBYOP

2 years ago

oh the env variable is how you link it


alaanor
HOBBYOP

2 years ago

thanks


alaanor
HOBBYOP

2 years ago

the 3 dot you added on nixPkgs are intentional ?


2 years ago

yes, without them you are telling nixpacks to only install ffmpeg


alaanor
HOBBYOP

2 years ago

I see !


alaanor
HOBBYOP

2 years ago

I can confirm this is working well now ! Everything is working, thanks again !


2 years ago

no problem!


royalgiant
HOBBY

2 years ago

How did you find the path to your nixpacks.toml file? I don't yet know how to ssh onto the server to look around how the structure is like? I'm running a rails app, sorry for dumb q. 😛


2 years ago

what path do you have it in your repo?


royalgiant
HOBBY

2 years ago

Thanks for the response @Brody , it's in the root

1242672971210952700


2 years ago

and do you have to root directory in the service settings set to anything?


alaanor
HOBBYOP

2 years ago

The same way you have railway.toml. So either path specified in the dashboard in your deployed service, or by default at the root of the deployment.


royalgiant
HOBBY

2 years ago

Thanks guys! It was at /nixpacks.toml because i just saw on the dash that railway uses / by default.


Loading...