!oNSIfazDqEcwhcOjSL:matrix.org

disko

366 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko93 Servers

Load older messages


SenderMessageTime
1 Apr 2024
@perchun:matrix.orgPerchun Pakalso, i was confused to see this feature named "format" though you recommend it to not format my disk19:22:22
@lassulus:lassul.uslassulusah, yeah,I actually check if there is already a partition table and skip creating any partition if that is the case19:41:45
@lassulus:lassul.uslassulusI will fix that tomorrow19:41:49
3 Apr 2024
@thevilsol:matrix.orgVilsol set a profile picture.00:10:29
4 Apr 2024
@strutztm:strutztm.de@strutztm:strutztm.de joined the room.10:16:08
@perchun:matrix.orgPerchun Pak
In reply to @perchun:matrix.org
well, this doesn't work
https://gist.github.com/PerchunPak/00acc9f000667c5c4dca4b8d4a6c76b0
(i am currently trying this in vm to be safe; without changes into modules/nixos/disko.nix, it gives the same result)

I did it!

[nixos@nixos:~/nixos-dotfiles]$ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                7:0    0 904.4M  1 loop  /nix/.ro-store
sr0                 11:0    1   950M  0 rom   /iso
vda                253:0    0   100G  0 disk  
├─vda1             253:1    0   500M  0 part  
├─vda2             253:2    0    10G  0 part  
├─vda3             253:3    0     1M  0 part  
├─vda4             253:4    0   500M  0 part  /mnt/boot
├─vda5             253:5    0     8G  0 part  [SWAP]
└─vda6             253:6    0    81G  0 part  
  └─encrypted      254:0    0    81G  0 crypt 
    └─root_vg-root 254:1    0    81G  0 lvm   /mnt/persist
                                              /mnt/nix
                                              /mnt

basically I [just modified script, produced by nix run ...disko... --mode disko ... --dry-run (mode is disko because format didn't create luks partition for some reason)

16:06:43
@perchun:matrix.orgPerchun Pak
In reply to @perchun:matrix.org
well, this doesn't work
https://gist.github.com/PerchunPak/00acc9f000667c5c4dca4b8d4a6c76b0
(i am currently trying this in vm to be safe; without changes into modules/nixos/disko.nix, it gives the same result)
*

I did it!

[nixos@nixos:~/nixos-dotfiles]$ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                7:0    0 904.4M  1 loop  /nix/.ro-store
sr0                 11:0    1   950M  0 rom   /iso
vda                253:0    0   100G  0 disk  
├─vda1             253:1    0   500M  0 part  
├─vda2             253:2    0    10G  0 part  
├─vda3             253:3    0     1M  0 part  
├─vda4             253:4    0   500M  0 part  /mnt/boot
├─vda5             253:5    0     8G  0 part  [SWAP]
└─vda6             253:6    0    81G  0 part  
  └─encrypted      254:0    0    81G  0 crypt 
    └─root_vg-root 254:1    0    81G  0 lvm   /mnt/persist
                                              /mnt/nix
                                              /mnt

basically I [just modified script](https://gist.github.com/PerchunPak/94a54415887c3a0a89c00a875c4cd204), produced by nix run ...disko... --mode disko ... --dry-run (mode is disko because format didn't create luks partition for some reason)

16:06:50
@perchun:matrix.orgPerchun Pak *

I did it!

[nixos@nixos:~/nixos-dotfiles]$ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                7:0    0 904.4M  1 loop  /nix/.ro-store
sr0                 11:0    1   950M  0 rom   /iso
vda                253:0    0   100G  0 disk  
├─vda1             253:1    0   500M  0 part  
├─vda2             253:2    0    10G  0 part  
├─vda3             253:3    0     1M  0 part  
├─vda4             253:4    0   500M  0 part  /mnt/boot
├─vda5             253:5    0     8G  0 part  [SWAP]
└─vda6             253:6    0    81G  0 part  
  └─encrypted      254:0    0    81G  0 crypt 
    └─root_vg-root 254:1    0    81G  0 lvm   /mnt/persist
                                              /mnt/nix
                                              /mnt

basically I just modified script, produced by nix run ...disko... --mode disko ... --dry-run (mode is disko because format didn't create luks partition for some reason)

16:07:10
@lassulus:lassul.uslassulushmm, didn't the disko command wipe your other partitions?16:09:21
@perchun:matrix.orgPerchun Pakit does, i just removed that part from script generated by disko https://gist.github.com/PerchunPak/94a54415887c3a0a89c00a875c4cd204#file-disko-patch-L8-L1116:10:12
@lassulus:lassul.uslassulusah ok16:10:23
@lassulus:lassul.uslassulusyeah thats a way to do it16:10:28
5 Apr 2024
@soispha:vhack.euBenedikt joined the room.04:23:38
6 Apr 2024
@hoskellisiera:matrix.orghoskellisieraHey, is there a way to use disko on the config.system.build.vm Attribute in a testflake?19:25:20
@hoskellisiera:matrix.orghoskellisiera * Hey, is there a way to use disko on the config.system.build.vm Attribute in a testflake? 19:25:31
@lassulus:lassul.uslassuluswhat do you want to do?19:33:40
@lassulus:lassul.uslassulusthere is sadly no way to have your disk configuration in the nixos generated vm config19:33:57
@matthewcroughan:defenestrate.itmatthewcroughan lassulus: does config.system.build.vm not have extendModules ? 19:38:13
@matthewcroughan:defenestrate.itmatthewcroughanoh yeah looks like it might now 19:38:41
@matthewcroughan:defenestrate.itmatthewcroughan * oh yeah looks like it might not19:38:44
@matthewcroughan:defenestrate.itmatthewcroughan would be cool to put that in passtrhu 19:38:56
@matthewcroughan:defenestrate.itmatthewcroughan * would be cool to put that in passthru 19:38:59
@hoskellisiera:matrix.orghoskellisiera
In reply to @lassulus:lassul.us
there is sadly no way to have your disk configuration in the nixos generated vm config
that's what I wanted to do
19:52:13
7 Apr 2024
@perchun:matrix.orgPerchun Pak Btw, I don't know if it is intended, but this command returns exit code 0 when partition exists
https://github.com/nix-community/disko/blob/0a17298c0d96190ef3be729d594ba202b9c53beb/lib/types/gpt.nix#L158
Should I open an issue on GitHub?
10:00:59
@lassulus:lassul.uslassulushmm, what is the problem?10:02:55
@lassulus:lassul.uslassulusah maybe an ! is missing10:04:51
@lassulus:lassul.uslassulusbut not sure how it even gets to that point, since it will skip the whole if statement if a table exists on line 15610:06:21
@perchun:matrix.orgPerchun Pak I am not familiar with the code, but this line has 3 possible states (from my understanding)
- partition table does not exist
- partition does not exist
- partition exists

In bottom two sgdisk exits with 0 code, but in first with some other (don't remember exactly). Though if partition table doesn't exist, it will be created on top of the script
10:06:40
@lassulus:lassul.uslassulusbut not sure there is a scenario where a partition table does not exist but a partition?10:07:33
@lassulus:lassul.uslassuluseither way, the code doesn't do whats intended :)10:07:46

Show newer messages


Back to Room ListRoom Version: 10