aboutsummaryrefslogtreecommitdiff
path: root/hosts/sagittarius
diff options
context:
space:
mode:
authorMiran Bastaja <miran.bastaja04@gmail.com>2024-07-06 06:48:40 +0200
committerMiran Bastaja <miran.bastaja04@gmail.com>2024-07-06 06:48:40 +0200
commitc97a1d66084aaf50ca816d9c482f296d31346f9f (patch)
treed03726dfb1edfa87b93ca42b9076658c7c50c940 /hosts/sagittarius
parentfed01b401d65e655f565fc5c6304f2ab0d758513 (diff)
formatting
Diffstat (limited to 'hosts/sagittarius')
-rw-r--r--hosts/sagittarius/default.nix5
-rw-r--r--hosts/sagittarius/hardware.nix29
-rw-r--r--hosts/sagittarius/home.nix5
-rw-r--r--hosts/sagittarius/ssh.nix8
-rw-r--r--hosts/sagittarius/web/acme.nix3
-rw-r--r--hosts/sagittarius/web/blog.nix8
-rw-r--r--hosts/sagittarius/web/default.nix3
-rw-r--r--hosts/sagittarius/web/git.nix3
-rw-r--r--hosts/sagittarius/web/matrix.nix18
-rw-r--r--hosts/sagittarius/web/mediadb.nix7
10 files changed, 62 insertions, 27 deletions
diff --git a/hosts/sagittarius/default.nix b/hosts/sagittarius/default.nix
index 946ecc7..2e45e03 100644
--- a/hosts/sagittarius/default.nix
+++ b/hosts/sagittarius/default.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
imports = [
# Include the results of the hardware scan.
./hardware.nix
@@ -21,7 +22,7 @@
matchConfig.Name = "enp1s0";
networkConfig.DHCP = "ipv4";
address = [ "2a01:4f9:c012:c7a7::/64" ];
- routes = [{ Gateway = "fe80::1"; }];
+ routes = [ { Gateway = "fe80::1"; } ];
};
};
diff --git a/hosts/sagittarius/hardware.nix b/hosts/sagittarius/hardware.nix
index 783b081..6b004d1 100644
--- a/hosts/sagittarius/hardware.nix
+++ b/hosts/sagittarius/hardware.nix
@@ -1,22 +1,33 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ modulesPath,
+ ...
+}:
{
- imports =
- [ (modulesPath + "/profiles/qemu-guest.nix")
- ];
+ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
- boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
+ boot.initrd.availableKernelModules = [
+ "ahci"
+ "xhci_pci"
+ "virtio_pci"
+ "virtio_scsi"
+ "sd_mod"
+ "sr_mod"
+ ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/34d333d4-2298-47c7-b015-5c3e2fd1a27e";
- fsType = "ext4";
- };
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/34d333d4-2298-47c7-b015-5c3e2fd1a27e";
+ fsType = "ext4";
+ };
swapDevices = [ ];
diff --git a/hosts/sagittarius/home.nix b/hosts/sagittarius/home.nix
index accbd5d..5b2bcd0 100644
--- a/hosts/sagittarius/home.nix
+++ b/hosts/sagittarius/home.nix
@@ -1,8 +1,9 @@
-{ flakeRoot, ... }: {
+{ flakeRoot, ... }:
+{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
- sharedModules = [{ imports = [ (flakeRoot + /share/home/minimal.nix) ]; }];
+ sharedModules = [ { imports = [ (flakeRoot + /share/home/minimal.nix) ]; } ];
users = {
root.home.stateVersion = "23.05";
diff --git a/hosts/sagittarius/ssh.nix b/hosts/sagittarius/ssh.nix
index 4951f3e..720f0c9 100644
--- a/hosts/sagittarius/ssh.nix
+++ b/hosts/sagittarius/ssh.nix
@@ -1,10 +1,14 @@
-{ ... }: {
+{ ... }:
+{
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
- AllowUsers = [ "ascella" "nongzhangren" ];
+ AllowUsers = [
+ "ascella"
+ "nongzhangren"
+ ];
};
};
}
diff --git a/hosts/sagittarius/web/acme.nix b/hosts/sagittarius/web/acme.nix
index 4cde574..0d27f29 100644
--- a/hosts/sagittarius/web/acme.nix
+++ b/hosts/sagittarius/web/acme.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
security.acme = {
acceptTerms = true;
defaults = {
diff --git a/hosts/sagittarius/web/blog.nix b/hosts/sagittarius/web/blog.nix
index 49ebb87..671674f 100644
--- a/hosts/sagittarius/web/blog.nix
+++ b/hosts/sagittarius/web/blog.nix
@@ -1,6 +1,10 @@
-{ inputs, pkgs, ... }: {
+{ inputs, pkgs, ... }:
+{
imports = [ ./acme.nix ];
- networking.firewall.allowedTCPPorts = [ 80 443 ];
+ networking.firewall.allowedTCPPorts = [
+ 80
+ 443
+ ];
services.nginx = {
enable = true;
diff --git a/hosts/sagittarius/web/default.nix b/hosts/sagittarius/web/default.nix
index 3fc702e..611d11b 100644
--- a/hosts/sagittarius/web/default.nix
+++ b/hosts/sagittarius/web/default.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
imports = [
./blog.nix
./matrix.nix
diff --git a/hosts/sagittarius/web/git.nix b/hosts/sagittarius/web/git.nix
index 732f7d0..adea3c3 100644
--- a/hosts/sagittarius/web/git.nix
+++ b/hosts/sagittarius/web/git.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
services.gitDaemon = {
enable = true;
repositories = [ "/srv/git/" ];
diff --git a/hosts/sagittarius/web/matrix.nix b/hosts/sagittarius/web/matrix.nix
index d230edc..c971ddc 100644
--- a/hosts/sagittarius/web/matrix.nix
+++ b/hosts/sagittarius/web/matrix.nix
@@ -19,11 +19,20 @@ let
}
}
'';
-in {
+in
+{
imports = [ ./acme.nix ];
- networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
- networking.firewall.allowedUDPPorts = [ 80 443 8448 ];
+ networking.firewall.allowedTCPPorts = [
+ 80
+ 443
+ 8448
+ ];
+ networking.firewall.allowedUDPPorts = [
+ 80
+ 443
+ 8448
+ ];
services.matrix-conduit = {
enable = true;
@@ -102,8 +111,7 @@ in {
};
upstreams."backend_conduit".servers = {
- "[::1]:${toString config.services.matrix-conduit.settings.global.port}" =
- { };
+ "[::1]:${toString config.services.matrix-conduit.settings.global.port}" = { };
};
};
}
diff --git a/hosts/sagittarius/web/mediadb.nix b/hosts/sagittarius/web/mediadb.nix
index 78d76cd..4ff83af 100644
--- a/hosts/sagittarius/web/mediadb.nix
+++ b/hosts/sagittarius/web/mediadb.nix
@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
networking.firewall.allowedTCPPorts = [ 5432 ];
services.postgresql = {
@@ -7,7 +8,9 @@
enableTCPIP = true;
enableJIT = true;
- settings = { password_encryption = "scram-sha-256"; };
+ settings = {
+ password_encryption = "scram-sha-256";
+ };
authentication = ''
# TYPE DATABASE USER ADDRESS METHOD