summaryrefslogtreecommitdiff
path: root/home-manager/systemd/llama.nix
diff options
context:
space:
mode:
authorJasper Ras <jaspert.ras@gmail.com>2024-11-09 14:26:34 +0100
committerJasper Ras <jaspert.ras@gmail.com>2024-11-09 14:26:34 +0100
commit3fce1b5d9350c116270111e92f2d993e1b518d4d (patch)
treedaada43eb23df53d6a0df3622d4bfe913851d1f3 /home-manager/systemd/llama.nix
parent4211ed3b82be9af26460a0a8d88dce9ce319bb47 (diff)
Inline home-manager
Diffstat (limited to 'home-manager/systemd/llama.nix')
-rw-r--r--home-manager/systemd/llama.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/home-manager/systemd/llama.nix b/home-manager/systemd/llama.nix
new file mode 100644
index 0000000..96c0d62
--- /dev/null
+++ b/home-manager/systemd/llama.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+let
+ homeDir = "${config.home.homeDirectory}";
+ llamaDir = "${homeDir}/.llama";
+ apache2Dir = "${homeDir}/.apache2";
+ httpd = "${pkgs.apacheHttpd}/bin/httpd";
+in {
+ systemd.user.services.llama = {
+ Unit.Description = "Hostnet Apache LLama";
+ Service = {
+ ExecStartPre = "${llamaDir}/se-vhosts.sh";
+ ExecStart = "${httpd} -f ${llamaDir}/apache2.conf -DFOREGROUND";
+ RestartSec = "2";
+ Restart = "always";
+ Environment = [
+ "APACHE_RUN_DIR=${apache2Dir}"
+ "APACHE_CONFDIR=${llamaDir}"
+ "APACHE_RUN_USER=${config.home.username}"
+ "APACHE_RUN_GROUP=${config.home.username}"
+ "APACHE_PID_FILE=${homeDir}/.apache2.pid"
+ "APACHE_RUN_FILE=${apache2Dir}/run"
+ "APACHE_LOCK_FILE=${apache2Dir}/lock"
+ "APACHE_LOG_FILE=${apache2Dir}/log"
+ ];
+ };
+ Install.WantedBy = [ "default.target" ];
+ };
+}