summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-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;};