-
Notifications
You must be signed in to change notification settings - Fork 26
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
Missing submodules in Nixos #64
Comments
There were some changes in modules related to nixcloud-webservices:: https://nixos.org/nixos/manual/release-notes.html#sec-release-19.09 |
This prevents nixcloud-webservices to work on the newly released 20.03 |
A couple days ago I had a discussion with @Melkor333 on IRC regarding this: https://logs.nix.samueldr.com/nixos/2020-07-12#1594566523-1594572059; where I also suggested a non-optimal solution The change in nixpkgs that introduced this problem is my PR NixOS/nixpkgs#75031. I don't think this is a problem with the PR though, because the problematic code in nixcloud-webservices at nixcloud-webservices/modules/web/core/webserver.nix Lines 64 to 66 in 3a0767f
After messing with it for a bit, here is how the same functionality can be achieved without relying on internals: {
options.webserver.userOptions = lib.mkOption {
type = lib.types.submodule options.users.users.type.functor.wrapped.getSubModules;
default = {};
};
config.users.users.webserver = lib.modules.mkAliasAndWrapDefsWithPriority lib.id options.webserver.userOptions; Also, make sure to not use nixcloud-webservices/modules/web/core/webserver.nix Lines 120 to 122 in 3a0767f
mkMerge instead. And to prevent attributes from being changed, a mkForce is recommended. So in the end that part looks about like this:
{
users.${config.webserver.user} = lib.mkMerge [
(lib.mkForce { inherit (config.webserver) user group; })
(lib.modules.mkAliasAndWrapDefsWithPriority lib.id options.webserver.userOptions)
];
} To prevent |
Oh wow thank you for taking another look at it!! 😯 I hope I’ll have time next weekend to run the tests with this code and create a PR... |
It is no longer possible to build nixcloud-webservices with current nixos-unstable:
building Nix...
building the system configuration...
error: attribute 'submodule' missing, at /home/username/repo/nixcloud-webservices/modules/web/core/webserver.nix:66:39
(use '--show-trace' to show detailed location information)
The text was updated successfully, but these errors were encountered: