Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

activator: fix IO streams in systemd socket

+9 -2
+7 -1
cmd/sower-activator/handler.go
··· 4 4 "bufio" 5 5 "encoding/json" 6 6 "fmt" 7 + "io" 7 8 "log/slog" 8 9 "net" 9 10 "path/filepath" ··· 21 22 22 23 // NewConnectionHandler creates a new handler for a connection. 23 24 func NewConnectionHandler(conn net.Conn, allowedUIDs, allowedGIDs []uint32) *ConnectionHandler { 25 + return NewConnectionHandlerWithWriter(conn, conn, allowedUIDs, allowedGIDs) 26 + } 27 + 28 + // NewConnectionHandlerWithWriter creates a new handler with explicit response writer. 29 + func NewConnectionHandlerWithWriter(conn net.Conn, writer io.Writer, allowedUIDs, allowedGIDs []uint32) *ConnectionHandler { 24 30 return &ConnectionHandler{ 25 31 conn: conn, 26 32 allowedUIDs: allowedUIDs, 27 33 allowedGIDs: allowedGIDs, 28 - encoder: json.NewEncoder(conn), 34 + encoder: json.NewEncoder(writer), 29 35 } 30 36 } 31 37
+1 -1
cmd/sower-activator/main.go
··· 64 64 } 65 65 defer conn.Close() 66 66 67 - handler := NewConnectionHandler(conn, uids, gids) 67 + handler := NewConnectionHandlerWithWriter(conn, os.Stdout, uids, gids) 68 68 handler.Handle() 69 69 } 70 70
+1
nix/nixos/activator.nix
··· 75 75 Type = "simple"; 76 76 StandardInput = "socket"; 77 77 StandardOutput = "socket"; 78 + StandardError = "journal"; 78 79 79 80 # Build allowed GIDs list at runtime (group GIDs may not be known at eval time) 80 81 ExecStart =