| 19 May 2024 |
lassulus | literalExample | 13:29:33 |
matthewcroughan | ❯ 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 | deprecated? | 13:29:59 |
matthewcroughan | literalExpression would still string interpolate if I put a ${pkgs.zstd} though right? | 13:30:51 |
matthewcroughan | It'll still take the string context from it? | 13:30:59 |
matthewcroughan | * It'll still take the string context from it and substitute a nix store path? | 13:31:05 |
lassulus | well I'm old I can't keep up with all the deprecations :D | 13:31:31 |
matthewcroughan | I'm young and neither can I | 13:31:41 |
matthewcroughan | But yes, I don't know how to provide an example that escapes the ${}, literalExpression still won't do that | 13:32:25 |
matthewcroughan | I'm unsure if the '' ends up getting rendered | 13:32:50 |
matthewcroughan | 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 | * 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 | yeah that looks to be the way | 13:37:47 |
lassulus | maybe just escape the ${ then? | 13:38:10 |
matthewcroughan | Yeah, that's the way | 13:38:26 |
matthewcroughan | literalExpression "''${foo}" is the way | 13:38:40 |
lassulus | in " ${ is escaped with \ | 13:40:00 |
lassulus | but in '' this would be correct | 13:40:24 |
matthewcroughan | Huzzah! I have had disko produce a raspberry pi 4 bootable image for me :) | 14:13:27 |
matthewcroughan | with bcachefs as the FS | 14:13:41 |
matthewcroughan | that took foreeeeever | 14:13:46 |
matthewcroughan | [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 | forever in writing the code or forever in running it? | 14:14:23 |
matthewcroughan | writing code | 14:14:28 |
matthewcroughan | Because the Pi is so weird | 14:14:37 |
matthewcroughan | pi3 would require even more changes to do this, because it doesn't support gpt only | 14:14:48 |
matthewcroughan | And that's where we were last time I came in here asking about Pi booting | 14:15:00 |
matthewcroughan | {
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 | something like this does everything | 14:15:59 |
matthewcroughan | now the only remaining problem is resize on first boot | 14:16:18 |