-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add ability to use a lib.nixosSystem system configuration (nixosConfigurations.<name>) as a NixOps deployment node configuration (nixopsConfigurations.<deployment>.<name>) #1516
Comments
NixOps relies on the ability to add its own modules, containing such data as ip addresses, ssh keys, etc, whereas a
So if you don't really need
|
I did {
nixosConfigurations = builtins.mapAttrs
(hostName: v: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
name = hostName;
};
modules = [
self.nixopsConfigurations.defaults
n
({ lib, ... }: {
options.deployment = lib.mkOption {
type = lib.types.anything;
default = { };
};
config.networking = { inherit hostName; };
})
];
})
self.nixopsConfigurations.nodes;
} |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/can-i-reuse-nixosconfigurations-foo-in-nixops/25243/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/can-i-reuse-nixosconfigurations-foo-in-nixops/25243/2 |
I came up with a similar approach with some additional help / explanation from @roberth (thanks again) and posted it in the linked discussion. The key fact I needed to understand was that I can't go back from a fully configured
|
This way I can use
nixos-rebuild ..
and/ornixops deploy ..
without repeating myselfThe text was updated successfully, but these errors were encountered: