-
-
Save rgrunbla/8f6325ad69d6dbe45a17393026064917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, ... }: | |
{ | |
networking.hostName = "nixos"; | |
networking.domain = "foobar.tech"; | |
i18n.defaultLocale = "fr_FR.UTF-8"; | |
i18n.supportedLocales = [ "fr_FR.UTF-8/UTF-8" ]; | |
time.timeZone = "Europe/Paris"; | |
console.keyMap = "fr-bepo"; | |
services.openssh.enable = true; | |
services.openssh.permitRootLogin = "yes"; | |
services.timesyncd.enable = lib.mkDefault true; | |
environment.systemPackages = with pkgs; [ ]; | |
users.mutableUsers = false; | |
users.users.root.hashedPassword = | |
"REDACTED"; | |
system.stateVersion = "20.03"; | |
systemd.services.foobar = { | |
description = "The foobar django server"; | |
wantedBy = [ "multi-user.target" ]; | |
after = [ "network.target" ]; | |
preStart = "rm -rf /var/lib/foobar && cp -a ${ | |
./foobar | |
} /var/lib/foobar"; | |
script = let pythonWithDjango = pkgs.python3.withPackages (p: [ (p.django.override { withGdal = true; }) p.djangorestframework p.psycopg2 ]); | |
in "cd /var/lib/foobar && ${pythonWithDjango}/bin/python manage.py runserver"; | |
serviceConfig = { | |
WorkingDirectory = "/var/lib/foobar"; | |
StateDirectory = "foobar"; | |
}; | |
}; | |
# services.nginx.enable = true; | |
# services.nginx.virtualHosts."foobar.tech" = { | |
# forceSSL = true; | |
# enableACME = true; | |
# root = "/var/www/foobar.tech"; | |
# }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment