-
Notifications
You must be signed in to change notification settings - Fork 9
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
How to add a custom module when using disnixos + nixops? #7
Comments
I probably need to investigate this, to fully uncover the problem. Can you try out a few things? An easier way to configure the modules path is by using the Another potential problem is how SSH works -- when you intend to remotely execute instructions over SSH and the login shell of the remote user is I have not fully documented yet how to create Dysnomia modules, but when I want to make modifications and test them, I typically use Dysnomia's test suite. If you clone the Git repo, then you can run the PostgreSQL tests as follows: $ nix-build release.nix -A tests.modules.postgresql-database if you want to make changes, then simply modify the script in |
One of my future plans is to make the development and deployment of Dysnomia modules easier. Right now, they are stored in a mono repo, but since we have Nix at our disposal, why not making it easier to deploy each plugin by using Nix in our advantage? |
Hi @svanderburg, I'm getting back to this lately. I tried a few variations of Let's say I created a new file called {
mymachine = { system, pkgs, lib, ... }: {
environment.etc."dysnomia/modules/postgresql-database2".source = pkgs.substituteAll {
src = ./modules/dysnomia/modules/postgresql-database2.in;
};
dysnomia = {
enable = true;
extraModulePaths = ["/etc/dysnomia/modules/"];
}
};
} Then, if I run I think I'm going in circles here because it's still the same problems as before. I'll go the route of making a clone of the git repo for the time being but I'd love to know how to do it this way, and to finally understand what I'm missing. Thank you 🙏 |
Actually... I made a local clone of dysnomia and wanted to use that one. So, in my configuration.nix, I did: dysnomia = {
enable = true;
enableLegacyModules = false;
package = pkgs.lib.mkForce (pkgs.dysnomia.overrideAttrs (finalAttrs: previousAttrs: {
version = "0.10.2";
src = /home/me/projects/dysnomia;
}));
} But that fails with:
To understand what's missing, I checked the tar.gz content of a dysnomia release. And there are differences with the repo itself! Edit: |
Hi!
I want to make some changes to the
postgresql-database.in
module. I figured the easiest would be to copy it, modify it, and ship it with another name so dysnomia could see the new module. But I fail to do that in at least two ways:@var@
variables do not get substituted correctly (especially the#!/bin/bash
at the top).I can share my full config if needed but here are the relevant parts:
In
network.nix
:For the purpose of this issue, there's no need to show the specific changes to the dysnomia module I made, the issue is relevant with a verbatim copy of any module.
Issue about replacing shebang and variables
Afterwards I deploy using
nixops
:And can see the file but none of the variables were replaced (which makes sense):
$ nixops ssh myserver $ head /etc/dysnomia-modules/postgresql-database-secret -n 1 #!/bin/bash
Looking at an official module, the shebang gets replaced correctly:
$ nixops ssh myserver $ head /nix/store/9d7jhh7xsyyx933blk0c504qff609qkl-dysnomia-0.10.1/libexec/dysnomia/postgresql-database -n 1 #!/nix/store/bm7jr70d9ghn5cczb3q0w90apsm05p54-bash-5.1-p8/bin/bash
I'm guessing I'm missing some call to one of the
substitute*
functions but I tried to grep in your repos and I don't see where that happens.Issue about not finding module
The second issue comes from not being able to locate the module. At least that's what it looks like but I know the bash error messages can be cryptic and can hide a permission issue as something else for example.
Anyway, deploying returns this error:
$ disnixos-env -s services.nix -n network.nix -d distribution.nix --use-nixops [...] [coordinator]: Executing activation of services: [target: myserver]: Activating service with key: 6c7779e925f58420b6761b4b04b8ada3412f8fcc8071ea2bc823dd943d5f6544 and package: /nix/store/47l1mkclinkqwfwgwd9r1i95vk1msrfy-ttrss with module: postgresql-database-secret in container: postgresql-database-secret, arguments: env: ‘/etc/dysnomia-modules/postgresql-database-secret’: No such file or directory [target: arsenic]: Activation failed of service: 6c7779e925f58420b6761b4b04b8ada3412f8fcc8071ea2bc823dd943d5f6544 [...]
Although it looks like it should be able to find the module correctly:
I grepped github for any clue on how to create a new module but couldn't find anything useful. Can you give me pointers on how to achieve this?
The text was updated successfully, but these errors were encountered: