diff options
| author | seth <[email protected]> | 2023-04-07 14:56:04 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-07 20:00:57 -0400 |
| commit | 4ee540028b3bbc9671db597e761033865c7ed6d1 (patch) | |
| tree | 9f87ecd0890ad9b24a5ddbde936031d9d8f6aebe /flake.nix | |
| parent | 87a91a195fbd75970b80002535f5f45d6987d173 (diff) | |
add portablectl service
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -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;}; |
