libstore: allow for multiple daemon sockets with preference
this will let us configure more than one socket to connect/bind to, which in turn lets us use posix acls on sockets for access control. we will also need something like this for the final rpc transition. Change-Id: I9c39f14906e9bf809055ab5c94bf687745b4f69e
This commit is contained in:
@@ -1,4 +1,41 @@
|
||||
foreach config : [ 'nix-daemon.socket', 'nix-daemon.service', 'nix-daemon@.service' ]
|
||||
lix_daemon_socket_units = []
|
||||
|
||||
# legacy sockets are handled specially for graceful fallback if nixos module
|
||||
# updates are not applied in lockstep with the socket split updates for lix.
|
||||
lix_daemon_socket_units += [ 'nix-daemon.socket' ]
|
||||
configure_file(
|
||||
input : 'daemon.socket.in',
|
||||
output : lix_daemon_socket_units[-1],
|
||||
install : true,
|
||||
install_dir : prefix / 'lib/systemd/system',
|
||||
install_mode : 'rw-r--r--',
|
||||
configuration : {
|
||||
'storedir' : store_dir,
|
||||
'localstatedir' : state_dir,
|
||||
'bindir' : bindir,
|
||||
'protocol' : 'legacy',
|
||||
'kind' : 'combined',
|
||||
'path' : 'socket',
|
||||
'dirmode' : '0755',
|
||||
},
|
||||
)
|
||||
configure_file(
|
||||
input : 'daemon@.service.in',
|
||||
output : 'nix-daemon@.service',
|
||||
install : true,
|
||||
install_dir : prefix / 'lib/systemd/system',
|
||||
install_mode : 'rw-r--r--',
|
||||
configuration : {
|
||||
'storedir' : store_dir,
|
||||
'localstatedir' : state_dir,
|
||||
'bindir' : bindir,
|
||||
'conflicts' : ' '.join(lix_daemon_socket_units),
|
||||
'protocol' : 'legacy',
|
||||
'kind' : 'combined',
|
||||
},
|
||||
)
|
||||
|
||||
foreach config : [ 'nix-daemon.service' ]
|
||||
configure_file(
|
||||
input : config + '.in',
|
||||
output : config,
|
||||
@@ -9,6 +46,7 @@ foreach config : [ 'nix-daemon.socket', 'nix-daemon.service', 'nix-daemon@.servi
|
||||
'storedir' : store_dir,
|
||||
'localstatedir' : state_dir,
|
||||
'bindir' : bindir,
|
||||
'conflicts' : ' '.join(lix_daemon_socket_units),
|
||||
},
|
||||
)
|
||||
endforeach
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=Nix Daemon
|
||||
Documentation=man:nix-daemon https://docs.lix.systems/manual/lix/stable
|
||||
Conflicts=nix-daemon.socket
|
||||
Conflicts=@conflicts@
|
||||
RequiresMountsFor=@storedir@
|
||||
RequiresMountsFor=@localstatedir@
|
||||
RequiresMountsFor=@localstatedir@/nix/db
|
||||
|
||||
Reference in New Issue
Block a user