From bfa3b885c1755efdd45265849c3a36e87938c1fe Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 6 Aug 2024 11:41:49 +0300 Subject: [PATCH] Home : Remove fsight. --- container/Fsight.nix | 199 ---------------------------------------- host/home/Container.nix | 4 - 2 files changed, 203 deletions(-) delete mode 100644 container/Fsight.nix diff --git a/container/Fsight.nix b/container/Fsight.nix deleted file mode 100644 index d604cc1..0000000 --- a/container/Fsight.nix +++ /dev/null @@ -1,199 +0,0 @@ -{ container, pkgs, config, lib, util, ... }: with lib; let - cfg = config.container.module.fsight; - hostConfig = config; -in { - options = { - container.module.fsight = { - enable = mkEnableOption "Fsight temporary servers."; - address = mkOption { - default = "10.1.0.29"; - type = types.str; - }; - # port = mkOption { - # default = 3000; - # type = types.int; - # }; - # domain = mkOption { - # default = "git.${config.container.domain}"; - # type = types.str; - # }; - storage = mkOption { - default = "${config.container.storage}/fsight"; - type = types.str; - }; - }; - }; - - config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "git" - "cloud" - "postgres" - ]; - - containers.fsight = container.mkContainer cfg { - bindMounts = { - "/var/lib/gitea" = { - hostPath = "${cfg.storage}/git"; - isReadOnly = false; - }; - "/var/lib/postgresql" = { - hostPath = "${cfg.storage}/postgres"; - isReadOnly = false; - }; - "/var/lib/nextcloud" = { - hostPath = "${cfg.storage}/cloud"; - isReadOnly = false; - }; - }; - - config = { config, ... }: container.mkContainerConfig cfg { - environment.systemPackages = with pkgs; [ gitea postgresql ]; - - services.gitea = let - domain = "fmp-git.${hostConfig.container.domain}"; - in { - enable = true; - stateDir = "/var/lib/gitea"; - - database = { - type = "postgres"; - # host = postgre.address; - # port = postgre.port; - user = "gitea"; - name = "gitea"; - createDatabase = true; - }; - - settings = let - gcArgs = "--aggressive --no-cruft --prune=now"; - gcTimeout = 600; - in { - "service".DISABLE_REGISTRATION = true; - "log".LEVEL = "Error"; - "server" = { - DISABLE_SSH = true; - DOMAIN = domain; - HTTP_ADDR = cfg.address; - ROOT_URL = "https://${domain}"; - }; - "ui" = { - AMBIGUOUS_UNICODE_DETECTION = false; - }; - "service.explore" = { - REQUIRE_SIGNIN_VIEW = true; - }; - "repository" = { - DEFAULT_PRIVATE = "private"; - DEFAULT_PUSH_CREATE_PRIVATE = true; - }; - "repository.pull-request".DEFAULT_MERGE_STYLE = "rebase"; - "repository.issue".MAX_PINNED = 99999; - "cron" = { - ENABLED = true; - RUN_AT_START = true; - }; - "repo-archive".ENABLED = false; - "cron.update_mirrors".SCHEDULE = "@midnight"; - "cron.cleanup_actions".ENABLED = true; - "cron.git_gc_repos" = { - ENABLED = true; - SCHEDULE = "@midnight"; - TIMEOUT = gcTimeout; - ARGS = gcArgs; - }; - "git" = { - GC_ARGS = gcArgs; - }; - "git.timeout".GC = gcTimeout; - }; - }; - - services.nextcloud = let - domain = "fmp-cloud.${hostConfig.container.domain}"; - in { - enable = true; - # package = pkgs.nextcloud29; - hostName = domain; - # phpOptions = { - # memory_limit = lib.mkForce "20G"; - # }; - config = { - adminuser = "root"; - adminpassFile = "${pkgs.writeText "NextcloudPassword" "root"}"; - - # dbhost = postgres.address; - dbname = "nextcloud"; - dbpassFile = "${pkgs.writeText "NextcloudDbPassword" "nextcloud"}"; - dbtype = "pgsql"; - dbuser = "nextcloud"; - }; - extraApps = { - inherit (config.services.nextcloud.package.packages.apps) deck notes onlyoffice; - }; - extraAppsEnable = true; - settings = { - trusted_domains = [ domain ]; - trusted_proxies = [ hostConfig.container.module.proxy.address ]; - allow_local_remote_servers = true; - }; - }; - - services.postgresql = let - authentication = util.trimTabs '' - local all all trust - host all all 0.0.0.0/0 trust - ''; - - ensureDatabases = [ - "root" - "gitea" - "nextcloud" - ]; - - ensureUsers = [ - { - name = "root"; - ensureClauses = { - superuser = true; - createrole = true; - createdb = true; - }; - ensureDBOwnership = true; - } { - name = "gitea"; - ensureClauses = { - createrole = true; - createdb = true; - }; - ensureDBOwnership = true; - } { - name = "nextcloud"; - ensureClauses = { - createrole = true; - createdb = true; - }; - ensureDBOwnership = true; - } - ]; - in { - inherit authentication ensureDatabases ensureUsers; - - enable = true; - package = pkgs.postgresql_16; - dataDir = "/var/lib/postgresql/data/16"; - enableTCPIP = true; - - # NOTE: Debug mode. - # settings = { - # log_connections = true; - # log_destination = lib.mkForce "syslog"; - # log_disconnections = true; - # log_statement = "all"; - # logging_collector = true; - # }; - }; - }; - }; - }; -} diff --git a/host/home/Container.nix b/host/home/Container.nix index f251e0e..b394f67 100644 --- a/host/home/Container.nix +++ b/host/home/Container.nix @@ -1,7 +1,4 @@ { ... }: { - # TODO: Remove this with Fsight container. ALSO!!! delete images and everything before that. - virtualisation.docker.enable = true; - container = { enable = true; @@ -11,7 +8,6 @@ ddns.enable = true; dns.enable = true; download.enable = true; - fsight.enable = true; git.enable = true; # ISSUE: hdd.enable = true; home.enable = true;