Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {config, pkgs, lib, ...}:
- let
- mach-nix = import (builtins.fetchGit { url = "https://github.com/DavHau/mach-nix"; ref = "refs/tags/3.4.0"; }) {};
- tgpy = mach-nix.mkPython { requirements = ''tgpy
- requests
- prettytable
- opencv-python
- pillow
- base65536
- aiohttp''; };
- in {
- containers.tgpy = {
- privateNetwork = true;
- hostAddress = "192.168.100.1";
- localAddress = "192.168.100.2";
- config = {config, pkgs, ...}: {
- system.stateVersion = "21.11";
- users.users.tgpy = {
- isNormalUser = true;
- };
- environment.systemPackages = with pkgs; [ tgpy wget curl ghc rustc ];
- systemd.services.tgpy = {
- enable = true;
- wantedBy = [ "multi-user.target" ];
- after = [ "network-online.target" ];
- wants = [ "network-online.target" ];
- description = "tgpy userbot autostart";
- serviceConfig = {
- User = "tgpy";
- Group = "users";
- Type = "simple";
- WorkingDirectory = "/home/tgpy";
- ExecStart = ''${tgpy}/bin/tgpy'';
- #ExecStartPre = ''/bin/sh -c "until /run/wrappers/bin/ping -c1 t.me; do /run/current-system/sw/bin/sleep 1; done;"'';
- ExecStartPre = ''/bin/sh -c "/run/current-system/sw/bin/sleep 30"'';
- };
- };
- };
- autoStart = true;
- ephemeral = true;
- bindMounts = {
- "/home/tgpy/.config" = {
- hostPath = "/var/config/";
- isReadOnly = false;
- };
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement