Giter VIP home page Giter VIP logo

Comments (5)

Lassulus avatar Lassulus commented on June 20, 2024 1

hey thank you. The error is in how you integrate your disko-file into your configuration I guess. do you just use imports = [ ./disko-file ]; ?

from disko.

Lassulus avatar Lassulus commented on June 20, 2024 1

ah, so the problem is disks is not in specialArgs and the nixos import functionality then tries to find disks in specialArgs and gives up if it's not there. sadly this is one of the points where nixos modules are not lazy.

for a better solution (although I haven't tested that yet) I would suggest creating an option or harcoding the device in the disko config without that fancy arg stuff (which I only introduced because the tests needed it this way, but it's basically gone in my big refactor here: #294)

if you want to try out the options method, do something like this:

{ config, lib, ... }: {
  options.disks = lib.mkOption {
    type = lib.types.listOf lib.types.str;
    default = [ "/dev/disk/by-id/nvme-Samsung_SSD_960_EVO_1TB_XXXXXXXXXXXXXXX" ];
  };
  disko.devices = {
    disk.nvme = {
      type = "disk";
      device = builtins.elemAt config.disks 0;
      content = {
      .... same as before ....

you can then override that anywhere in your nixos configuration with

disks = [ "/dev/someotherdev" ];

but if you don't really want to change disks at some point, you can just hardcode it by changing your config into this:

{ 
  disko.devices = {
    disk.nvme = {
      type = "disk";
      device = "/dev/disk/by-id/nvme-Samsung_SSD_960_EVO_1TB_XXXXXXXXXXXXXXX";
      content = {
      .... same as before ....

hopefully that made it clear, if you have more questions, feel free to ask here :)

from disko.

lutzgo avatar lutzgo commented on June 20, 2024

Wow, thank you for coming back so fast. In fact I use it as a module (freely adapted from Setting up my machines: nix style. Here is my complete configuration: nix-it-up.

from disko.

Lassulus avatar Lassulus commented on June 20, 2024

sadly the module method breaks the cli args method, I still to find a better way in the CLI for that :) but maybe I rewrite the CLI to just use a nixos config and then it extracts the create and mount scripts from there.

from disko.

lutzgo avatar lutzgo commented on June 20, 2024

Thank you very much. I tried the first solution just out of curiosity, but it threw an error, so I went with the easy (hardcoded, disk-specific) way. Maybe I have try the harder way, when I need it with another machine.

Thank you for fixing this.

from disko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.