Refactor Nix shell into Nix flake #63
Labels
No Label
Bug
Contributions welcome
Did not do
Duplicate
Feature
Module
Backups
Module
GraphQL
Priority
High
Priority
Low
Priority
Medium
Refactor
Severity
High
Severity
Low
Severity
Medium
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SelfPrivacy/selfprivacy-rest-api#63
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Moving to flake will give us a unified environment across production installation, development and CI instances. This will also allow us to upgrade the system without the fear of breaking the API due to breaking changes in dependencies.
The work has began on the
flake
branch, and further testing is needed.Branch with the flake.nix:
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/commits/branch/flake
We need compatibility of this API application with multiple NixOS configurations (each NixOS configuration provides nixpkgs input, which is passed to API project as well). So we need to build and test API application against several NixOS configurations (several commits).
When we base this API project on specific NixOS configuration commits, it seems we need to have several flake lock files:
[current API commit]
<-[selfprivacy-nixos-config.git?rev=11567d4]
<-[nixpkgs...]
nixos-11567d4-flake.lock
[current API commit]
<-[selfprivacy-nixos-config.git?rev=2d7680d]
<-[nixpkgs...]
nixos-2d7680d-flake.lock
[current API commit]
<-[selfprivacy-nixos-config.git?rev=f11d8cc]
<-[nixpkgs...]
nixos-f11d8cc-flake.lock
Hence, continuous integration system will be able to test all required combinations of API & NixOS configuration, after building like this:
nix build --no-write-lock-file --reference-lock-file nixos-11567d4-flake.lock
nix build --no-write-lock-file --reference-lock-file nixos-2d7680d-flake.lock
nix build --no-write-lock-file --reference-lock-file nixos-f11d8cc-flake.lock
Other naming ideas instead of
nixos-11567d4-flake.lock
:based-on-nixos-11567d4-flake.lock
for-nixos-11567d4-flake.lock
for-config-2023-10-20-11567d4-flake.lock
No longer compatible flake lock files will be removed in the relevant commits. New will be added. For each commit after CI gets its job done successfully with each flake lock combination, CI marks commit as good, hence we're sure the combination works.
Or do we need to build the API application against different SelfPrivacy NixOS configurations at all?
@inex, what do you think?
sp-nixos-11567d4-flake.lock
would be a good name, I think.It is a NixOS configuration that declares a specific API version, so if needed we can in theory generate a list of revisions that depend on a specific API version.
Fixed by #85