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
Compile with Nix
All checks were successful
continuous-integration/drone/push Build is passing
c395880165
Embed static/ and templates/
All checks were successful
continuous-integration/drone/push Build is passing
b41630e941
Ease packaging by making resource path configurable
All checks were successful
continuous-integration/drone/push Build is passing
a84ac778ad
Format + documentation
All checks were successful
continuous-integration/drone/push Build is passing
158eda06de
Add docker entry
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
ba8042a21a
quentin added 1 commit 2022-07-24 08:08:41 +00:00
Remove vendoring of gomod2nix
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
11574aeb19
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
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin nix:nix
git checkout nix
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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.