Description
Is your feature request related to a problem?
I would want to use flakes inside single git monorepo to define my server and develop services too.
One can learn how to develop and deploy a simple go service following this great blog:
http://mtlynch.io/notes/simple-go-web-service-nixos/
I followed this and then moved the separate go service into: ./services/basic-go-web-app/
inside the git repo which contained the server configs and it's flake.nix
It's easy to have multiple flakes in single repository and use them with relative paths:
basic-go-web-app.url = "path:./services/basic-go-web-app/";
But then what happens automatically is that flake.lock
will get the initial version of the local project and will not be updated automatically.
One needs to rely on hacks like --override-input basic-go-web-app ./services/basic-go-web-app/
to update the service into the servers.
Would there be an easy way to skip relative project from the lock files completely so that the service would always be built and deployed without the --override-input
flag?
Proposed solution
Similarly as we have the special flag follows
:
inputs = {
# Reusable packages for nixos configs
# Use the version of nixpkgs that has been tested to work with SrvOS
srvos.url = "github:nix-community/srvos";
nixpkgs.follows = "srvos/nixpkgs";
}
we could have an option disable-lock
= true
or even default to this when using relative paths.
This is a major headache and confusion for a new users like me.
Alternative solutions
One can use the:
1. --override-input basic-go-web-app ./services/basic-go-web-app/
as argument to the nixes-rebuild
2. Update the input in flake.lock
with: nix flake lock --update-input basic-go-web-app
Additional context
Some discussions regarding this:
https://discourse.nixos.org/t/relative-path-support-for-nix-flakes/18795/5
Checklist
- checked latest Nix manual (source)
- checked open feature issues and pull requests for possible duplicates
Add 👍 to issues you find important.