I am porting my hyprland setup into a standalone flake where it, in theory, could be consumed by everyone. As part of the configuration, there are certain times when I will need to use the username or the home folder path.
Is there a way to reference the current user via Nix code without using an environment variable? I could, in theory, create a mandatory option where the user sets their username, but that doesn’t feel right and would be my fallback option if I don’t figure this out.
You probably want to write a module option or a function and have users of your flake set that option or pass the user as an argument. If memory serves there’s also home.user or a very similarly named option, but I don’t use HM.
For clarification, the username will be used in Nix or Home Manager configuration options. Not the flake itself. I am just using the flake as a consumption/distribution point. My question is more about Nix itself.