mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/geoclue2: don't run as root
This commit is contained in:
parent
3f488fd36b
commit
82135b6c81
2 changed files with 14 additions and 0 deletions
|
@ -188,6 +188,19 @@ in
|
||||||
|
|
||||||
systemd.packages = [ package ];
|
systemd.packages = [ package ];
|
||||||
|
|
||||||
|
users.users.geoclue = {
|
||||||
|
isSystemUser = true;
|
||||||
|
home = "/var/lib/geoclue";
|
||||||
|
group = "geoclue";
|
||||||
|
description = "Geoinformation service";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.geoclue = {};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /var/lib/geoclue 0755 geoclue geoclue"
|
||||||
|
];
|
||||||
|
|
||||||
# restart geoclue service when the configuration changes
|
# restart geoclue service when the configuration changes
|
||||||
systemd.services."geoclue".restartTriggers = [
|
systemd.services."geoclue".restartTriggers = [
|
||||||
config.environment.etc."geoclue/geoclue.conf".source
|
config.environment.etc."geoclue/geoclue.conf".source
|
||||||
|
|
|
@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
|
||||||
"-Ddemo-agent=${if withDemoAgent then "true" else "false"}"
|
"-Ddemo-agent=${if withDemoAgent then "true" else "false"}"
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
"-Dsysconfdir_install=${placeholder "out"}/etc"
|
"-Dsysconfdir_install=${placeholder "out"}/etc"
|
||||||
|
"-Ddbus-srv-user=geoclue"
|
||||||
] ++ optionals stdenv.isDarwin [
|
] ++ optionals stdenv.isDarwin [
|
||||||
"-D3g-source=false"
|
"-D3g-source=false"
|
||||||
"-Dcdma-source=false"
|
"-Dcdma-source=false"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue