Comments (5)
Would it be feasible to do this through a .nix
file? In my opinion, the declarative configuration syntax is one of Nix's greatest strengths, and it would be great to integrate that with Nixpacks. I don't know how it would be implemented, and I don't know that much about Nix, but I was thinking about something along these lines in terms of syntax:
{stdenv, nixpacks}: rec {
derivation = stdenv.mkDerivation {
# ...
};
deploy = nixpacks.configure {
inherit derivation;
startCommand = "./whatever";
# Since the package is already built by the derivation, you shouldn't need a separate build command here
};
}
Or something like that.
from nixpacks.
That could work. And I do think it is a good idea to be able to import/build Nix projects with zero-config. However, I am not sure this is the right approach for all projects. Ideally, users can use all features of Nixpacks without having to know and understand the Nix expression language (see core ideas in readme). This is also something you have to opt into completely and means that if you want to save the start command to version control you will have to also figure out how to build your app with Nix and cannot take advantage of the providers.
That being said, looking for and building a default.nix
or a flake.nix
is a great idea. We could have a NixProvider
that does this.
from nixpacks.
An idea: if Nixpacks were to export some sort of interface to Nix expressions, then would it be possible to also export the providers? Maybe even provide some sort of wrapper around mkDerivation
, to allow the user to have the best of both worlds (zero-config Nix expressions)? Something like this, maybe:
{nixpacks, stdenv, myDependency}:
nixpacks.mkDerivation {
# All options are optional; `extends` would default to stdenv, most likely.
extends = stdenv;
buildCommand = "whatever";
runCommand = "./whatever";
packages = [ myDependency ];
}
That might take whatever the extends
option is and then wrap extends.mkDerivation
with the required build steps and dependencies.
from nixpacks.
Oh yeah that is a neat idea. It would allow us to leverage the Nix ecosystem a bit more too. I'll play around with it.
from nixpacks.
Moved to discussions (#120)
from nixpacks.
Related Issues (20)
- Add NIXPACKS_VERSION to environment
- Projects containing read-only files cannot be built HOT 4
- Elixir nixpack shouldn't run migrations in build step HOT 1
- Redis internal URLs cause build errors HOT 8
- Support for pnpm v9 HOT 5
- Bun 1.1 - Nixpacks Feature Request HOT 3
- Rust provider tries to open Cargo.toml in wrong folder
- Nixpacks Feature Request: Python 3.12 Support HOT 1
- Nixpacks Feature Request,Support setting nix image source address HOT 1
- Better Python provider HOT 1
- Specifying php.ini params as a configuration
- Nixpacks Bug Report - Failed to solve process - Ruby install
- TEST
- TEST: IGNORE: Nixpacks Bug Report
- TEST: IGNORE: Nixpacks Bug Report
- TEST: IGNORE: Nixpacks Bug Report
- TEST: IGNORE Nixpacks Bug Report
- Requiring docker when supplying --out HOT 3
- Set Node v20 as default version HOT 1
- Default Gleam version outdated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixpacks.