apognu / tuigreet

Graphical console greeter for greetd
GNU General Public License v3.0
986 stars 45 forks source link

NixOS instructions improvement. #58

Closed gcoakes closed 2 years ago

gcoakes commented 2 years ago

While it looks like it will probably work, the NixOS instructions make use of a non-standard mechanism for referencing the bin directory of a package. lib.makeBinPath is intended to be used to create a colon separated list of directories that contain executables in package. I think the correct instructions would be:

{ pkgs, lib, ... }:
{
  services.greetd = {
    enable = true;
    settings = {
      default_session = {
        command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
        user = "greeter";
      };
    };
  };
}
apognu commented 2 years ago

NixOS instructions were contributed by @ymatsiuk, maybe they could chip in if they are still around.

I don't use NixOS and wouldn't know which is the best way to go.

In any case, I'm willing to accept a PR if you can.

ymatsiuk commented 2 years ago

Both work the same way. This is the generated greetd config part:

~ ❯ cat /nix/store/xl677mpvdjf1vigwnsksd44ambv2p77y-greetd.toml
[default_session]
command = "/nix/store/8lsdism0dzg7whng5szllc676vd4haiv-tuigreet-0.7.2/bin/tuigreet --time --cmd /nix/store/cm7vr2h1aha8zxq31q4fq9qi1x2fi35v-sway-run"
user = "greeter"
...

I was not aware of standard mechanism (nixpkgs has a lot of examples that use both approaches) and lib.makeBinPath was suggested multiple times while I was submitting PRs into nixpkgs using ${pkgs.foo}/bin/foo. Since the example of greetd module suggests using this pattern I think it makes sense to be consistent with official doc. Thanks @gcoakes 👍🏻

apognu commented 2 years ago

Thanks to both of you for raising the issue, for your input and for the PR.