From 205c5eb5443fe8292751f0de17356fb03af7c159 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Wed, 4 Oct 2023 11:11:30 +0200 Subject: [PATCH] feat(compute01): Deploy RStudio server on rstudio.dgnum.eu --- machines/compute01/_configuration.nix | 1 + machines/compute01/rstudio-server.nix | 35 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 machines/compute01/rstudio-server.nix diff --git a/machines/compute01/_configuration.nix b/machines/compute01/_configuration.nix index 47c6e00..95a5f34 100644 --- a/machines/compute01/_configuration.nix +++ b/machines/compute01/_configuration.nix @@ -14,6 +14,7 @@ lib.extra.mkConfig { "mastodon" "nextcloud" "outline" + "rstudio-server" "satosa" "zammad" ]; diff --git a/machines/compute01/rstudio-server.nix b/machines/compute01/rstudio-server.nix new file mode 100644 index 0000000..a85cb82 --- /dev/null +++ b/machines/compute01/rstudio-server.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: + +let + host = "rstudio.dgnum.eu"; + port = 19000; +in { + services.rstudio-server = { + enable = true; + rserverExtraConfig = '' + www-port = ${builtins.toString port} + ''; + + package = pkgs.rstudioServerWrapper.override { + packages = with pkgs.rPackages; [ ggplot2 rmarkdown dplyr ]; + }; + }; + + users.users.ruser = { + isNormalUser = true; + hashedPassword = + "$6$pTXXVh8NfE.M8VPc$q0fFh3Y7Y0DauLCcZLgJzFciq1wkjoHmO61XpOrZLH3a1M32ZzOMbjx2XMm2QxrUncbx6hGerY/lD8rQ8InS4."; + }; + + dgn-access-control.users.ruser = [ "jemagius" ]; + + # services.nginx.virtualHosts.${host} = { + # enableACME = true; + # forceSSL = true; + # + # locations."/" = { + # proxyPass = "http://localhost:${builtins.toString port}"; + # proxyWebsockets = true; + # }; + # }; +}