summaryrefslogtreecommitdiff
path: root/vms/configuration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'vms/configuration.nix')
-rw-r--r--vms/configuration.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/vms/configuration.nix b/vms/configuration.nix
new file mode 100644
index 0000000..c6e2cdf
--- /dev/null
+++ b/vms/configuration.nix
@@ -0,0 +1,25 @@
1{ pkgs, ... }:
2{
3 config = {
4 users.users.root.password = "";
5 users.mutableUsers = false;
6
7 environment.systemPackages = [
8 pkgs.curl
9 ];
10 systemd.services.django-hello-world = {
11 description = "An example django app";
12 wantedBy = [ "multi-user.target" ];
13 after = [ "network.target" ];
14
15 preStart = "rm -rf /var/lib/django_app/test_app && cp -a ${./test_django} /var/lib/django_app/test_app";
16 script =
17 let pythonWithDjango = pkgs.python3.withPackages (p: [ p.django ]);
18 in "cd /var/lib/django_app/test_app && ${pythonWithDjango}/bin/python manage.py runserver";
19 serviceConfig = {
20 WorkingDirectory = "/var/lib/django_app";
21 StateDirectory = "django_app";
22 };
23 };
24 };
25}