kasei: split services into services
directory
This commit is contained in:
parent
7193a12ac2
commit
b1650e91a6
@ -1,5 +1,14 @@
|
||||
{ config, lib, pkgs, inputs, specialArgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./services/docker.nix
|
||||
./services/libvirtd.nix
|
||||
./services/logiops.nix
|
||||
./services/postgres.nix
|
||||
./services/stable-diffusion.nix
|
||||
./services/tailscale.nix
|
||||
];
|
||||
|
||||
machineVars = {
|
||||
headless = false;
|
||||
gaming = true;
|
||||
@ -37,13 +46,7 @@
|
||||
hostName = "kasei";
|
||||
networkmanager.enable = true;
|
||||
interfaces.enp6s0.useDHCP = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 7860 ];
|
||||
allowedUDPPorts = [ config.services.tailscale.port ];
|
||||
checkReversePath = "loose";
|
||||
trustedInterfaces = [ "tailscale0" ];
|
||||
};
|
||||
firewall.enable = true;
|
||||
hostId = "f0660cef";
|
||||
};
|
||||
|
||||
@ -56,32 +59,6 @@
|
||||
tailscale.enable = true;
|
||||
};
|
||||
|
||||
# TODO: remove when merged: https://github.com/NixOS/nixpkgs/pull/167388
|
||||
systemd = {
|
||||
services = {
|
||||
logid = {
|
||||
description = "Logitech Configuration Daemon";
|
||||
startLimitIntervalSec = 0;
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.logiops}/bin/logid";
|
||||
User = "root";
|
||||
ExecReload = "/bin/kill -HUP $MAINPID";
|
||||
Restart="on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
libvirtd.enable = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||
initrd.kernelModules = [ ];
|
||||
@ -134,6 +111,5 @@
|
||||
cpu.amd.updateMicrocode = true;
|
||||
enableRedistributableFirmware = true;
|
||||
keyboard.zsa.enable = true;
|
||||
logitech.wireless.enable = true;
|
||||
};
|
||||
}
|
||||
|
4
hosts/kasei/services/docker.nix
Normal file
4
hosts/kasei/services/docker.nix
Normal file
@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
}
|
4
hosts/kasei/services/libvirtd.nix
Normal file
4
hosts/kasei/services/libvirtd.nix
Normal file
@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
}
|
23
hosts/kasei/services/logiops.nix
Normal file
23
hosts/kasei/services/logiops.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# TODO: remove when merged: https://github.com/NixOS/nixpkgs/pull/167388
|
||||
systemd.services = {
|
||||
logid = {
|
||||
description = "Logitech Configuration Daemon";
|
||||
startLimitIntervalSec = 0;
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.logiops}/bin/logid";
|
||||
User = "root";
|
||||
ExecReload = "/bin/kill -HUP $MAINPID";
|
||||
Restart="on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hardware.logitech.wireless.enable = true;
|
||||
}
|
13
hosts/kasei/services/postgres.nix
Normal file
13
hosts/kasei/services/postgres.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableTCPIP = true;
|
||||
authentication = ''
|
||||
# tailscale xps
|
||||
host all all 100.94.170.21/32 md5
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 5432 ];
|
||||
}
|
25
hosts/kasei/services/stable-diffusion.nix
Normal file
25
hosts/kasei/services/stable-diffusion.nix
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
systemd.services.sdwebui = {
|
||||
description = "Stable Diffusion Web UI";
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
path = with pkgs; [
|
||||
nix
|
||||
git
|
||||
nix-output-monitor
|
||||
bash
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "/home/h7x4/sd-webui/run.sh";
|
||||
User = "h7x4";
|
||||
ExecReload = "/bin/kill -HUP $MAINPID";
|
||||
Restart="on-failure";
|
||||
WorkingDirectory = "/home/h7x4/sd-webui";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 7860 ];
|
||||
}
|
10
hosts/kasei/services/tailscale.nix
Normal file
10
hosts/kasei/services/tailscale.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [ config.services.tailscale.port ];
|
||||
checkReversePath = "loose";
|
||||
trustedInterfaces = [ "tailscale0" ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user