Closed mvnetbiz closed 11 months ago
I'm seeing this too for every key in my config (at least removing the first few just saw other ones fail).
Likely related to https://github.com/NixOS/nixops/pull/1569 cc @K900 @roberth.
My keys look like:
deployment.keys.foo = {
text = "Some secret";
destDir = "/var/keys";
};
I'll take a look tomorrow morning.
Any update on this?
Sorry, completely lost track of this :( Can you try https://github.com/NixOS/nixops/pull/1572 ?
Sorry, completely lost track of this :( Can you try #1572 ?
Is there an easy way to get the a flake input with your contribution?
github:K900/nixops/patch-1
That did not fix the problem.
Sorry then, I'm temporarily out of ideas. I'll have to look at it closer later. For now you should be able to comment out this line: https://github.com/NixOS/nixops/blob/2cfc2cb4fa9ecb89a4274574ff7f63ea61782498/nixops/util.py#L168
Maybe we should do that for now and push a patch release? nixops has been broken in nixpkgs for quite a while now, and while it is possible to use a pinned version it is annoying and requires every user to find out what is happening on their own.
I've opened #1573, which solves this for me, but it would be nice with more testing.
github:K900/nixops/patch-1
hope this isn't too offtopic but I am trying to use these patches, but with a flake like this:
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixops.url = "github:talyz/nixops/mapping-types";
nixops.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nixops, ... }:
{
nixopsConfigurations.default = {
inherit nixpkgs;
network.storage.legacy.databasefile = "~/.nixops/deployments.nixops";
network.enableRollback = true;
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
nixops-pkgs = nixops.packages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = [
pkgs.nix
nixops-pkgs.default
];
};
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
});
}
I just get
error: The option `deployment.hetznerCloud' does not exist. Definition values:
...
wish something like this would work ^^ https://github.com/NixOS/nixops/issues/1324#issuecomment-1174855490
Yes, that should be because the hetzner plugin is missing. A somewhat easy way to test this is to override NixOps' src
attribute in nixpkgs.
This has been broken in nixpkgs-unstable
for a month now. Can we consider merging a quick fix (disabling the type check) for now until we can get a full resolution?
For those who need to deploy now an easy workaround is using nixops from 23.05 nix shell github:NixOS/nixpkgs/nixos-23.05#nixopsUnstable -c nixops help
. Be aware what version you are using though if you need bug fixes or new features.
With recent nixops, using keys results in the error:
typeguard.TypeCheckError: value of key 'test' of nixops.resources.ResourceEval is not an instance of nixops.backends.KeyOptions
Full exception
``` Traceback (most recent call last): File "/nix/store/1n5hmldxwzg2d2xmqlqxbf42ra57i11z-nixops-unstable-2023-10-26/bin/.nixops-wrapped", line 9, inflake.nix
```nix { description = "nixops python type bug"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = { self, nixpkgs }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; inherit (nixpkgs) lib; in { nixopsConfigurations.default = { inherit nixpkgs; network.description = "test"; network.storage.legacy = { databasefile = "test.nixops"; }; machine = { system.stateVersion = "23.11"; deployment.targetEnv = "libvirtd"; deployment.keys.test = { keyCommand = [ "dd" "if=/dev/urandom" "bs=1" "count=10" ]; user = "root"; }; }; }; defaultPackage.x86_64-linux = with pkgs; (buildEnv { name = "test"; paths = [ nixops_unstable ]; }); }; } ```