mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 19:45:54 +00:00
013b848346
devmon refuses to run as root. Instead, we now run it as a user service, and enable udisks2 in order to perform the mounts.
31 lines
649 B
Nix
31 lines
649 B
Nix
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.devmon;
|
|
|
|
in {
|
|
options = {
|
|
services.devmon = {
|
|
enable = mkOption {
|
|
default = false;
|
|
description = ''
|
|
Whether to enable devmon, an automatic device mounting daemon.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.user.services.devmon = {
|
|
description = "devmon automatic device mounting daemon";
|
|
wantedBy = [ "default.target" ];
|
|
path = [ pkgs.udevil pkgs.procps pkgs.udisks2 pkgs.which ];
|
|
serviceConfig.ExecStart = "${pkgs.udevil}/bin/devmon";
|
|
};
|
|
|
|
services.udisks2.enable = true;
|
|
};
|
|
}
|