diff --git a/config/fudo/mail-container.nix b/config/fudo/mail-container.nix index c918116..18ae663 100644 --- a/config/fudo/mail-container.nix +++ b/config/fudo/mail-container.nix @@ -141,7 +141,7 @@ in rec { ]; imports = [ - ../local.nix + ./mail.nix ]; environment = { diff --git a/config/local.nix b/config/local.nix deleted file mode 100644 index cd6fee6..0000000 --- a/config/local.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, config, pkgs, ... }: - -with lib; { - imports = [ - ./fudo/acme-for-hostname.nix - ./fudo/authentication.nix - ./fudo/backplane - ./fudo/chat.nix - ./fudo/client/dns.nix - ./fudo/common.nix - ./fudo/dns.nix - ./fudo/garbage-collector.nix - ./fudo/git.nix - ./fudo/grafana.nix - ./fudo/ipfs.nix - ./fudo/kdc.nix - ./fudo/ldap.nix - ./fudo/local-network.nix - ./fudo/mail.nix - ./fudo/mail-container.nix - ./fudo/minecraft-server.nix - ./fudo/netinfo-email.nix - ./fudo/node-exporter.nix - ./fudo/password.nix - ./fudo/postgres.nix - ./fudo/prometheus.nix - ./fudo/secure-dns-proxy.nix - ./fudo/slynk.nix - ./fudo/system.nix - ./fudo/vpn.nix - ./fudo/webmail.nix - - ./informis/cl-gemini.nix - - ../fudo/profiles - ../fudo/sites - ]; -} diff --git a/config/postgresql_11.nix b/config/postgresql_11.nix deleted file mode 100644 index e2238cb..0000000 --- a/config/postgresql_11.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - - catLines = builtins.concatStringsSep "\n"; - - userOpts = { config, ... }: { - options = { - passwd = mkOption { - type = types.str; - description = '' - The password of a given user. - ''; - }; - - databases = mkOption { - type = types.attrsOf types.lines; - default = {}; - description = '' - A list of databases to which this user should have access. - ''; - }; - }; - }; - - grantDatabaseAccess = username: database: '' - GRANT CONNECT ON DATABASE ${database} TO USER ${username}; - GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA ${database} TO USER ${username}; - ''; - - createUserSql = username: userOpts: '' - CREATE ROLE ${username} ENCRYPTED PASSWORD ${userOpts.passwd}; - ${catLines (map (grantDatabaseAccess username) userOpts.databases)} - ''; - - createDatabaseSql = database: dbOpts: '' - CREATE DATABASE ${database}; - USE ${database}; - ''; - - dataPath = /srv + ("/" + config.networking.hostName); - -in { - - options = { - fudo.postgresql = { - - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable the PostgreSQL server for Fudo services. - ''; - }; - - databases = mkOption { - type = types.attrsOf types.lines; - default = {}; - description = '' - A map of database_name => database_defn. - ''; - }; - - users = mkOption { - type = with types; attrsOf (submodule userOpts); - default = {}; - description = '' - A map of user_name => { user_attributes }. - ''; - }; - }; - }; -} diff --git a/defaults.nix b/defaults.nix index 548b676..555f956 100644 --- a/defaults.nix +++ b/defaults.nix @@ -8,7 +8,7 @@ in { imports = [ ./hardware-configuration.nix ./packages/local.nix - ./config/local.nix + ./config ]; diff --git a/hosts/france.nix b/hosts/france.nix index 4b0bd93..7c03bb1 100644 --- a/hosts/france.nix +++ b/hosts/france.nix @@ -578,6 +578,12 @@ in { }; }; + fudo.ipfs = { + enable = true; + users = [ "niten" "reaper" ]; + api-address = "/ip4/${host_ipv4}/tcp/5001"; + }; + ### # Minecraft ### diff --git a/users/niten.nix b/users/niten.nix index 707d88e..c616c4b 100644 --- a/users/niten.nix +++ b/users/niten.nix @@ -17,7 +17,7 @@ in { rm = "rm --one-file-system --preserve-root"; }; - extraInit = '' + initExtra = '' case $TERM in screen|xterm*|rxvt*) shopt -s checkwinsize