Compare commits
3 Commits
2ba961bfa8
...
ac34f029ed
| Author | SHA1 | Date | |
|---|---|---|---|
| ac34f029ed | |||
| 8d04add7dc | |||
| d7a07cebf5 |
@@ -60,7 +60,7 @@ in
|
|||||||
description = "Timer for cleaning up old snapshots on standby";
|
description = "Timer for cleaning up old snapshots on standby";
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "daily";
|
OnCalendar = "hourly";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
54
flake.lock
generated
54
flake.lock
generated
@@ -62,11 +62,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761247699,
|
"lastModified": 1761420385,
|
||||||
"narHash": "sha256-yMQCRsD6F6eyt0ckCbAHH3W59mav7rbn9hwfUWd+rHU=",
|
"narHash": "sha256-bfBSmKNHry6L/NGBmdymmEA5P/XLzuLDRw2kqaHDsLc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "browser-previews",
|
"repo": "browser-previews",
|
||||||
"rev": "5fc2e2d88f87b46b72767fd6fc2d4af7d983f2c7",
|
"rev": "c5eae237f38310ed4c9bea0f6c19e0fe04ad61ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -153,11 +153,11 @@
|
|||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761217923,
|
"lastModified": 1761647152,
|
||||||
"narHash": "sha256-usNQQSwmaHdHiRttmH4no/CVTUyEP+sIoAkkRMgdu0g=",
|
"narHash": "sha256-zuciw00Auu3tNquWiznfIVxgVZepLsaIqC7cwC1+GQ4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "ethereum.nix",
|
"repo": "ethereum.nix",
|
||||||
"rev": "8c3827adc7e1ea75b43ad3d7c4f9ab9acc3b6273",
|
"rev": "7046ba564c47d7cb298493175ea3c3e9b1186c2e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -218,11 +218,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760813311,
|
"lastModified": 1760948891,
|
||||||
"narHash": "sha256-lbHQ7FXGzt6/IygWvJ1lCq+Txcut3xYYd6VIpF1ojkg=",
|
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "4e627ac2e1b8f1de7f5090064242de9a259dbbc8",
|
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -732,11 +732,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760846226,
|
"lastModified": 1761451000,
|
||||||
"narHash": "sha256-xmU8kAsRprJiTGBTaGrwmjBP3AMA9ltlrxHKFuy5JWc=",
|
"narHash": "sha256-qBJL6xEIjqYq9zOcG2vf2nPTeVBppNJzvO0LuQWMwMo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "5024e1901239a76b7bf94a4cd27f3507e639d49e",
|
"rev": "ed6b293161b378a7368cda38659eb8d3d9a0dac4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -763,11 +763,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761016216,
|
"lastModified": 1761468971,
|
||||||
"narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=",
|
"narHash": "sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "481cf557888e05d3128a76f14c76397b7d7cc869",
|
"rev": "78e34d1667d32d8a0ffc3eba4591ff256e80576e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -809,11 +809,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760872779,
|
"lastModified": 1761349956,
|
||||||
"narHash": "sha256-c5C907Raf9eY8f1NUXYeju9aUDlm227s/V0OptEbypA=",
|
"narHash": "sha256-tH3wHnOJms+U4k/rK2Nn1RfBrhffX92jLP/2VndSn0w=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "63bdb5d90fa2fa11c42f9716ad1e23565613b07c",
|
"rev": "02f2cb8e0feb4596d20cc52fda73ccee960e3538",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -825,11 +825,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable_2": {
|
"nixpkgs-unstable_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761114652,
|
"lastModified": 1761373498,
|
||||||
"narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=",
|
"narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c",
|
"rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -865,11 +865,11 @@
|
|||||||
"systems": "systems_5"
|
"systems": "systems_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761222236,
|
"lastModified": 1761657569,
|
||||||
"narHash": "sha256-Um296vYIWjSjm4btukpjyVPLIz5ovQgoAtEYXFb/Jr4=",
|
"narHash": "sha256-2D4Tw5Vp52RU5amnBvq0/z+zgZqafwl4bhg8dJBBjXI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "39443b9f5737b6f8ee0b654eb47d3a64daac1bd0",
|
"rev": "03c0dabb9a63f52bc2ebf571f3755720df1ca81e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -1085,11 +1085,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760889407,
|
"lastModified": 1761311587,
|
||||||
"narHash": "sha256-ppIp04fmz+BaTpJs1nIOmPADg02asfQFrFbhb3SmxsE=",
|
"narHash": "sha256-Msq86cR5SjozQGCnC6H8C+0cD4rnx91BPltZ9KK613Y=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "3f258dead9fed51f53862366d3a6bc1b622ee7cb",
|
"rev": "2eddae033e4e74bf581c2d1dfa101f9033dbd2dc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
job "code-server" {
|
|
||||||
datacenters = ["alo"]
|
|
||||||
|
|
||||||
meta {
|
|
||||||
uuid = uuidv4()
|
|
||||||
}
|
|
||||||
|
|
||||||
group "code" {
|
|
||||||
network {
|
|
||||||
port "http" {
|
|
||||||
to = 8080
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
volume "appdata" {
|
|
||||||
type = "host"
|
|
||||||
read_only = false
|
|
||||||
source = "appdata"
|
|
||||||
}
|
|
||||||
volume "nix-store" {
|
|
||||||
type = "host"
|
|
||||||
read_only = true
|
|
||||||
source = "nix-store"
|
|
||||||
}
|
|
||||||
volume "sw" {
|
|
||||||
type = "host"
|
|
||||||
read_only = true
|
|
||||||
source = "sw"
|
|
||||||
}
|
|
||||||
|
|
||||||
task "server" {
|
|
||||||
driver = "docker"
|
|
||||||
|
|
||||||
config {
|
|
||||||
image = "codercom/code-server:latest"
|
|
||||||
ports = ["http"]
|
|
||||||
|
|
||||||
volumes = [
|
|
||||||
"/data/services/code:/home/coder",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
env {
|
|
||||||
ANTHROPIC_API_KEY = "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"
|
|
||||||
}
|
|
||||||
|
|
||||||
user = "1000"
|
|
||||||
|
|
||||||
resources {
|
|
||||||
cpu = 1000
|
|
||||||
memory = 1024
|
|
||||||
}
|
|
||||||
|
|
||||||
service {
|
|
||||||
name = "code"
|
|
||||||
port = "http"
|
|
||||||
|
|
||||||
tags = [
|
|
||||||
"traefik.enable=true",
|
|
||||||
"traefik.http.routers.code.entryPoints=websecure",
|
|
||||||
"traefik.http.routers.code.middlewares=authentik@file",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
volume_mount {
|
|
||||||
volume = "nix-store"
|
|
||||||
destination = "/nix/store"
|
|
||||||
}
|
|
||||||
volume_mount {
|
|
||||||
volume = "sw"
|
|
||||||
destination = "/sw"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task "setup" {
|
|
||||||
driver = "exec"
|
|
||||||
|
|
||||||
lifecycle {
|
|
||||||
hook = "prestart"
|
|
||||||
sidecar = false
|
|
||||||
}
|
|
||||||
|
|
||||||
config {
|
|
||||||
command = "sh"
|
|
||||||
args = ["-c", <<EOF
|
|
||||||
# Set up npm global directory
|
|
||||||
export NPM_CONFIG_PREFIX=/appdata/code/.npm-global
|
|
||||||
mkdir -p $NPM_CONFIG_PREFIX
|
|
||||||
|
|
||||||
# Check if we should update (weekly check)
|
|
||||||
WEEK_AGO=$(date -d '7 days ago' +%s 2>/dev/null || date -v-7d +%s 2>/dev/null || echo 0)
|
|
||||||
LAST_UPDATE=$(stat -c %Y /appdata/code/.claude-last-update 2>/dev/null || echo 0)
|
|
||||||
|
|
||||||
if [ ! -f /appdata/code/.claude-installed ] || [ $LAST_UPDATE -lt $WEEK_AGO ]; then
|
|
||||||
echo "Installing/updating Claude Code..."
|
|
||||||
/sw/bin/npm install -g @anthropic-ai/claude-code --prefix=$NPM_CONFIG_PREFIX
|
|
||||||
touch /appdata/code/.claude-installed
|
|
||||||
touch /appdata/code/.claude-last-update
|
|
||||||
else
|
|
||||||
echo "Claude Code is up to date (checked within last week)"
|
|
||||||
fi
|
|
||||||
EOF
|
|
||||||
]
|
|
||||||
}
|
|
||||||
user = "1000"
|
|
||||||
volume_mount {
|
|
||||||
volume = "appdata"
|
|
||||||
destination = "/appdata"
|
|
||||||
}
|
|
||||||
volume_mount {
|
|
||||||
volume = "nix-store"
|
|
||||||
destination = "/nix/store"
|
|
||||||
}
|
|
||||||
volume_mount {
|
|
||||||
volume = "sw"
|
|
||||||
destination = "/sw"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user