Merge pull request #61729 from worldofpeace/geoclue/no-root

nixos/geoclue2: don't run as root
This commit is contained in:
worldofpeace 2019-06-04 23:11:34 -04:00 committed by GitHub
commit 094e150804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -188,6 +188,19 @@ in
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
systemd.services."geoclue".restartTriggers = [
config.environment.etc."geoclue/geoclue.conf".source

View File

@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
"-Ddemo-agent=${if withDemoAgent then "true" else "false"}"
"--sysconfdir=/etc"
"-Dsysconfdir_install=${placeholder "out"}/etc"
"-Ddbus-srv-user=geoclue"
] ++ optionals stdenv.isDarwin [
"-D3g-source=false"
"-Dcdma-source=false"