Comments (5)
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.
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.
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.
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.
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)
- Using disko to generate raspberry pi sd card images
- Random boot failues due to partition confusion because disko now relies on `by-partlabel` HOT 8
- ZFS Features Support: Dataset property inheritance HOT 2
- Converting an existing system to use disko? HOT 5
- GRUB Mirrored boot entries with disko HOT 2
- zpool create error: one or more vdevs refer to the same device HOT 1
- How to test luks setup with `--vm-test` HOT 5
- device already has a partition, skipping creating zpool zroot HOT 1
- Can't automount ZFS dataset without using mountpoint="legacy" HOT 1
- `disko-install` should error out immediately if it was invoked without `sudo` HOT 1
- [DOC] add demo/example config for subvolumes on btrfs on lvm on luks HOT 1
- Add docs for upgrade from legacy table to gpt HOT 5
- QUESTION: neededForBoot option HOT 2
- Random Boot failures due to failing to mount /usr/bin HOT 4
- Size range HOT 1
- encrypted swap and hibernation HOT 2
- Generate an .iso unattended install image HOT 17
- typo in the docs?
- how to to pass flake `self` using `specialArgs`? HOT 2
- disko-install: error: infinite recursion encountered HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disko.