disko icon indicating copy to clipboard operation
disko copied to clipboard

Importing disko from inputs in the same file than the disk configuration throw an error

Open Simon-Kenn opened this issue 1 year ago • 5 comments

Importing disko module directly in the disko formating file throw the error function anonymous lambda called without required argument inputs

{
  imports = [ inputs.disko.nixosModules.disko ];

  disko.devices = {…};
}```

Simon-Kenn avatar Feb 05 '24 15:02 Simon-Kenn

inputs is not defined, you need to pass it somehow from your flake.nix. maybe with specialArgs?

Lassulus avatar Feb 06 '24 11:02 Lassulus

yhea sorry it is defined and imported i copy the code fast and forget to show it

  imports = [ inputs.disko.nixosModules.disko ];

  disko.devices = {…};
}

But the next process works perfectly, where ./disk.nix is the disko configuration

{config, lib, pkgs, inputs, outputs, ...}:
{
    imports = [
        ./hardware-configuration.nix
        inputs.disko.nixosModules.disko
        ./disk.nix
        ./encrypted-ephemeral-btrfs.nix
        ./impermanence.nix
        ./users.nix
        ./fish.nix
        ./wireless.nix
        ./openssh.nix
        ./sops.nix
    ];
}

Simon-Kenn avatar Feb 06 '24 15:02 Simon-Kenn

I'm not really following, it seems like you try to access inputs somewhere, where it is not defined. I can help you if you paste more of your config I guess.

Lassulus avatar Feb 07 '24 04:02 Lassulus

You can find my config, the file is nixos/encrypted-ephemeral-btrfs.nix here

Simon-Kenn avatar Feb 07 '24 16:02 Simon-Kenn

I saw your config. You used disko under flakes, and there has a params from outside, so you should run command with --flake ....

https://github.com/Simon-Kenn/nixOs-sample/blob/35173d5f5c4da5f43cb59e09d787247fb7e500a0/README.md?plain=1#L24

Have a try : sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko --flake /path/to/nixOs-sample

You can find my config, the file is nixos/encrypted-ephemeral-btrfs.nix here

byronogis avatar Feb 14 '24 07:02 byronogis

As there's been no activity for a long time and this doesn't seem to be an issue with disko itself, I'll close this issue for now. If you get back to this and find you're still having issues, feel free to re-open it.

If you're not the OP and have a similar issue, feel free to open a new issue and reference this one :)

iFreilicht avatar Oct 01 '24 17:10 iFreilicht