-
-
Notifications
You must be signed in to change notification settings - Fork 283
Flake: add package, module #458
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
base: develop
Are you sure you want to change the base?
Conversation
| }; | ||
| }; | ||
| config = lib.mkIf cfg.enable { | ||
| services.postgresql = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done by checking for db.createLocally which I saw being used many times in the nixos modules.
| ensureDatabases = [ "asciinema_server" ]; | ||
| }; | ||
| systemd.services.postgresql.postStart = let | ||
| password_file_path = config.sops.secrets.POSTGRES_PASSWORD.path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a module shouldn't concern itself with sops, instead just provide a way to set the password via a path or an envFile. and the user can decide whether to use sops/agenix etc.
Right, it's not ready to go, but almost there. A few things have changed with regards to building the project since this PR was opened, so I started to incrementally add necessary pieces to the flake, inspired by @s1341 work here.
I agree, I'm going to add
I'm not quite sure how to best handle Postgres password here actually. Any suggestions? |
|
In nixpkgs modules, edit: ideally this is supposted to fix it NixOS/nixpkgs#326306, but the pr is in limbo. Majority of the services in nixpkgs do something like |
This PR adds a
packageand anixosModuleto theflake.nix.For ease of testing, I also added a 'container'
nixosConfiguration, which can be brought up by doing the following:sudo nixos-container create asciinema --flake .#container sudo nixos-container asciinema startYou should then be able to do:
export ASCIINEMA_API_URL=http://asciinema:4000 asciinema rec test.cast asciinema upload test.castNote: for the package, it was necessary to set hashes on both the
mixReleaseand therustPackage. Those will need to be updated as the code/dependencies change.