fix: rustypaste-cli overlay and enabling regardless of server host

This commit is contained in:
Ceferino Patino 2025-08-08 16:53:11 -05:00
commit bd708269db
Signed by: c4patino
SSH key fingerprint: SHA256:9fQ9TsujGrdNNi76mnsu63v7dS5JOmHRZEqBOl49OR8
3 changed files with 13 additions and 11 deletions

View file

@ -58,8 +58,5 @@
};
};
overlays = with inputs; [
devshell.overlays.default
];
};
};
}

View file

@ -18,10 +18,10 @@ in {
enable = mkEnableOption "rustypaste";
};
config = mkIf cfg.enable {
config = {
environment.systemPackages = with pkgs; [rustypaste-cli];
systemd.services.rustypaste = {
systemd.services.rustypaste = mkIf cfg.enable {
description = "rustypaste";
wantedBy = ["multi-user.target"];
@ -42,7 +42,7 @@ in {
};
};
users = {
users = mkIf cfg.enable {
users.rustypaste = {
isSystemUser = true;
group = "rustypaste";
@ -51,7 +51,7 @@ in {
groups.rustypaste = {};
};
environment.etc."rustypaste/rustypaste.toml" = {
environment.etc."rustypaste/rustypaste.toml" = mkIf cfg.enable {
source = let
crypt = "${inputs.self}/secrets/crypt/";
in "${crypt}/rustypaste/server.toml";
@ -59,12 +59,12 @@ in {
mode = "0755";
};
systemd.tmpfiles.rules = [
systemd.tmpfiles.rules = mkIf cfg.enable [
"d /var/lib/rustypaste 2750 rustypaste rustypaste -"
];
networking.firewall.allowedTCPPorts = [port];
networking.firewall.allowedTCPPorts = mkIf cfg.enable [port];
${namespace}.services.storage.impermanence.folders = ["/var/lib/rustypaste"];
${namespace}.services.storage.impermanence.folders = mkIf cfg.enable ["/var/lib/rustypaste"];
};
}

View file

@ -0,0 +1,5 @@
{...}: final: prev: {
rustypaste-cli = prev.rustypaste-cli.overrideAttrs (oldAttrs: {
cargoBuildFeatures = ["use-native-certs"];
});
}