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

Static Site #169

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Static Site #169

merged 1 commit into from
Apr 17, 2024

Conversation

lorenzleutgeb
Copy link
Member

@lorenzleutgeb lorenzleutgeb commented Apr 10, 2024

Fixes #165

Comments:

  • Code to generate a (quite large) list/dump of options is in flake.nix, all details regarding the static site is in overview/*.
  • Since there's currently no straightforward way to query the module system about which options are defined in a given module, I had to add nixos.modules.<name>.options to the schema for projects/*/default.nix which is a regex that describes the names of the options that the module at nixos.modules.<name>.path defines. I don't particularly like this, but it's the best solution I can think of at the moment. I did briefly consult with the module system maintainers on Matrix.
  • Uses Pandoc to generate the HTML.
  • Uses the v.Nu HTML checker to ensure that our generated HTML is sane.
  • Also pipes through configurations with syntax highlighting (powered by Pandoc or whatever it depends on for syntax highlighting).

projects/Flarum/project.nix Outdated Show resolved Hide resolved
projects/default.nix Outdated Show resolved Hide resolved
projects/mCaptcha/project.nix Outdated Show resolved Hide resolved
@fricklerhandwerk fricklerhandwerk merged commit 6c3231d into main Apr 17, 2024
3 checks passed
@fricklerhandwerk fricklerhandwerk deleted the plist branch April 17, 2024 13:58
Comment on lines +8 to +11
modules.service = {
path = ./service.nix;
options = "services\\.kbin\\..*";
};
Copy link
Collaborator

@fricklerhandwerk fricklerhandwerk Apr 17, 2024

Choose a reason for hiding this comment

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

@lorenzleutgeb I understand this as a stopgap to get things off the ground, but really don't like this stringly typed pattern. What if we instead had

modules.services.kbin = ./service.nix

and use the actual attrpath down from modules as the key in the website rendering? It would impose some constraints on how to lay out the module code, but that don't feel too bad at first glance.

Copy link
Member Author

@lorenzleutgeb lorenzleutgeb Apr 17, 2024

Choose a reason for hiding this comment

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

That proposal works out for NixOS modules, yes. But not for, say, home-manager. We could do that by inverting things...

{
  modules = {
    nixos.services.kbin = ./service.nix;
    homeManager.programs.kbin-client-tool = ./hm.nix;
  };
}

But that's also not nice. Because we already have nixos.{tests,configurations}. So I suggest that we would add homeManager at the NixOS level once we actually have non-NixOS modules:

{
  nixos.modules.services.kbin = ./services.nix;
  homeManager.modules.programs.kbin-client-tool = ./hm.nix;
}

Will create an updated PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wait... We also have to flatten the module names for flake outputs. So these names would get longer, e.g. nixosModules."KBin/services/kbin" but we could use the option path itself only, e.g. nixosModules."services.kbin".

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest that we would add homeManager at the NixOS level once we actually have non-NixOS modules

That's what I had in mind, yes.

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.

Static site that lists all available projects
2 participants