A common and reliable pattern in service unit files is thus:
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
| ## Builder for NixOS configurations defined at the end of the file to be built into KVM VM's | |
| { system ? builtins.currentSystem }: | |
| let | |
| loadcfg = cfgfile: { config, pkgs, ...}: { | |
| imports = [ <nixos/modules/virtualisation/qemu-vm.nix> cfgfile ]; | |
| config = { | |
| networking.extraHosts = '' | |
| 176.32.0.254 template | |
| ''; |
| #!/usr/bin/python | |
| import numpy | |
| import pyaudio | |
| import re | |
| import sys | |
| WIDTH = 79 | |
| BOOST = 1.0 |
| import tornado.ioloop | |
| import tornado.web | |
| from tornado.httpserver import HTTPServer | |
| from tornado.options import options, define | |
| from tornado.netutil import bind_unix_socket | |
| class MainHandler(tornado.web.RequestHandler): | |
| def get(self): | |
| self.write("Hello, world") | |
| def shutdown(graceful=True): | |
| """Shut down the application. | |
| If a graceful stop is requested, waits for all of the IO loop's | |
| handlers to finish before shutting down the rest of the process. | |
| We impose a 10 second timeout. | |
| """ | |
| ioloop = tornado.ioloop.IOLoop.instance() | |
| def final_stop(): |