Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nix flake with devshell and package #324

Merged
merged 7 commits into from
Apr 30, 2022
Merged

Add nix flake with devshell and package #324

merged 7 commits into from
Apr 30, 2022

Conversation

robbevp
Copy link
Member

@robbevp robbevp commented Apr 18, 2022

re accentor/flake#5

This PR:

  • Adds a flake.nix that exposes the api package and a devshell
  • Adds a github action to automatically keep gemset.nix in sync (after dependabot or if people don't use nix).

Might be good if this can be tried on different machines and OS's (I only have aarch64-darwin).

Details

The devshell can be used with nix develop or use flake inside an .envrc-file.

It will print out a message with some of the additional commands:

🔨 Welcome to Accentor API

[database]

  pg:console - Open database console
  pg:setup   - Setup postgres in project folder
  pg:start   - Start postgres instance
  pg:stop    - Stop postgres instance

[general commands]

  menu       - prints this menu

If we want to, we can customize this message.

The pg:* commands allow us to keep the database fully contained within the project folder. Running pg:start should be plenty to setup and run a database in tmp/postgres. (I adopted this approach so I can easily switch between major versions of postgres accross different projects).

Github action

@chvp For this action to work after dependabot (and trigger actions), you might have to add a PAT for dependabot to use. source

@robbevp robbevp added the chore Repository or build maintenance label Apr 18, 2022
@robbevp robbevp requested review from rien and chvp April 18, 2022 07:26
@robbevp robbevp self-assigned this Apr 18, 2022
Copy link
Member

@chvp chvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played around with it locally, everything seems to work.

@chvp chvp merged commit 25bce0d into main Apr 30, 2022
@chvp chvp deleted the chore/add-flake branch April 30, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Repository or build maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants