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

nixos: Apply changes from nixpkgs module #186

Merged
merged 8 commits into from
Oct 30, 2024
Merged

nixos: Apply changes from nixpkgs module #186

merged 8 commits into from
Oct 30, 2024

Conversation

zhaofengli
Copy link
Owner

This PR updates the NixOS module to follow the one added in NixOS/nixpkgs#347749.

In particular, services.atticd.credentialsFile was renamed to services.atticd.environmentFile and new hardening options were added to the systemd service.

@zhaofengli zhaofengli requested a review from cole-h October 14, 2024 16:28
@zhaofengli
Copy link
Owner Author

Also cc'ing @adamcstephens

nixos/atticd.nix Outdated Show resolved Hide resolved
nixos/atticd.nix Outdated Show resolved Hide resolved
systemd.services.atticd = {
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ] ++ lib.optionals hasLocalPostgresDB [ "postgresql.service" ];
requires = lib.optionals hasLocalPostgresDB [ "postgresql.service" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

It was pointed out to me that the after generates an eval warning. You'll want this too NixOS/nixpkgs#349083

zhaofengli and others added 8 commits October 29, 2024 12:23
Co-authored-by: Adam Stephens <adam@valkor.net>
Co-authored-by: Adam Stephens <adam@valkor.net>
Co-authored-by: Adam Stephens <adam@valkor.net>
Co-authored-by: Adam Stephens <adam@valkor.net>
Co-authored-by: Adam Stephens <adam@valkor.net>
fixes:

trace: evaluation warning: atticd.service is ordered after 'network-online.target' but doesn't depend on it
@zhaofengli zhaofengli merged commit 48c8b39 into main Oct 30, 2024
39 checks passed
@zhaofengli zhaofengli deleted the nixos-hardening branch October 30, 2024 03:01
'';
export ATTIC_SERVER_TOKEN_HS256_SECRET_BASE64="dGVzdCBzZWNyZXQ="
export ATTIC_SERVER_DATABASE_URL="sqlite://:memory:"
${lib.getExe cfg.package} --mode check-config -f $configFile
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think using getExe makes sense here or in serviceConfig.

This breaks using the attic (or attic-nixpkgs) package for the service, because that package has attic set as mainProgram, which is the wrong binary to use here. So setting services.attic.package = pkgs.attic was working fine before this change, but is broken with it.

Since this package includes both server and client, it should be usable here IMO.

I've been using that package to avoid having to build attic twice, for server and client binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants