!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1634 Members
Nix programming language292 Servers

Load older messages


SenderMessageTime
27 Apr 2025
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:19:36
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:20:10
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:20:51
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:21:21
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:21:26
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:21:28
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:21:29
@wilma-schultz:tchncs.de@wilma-schultz:tchncs.deRedacted or Malformed Event03:21:30
@mjolnir:nixos.orgNixOS Moderation Bot banned @wilma-schultz:tchncs.de@wilma-schultz:tchncs.de (<no reason supplied>).03:21:30
@uep:matrix.orguep changed the join rule to "invite" from "public".03:25:00
@awwpotato:envs.net@awwpotato:envs.net left the room.03:45:01
@slamphear:matrix.org@slamphear:matrix.org left the room.05:20:59
@realhotgirlshit:envs.netrocky (she/they) 🏳️‍⚧️ I’m trying to set up LUKS–style Btrfs full disk encryption on my older BIOS desktop with a layout generated from disko. I try to install it, but I get an error that says installation of GRUB on /dev/sda failed: No such file or directory.

The command I used:
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run 'github:nix-community/disko/latest#disko-install' -- --flake '/etc/nixos#koolthing' --disk main /dev/sda

The relevant NixOS configuration:

  # Disable UEFI.
  boot.loader.systemd-boot.enable = false;

  # Use the GRUB 2 boot loader.
  boot.loader.grub.enable = true;
  boot.loader.grub.efiSupport = false;

  boot.loader.efi.canTouchEfiVariables = false;
  # boot.loader.grub.efiInstallAsRemovable = true;
  # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  # Define on which hard drive you want to install Grub.
  boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

The entire disko configuration in its flake:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
  inputs.disko.url = "github:nix-community/disko/latest";
  inputs.disko.inputs.nixpkgs.follows = "nixpkgs";

  outputs = {self, disko, nixpkgs }: {
    nixosConfigurations.koolthing = nixpkgs.legacyPackages.x86_64-linux.nixos [
      ./configuration.nix
      disko.nixosModules.disko
      {
        disko.devices = {
	  disk = {
          main = {
            type = "disk";
            device = "/dev/vdb";
            content = {
              type = "gpt";
              partitions = {
                # Legacy BIOS, MBR-style partition table.
                boot = {
                  size = "1M";
                  type = "EF02"; # Grub MBR.
                };

                # The LUKS-encrypted root.
                luks = {
                  size = "300G";
                  content = {
                    type = "luks";
                    name = "crypted";

                    # Set up with an interactive password and not a keyfile.
                    settings = {
                      allowDiscards = true;
                    };

                    # The Btrfs filesystem.
                    content = {
                      type = "btrfs";
                      extraArgs = ["-f"]; # Overwrite any existing file system.
                      subvolumes = {
                        "/root" = {
                          mountpoint = "/";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The home subvolume.
                        "/home" = {
                          mountpoint = "/home";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The nix subvolume.
                        "/nix" = {
                          mountpoint = "/nix";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };
                      };
                    };
                  };
                };
              };
            };
          };
	};
        };
      }
    ];
  };
}
06:45:27
@vengmark2:matrix.orgl0b0Absolutely! It supports all popular languages out of the box, allows mixing them (much easier than trying to get N package managers to cooperate), and by just doing idiomatic Nix you automatically get one of the best things for monorepos: minimal rebuilds.07:33:40
@marcusramberg:matrix.orgMarcusFfs08:10:42
@vengmark2:matrix.orgl0b0It just means what it says: /dev/sda does not exist. You'll have to specify a different disk.08:21:34
@vengmark2:matrix.orgl0b0But this is not really appropriate for this room; try https://matrix.to/#/#disko:nixos.org instead.08:22:03
@tedbyron:matrix.org@tedbyron:matrix.org left the room.17:30:59
28 Apr 2025
@zonnebloem:matrix.orgzonnebloemhi13:17:06
@zonnebloem:matrix.orgzonnebloemI'm having trouble converting pkgs.substituteAll to pkgs.replaceVars13:17:36
@zonnebloem:matrix.orgzonnebloem
  cssBase = builtins.readFile (
    pkgs.replaceVars ./waybar-style.css {
      base03 = "#002b36";
      doesntExist = "#073642";
    }
  );

nix error

  error: builder for '/nix/store/ljzv9k9dj9n6hh3mgsxwjw161qcw6a40-waybar-style.css.drv' failed with exit code 1;
       last 6 log lines:
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > substituteStream() in derivation waybar-style.css: ERROR: pattern @doesntExist@ doesn't match anything in file '/nix/store/x6b14c7gkk03wkh1pgsw2klffzv4hdsf-waybar-style.css'
       For full logs, run:
         nix log /nix/store/ljzv9k9dj9n6hh3mgsxwjw161qcw6a40-waybar-style.css.drv 

replaceVars doesn't ignore extras in the set. Is there a way to ignore the extras?

13:22:27
@charlotte:vanpetegem.me@charlotte:vanpetegem.me left the room.14:31:25
@mattsturg:matrix.orgMatt Sturgeon

That's intentional; the idea is that you only pass the variables you actually want to replace to replaceVars.

That's one of the main reasons why replaceVars is preferred over substituteAll.

If you don't know what vars will be available to replace, you should continue using substituteAll. However generally it's better to be explicit and only pass the variables you actually want to replace to replaceVars.

let
  colours = {
    # ...
  };
  cssBase = builtins.readFile (
    pkgs.replaceVars ./waybar-style.css {
      inherit (colours)
        base03
        ;
    }
  );
in

Side-note: passing your replaceVars derivation to builtins.readFile is an example of Import From Derivation. This is often a bad idea; it leads to poor performance; it also isn't allowed in the nixpkgs repo.

15:03:56
@mattsturg:matrix.orgMatt Sturgeon *

That's intentional; the idea is that you only pass the variables you actually want to replace to replaceVars.

In most cases, the input variables not matching the variables present in the template file is a bug; e.g. a spelling error; or a change in the template file that hasn't been updated in the input variables.

That's one of the main reasons why replaceVars is preferred over substituteAll.

If you don't know what vars will be available to replace, you should continue using substituteAll. However generally it's better to be explicit and only pass the variables you actually want to replace to replaceVars.

let
  colours = {
    # ...
  };
  cssBase = builtins.readFile (
    pkgs.replaceVars ./waybar-style.css {
      inherit (colours)
        base03
        ;
    }
  );
in

Side-note: passing your replaceVars derivation to builtins.readFile is an example of Import From Derivation. This is often a bad idea; it leads to poor performance; it also isn't allowed in the nixpkgs repo.

15:05:39
29 Apr 2025
@federicodschonborn:matrix.orgThis legally distinct plastic brick is licensed under the terms of the he/him or they/them pronouns, at your choice changed their display name from This LEGO® Worm™ is licensed under the terms of the he/him or they/them pronouns, at your choice to This legally distinct plastic brick is licensed under the terms of the he/him or they/them pronouns, at your choice.14:37:53
@dolcetriade:matrix.orgDolceTriadeIn nix-tree, why are some packages blue?23:58:31
@utdemir:matrix.orgutdemirHmm. I think they are the ones with no dependencies.23:59:19
30 Apr 2025
@dolcetriade:matrix.orgDolceTriadeAhh, thanks! Was curious if there was any special meaning behind it.07:17:06
@apeioo:matrix.orgLorenz changed their display name from apeioo to Lorenz.12:01:56
@sheeldotme:matrix.org@sheeldotme:matrix.org left the room.14:23:09

There are no newer messages yet.


Back to Room ListRoom Version: 6