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

yabar: add module #32582

Merged
merged 1 commit into from Feb 9, 2018
Merged

yabar: add module #32582

merged 1 commit into from Feb 9, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Dec 12, 2017

Motivation for this change

To make the configuration of yabar more pleasant and easier to
validate, a NixOS module will be quite helpful.

An example config could look like this:

{
  programs.yabar = {
    enable = true;
    bars.top.indicators.exec = "YA_DATE";
  };
}

The module adds a user-owned systemd service which runs yabar after
starting up X.

NOTE: I'd be happy to contribute a testcase, but I don't know how to properly talk to a user unit using $m->waitForUnit(); as this will be needed to check if yabar is really running by the currently authenticated user.

The change can be tested with the newly introduced test or the following vm config:

{
  yabartest = { pkgs, ... }: {
    users.extraUsers.vm = {
      password = "vm";
      isNormalUser = true;
      extraGroups = [ "wheel" ];
    };

    services.xserver = {
      enable = true;
      desktopManager = {
        default = "none";
        xterm.enable = false;
      };
      windowManager = {
        i3.enable = true;
        default = "i3";
      };
    };

    programs.yabar = {
      enable = true;
      package = pkgs.yabar-unstable;

      bars = {
        top = {
          indicators = {
            ya_workspace = {
              exec = "YABAR_WORKSPACE";
            };
            ya_date = {
              exec = "YABAR_DATE";
            };
          };
        };
        bottom = {
          position = "bottom";
          indicators = {
            ya_workspace = {
              exec = "YABAR_WORKSPACE";
              align = "right";
              extra = {
                fixed-size = 300;
                internal-prefix = "abcdef";
              };
            };
          };
        };
      };
    };
  };
}
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Ma27
Copy link
Member Author

Ma27 commented Dec 17, 2017

@fpletz I applied the changes you suggested on friday :-)

@Ma27
Copy link
Member Author

Ma27 commented Dec 30, 2017

@orivej is there anything else to do for me? %)

To make the configuration of `yabar` more pleasant and easier to
validate, a NixOS module will be quite helpful.

An example config could look like this:

```
{
  programs.yabar = {
    enable = true;
    bars.top.indicators.exec = "YA_DATE";
  };
}
```

The module adds a user-controlled systemd service which runs `yabar` after
starting up X.
@Ma27
Copy link
Member Author

Ma27 commented Jan 4, 2018

I just rewrote the test as #32845 has been merged

@Ma27
Copy link
Member Author

Ma27 commented Jan 14, 2018

ping?

@fpletz fpletz merged commit 3748f3a into NixOS:master Feb 9, 2018
@Ma27 Ma27 deleted the yabar-module branch February 9, 2018 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants