!oNSIfazDqEcwhcOjSL:matrix.org

disko

367 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko95 Servers

Load older messages


SenderMessageTime
7 Apr 2024
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @perchun:matrix.org
Vimjoyer did config for btrfs + impermanence, don't know about other things 
https://youtu.be/YPKwkWtK7l0?feature=shared

disko has gone crazy, or me?

                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/root" = {
                      mountpoint = "/";
                      mountOptions = ["compress=zstd" "noatime"];
                    };

mounts / in /root

10:34:06
@perchun:matrix.orgPerchun Pak
In reply to @xxxcrow:matrix.org

disko has gone crazy, or me?

                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/root" = {
                      mountpoint = "/";
                      mountOptions = ["compress=zstd" "noatime"];
                    };

mounts / in /root

It backups all your data on every reboot. I can show you the folder structure when I arrive home
10:35:16
@xxxcrow:matrix.orgn3v3r_a9a1nso, i can find all the stuff in /root directory10:35:16
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @perchun:matrix.org
It backups all your data on every reboot. I can show you the folder structure when I arrive home
i mean, it's not even that much of impermanence, but really about disko
10:36:14
@xxxcrow:matrix.orgn3v3r_a9a1n

ok, this is the drive:

            luks = {
              size = "100%";
              content = {
                type = "luks";
                name = "nvme-crypt";
                # disable settings.keyFile if you want to use interactive password entry
                #passwordFile = "/tmp/secret.key"; # Interactive
                settings = {
                  allowDiscards = true;
                  #keyFile = "/tmp/secret.key";
                };
                #additionalKeyFiles = ["/tmp/additionalSecret.key"];
                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/root" = {
                      mountpoint = "/";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/home" = {
                      mountpoint = "/home";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/persist" = {
                      mountpoint = "/persist";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/log" = {
                      mountpoint = "/var/log";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/swap" = {
                      mountpoint = "/.swapvol";
                      swap.swapfile.size = "8G";
                    };
                  };
                };
              };
            };
          };
        };
      };
10:36:46
@perchun:matrix.orgPerchun Pak When you're booted into the system, root is in /. When you mount the disk, structure is something like
```
- nix/store
- old_roots
 - $(date) # older than 30d are automatically deleted
- root
- and some fourth folder name of which I completely forgot
```
10:37:23
@perchun:matrix.orgPerchun Pak Fourth is persist 10:38:10
@perchun:matrix.orgPerchun Pak Btw, here is how you can use it with luks
https://gist.github.com/PerchunPak/0df4fa9117dfb036b0564a9f058f539c
10:39:49
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @xxxcrow:matrix.org

ok, this is the drive:

            luks = {
              size = "100%";
              content = {
                type = "luks";
                name = "nvme-crypt";
                # disable settings.keyFile if you want to use interactive password entry
                #passwordFile = "/tmp/secret.key"; # Interactive
                settings = {
                  allowDiscards = true;
                  #keyFile = "/tmp/secret.key";
                };
                #additionalKeyFiles = ["/tmp/additionalSecret.key"];
                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/root" = {
                      mountpoint = "/";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/home" = {
                      mountpoint = "/home";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/persist" = {
                      mountpoint = "/persist";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/log" = {
                      mountpoint = "/var/log";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/swap" = {
                      mountpoint = "/.swapvol";
                      swap.swapfile.size = "8G";
                    };
                  };
                };
              };
            };
          };
        };
      };
ok, what do you thing the result of this would be?
10:42:22
@xxxcrow:matrix.orgn3v3r_a9a1n

i do:
nix run github:nix-community/nixos-anywhere -- --flake .#immortal root@192.168.1.100 --no-reboot

10:44:32
@xxxcrow:matrix.orgn3v3r_a9a1nthen mount /dev/mapper/nvme-crypt /mnt10:44:50
@xxxcrow:matrix.orgn3v3r_a9a1n
[root@nixos:~]# ls /mnt/
home  log  nix  persist  root  swap

[root@nixos:~]# ls /mnt/root
bin  boot  dev  etc  home  lib  lib64  nix  persist  proc  root  run  srv  sys  tmp  usr  var

[root@nixos:~]# btrfs subvolume list /mnt
ID 256 gen 29 top level 5 path home
ID 257 gen 33 top level 5 path log
ID 258 gen 33 top level 5 path nix
ID 259 gen 29 top level 5 path persist
ID 260 gen 36 top level 5 path root
ID 261 gen 18 top level 5 path swap
ID 262 gen 29 top level 260 path root/srv
ID 263 gen 30 top level 260 path root/var/lib/portables
ID 264 gen 31 top level 260 path root/var/lib/machines
ID 265 gen 33 top level 260 path root/var/tmp

10:47:53
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @xxxcrow:matrix.org
then mount /dev/mapper/nvme-crypt /mnt
or i shouldn't do it at all?
10:50:02
@lassulus:lassul.uslassulus Perchun Pak: I created this PR to fix the gpt behaviour: https://github.com/nix-community/disko/pull/595 10:51:22
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @xxxcrow:matrix.org
or i shouldn't do it at all?
if i mount the way tutorials on impermanence+btrfs say, everything looks fine,but how do i take the snapshot
10:54:15
@xxxcrow:matrix.orgn3v3r_a9a1n
In reply to @perchun:matrix.org
Vimjoyer did config for btrfs + impermanence, don't know about other things 
https://youtu.be/YPKwkWtK7l0?feature=shared
also, sorry if it's not true, but i think the way way he implements everything is not really ok
1st. https://discourse.nixos.org/t/what-does-impermanence-add-over-built-in-functionality/27939/16
2nd. it doesn't work with some stuff (can't remember what exactly either lanzaboote, or clevis, or something like that)
3rd. something else i forgot exactly what
11:22:11
@perchun:matrix.orgPerchun Pak
In reply to @xxxcrow:matrix.org
also, sorry if it's not true, but i think the way way he implements everything is not really ok
1st. https://discourse.nixos.org/t/what-does-impermanence-add-over-built-in-functionality/27939/16
2nd. it doesn't work with some stuff (can't remember what exactly either lanzaboote, or clevis, or something like that)
3rd. something else i forgot exactly what
Yeah, it deleted all of my data if there wasn't something correct in the setup. Like no /persist/system or wrong permissions on /persist/home (in second scenario, home manager just failed to start completely). Though it is probably the fault of impermanence.

But for now, it works on my machine™. Feel free to send your final setup, I will happily steal it ;)
11:57:22
@lassulus:lassul.uslassuluswhoops, I accidently ran sgdisk -o isntead -p on my main disk :D12:52:35
@lassulus:lassul.uslassulusluckily I could recover it with disko12:52:46
@lassulus:lassul.uslassulusbut why are those 2 parameters (-p pronts, -o wipes) so close together on the keyboard :D12:53:07
@lassulus:lassul.uslassulus * but why are those 2 parameters (-p prints, -o wipes) so close together on the keyboard :D12:53:14
@xxxcrow:matrix.orgn3v3r_a9a1n Quick questiono about disko and nixos-anywhere!
How do I skip disko in nixos-anywhere?
16:01:36
@lassulus:lassul.uslassulusHmm you can't really. Maybe we should add a --stop-after-kexec parameter16:29:37
8 Apr 2024
@vengmark2:matrix.orgl0b0 joined the room.00:55:29
@palo:xaos.space@palo:xaos.space changed their display name from palo to palo moved to @mrvandalo:terranix.org.13:03:24
@mrvandalo:terranix.orgpalo joined the room.13:06:37
@palo:xaos.space@palo:xaos.space left the room.13:06:51
@mrvandalo:terranix.orgpalo changed their display name from mrvandalo to palo.13:12:45
@xxxcrow:matrix.orgn3v3r_a9a1n

is disko working with clevis??

error:
       … while evaluating attribute 'nodes'

         at «string»:4:25:

            3|                       (deploy // {
            4|                         nodes = {
             |                         ^
            5|                           inherit (deploy.nodes) "immortal";

       … while evaluating attribute 'immortal'

         at «string»:5:49:

            4|                         nodes = {
            5|                           inherit (deploy.nodes) "immortal";
             |                                                 ^
            6|                         };

       (stack trace truncated; use '--show-trace' to show the full trace)

       error:
       Failed assertions:
       - No filesystem or LUKS device with the name /dev/disk/by-uuid/9119a486-5702-4af7-bce8-5bb7e513ea6f is declared in your configuration.
       - No filesystem or LUKS device with the name /dev/disk/by-uuid/e85aa7c5-5926-434c-8142-0ede397a6369 is declared in your configuration.
🚀 ❌ [deploy] [ERROR] Failed to evaluate deployment data: Evaluation resulted in a bad exit code: Some(1)

15:07:54
@perchun:matrix.orgPerchun Pak

afaik, disko doesn't use uuids to manage paritions, but labels

~ ❯ ls /dev/disk/by-partlabel/
 disk-main-ESP
 disk-main-luks
 disk-main-swap
15:13:19

Show newer messages


Back to Room ListRoom Version: 10