forked from Drift/pvv-nixos-config
Compare commits
1 Commits
richara-ad
...
nettsiden-
Author | SHA1 | Date | |
---|---|---|---|
2f9bda6fd6 |
@@ -10,10 +10,9 @@
|
|||||||
#./services/keycloak.nix
|
#./services/keycloak.nix
|
||||||
|
|
||||||
# TODO: set up authentication for the following:
|
# TODO: set up authentication for the following:
|
||||||
# ./services/website.nix
|
./services/website.nix
|
||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
./services/gitea/default.nix
|
./services/gitea/default.nix
|
||||||
./services/webmail
|
|
||||||
# ./services/mediawiki.nix
|
# ./services/mediawiki.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
6
hosts/bekkalokk/services/nettsiden/default.nix
Normal file
6
hosts/bekkalokk/services/nettsiden/default.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
let
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
53
hosts/bekkalokk/services/nettsiden/package.nix
Normal file
53
hosts/bekkalokk/services/nettsiden/package.nix
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
src,
|
||||||
|
php82,
|
||||||
|
php82Extensions,
|
||||||
|
sqlite,
|
||||||
|
git,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
pname = "nettsiden";
|
||||||
|
version = "0.1.0";
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
php82
|
||||||
|
(with php82Extensions; [
|
||||||
|
iconv
|
||||||
|
mbstring
|
||||||
|
pdo_mysql
|
||||||
|
pdo_sqlite
|
||||||
|
])
|
||||||
|
sqlite
|
||||||
|
git
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
export PHPHOST=localhost
|
||||||
|
export PHPPORT=1080
|
||||||
|
alias runDev='php -S $PHPHOST:$PHPPORT -d error_reporting=E_ALL -d display_errors=1 -t www/'
|
||||||
|
|
||||||
|
# Prepare dev environment with sqlite and config files
|
||||||
|
test -e pvv.sqlite || sqlite3 pvv.sqlite < dist/pvv.sql
|
||||||
|
test -e sql_config.php || cp -v dist/sql_config_example.php sql_config.php
|
||||||
|
|
||||||
|
test -e dataporten_config.php || cp -v dist/dataporten_config.php dataporten_config.php
|
||||||
|
|
||||||
|
test -e composer.phar || curl -O https://getcomposer.org/composer.phar
|
||||||
|
|
||||||
|
if [ ! -f lib/OAuth2-Client/OAuth2Client.php ] ; then
|
||||||
|
echo Missing git submodules. Installing...
|
||||||
|
(set -x; git submodule update --init --recursive) || exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d vendor ] ; then
|
||||||
|
php composer.phar install || exit $?
|
||||||
|
cp -v dist/authsources_example.php vendor/simplesamlphp/simplesamlphp/config/authsources.php
|
||||||
|
cp -v dist/saml20-idp-remote.php vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
|
||||||
|
cp -v vendor/simplesamlphp/simplesamlphp/config-templates/config.php vendor/simplesamlphp/simplesamlphp/config/config.php
|
||||||
|
sed -e "s/'trusted.url.domains' => array()/'trusted.url.domains' => array(\"$PHPHOST:$PHPPORT\")/g" < vendor/simplesamlphp/simplesamlphp/config-templates/config.php > vendor/simplesamlphp/simplesamlphp/config/config.php
|
||||||
|
ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
@@ -1,6 +0,0 @@
|
|||||||
{ config, values, pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./roundcube.nix
|
|
||||||
];
|
|
||||||
}
|
|
@@ -1,34 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.services.roundcube;
|
|
||||||
domain = "roundcube.pvv.ntnu.no";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services.roundcube = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.roundcube.withPlugins (plugins: [ plugins.persistent_login plugins.thunderbird_labels plugins.contextmenu plugins.custom_from]);
|
|
||||||
dicts = with pkgs.aspellDicts; [ en en-science en-computers nb nn fr de it];
|
|
||||||
maxAttachmentSize = 20;
|
|
||||||
# this is the url of the vhost, not necessarily the same as the fqdn of the mailserver
|
|
||||||
hostName = domain;
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
# starttls needed for authentication, so the fqdn required to match
|
|
||||||
# the certificate
|
|
||||||
$config['enable_installer'] = false;
|
|
||||||
$config['default_host'] = "ssl://imap.pvv.ntnu.no";
|
|
||||||
$config['default_port'] = 993;
|
|
||||||
#$config['smtp_server'] = "tls://smtp.pvv.ntnu.no";
|
|
||||||
#$config['smtp_port'] = 25;
|
|
||||||
$config['smtp_server'] = "ssl://smtp.pvv.ntnu.no";
|
|
||||||
$config['smtp_port'] = 465;
|
|
||||||
# $config['smtp_user'] = "%u@pvv.ntnu.no";
|
|
||||||
$config['mail_domain'] = "pvv.ntnu.no";
|
|
||||||
$config['smtp_user'] = "%u";
|
|
||||||
# $config['smtp_pass'] = "%p";
|
|
||||||
$config['support_url'] = "";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
users.users.richarah = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "";
|
|
||||||
extraGroups = [
|
|
||||||
"wheel"
|
|
||||||
"drift"
|
|
||||||
];
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
docker
|
|
||||||
];
|
|
||||||
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
""
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
Reference in New Issue
Block a user