Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config file #156

Open
mock1328 opened this issue Sep 26, 2024 · 4 comments
Open

config file #156

mock1328 opened this issue Sep 26, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mock1328
Copy link

IMO, would be great if we had a /etc/greetd/tuigreet.toml config file alongside running with args.
Options line gets too long and ugly very quickly, managing config file could be easier

@apognu
Copy link
Owner

apognu commented Sep 26, 2024

Thanks for the issue. I was actually thinking about doing something like it, since this also bothers me.

I'll categorize this as a feature request and I'll probably work on it for 0.11.

@apognu apognu added the enhancement New feature or request label Sep 26, 2024
@apognu apognu self-assigned this Sep 26, 2024
@apognu apognu added this to the 0.11.0 milestone Sep 26, 2024
@apognu
Copy link
Owner

apognu commented Oct 16, 2024

This is being worked on and, on the relevant branch, it is at a stage where it can be tested and polished. I'll still ask that, if someone wanted to give it a go, they be careful, it is still very much a work in progress.

I plan on having this ready for 0.11 (so not the next version).

@Hugo-Heagren
Copy link

Hugo-Heagren commented Nov 5, 2024

I have used tuigreet from NixOS before, and have just set it up again (thus finding my way here, finding to my great delight this had already been handled 😃). It would be really good if there was a structured way of setting configs from the configuration.nix -- more structured than just writing a string. Has that been thought of? Should I open a new issue?

I'm imaging that something like this would write the config file in the relevant way (perhaps overwriting everything previously, perhaps only setting the keys which are explicit set herein):

services.greetd = {
  enable = true;
  settings = {
    default_session = {
      command = "${lib.makeBinPath [pkgs.greetd.tuigreet] }/tuigreet";
      user = "greeter";
    }; 
    vt = 1;
  };
 # Not sure where the best place for this would be. Perhaps not inside greetd? IDK.
  tuigreet.config = {
    time = true;
    asterisks = true;
    command = "bash";
    # Note structured theme, I think this would be handy for applying
    # system-wide colour schemes
    theme = {
      border = magenta;
      text = cyan;
      prompt = green;
      time = red;
      action = blue;
      button = yellow;
      container = black;
      input = red;
    };
  };
};

ETA: I've just seen that the implementation uses a TOML file. The decision was made not to include a write-to-TOML function in the nix builtins, though there is a toTOML function function in nix-std.

@apognu
Copy link
Owner

apognu commented Nov 6, 2024

@Hugo-Heagren Yes, this is ongoing (albeit taking a bit more time than I anticipated) and will use TOML indeed.

As far as custom Nix derivations for tuigreet config, I am not really sure what I can do here since I do not maintain the packaging for various distributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants