Change the location of Hyprland config file in NixOS?

In my system currently, I have Hyprland that uses the default location of config file:

~/.config/hypr/hyprland.conf

but I want to have the configuration inside my dotfiles. I saw that hyprland provides an option to change the location with --config option (reference: Hyprland Wik/Cofiguring and Mankier/Hyprland).

But running hyprland --config ~/.dotfiles/path-to-config/hyprland.conf only opens a new window with a new hyprland session (?).

I tried to check whether NixOS has an option for it or not but NixOS Option Search page shows up nothing on changing the configuration.

Is there a way to change the location of Hyprland config file in NixOS?

What about using Home Manager?

Alternatively, you could probably overlay it to use wrapProgram in postInstall.

Something like:

nixpkgs.overlays = [
  (self: super: {
    hyprland = super.hyprland.override {
      nativeBuildInputs = [ pkgs.makeWrapper ];
      postInstall = ''
        wrapProgram --add-flags "/home/USER/CONFIG-PATH" "$out/bin/hyprland"
      '';
    };
  })
];

Untested, as I’m writing from a phone currently.

makeWrapper is already in nativeBuildInputs so you could even drop that part of the override.

Also it should be overrideAttrs, not override, and it should be appended to the existing postInstall.