File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description=monacle (Next.js) via Nix Node.js 20.20.0
3+ Wants=network-online.target
4+ After=network-online.target
5+
6+ [Service]
7+ Type=simple
8+ User=monad
9+ Group=monad
10+
11+ Environment="PORT=3000"
12+ Environment=NODE_ENV=production
13+ Environment="NIX_CONFIG=experimental-features = nix-command flakes"
14+ EnvironmentFile=/etc/monacle/monacle.env
15+
16+ # infra checkout 위치 (systemd WorkingDirectory와는 별개)
17+ Environment="INFRA_REPO=https://github.com/monadimi/monacle.git"
18+ Environment="INFRA_BRANCH=main"
19+ Environment="INFRA_ROOT=/home/monad/apps/monacle/infra-src"
20+ Environment="INFRA_DIR=/home/monad/apps/monacle/infra-src/infra"
21+
22+ WorkingDirectory=/home/monad/apps/monacle
23+
24+ ExecStartPre=/usr/bin/bash -lc 'set -euo pipefail; \
25+ umask 022; \
26+ if [ ! -d "$INFRA_ROOT/.git" ]; then \
27+ rm -rf "$INFRA_ROOT"; \
28+ /usr/bin/git clone --depth 1 --branch "$INFRA_BRANCH" "$INFRA_REPO" "$INFRA_ROOT"; \
29+ else \
30+ cd "$INFRA_ROOT"; \
31+ /usr/bin/git fetch origin "$INFRA_BRANCH" --depth 1; \
32+ /usr/bin/git reset --hard "origin/$INFRA_BRANCH"; \
33+ /usr/bin/git clean -fd; \
34+ fi; \
35+ /nix/var/nix/profiles/default/bin/nix build "$INFRA_DIR"#monacle-run --out-link /home/monad/apps/monacle/nix-monacle \
36+ '
37+
38+ ExecStart=/usr/bin/bash -lc 'set -euo pipefail; exec /home/monad/apps/monacle/nix-monacle/bin/monacle-run'
39+
40+ Restart=always
41+ RestartSec=3
42+
43+ NoNewPrivileges=true
44+ PrivateTmp=true
45+ ProtectSystem=strict
46+ ProtectHome=false
47+ LockPersonality=true
48+ RestrictRealtime=true
49+ RestrictSUIDSGID=true
50+
51+ UMask=0077
52+ ReadWritePaths=/home/monad/apps/monacle /var/cache/monacle /var/log/monacle /home/monad/apps/monacle/infra-src
53+
54+ [Install]
55+ WantedBy=multi-user.target
You can’t perform that action at this time.
0 commit comments