Skip to content

Instantly share code, notes, and snippets.

@meowgorithm
Last active January 20, 2023 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meowgorithm/3e039e2414a6f3e01b156e574b3a6b48 to your computer and use it in GitHub Desktop.
Save meowgorithm/3e039e2414a6f3e01b156e574b3a6b48 to your computer and use it in GitHub Desktop.
Soft Serve on NixOS at DigitalOcean
{
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