1
Fork 0

Set up intray server setup + change catgirl config

This commit is contained in:
Matei Adriel 2024-02-02 02:42:03 +01:00
parent ff97c8886b
commit e37b3bc363
No known key found for this signature in database
7 changed files with 58 additions and 7 deletions

View file

@ -177,7 +177,7 @@
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.${user} = import ./home/${hostname}.nix; home-manager.users.${user} = import ./home/${hostname}.nix;
home-manager.extraSpecialArgs = specialArgs system; home-manager.extraSpecialArgs = specialArgs system // { inherit hostname; };
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
stylix.homeManagerIntegration.followSystem = false; stylix.homeManagerIntegration.followSystem = false;
@ -220,7 +220,7 @@
mkHomeConfig = { system, hostname }: mkHomeConfig = { system, hostname }:
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = specialArgs system; extraSpecialArgs = specialArgs system // { inherit hostname; };
modules = [ ./home/${hostname}.nix ]; modules = [ ./home/${hostname}.nix ];
}; };
in in

View file

@ -1,9 +1,10 @@
# Catgirl is a terminal based irc client # Catgirl is a terminal based irc client
{ config, pkgs, ... }: { config, pkgs, hostname ? "hermes", ... }:
let let
mkCatgirlNetwork = network: '' mkCatgirlNetwork = network: ''
host = ${network}.irc.moonythm.dev host = ${network}.irc.moonythm.dev
save = ${network} save = ${network}
user = ${hostname}
port = 6697 port = 6697
''; '';
in in

View file

@ -14,7 +14,6 @@ let
# {{{ self management # {{{ self management
# NOTE: using `pkgs.system` before `module.options` is evaluated # NOTE: using `pkgs.system` before `module.options` is evaluated
# leads to infinite recursion! # leads to infinite recursion!
inputs.intray.nixosModules.x86_64-linux.default
inputs.smos.nixosModules.x86_64-linux.default inputs.smos.nixosModules.x86_64-linux.default
inputs.tickler.nixosModules.x86_64-linux.default inputs.tickler.nixosModules.x86_64-linux.default
# }}} # }}}

View file

@ -7,4 +7,8 @@
dnsProvider = "porkbun"; dnsProvider = "porkbun";
environmentFile = config.sops.secrets.porkbun_secrets.path; environmentFile = config.sops.secrets.porkbun_secrets.path;
}; };
environment.persistence."/persist/state".directories = [
"/var/lib/acme"
];
} }

View file

@ -7,6 +7,7 @@
./services/syncthing.nix ./services/syncthing.nix
./services/whoogle.nix ./services/whoogle.nix
./services/pounce.nix ./services/pounce.nix
./services/intray.nix
./filesystems ./filesystems
./hardware ./hardware
]; ];

View file

@ -0,0 +1,49 @@
{ config, ... }:
let
username = "prescientmoon";
apiHost = "api.intray.moonythm.dev";
apiPort = 8402;
webHost = "intray.moonythm.dev";
webPort = 8403;
in
{
# {{{ Import intray module
imports = [
# We patch out the `intray` module to allow manual configuration for nginx
a:
# NOTE: using `pkgs.system` before `module.options` is evaluated
# leads to infinite recursion!
let m = inputs.intray.nixosModules.x86_64-linux.default a;
in
{
inherit (m) options;
config = { inherit (m.config) systemd; };
}
];
# }}}
# {{{ Configure intray
services.intray.production = {
enable = true;
api-server = {
enable = true;
hosts = [ apiHost ];
port = apiPort;
admins = [ username ];
};
web-server = {
enable = true;
hosts = [ webHost ];
port = webPort;
api-url = "https://${apiHost}";
};
};
# }}}
# {{{ Networking & storage
services.nginx.virtualHosts.${apiHost} = config.satellite.proxy apiPort;
services.nginx.virtualHosts.${webHost} = config.satellite.proxy webPort;
environment.persistence."/persist/state".directories = [
"/www/intray/production/data"
];
# }}}
}

View file

@ -27,7 +27,4 @@ in
}; };
services.nginx.virtualHosts."search.moonythm.dev" = config.satellite.proxy port; services.nginx.virtualHosts."search.moonythm.dev" = config.satellite.proxy port;
environment.persistence."/persist/state".directories = [
"/var/lib/acme"
];
} }