R
Railwayβ€’7mo ago
Alaanor

Cannot change nixpkgsArchive hash from railway.toml

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"]
[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
Solution:
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 - ```toml [phases.setup] nixpkgsArchive = 'a459b363de387c078080b719b30c54d8a79b4a3e'...
Jump to solution
15 Replies
Percy
Percyβ€’7mo ago
Project ID: 8bccf693-4059-4ef3-9dd0-55493979fdb7
Alaanor
AlaanorOPβ€’7mo ago
8bccf693-4059-4ef3-9dd0-55493979fdb7
Brody
Brodyβ€’7mo 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
AlaanorOPβ€’7mo ago
Is there somewhere a documentation where it explain how I can use a nixpacks.toml with railway ? I'm in a monorepo so it can't just be at root (and thanks :PraygeW: , glad to see I'm not alone on this)
Solution
Brody
Brodyβ€’7mo 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']
[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
AlaanorOPβ€’7mo ago
oh the env variable is how you link it thanks the 3 dot you added on nixPkgs are intentional ?
Brody
Brodyβ€’7mo ago
yes, without them you are telling nixpacks to only install ffmpeg
Alaanor
AlaanorOPβ€’7mo ago
I see ! I can confirm this is working well now ! Everything is working, thanks again !
Brody
Brodyβ€’7mo ago
no problem!
Donald Lee (312477)
Donald Lee (312477)β€’7mo 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. πŸ˜›
Brody
Brodyβ€’7mo ago
what path do you have it in your repo?
Donald Lee (312477)
Donald Lee (312477)β€’7mo ago
Thanks for the response @Brody , it's in the root
No description
Brody
Brodyβ€’7mo ago
and do you have to root directory in the service settings set to anything?
Alaanor
AlaanorOPβ€’7mo 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.
Donald Lee (312477)
Donald Lee (312477)β€’7mo ago
Thanks guys! It was at /nixpacks.toml because i just saw on the dash that railway uses / by default.
Want results from more Discord servers?
Add your server