From d215844495f3133d2540e4fb76631517055b7242 Mon Sep 17 00:00:00 2001 From: randomuser Date: Thu, 28 Dec 2023 15:59:44 -0600 Subject: [PATCH] changes --- boxes/mainsail/default.nix | 84 +++------------------------- boxes/{virtbox => mainsail}/home.nix | 0 boxes/mainsail/server.nix | 80 ++++++++++++++++++++++++++ flake.nix | 14 +++++ 4 files changed, 101 insertions(+), 77 deletions(-) rename boxes/{virtbox => mainsail}/home.nix (100%) create mode 100644 boxes/mainsail/server.nix diff --git a/boxes/mainsail/default.nix b/boxes/mainsail/default.nix index f3b7209..e492f9b 100644 --- a/boxes/mainsail/default.nix +++ b/boxes/mainsail/default.nix @@ -1,6 +1,12 @@ { lib, config, pkgs, ...}: { imports = [ + ./hardware-configuration.nix + ./server.nix + ../../modules/bootstrap.nix + ../../modules/common.nix + ../../modules/x11.nix + ../../modules/discord.nix ]; boot.loader.grub.enable = true; @@ -8,42 +14,6 @@ networking.hostName = "mainsail"; - services.paperless = { - enable = true; - passwordFile = "/etc/paperless-password"; - port = 3004; - address = "localhost"; - extraConfig = { - PAPERLESS_URL = "https://paperless.beepboop.systems"; - }; - }; - - services.calibre-web.enable = true; - services.calibre-web.listen.port = 8080; - - programs.adb.enable = true; - users.users.usr.extraGroups = ["adbusers"]; - - services.openssh = { - enable = true; - ports = [2222]; - }; - - services.radicale = { - enable = true; - config = '' - [auth] - type = htpasswd - htpasswd_filename = radicale-passwd - htpasswd_encryption = plain - ''; - }; - - systemd.targets.sleep.enable = false; - systemd.targets.suspend.enable = false; - systemd.targets.hibernate.enable = false; - systemd.targets.hybrid-sleep.enable = false; - services.getty.greetingLine = " welcome to mainsail |`-:_ ,----....____ | `+. @@ -72,45 +42,5 @@ mepo ]; - systemd.services.paperless-web-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 3004:localhost:3004 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - serviceConfig = { - Restart = "on-failure"; - StartLimitInterval = 0; - StartLimitBurst = 10000; - RestartSec = "0s"; - }; - }; - - systemd.services.radicale-web-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 5232:localhost:5232 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - serviceConfig = { - Restart = "on-failure"; - StartLimitInterval = 0; - StartLimitBurst = 10000; - RestartSec = "0s"; - }; - }; - - systemd.services.internal-ssh-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 2222:localhost:2222 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - serviceConfig = { - Restart = "on-failure"; - StartLimitInterval = 0; - StartLimitBurst = 10000; - RestartSec = "0s"; - }; - }; + system.stateVersion = "23.11"; } diff --git a/boxes/virtbox/home.nix b/boxes/mainsail/home.nix similarity index 100% rename from boxes/virtbox/home.nix rename to boxes/mainsail/home.nix diff --git a/boxes/mainsail/server.nix b/boxes/mainsail/server.nix new file mode 100644 index 0000000..a3102eb --- /dev/null +++ b/boxes/mainsail/server.nix @@ -0,0 +1,80 @@ +{ lib, config, pkgs, ...}: +{ + services.paperless = { + enable = true; + passwordFile = "/etc/paperless-password"; + port = 3004; + address = "localhost"; + extraConfig = { + PAPERLESS_URL = "https://paperless.beepboop.systems"; + }; + }; + + services.calibre-web.enable = true; + services.calibre-web.listen.port = 8080; + + programs.adb.enable = true; + users.users.usr.extraGroups = ["adbusers"]; + + services.openssh = { + enable = true; + ports = [2222]; + }; + + services.radicale = { + enable = true; + config = '' + [auth] + type = htpasswd + htpasswd_filename = radicale-passwd + htpasswd_encryption = plain + ''; + }; + + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; + + systemd.services.paperless-web-bridge = { + script = '' + ${pkgs.openssh}/bin/ssh -v -NR 3004:localhost:3004 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems + ''; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "ankisyncd.service" ]; + serviceConfig = { + Restart = "on-failure"; + StartLimitInterval = 0; + StartLimitBurst = 10000; + RestartSec = "0s"; + }; + }; + + systemd.services.radicale-web-bridge = { + script = '' + ${pkgs.openssh}/bin/ssh -v -NR 5232:localhost:5232 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems + ''; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "ankisyncd.service" ]; + serviceConfig = { + Restart = "on-failure"; + StartLimitInterval = 0; + StartLimitBurst = 10000; + RestartSec = "0s"; + }; + }; + + systemd.services.internal-ssh-bridge = { + script = '' + ${pkgs.openssh}/bin/ssh -v -NR 2222:localhost:2222 -oExitOnForwardFailure=yes -p 55555 useracc@beepboop.systems + ''; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "ankisyncd.service" ]; + serviceConfig = { + Restart = "on-failure"; + StartLimitInterval = 0; + StartLimitBurst = 10000; + RestartSec = "0s"; + }; + }; +} diff --git a/flake.nix b/flake.nix index a2c7fb3..f1964c5 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,20 @@ } ]; }; + mainsail = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/mainsail + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.usr = import ./boxes/mainsail/home.nix; + } + ]; + }; }; }; }