Trying to make my file for a general user (trying to stay anonomus)

Hi!
I have a file that has a command that requires a string input of my username.

I have a folder containing all config files used for creating and managing different home-manager users.

how could I use this folder to avoid putting in my specific username in the command? I’m trying to stay anonymous on github, so I want users only referenced in one location. (also to make it a general system anyone can use.)

the command in question: services.getty.autologinUser = "username";

File structure (file containing command highlighted):

any help would be appreciated!

I found a solution, though it’s not one I particularly like…
services.getty.autologinUser = builtins.getEnv "USER";

1 Like

My default solution for avoiding identity-linking via config repos is to use VCS-ignored files with the relevant data, which I then import. Not sure whether flakes like either of the two solutions (I don’t use flakes); I guess you could have an extra input to the flake that is not published?

1 Like

You can also go the dependency inversion route and make your project just a set of modules, with a custom custom.mainuser option which you then use anywhere you need a handle on the username.

Your actual configuration.nix on your real machine would then just look something like:

{ inputs, ... }: {
  imports = [
    inputs.mysystemflake.nixosModules.default
  ];

  custom.mainUser = "matsunoki";
}

Since it’s so small there would then never really be a reason to put it on GitHub.

You can of course also use whatever non-flake mechanism you prefer for depending on something.

1 Like