Last active
January 20, 2023 18:28
-
-
Save meowgorithm/3e039e2414a6f3e01b156e574b3a6b48 to your computer and use it in GitHub Desktop.
Soft Serve on NixOS at DigitalOcean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
pkgs, | |
modulesPath, | |
lib, | |
... | |
}: let | |
sshdPort = 8888; | |
softServePort = 22; | |
in { | |
imports = | |
lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix | |
++ [ | |
(modulesPath + "/virtualisation/digital-ocean-config.nix") | |
]; | |
networking.firewall.allowedTCPPorts = [sshdPort softServePort]; | |
services.openssh.ports = [sshdPort]; | |
environment.systemPackages = with pkgs; [ | |
alejandra | |
duf | |
git | |
helix | |
htop | |
nil | |
soft-serve | |
tmux | |
tree | |
]; | |
security.sudo.wheelNeedsPassword = false; | |
users.users.christian = { | |
isNormalUser = true; | |
extraGroups = ["wheel"]; | |
}; | |
systemd.services = { | |
soft-serve = { | |
description = "Soft Serve"; | |
wantedBy = ["multi-user.target"]; | |
restartIfChanged = true; | |
environment = { | |
SOFT_SERVE_PORT = builtins.toString softServePort; | |
SOFT_SERVE_HOST = "git.rocha.is"; | |
}; | |
serviceConfig = { | |
Type = "simple"; | |
Restart = "always"; | |
RestartSec = "1"; | |
WorkingDirectory = "/soft"; | |
ExecStart = '' | |
${pkgs.soft-serve}/bin/soft serve | |
''; | |
}; | |
}; | |
}; | |
system.stateVersion = "22.11"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment