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

Rework NixOS module #47

Closed
wants to merge 3 commits into from
Closed

Rework NixOS module #47

wants to merge 3 commits into from

Conversation

riotbib
Copy link
Contributor

@riotbib riotbib commented Nov 19, 2023

This is a draft.

This PR changes the provided NixOS module to adjust to recent changes to the codebase. It fails to build at hardening steps. Since this is not my area of expertise I'm happy to ask for help.

TODO

  • Fix hardening
  • Implement MIME mapping
  • Implement custom_index and static_files paths
  • Implement url_prefix

Please note: This commit would also change src from locally to fetchFromGitHub; please adjust accordingly if this ain't wanted.

This is a draft.

This PR changes the provided NixOS module to adjust to recent changes to
the codebase. It fails to build at hardening steps. Since this is not my
area of expertise I'm happy to ask for help.

TODO
- Fix hardening
- Implement MIME mapping
- Implement custom_index and static_files paths
- Implement url_prefix

Please note: This commit would also change src from locally to
fetchFromGitHub; please adjust accordingly if this ain't wanted.
@riotbib riotbib marked this pull request as draft November 19, 2023 01:57
@riotbib
Copy link
Contributor Author

riotbib commented Nov 19, 2023

Furthermore Go is sourced from nixpkgs-unstable since v1.21 is not in stable yet.

riotbib and others added 2 commits February 2, 2024 09:45
The previous work-around with fetching buildGo121Module from
nixpkgs-unstable is not need anymore, since we're on NixOS 23.11 now.
@riotbib
Copy link
Contributor Author

riotbib commented Feb 2, 2024

I am not that keen to accomplish the TODOs from my first comment here, so maybe lets drop the support for NixOS?

Otherwise, I just pushed some small changes for the packaging instructions.

Copy link
Owner

@oxzi oxzi left a comment

Choose a reason for hiding this comment

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

Thanks for your PR and please excuse my very late reply.

Furthermore Go is sourced from nixpkgs-unstable since v1.21 is not in stable yet.

With NixOS 23.11 this is no longer an issue :>

I am not that keen to accomplish the TODOs from my first comment here, so maybe lets drop the support for NixOS?

I'd like to keep the NixOS support. Otherwise, I'd also could take another look at it.

Otherwise, I just pushed some small changes for the packaging instructions.

If you just want to tackle this first, feel free.

@@ -20,6 +25,51 @@ let
map (x: "${x.from} ${x.to}") cfg.mimeMap);

cfg = config.services.gosh;

goshConfig = pkgs.writeText "gosh.yml" ''
Copy link
Owner

Choose a reason for hiding this comment

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

Please take a look at pkgs.formats.toml. One could drastically simplify the module by just passing the configuration as a types.attrs or types.submodule.

# TODO: One has to configure this one.
vendorSha256 = "0000000000000000000000000000000000000000000000000000";
vendorHash = "sha256-TcrUG8k/SxDqXgnzYqS1hWNAnAHswbWuBoQ+nSYdBBk=";
Copy link
Owner

Choose a reason for hiding this comment

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

I explicitly have not defined a revision as this will lead to breakages and, thus, the end user has to explicitly define which revision should be used. Otherwise, this have to be bumped for every other commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least this change should be done before NixOS 24.05, because:

trace: warning: vendorSha256 is deprecated. Use vendorHash instead

@riotbib
Copy link
Contributor Author

riotbib commented May 9, 2024

Bump, since NixOS 24.05 is rushing torwards us. I'd switch to OpenBSD deployment though.

@riotbib
Copy link
Contributor Author

riotbib commented May 30, 2024

Just upgraded to NixOS 24.05, and let's just drop the official support. It was too exhausting. 👍

@riotbib riotbib closed this May 30, 2024
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.

2 participants