This is the configuration for my home desktop. It is after the racing ship Razorback from the Expanse Novels[1].

nixosModules.razorback = {
  networking.hostName = "razorback";
  imports = [
    <<razorback-modules>>
  ];
};
nixosConfigurations.razorback = self.lib.mkNixOS {
  modules = [ self.nixosModules.razorback ];
};
flake.nix:outputs

Hardware configuration generated using nixos-generate-config:

(let ((out (shell-command-to-string
            (concat "2>/dev/null "
                    "nixos-generate-config --no-filesystems --show-hardware-config"
                    "| nixfmt"))))
  (concat "#+caption: hosts/razorback/hardware-configuration.nix\n"
          "#+begin_src nix :mkdirp yes :tangle out/hosts/razorback/hardware-configuration.nix\n"
          out
          "#+end_src"))
./hosts/razorback/hardware-configuration.nix
nixos/razorback

Disko configuration

{
  disko.devices = {
    disk = {
      nvme = {
        type = "disk";
        device = "/dev/nvmn0n1";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              size = "1G";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [
                  "defaults"
                ];
              };
            };
            luks = {
              size = "100%";
              content = {
                type = "luks";
                name = "crypt-root";
                extraOpenArgs = [ "--allow-discards" ];
                content = {
                  type = "lvm_pv";
                  vg = "pool";
                };
              };
            };
          };
        };
      };
    };
    lvm_vg = {
      pool = {
        type = "lvm_vg";
        lvs = {
          swap = {
            size = "32G";
            content = {
              type = "swap";
            };
          };
          rpool = {
            size = "100%FREE";
            content = {
              type = "zfs";
              pool = "rpool";
            };
          };
        };
      };
    };
    zpool = {
      rpool = {
        type = "zpool";
        postCreateHook = "zfs snapshot rpool/razorback/root@blank && zfs snapshot -r rpool/razorback/home@blank";
        options = {
          ashift = "12";
          autotrim = "on";
        };
        rootFsOptions = {
          acltype = "posixacl";
          canmount = "off";
          normalization = "formD";
          mountpoint = "none";
          relatime = "on";
          xattr = "sa";
        };
        datasets = {
          "razorback" = {
            type = "zfs_fs";
            mountpoint = "/persist";
            options.mountpoint = "legacy";
            options.compression = "zstd";
          };
          "razorback/root" = {
            type = "zfs_fs";
            mountpoint = "/";
            options.mountpoint = "legacy";
            options.compression = "zstd";
          };
          "razorback/nix" = {
            type = "zfs_fs";
            mountpoint = "/nix";
            options.mountpoint = "legacy";
            options.compression = "zstd";
          };
          "razorback/home" = {
            type = "zfs_fs";
            options.canmount = "off";
            options.mountpoint = "legacy";
          };
          "razorback/home/vlaci" = {
            type = "zfs_fs";
            options.mountpoint = "legacy";
            mountpoint = "/persist/home/vlaci";
          };
          "razorback/var" = {
            type = "zfs_fs";
            options.canmount = "off";
            options.mountpoint = "legacy";
          };
          "razorback/var/lib" = {
            type = "zfs_fs";
            options.canmount = "off";
            options.mountpoint = "legacy";
          };
          "razorback/var/lib/libvirt" = {
            type = "zfs_fs";
            options.mountpoint = "legacy";
            mountpoint = "/persist/var/lib/libvirt";
          };
        };
      };
    };
  };
}
hosts/razorback/disko-config.nix
./hosts/razorback/disko-config.nix
nixos/razorback
{
  lib,
  pkgs,
  config,
  ...
}:
 
{
  boot.initrd.systemd = {
    enable = true;
    emergencyAccess = true;
    services.revert-root = {
      after = [
        "zfs-import-rpool.service"
      ];
      wantedBy = [ "initrd.target" ];
      before = [
        "sysroot.mount"
      ];
      path = with pkgs; [
        zfs
      ];
      unitConfig = {
        DefaultDependencies = "no";
        ConditionKernelCommandLine = [ "!zfs_no_rollback" ];
      };
      serviceConfig.Type = "oneshot";
 
      script = ''
        zfs rollback -r rpool/${config.networking.hostName}/root@blank
      '';
    };
    # HACK: do not try to import pool before LUKS is opened. Otherwise
    # if passphrase is not entered in time, importing will time out.
    services.zfs-import-rpool.after = [ "cryptsetup.target" ];
 
    services.create-needed-for-boot-dirs = {
      after = lib.mkForce [ "revert-root.service" ];
    };
  };
}
nixos/razorback
{
  networking.hostId = "8425e349";
  boot.supportedFilesystems = [ "zfs" ];
 
  boot.zfs = {
    allowHibernation = true;
    devNodes = "/dev/mapper";
    forceImportRoot = false;
  };
 
  services.zfs.autoScrub.enable = true;
 
  virtualisation.docker.storageDriver = "zfs";
 
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
}
nixos/razorback
{
  networking.networkmanager.enable = true;
  _.persist.directories = [ "/etc/NetworkManager/system-connections" ];
}
nixos/razorback
{ pkgs, ... }:
 
{
  boot.tmp = {
    useTmpfs = true;
    tmpfsSize = "100%";
  };
  boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
  boot.kernelPackages = pkgs.linuxPackages_latest;
 
  services.hardware.openrgb = {
    enable = true;
    motherboard = "amd";
  };
 
  hardware.graphics = {
    ## radv: an open-source Vulkan driver from freedesktop
    enable32Bit = true;
 
    ## amdvlk: an open-source Vulkan driver from AMD
    extraPackages = [ pkgs.amdvlk ];
    extraPackages32 = [ pkgs.driversi686Linux.amdvlk ];
  };
 
  system.stateVersion = "24.11";
}
nixos/razorback
{ pkgs, ... }:
 
{
  programs.steam = {
    enable = true;
  };
 
  _.persist.allUsers.directories = [
    ".local/share/Steam"
    ".steam"
  ];
 
  environment.systemPackages = with pkgs; [
    protonup-qt
    gamemode
  ];
 
  nixpkgs.config.packageOverrides = pkgs: {
    linux-firmware = pkgs.linux-firmware.overrideAttrs (old: {
      version = "2025-05-03";
      src = pkgs.fetchgit {
        url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
        rev = "43dfb5fb64bb2707ba4fce1bc0fe835ad644b797";
        hash = "sha256-12ejuqtuYux7eK6lEAuH4/WUeVXT7+RXOx1qca6ge4Y=";
      };
    });
    mesa = pkgs.mesa.overrideAttrs (old: rec {
      version = "25.1.0-rc3";
      src = pkgs.fetchFromGitLab {
        domain = "gitlab.freedesktop.org";
        owner = "mesa";
        repo = "mesa";
        rev = "mesa-${version}";
        hash = "sha256-X1T4dqQSHhnoRXXjjyWrRu4u8RJ5h+PFBQYf/gUInm4=";
      };
      patches = [
        (pkgs.writeText "opencl.patch" ''
          diff --git a/meson.build b/meson.build
          index c150bff74ff..37fa7f0531b 100644
          --- a/meson.build
          +++ b/meson.build
          @@ -1850,7 +1850,7 @@ endif
 
           dep_clang = null_dep
           if with_clc or with_gallium_clover
          -  llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
          +  llvm_libdir = get_option('clang-libdir')
 
             dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
 
          diff --git a/meson.options b/meson.options
          index 82324617884..4bde97a8568 100644
          --- a/meson.options
          +++ b/meson.options
          @@ -738,3 +738,10 @@ option(
               'none', 'dri2'
             ],
           )
          +
          +option(
          +  'clang-libdir',
          +  type : 'string',
          +  value : ''',
          +  description : 'Locations to search for clang libraries.'
          +)
          diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
          index ab2c83556a8..a59e88e122f 100644
          --- a/src/gallium/targets/opencl/meson.build
          +++ b/src/gallium/targets/opencl/meson.build
          @@ -56,7 +56,7 @@ if with_opencl_icd
               configuration : _config,
               input : 'mesa.icd.in',
               output : 'mesa.icd',
          -    install : true,
          +    install : false,
               install_tag : 'runtime',
               install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
             )
          diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
          index 35833dc7423..41a95927cab 100644
          --- a/src/gallium/targets/rusticl/meson.build
          +++ b/src/gallium/targets/rusticl/meson.build
          @@ -63,7 +63,7 @@ configure_file(
             configuration : _config,
             input : 'rusticl.icd.in',
             output : 'rusticl.icd',
          -  install : true,
          +  install : false,
             install_tag : 'runtime',
             install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
           )
        '')
      ];
    });
  };
}
nixos/razorback