diff --git a/hive.nix b/hive.nix index a4114a7..33432d7 100644 --- a/hive.nix +++ b/hive.nix @@ -25,7 +25,6 @@ in { (import "${sources.agenix}/modules/age.nix") ./pinning.nix ./common - ./services ]; }; diff --git a/hosts/tohru/configuration.nix b/hosts/tohru/configuration.nix index 64d293a..e969ad7 100644 --- a/hosts/tohru/configuration.nix +++ b/hosts/tohru/configuration.nix @@ -5,6 +5,7 @@ [ ./hardware-configuration.nix ./home.nix + ../../services/evolution.nix ../../services/fonts.nix ../../services/steam.nix ./syncthing.nix @@ -15,10 +16,6 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.systemd-boot.editor = false; - programs.evolution.enable = true; - qenya.services.fonts.enable = true; - qenya.services.steam.enable = true; - networking.networkmanager.enable = true; i18n.defaultLocale = "en_GB.UTF-8"; diff --git a/hosts/yevaud/configuration.nix b/hosts/yevaud/configuration.nix index 7abce5a..289bff2 100644 --- a/hosts/yevaud/configuration.nix +++ b/hosts/yevaud/configuration.nix @@ -4,27 +4,12 @@ imports = [ ./hardware-configuration.nix ./home.nix + ./forgejo.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - qenya.services.forgejo = { - enable = true; - domain = "git.qenya.tel"; - stateDir = "/data/forgejo"; - }; - - services.nginx = { - enable = true; - virtualHosts = { - "git.katherina.rocks" = { - forceSSL = true; - enableACME = true; - locations."/".return = "301 https://git.qenya.tel$request_uri"; - }; - }; - }; - system.stateVersion = "23.11"; } + diff --git a/hosts/yevaud/forgejo.nix b/hosts/yevaud/forgejo.nix new file mode 100644 index 0000000..7c8f1ba --- /dev/null +++ b/hosts/yevaud/forgejo.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +{ + # TODO: email out + # TODO: interface customisation + + services = { + nginx = { + enable = true; + virtualHosts = { + "git.qenya.tel" = { + forceSSL = true; + enableACME = true; + locations."/".proxyPass = "http://[::1]:3000/"; + }; + "git.katherina.rocks" = { + forceSSL = true; + enableACME = true; + locations."/".return = "301 https://git.qenya.tel$request_uri"; + }; + }; + }; + + forgejo = { + enable = true; + stateDir = "/data/forgejo"; + settings = { + DEFAULT.APP_NAME = "git.qenya.tel"; + cache = { + ADAPTER = "twoqueue"; + HOST = ''{"size": 100, "recent_ratio": 0.25, "ghost_ratio": 0.5}''; + }; + database = { + DB_TYPE = "sqlite3"; + SQLITE_JOURNAL_MODE = "WAL"; + }; + security.LOGIN_REMEMBER_DAYS = 365; + server = { + DOMAIN = "git.qenya.tel"; + HTTP_PORT = 3000; + ROOT_URL = "https://git.qenya.tel/"; + }; + service.DISABLE_REGISTRATION = true; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; +} diff --git a/services/default.nix b/services/default.nix deleted file mode 100644 index 7c73723..0000000 --- a/services/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./fonts.nix - ./forgejo.nix - ./steam.nix - ]; -} \ No newline at end of file diff --git a/services/evolution.nix b/services/evolution.nix new file mode 100644 index 0000000..900fb38 --- /dev/null +++ b/services/evolution.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: + +{ + programs.evolution.enable = true; +} diff --git a/services/fonts.nix b/services/fonts.nix index 2845030..1820cd9 100644 --- a/services/fonts.nix +++ b/services/fonts.nix @@ -1,17 +1,7 @@ { config, lib, pkgs, ... }: -let - cfg = config.qenya.services.fonts; - inherit (lib) mkIf mkEnableOption; -in { - options.qenya.services.fonts = { - enable = mkEnableOption "Fonts"; - }; - - config = mkIf cfg.enable { - fonts.packages = with pkgs; [ - corefonts - ]; - }; + fonts.packages = with pkgs; [ + corefonts + ]; } diff --git a/services/forgejo.nix b/services/forgejo.nix deleted file mode 100644 index 8cca791..0000000 --- a/services/forgejo.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.qenya.services.forgejo; - inherit (lib) mkIf mkEnableOption mkOption types; -in -{ - options.qenya.services.forgejo = { - enable = mkEnableOption "Forgejo"; - domain = mkOption { - type = types.str; - }; - stateDir = mkOption { - type = types.str; - }; - }; - - config = mkIf cfg.enable { - # TODO: email out - # TODO: interface customisation - - services = { - nginx = { - enable = true; - virtualHosts = { - ${cfg.domain} = { - forceSSL = true; - enableACME = true; - locations."/".proxyPass = "http://[::1]:3000/"; - }; - }; - }; - - forgejo = { - enable = true; - stateDir = cfg.stateDir; - settings = { - DEFAULT.APP_NAME = cfg.domain; - cache = { - ADAPTER = "twoqueue"; - HOST = ''{"size": 100, "recent_ratio": 0.25, "ghost_ratio": 0.5}''; - }; - database = { - DB_TYPE = "sqlite3"; - SQLITE_JOURNAL_MODE = "WAL"; - }; - security.LOGIN_REMEMBER_DAYS = 365; - server = { - DOMAIN = cfg.domain; - HTTP_PORT = 3000; - ROOT_URL = "https://${cfg.domain}/"; - }; - service.DISABLE_REGISTRATION = true; - }; - }; - }; - - networking.firewall.allowedTCPPorts = [ 80 443 ]; - }; -} diff --git a/services/steam.nix b/services/steam.nix index 0a3c3d4..d59135c 100644 --- a/services/steam.nix +++ b/services/steam.nix @@ -1,21 +1,11 @@ { config, lib, pkgs, ... }: -let - cfg = config.qenya.services.steam; - inherit (lib) mkIf mkEnableOption; -in { - options.qenya.services.steam = { - enable = mkEnableOption "Steam"; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; }; - config = mkIf cfg.enable { - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - }; - - services.joycond.enable = true; - }; -} + services.joycond.enable = true; +} \ No newline at end of file