Skip to content

services.xserver.xautolock: add module #25578

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

Merged
merged 1 commit into from
May 19, 2017
Merged

services.xserver.xautolock: add module #25578

merged 1 commit into from
May 19, 2017

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented May 7, 2017

Motivation for this change

I currently use xautolock for autolocking things.
However I'd like to have a declarative module rather than a hacked configuration in the sessionCommands option of the displayManager.

I tested it using the following configurations:

{ #...
  services.xserver = {
    # configuration with disabled notifier (no notification published before autolock)
    enable = true;
    displayManager.slim.enable = false;
    displayManager.sddm.enable = true;
    desktopManager.default = "xfce";
    desktopManager.xterm.enable = false;
    desktopManager.xfce.enable = true;
    xautolock = {
      enable = true;
      time = 1;
      enableNotifier = false;
    };
  };
}
{
  # ...
  services.xserver = {
    # configuration with enabled notifier (notification published before autolock)
    enable = true;
    displayManager.slim.enable = false;
    displayManager.sddm.enable = true;
    desktopManager.default = "xfce";
    desktopManager.xterm.enable = false;
    desktopManager.xfce.enable = true;
    xautolock = {
      enable = true;
      time = 1;
      locker = "i3lock";
      enableNotifier = true;
      notifier = "notify-send 'foo'";
    };
  };
}

I tested it using the following command:

NIXOS_CONFIG=`pwd`/vmtest.nix nixos-rebuild -I nixpkgs=$HOME/Projects/nixpkgs/ build-vm

Note:

I checked the xsession file and it seemed to work for me, however it would be nice if someone could test it before merging :-)

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
    • Linux
  • 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.

Sorry, something went wrong.

@pSub pSub added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label May 7, 2017
@pSub pSub requested review from fpletz and removed request for fpletz May 7, 2017 12:05
};

locker = mkOption {
example = "i3lock -i /path/to/img";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a sane default locker option for instances i3lock?

@Ma27
Copy link
Member Author

Ma27 commented May 9, 2017 via email

@Ma27
Copy link
Member Author

Ma27 commented May 9, 2017

@Mic92 done. xlock is now the default value.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Ma27 Maximilian Bosch
@Ma27
Copy link
Member Author

Ma27 commented May 10, 2017

is there anyone else who might be able to test this? :-)

@kamilchm
Copy link
Member

Basic setup works for me.

@Ma27
Copy link
Member Author

Ma27 commented May 12, 2017

is there anything missing from my side or can this be merged? :-)

@Mic92 Mic92 merged commit 2f22bbe into NixOS:master May 19, 2017
@Mic92
Copy link
Member

Mic92 commented May 19, 2017

Thanks!

@Ma27 Ma27 deleted the module/xautolock branch May 21, 2017 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants