Nix packaging #15

Open
quentin wants to merge 6 commits from nix into main
Owner

To build Guichet in a controlled environment and to unify our release logic, I added some logic to package Guichet with Nix.
The packaging is based on gomod2nix and requires a gomod2nix.toml file.

I have also embedded some files provided by gomod2nix in the nix/builder folder.
It might be possible to rewrite our default.nix to not import them and use the ones from the gomod2nix repo.

I have parameterized the code everywhere we call static/ and templates/ as seeking these folders only on the current working directory was making packaging and releasing harder than necessary.
Now, you can set multiple paths in the JSON file and additionnaly the working directory and the executable path are automatically checked.
This change is retro-compatible and, in practise, the 2 default paths should cover most if not all the cases.

As a side note, the generated docker image is not bigger than the previous one (prev: ~6MB, this one: ~4.5MB).

In the long run, the idea is to use this work to automatically release guichet binaries like garage ones, both statically and on the Docker Hub.

To build Guichet in a controlled environment and to unify our release logic, I added some logic to package Guichet with Nix. The packaging is based on gomod2nix and requires a `gomod2nix.toml` file. I have also embedded some files provided by `gomod2nix` in the `nix/builder` folder. It might be possible to rewrite our `default.nix` to not import them and use the ones from the `gomod2nix` repo. I have parameterized the code everywhere we call `static/` and `templates/` as seeking these folders only on the current working directory was making packaging and releasing harder than necessary. Now, you can set multiple paths in the JSON file and additionnaly the working directory and the executable path are automatically checked. This change is retro-compatible and, in practise, the 2 default paths should cover most if not all the cases. As a side note, the generated docker image is not bigger than the previous one (prev: ~6MB, this one: ~4.5MB). In the long run, the idea is to use this work to automatically release guichet binaries like garage ones, both statically and on the Docker Hub.
quentin added 5 commits 2022-07-19 14:19:23 +00:00
continuous-integration/drone/push Build is passing Details
c395880165
Compile with Nix
continuous-integration/drone/push Build is passing Details
b41630e941
Embed static/ and templates/
continuous-integration/drone/push Build is passing Details
a84ac778ad
Ease packaging by making resource path configurable
continuous-integration/drone/push Build is passing Details
158eda06de
Format + documentation
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
ba8042a21a
Add docker entry
quentin added 1 commit 2022-07-24 08:08:41 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
11574aeb19
Remove vendoring of gomod2nix
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
This pull request has changes conflicting with the target branch.
  • admin.go
  • directory.go
  • gomod2nix.toml
  • invite.go
  • main.go
  • profile.go
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/guichet#15
No description provided.