!oNSIfazDqEcwhcOjSL:matrix.org

disko

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

Load older messages


SenderMessageTime
19 May 2024
@lassulus:lassul.uslassulusliteralExample13:29:33
@matthewcroughan:defenestrate.itmatthewcroughan
❯ rg literalExample
lib/default.nix
146:      scrubOptionValue literalExpression literalExample

lib/options.nix
400:  literalExample = lib.warn "lib.literalExample is deprecated, use lib.literalExpression instead, or use lib.literalMD for a non-Nix description." literalExpression;

13:29:57
@matthewcroughan:defenestrate.itmatthewcroughandeprecated?13:29:59
@matthewcroughan:defenestrate.itmatthewcroughan literalExpression would still string interpolate if I put a ${pkgs.zstd} though right? 13:30:51
@matthewcroughan:defenestrate.itmatthewcroughanIt'll still take the string context from it?13:30:59
@matthewcroughan:defenestrate.itmatthewcroughan * It'll still take the string context from it and substitute a nix store path?13:31:05
@lassulus:lassul.uslassuluswell I'm old I can't keep up with all the deprecations :D13:31:31
@matthewcroughan:defenestrate.itmatthewcroughanI'm young and neither can I13:31:41
@matthewcroughan:defenestrate.itmatthewcroughan But yes, I don't know how to provide an example that escapes the ${}, literalExpression still won't do that 13:32:25
@matthewcroughan:defenestrate.itmatthewcroughan I'm unsure if the '' ends up getting rendered 13:32:50
@matthewcroughan:defenestrate.itmatthewcroughan
nixos/modules/services/networking/jibri/default.nix:      example = literalExpression ''
nixos/modules/services/networking/jibri/default.nix-        "jitsi-meet" = {
nixos/modules/services/networking/jibri/default.nix-          xmppServerHosts = [ "localhost" ];
nixos/modules/services/networking/jibri/default.nix-          xmppDomain = config.services.jitsi-meet.hostName;
nixos/modules/services/networking/jibri/default.nix-
nixos/modules/services/networking/jibri/default.nix-          control.muc = {
nixos/modules/services/networking/jibri/default.nix-            domain = "internal.''${config.services.jitsi-meet.hostName}";
nixos/modules/services/networking/jibri/default.nix-            roomName = "JibriBrewery";
nixos/modules/services/networking/jibri/default.nix-            nickname = "jibri";
``
13:37:39
@matthewcroughan:defenestrate.itmatthewcroughan *
nixos/modules/services/networking/jibri/default.nix:      example = literalExpression ''
nixos/modules/services/networking/jibri/default.nix-        "jitsi-meet" = {
nixos/modules/services/networking/jibri/default.nix-          xmppServerHosts = [ "localhost" ];
nixos/modules/services/networking/jibri/default.nix-          xmppDomain = config.services.jitsi-meet.hostName;
nixos/modules/services/networking/jibri/default.nix-
nixos/modules/services/networking/jibri/default.nix-          control.muc = {
nixos/modules/services/networking/jibri/default.nix-            domain = "internal.''${config.services.jitsi-meet.hostName}";
nixos/modules/services/networking/jibri/default.nix-            roomName = "JibriBrewery";
nixos/modules/services/networking/jibri/default.nix-            nickname = "jibri";
13:37:42
@matthewcroughan:defenestrate.itmatthewcroughanyeah that looks to be the way13:37:47
@lassulus:lassul.uslassulusmaybe just escape the ${ then?13:38:10
@matthewcroughan:defenestrate.itmatthewcroughanYeah, that's the way13:38:26
@matthewcroughan:defenestrate.itmatthewcroughan literalExpression "''${foo}" is the way 13:38:40
@lassulus:lassul.uslassulus in " ${ is escaped with \ 13:40:00
@lassulus:lassul.uslassulusbut in '' this would be correct13:40:24
@matthewcroughan:defenestrate.itmatthewcroughanHuzzah! I have had disko produce a raspberry pi 4 bootable image for me :)14:13:27
@matthewcroughan:defenestrate.itmatthewcroughanwith bcachefs as the FS14:13:41
@matthewcroughan:defenestrate.itmatthewcroughanthat took foreeeeever14:13:46
@matthewcroughan:defenestrate.itmatthewcroughan
[matthew@corpo:~]$ df -T
Filesystem                             Type     1K-blocks    Used Available Use% Mounted on
devtmpfs                               devtmpfs    398268       0    398268   0% /dev
tmpfs                                  tmpfs      3982668       0   3982668   0% /dev/shm
tmpfs                                  tmpfs      1991336    8212   1983124   1% /run
tmpfs                                  tmpfs      3982668    2220   3980448   1% /run/wrappers
/dev/disk/by-partlabel/disk-disk1-root bcachefs   9438577 4322971   5036905  47% /
/dev/mmcblk1p2                         vfat         30634   23028      7606  76% /firmware
/dev/mmcblk1p1                         ext4         90333   78055      5110  94% /boot
tmpfs                                  tmpfs       796532       4    796528   1% /run/user/1000

14:14:10
@lassulus:lassul.uslassulusforever in writing the code or forever in running it?14:14:23
@matthewcroughan:defenestrate.itmatthewcroughanwriting code14:14:28
@matthewcroughan:defenestrate.itmatthewcroughanBecause the Pi is so weird14:14:37
@matthewcroughan:defenestrate.itmatthewcroughanpi3 would require even more changes to do this, because it doesn't support gpt only14:14:48
@matthewcroughan:defenestrate.itmatthewcroughanAnd that's where we were last time I came in here asking about Pi booting14:15:00
@matthewcroughan:defenestrate.itmatthewcroughan
{
  disko.extraPostVM = ''
    ${pkgs.zstd}/bin/zstd --compress $out/*raw
    rm $out/*raw
  '';
  disko.devices = {
    disk = {
      disk1 = {
        imageSize = "10G";
        type = "disk";
        device = "/dev/mmcblk0";
        postCreateHook = ''
          lsblk
          sgdisk -A 1:set:2 /dev/vda
        '';
        content = {
          type = "gpt";
          partitions = {
            firmware = {
              size = "30M";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/firmware";
                postMountHook = toString (pkgs.writeScript "postMountHook.sh" ''
                  (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf *.dtb /mnt/firmware/)
                  cp ${pkgs.ubootRaspberryPi4_64bit}/u-boot.bin /mnt/firmware/u-boot-rpi4.bin
                  cp ${configTxt} /mnt/firmware/config.txt
                '');
              };
            };
            boot = {
              size = "100M";
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/boot";
              };
            };
            root = {
              name = "root";
              size = "100%";
              content = {
                type = "filesystem";
                format = "bcachefs";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

14:15:54
@matthewcroughan:defenestrate.itmatthewcroughansomething like this does everything14:15:59
@matthewcroughan:defenestrate.itmatthewcroughannow the only remaining problem is resize on first boot14:16:18

Show newer messages


Back to Room ListRoom Version: 10