localtime: use upstream unit and fix polkit rule installation
Also don't allocate a user - the upstream unit uses DynamicUser.
This commit is contained in:
parent
66da10e80f
commit
0073c1fb0b
@ -22,33 +22,16 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.geoclue2.enable = true;
|
services.geoclue2.enable = true;
|
||||||
|
|
||||||
# so polkit will pick up the rules
|
# We use the 'out' output, since localtime has its 'bin' output
|
||||||
environment.systemPackages = [ pkgs.localtime ];
|
# first, so that is what we get if we use the derivation bare.
|
||||||
|
# Install the polkit rules.
|
||||||
users.users = [{
|
environment.systemPackages = [ pkgs.localtime.out ];
|
||||||
name = "localtimed";
|
# Install the systemd unit.
|
||||||
description = "Taskserver user";
|
systemd.packages = [ pkgs.localtime.out ];
|
||||||
}];
|
|
||||||
|
|
||||||
systemd.services.localtime = {
|
systemd.services.localtime = {
|
||||||
description = "localtime service";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
partOf = [ "geoclue.service "];
|
serviceConfig.Restart = "on-failure";
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Restart = "on-failure";
|
|
||||||
# TODO: make it work with dbus
|
|
||||||
#DynamicUser = true;
|
|
||||||
Nice = 10;
|
|
||||||
User = "localtimed";
|
|
||||||
PrivateTmp = "yes";
|
|
||||||
PrivateDevices = true;
|
|
||||||
PrivateNetwork = "yes";
|
|
||||||
NoNewPrivileges = "yes";
|
|
||||||
ProtectSystem = "strict";
|
|
||||||
ProtectHome = true;
|
|
||||||
ExecStart = "${pkgs.localtime}/bin/localtimed";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,10 @@ buildGoPackage rec {
|
|||||||
|
|
||||||
buildInputs = [ m4 ];
|
buildInputs = [ m4 ];
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=$(out)" "BINDIR=$(bin)/bin" ];
|
makeFlags = [
|
||||||
|
"PREFIX=${placeholder "out"}"
|
||||||
|
"BINDIR=${placeholder "bin"}/bin"
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd go/src/${goPackagePath}
|
cd go/src/${goPackagePath}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user