diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-07-22 01:16:01 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-07-22 01:16:01 +0200 |
commit | 8eb07d94a12f0fb8d4a8f15043aedc8cadd7c676 (patch) | |
tree | 647e9737344bef2206b082222d7ff87307fd91c2 /vms/configuration.nix | |
download | Nixies-8eb07d94a12f0fb8d4a8f15043aedc8cadd7c676.tar.gz Nixies-8eb07d94a12f0fb8d4a8f15043aedc8cadd7c676.tar.zst Nixies-8eb07d94a12f0fb8d4a8f15043aedc8cadd7c676.zip |
Initial commit
Diffstat (limited to 'vms/configuration.nix')
-rw-r--r-- | vms/configuration.nix | 25 |
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 | } | ||