Conversation
| }; | ||
| }; | ||
| config = lib.mkIf cfg.enable { | ||
| services.postgresql = { |
There was a problem hiding this comment.
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.
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.