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

Must specify 23.05 as a CLI param, otherwise, issues errors with new configs #247

Open
RooSoft opened this issue Jun 15, 2023 · 6 comments

Comments

@RooSoft
Copy link

RooSoft commented Jun 15, 2023

Trying to generate a 23.05 proxmox image with my config originally based on 22.11... made sure there are no 22.11 references anywhere, flushed the build folder and launched the thing. Got this error:

error: The option `services.openssh.settings' does not exist. Definition values:
       - In `[REDACTED]/generators/common/ssh.nix':
           {
             PasswordAuthentication = true;
             PermitRootLogin = "no";
           }

Seems to me like it's trying to apply 22.11 options, so I added -I nixpkgs=channel:nixos-23.05 to the CLI command, and it worked.

By the way, I am using the flake, here is my whole command:

nix run github:nix-community/nixos-generators/1.7.0 -- --format proxmox --configuration host/dummy/configuration.nix -I nixpkgs=channel:nixos-23.05 -o builds/

Isn't 23.05 supposed to be the default by now, as 22.11 is flagged as deprecated? What am I doing wrong?

@mayl
Copy link
Contributor

mayl commented Jun 15, 2023

You mention this used to be 22.11. Is your system's nix-channel still on 22.11? I assume when running it the way you show the default would be up pull nixpkgs from that, unless you overwrite the environment variable.

@RooSoft
Copy link
Author

RooSoft commented Jun 15, 2023

Yeah, you're right, sudo nix-channel --list, issues nixos https://nixos.org/channels/nixos-22.11.

Most probably is why.. thanks!

@RooSoft
Copy link
Author

RooSoft commented Jun 15, 2023

I know this isn't related to this project, but how can I declaratively upgrade my channels from 22.11 when nixos-version shows 23.05.

That current setup is not using flakes for now...

Would love to upgrade and make sure the issue is resolved.

@mayl
Copy link
Contributor

mayl commented Jun 15, 2023

Channels basically aren't declarative, I personally don't know of any way to manage them declaratively.

If you want to change your vm configuration to use a specific nixpkgs I would suggest using a flake, which automatically pins inputs independently from the system they are built on. You could also do that for your system, but it wouldn't change the behavior that tripped you up here because your channels would be the same.

@yavko
Copy link

yavko commented Aug 28, 2023

Channels basically aren't declarative, I personally don't know of any way to manage them declaratively.

If you want to change your vm configuration to use a specific nixpkgs I would suggest using a flake, which automatically pins inputs independently from the system they are built on. You could also do that for your system, but it wouldn't change the behavior that tripped you up here because your channels would be the same.

You can manage them declaratively, as I do here by making all my flake inputs as channels :) (using nix.nixPath)
https://github.com/yavko/Dotfiles/blob/025886d49324c0a83fd18e8d2979be81ea3a7c37/modules/nix-daemon.nix#L10-L16

@mayl
Copy link
Contributor

mayl commented Aug 31, 2023

Eh, sure... But when I go into a folder somewhere on my system and nix-build an expression that uses <nixpkgs> (i.e. import nixpkgs from a channel vs a flake input or a pinned reference with something like niv) that is basically going to be exactly the same situation as above - the version is going to come from the system's state, it's not declared in the build expression.

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

No branches or pull requests

3 participants