summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-04-07 14:56:04 -0400
committerseth <[email protected]>2023-04-07 20:00:57 -0400
commit4ee540028b3bbc9671db597e761033865c7ed6d1 (patch)
tree9f87ecd0890ad9b24a5ddbde936031d9d8f6aebe
parent87a91a195fbd75970b80002535f5f45d6987d173 (diff)
add portablectl service
-rw-r--r--flake.nix31
1 files changed, 30 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 81352e5..0fbd81c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -96,12 +96,12 @@
inherit (pkgs.pkgsStatic.stdenv) cc;
in "${cc}/bin/${cc.targetPrefix}cc";
});
+ cmd = "${teawiebot-smol}/bin/teawiebot";
in
{
inherit teawiebot;
container = let
inherit (pkgs.dockerTools) buildLayeredImage caCertificates;
- cmd = "${teawiebot-smol}/bin/teawiebot";
in
buildLayeredImage {
name = "teawiebot";
@@ -109,6 +109,35 @@
contents = [caCertificates];
config.Cmd = ["${cmd}"];
};
+ service = let
+ inherit (pkgs) cacert portableService;
+ service = pkgs.writeTextFile {
+ name = "teawiebot.service";
+ text = ''
+ [Unit]
+ Description=portable service for teawiebot
+
+ [Service]
+ DynamicUser=yes
+ ExecStart="${cmd}"
+
+ [Install]
+ WantedBy=multi-user.target
+ '';
+ };
+ in
+ portableService {
+ inherit (teawiebot) pname;
+ inherit (teawiebot-smol) version;
+ description = "portable service for teawiebot!";
+ units = [service];
+ symlinks = [
+ {
+ object = "${cacert}/etc/ssl";
+ symlink = "/etc/ssl";
+ }
+ ];
+ };
}
// {default = self.packages.${system}.teawiebot;};