mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01: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.
30 lines
649 B
Nix
30 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;
|
|
};
|
|
}
|