Rolling back Hyprland release using nixpkgs and not flakes

I am exploring how to selectively roll back a specific package to a prior release without flakes or home-manager so I am working with NixOS’s nixpkgs using configuration.nix only.

The current latest reslease of Hyprland is v47.2. My task is to roll back to v46.2. The reason why is that after the 47.2 upgrade, the compositor (or at least with my dotfiles) became completely FUBAR’ed. When I used NixOS’s built in generation roll back feature (at the UEFI bootloader), going back to Hyprland v46.2 worked perfectly. I could submit a bug report upstream but for now I wish to experiment with NixOS famous abilitiy to rollback packages using symlinks or similar methods.

I am relatively new to the NixOS world. I’ve consluted the official FAQ on pinning releases: FAQ/Pinning Nixpkgs - NixOS Wiki

I found a helpful website from the Nix community which provides code samples and suggested commands: Nix Package Versions

From that site, here was one such suggested code snippet:

let
    pkgs = import (builtins.fetchTarball {
        url = "https://github.com/NixOS/nixpkgs/archive/21808d22b1cda1898b71cf1a1beb524a97add2c4.tar.gz";
    }) {};

    myPkg = pkgs.hyprland;
in

nixpkgs didn’t like that and returned this error. I moved around the codesnippet around my configuration.nix.

Any idea what it is trying to say in greater detail and can anyone offer suggestions for what I could try next?

Error in full
       … while evaluating the attribute 'config'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12284:
       … while calling the 'seq' builtin
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12293:
       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: syntax error, unexpected LET
       at /home/evangelist/nixoslaptop-configs/configuration.nix:206:3:
          205|
          206|   let
             |   ^
          207|      pkgs = import (builtins.fetchTarball {
building Nix...
error:
       … while evaluating the attribute 'config'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12284:
       … while calling the 'seq' builtin
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12293:
       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: syntax error, unexpected LET
       at /home/evangelist/nixoslaptop-configs/configuration.nix:206:3:
          205|
          206|   let
             |   ^
          207|      pkgs = import (builtins.fetchTarball {
building the system configuration...
error:
       … while evaluating the attribute 'config.system.build.toplevel'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12284:
       … while calling the 'seq' builtin
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:12293:
       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: syntax error, unexpected LET
       at /home/evangelist/nixoslaptop-configs/configuration.nix:206:3:
          205|
          206|   let
             |   ^
          207|      pkgs = import (builtins.fetchTarball {

Here is the experimental branch on my GitHub repo showing the current state of my configuration.nix:

You can try overriding the version, but I’ll be honest, considering how sensitive hyprland is to specific versions of its dependencies, I don’t think you’ll have much luck doing so.

$ Hyprland --version
Hyprland 0.47.2 built from branch v0.47.2-b at commit 882f7ad7d2bbfc7440d0ccaef93b1cdd78e8e3ff  (version: bump to 0.47.2).
Date: 2025-02-02
Tag: v0.47.2, commits: 882f7ad7d2bbfc7440d0ccaef93b1cdd78e8e3ff
built against:
 aquamarine 0.7.2
 hyprlang 0.6.0
 hyprutils 0.5.0
 hyprcursor 0.1.11
 hyprgraphics 0.1.1

I think I could isolate and rollback these five additional dependencies if I could find out how to rollback packages in general with nixpkgs.