Merge pull request #63204 from michaelpj/imp/localtime-upstream
localtime: use upstream unit, fix polkit rules
This commit is contained in:
commit
d672ceeb68
@ -28,33 +28,16 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, systemd, polkit, fetchFromGitHub, buildGoPackage, m4}:
|
{ stdenv, fetchFromGitHub, buildGoPackage, m4 }:
|
||||||
|
|
||||||
buildGoPackage rec {
|
buildGoPackage rec {
|
||||||
name = "localtime-2017-11-07";
|
name = "localtime-2017-11-07";
|
||||||
@ -11,18 +11,20 @@ buildGoPackage rec {
|
|||||||
};
|
};
|
||||||
goPackagePath = "github.com/Stebalien/localtime";
|
goPackagePath = "github.com/Stebalien/localtime";
|
||||||
|
|
||||||
buildInputs = [ systemd polkit m4 ];
|
buildInputs = [ m4 ];
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=$(out)" ];
|
makeFlags = [
|
||||||
|
"PREFIX=${placeholder "out"}"
|
||||||
|
"BINDIR=${placeholder "bin"}/bin"
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd go/src/${goPackagePath}
|
cd go/src/${goPackagePath}
|
||||||
make localtimed
|
make $makeFlags
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $bin/bin
|
make install $makeFlags
|
||||||
install -Dm555 localtimed $bin/bin
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user