Skip to content

Commit

Permalink
Add mongosh to system packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucus16 committed Oct 13, 2024
1 parent 0b064d6 commit 33e94ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nix/services/kn/shared.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
{ config, lib, pkgs, ... }:
let
cfg = config.kn.shared;

knshell = pkgs.runCommandNoCC "knshell" { buildInputs = [ pkgs.makeWrapper ]; } ''
makeWrapper ${pkgs.kninfra}/bin/shell $out/bin/knshell \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: ''--set "${n}" "${v}"'') cfg.env)}
'';

in {
options.kn.shared = with lib; {
enable = mkEnableOption "KN DB";
Expand All @@ -26,13 +32,7 @@ in {
# TODO: limit access to mongodb
services.mongodb.enable = true;
users.groups.infra = {};
# socket activation
environment.systemPackages = [(
pkgs.runCommandNoCC "knshell" { buildInputs = [ pkgs.makeWrapper ]; } ''
makeWrapper ${pkgs.kninfra}/bin/shell $out/bin/knshell \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: ''--set "${n}" "${v}"'') cfg.env)}
''
)];
environment.systemPackages = [ pkgs.mongosh knshell ];
systemd.services = lib.mkIf cfg.initialDB {
giedo = rec {
requires = [ "kn_initial_state.service" ];
Expand Down

0 comments on commit 33e94ec

Please sign in to comment.