Compare commits
51 Commits
a9247ba1a5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e4dd6d1d2 | ||
|
|
4466e39a55 | ||
|
|
ba912d0562 | ||
|
|
0b5a00afb6 | ||
|
|
367a21894e | ||
|
|
9bc1120795 | ||
|
|
fc29989709 | ||
|
|
45840d962d | ||
|
|
fbda875a6f | ||
|
|
83db5f51ce | ||
|
|
a501d9f4b1 | ||
|
|
d88c8f4807 | ||
|
|
acca27b76c | ||
|
|
4434093128 | ||
|
|
07d1bd6e06 | ||
|
|
1c27e2f318 | ||
|
|
e73e22d0b5 | ||
|
|
feae94f042 | ||
|
|
dc608152f7 | ||
|
|
445e08a771 | ||
|
|
1c9f2b54df | ||
|
|
2e8306c281 | ||
|
|
e522024eb9 | ||
|
|
faa8df37fc | ||
|
|
229ab0ea80 | ||
|
|
7c55d2875c | ||
|
|
398ec0f0f3 | ||
|
|
670c1972c5 | ||
|
|
3bd35e7a53 | ||
|
|
4e69da43c9 | ||
|
|
11bfe1baac | ||
|
|
bf6c231d1f | ||
|
|
f0dd952341 | ||
|
|
50a4c72a67 | ||
|
|
cc63f0ae04 | ||
|
|
47c1567a15 | ||
|
|
bca14b7326 | ||
|
|
895a9f18b1 | ||
|
|
108c6dec41 | ||
|
|
5fc68dc852 | ||
|
|
a327c6c6c9 | ||
|
|
5a4bd85e11 | ||
|
|
c57176dff5 | ||
|
|
9725b50d70 | ||
|
|
2c4b842446 | ||
|
|
550150fdd2 | ||
|
|
5ce8581135 | ||
|
|
04e5776d02 | ||
|
|
ae002a4370 | ||
|
|
2f219876ba | ||
|
|
f93614daf8 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
# git.nix
|
# git.nix
|
||||||
*.env
|
*.env
|
||||||
.devenv
|
.devenv
|
||||||
|
|
||||||
|
*.log
|
||||||
@@ -31,7 +31,9 @@ Used to enter the development shell. Be careful, as this will create a `.devenv`
|
|||||||
|
|
||||||
### venv
|
### venv
|
||||||
|
|
||||||
Activated with `.devenv/state/venv/bin/activate`. Used in VSCode for type hints, running, and debugging
|
`.devenv/state/venv/bin/python`
|
||||||
|
|
||||||
|
Used in VSCode for type hints, running, and debugging
|
||||||
|
|
||||||
### Jupyter
|
### Jupyter
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ nix-channel --update && nix-shell -p git
|
|||||||
Then build the system from the flake
|
Then build the system from the flake
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nixos-rebuild switch --flake git+https://gitea.john-stream.com/john/ad-nix#ad-nix
|
nixos-rebuild switch --flake git+https://gitea.john-stream.com/john/ad-nix#ad-nix --impure
|
||||||
```
|
```
|
||||||
|
|
||||||
### Secrets
|
### Secrets
|
||||||
|
|||||||
@@ -1,25 +1,78 @@
|
|||||||
{
|
{
|
||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"path": "/usr/src/app"
|
"path": "/home/appdaemon/ad-lola"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "/conf"
|
"path": "/conf/lola"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "/srv/appdaemon/snippets"
|
"path": "/home/appdaemon/ad-nix"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "/srv/appdaemon/ad-nix"
|
"path": "/home/appdaemon/ad-test"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"python.defaultInterpreterPath": "/usr/src/app/.devenv/state/venv/bin/python3",
|
// Python
|
||||||
|
"[python]": {
|
||||||
|
"editor.autoClosingDelete": "always",
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||||
|
// "editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.organizeImports.ruff": "explicit",
|
||||||
|
// "source.fixAll": "explicit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"python.defaultInterpreterPath": "${workspaceFolder}/.devenv/state/venv/bin/python3",
|
||||||
|
"python.autoComplete.extraPaths": ["~/ad-lola", "${fileWorkspaceFolder}/apps/room_control/src"],
|
||||||
"python.analysis.extraPaths": [
|
"python.analysis.extraPaths": [
|
||||||
"/usr/src/app"
|
"~/ad-lola",
|
||||||
|
"${workspaceFolder:conf}/lola/apps/room_control/src",
|
||||||
|
"${workspaceFolder:conf}/lola/apps/lola-parking/src"
|
||||||
],
|
],
|
||||||
"ruff.interpreter": [
|
"python.analysis.autoFormatStrings": true,
|
||||||
"/usr/src/app/.devenv/state/venv/bin/python3"
|
"python.analysis.completeFunctionParens": true,
|
||||||
|
"python.analysis.autoImportCompletions": true,
|
||||||
|
"python.analysis.importFormat": "relative",
|
||||||
|
"python.analysis.autoIndent": true,
|
||||||
|
"python.analysis.useLibraryCodeForTypes": true,
|
||||||
|
"python.analysis.languageServerMode": "full",
|
||||||
|
"python.analysis.typeEvaluation.enableReachabilityAnalysis": true,
|
||||||
|
"python.languageServer": "Pylance",
|
||||||
|
"python.terminal.shellIntegration.enabled": true,
|
||||||
|
|
||||||
|
// Ruff settings
|
||||||
|
"ruff.enable": true,
|
||||||
|
"ruff.organizeImports": true,
|
||||||
|
"ruff.importStrategy": "fromEnvironment",
|
||||||
|
"ruff.nativeServer": true,
|
||||||
|
"ruff.configurationPreference": "filesystemFirst",
|
||||||
|
"ruff.configuration": "${workspaceFolder}/pyproject.toml",
|
||||||
|
"ruff.fixAll": true,
|
||||||
|
"ruff.lint.enable": true,
|
||||||
|
// https://docs.astral.sh/ruff/rules/
|
||||||
|
"ruff.lint.extendSelect": [
|
||||||
|
"F", "W", "I",
|
||||||
|
"E1", "E2", "E3", "E4", "E5", "E7", "E9"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
// Notebooks
|
||||||
|
// "jupyter.askForKernelRestart": false,
|
||||||
|
"notebook.defaultFormatter": "charliermarsh.ruff",
|
||||||
|
"notebook.formatOnSave.enabled": true,
|
||||||
|
"notebook.codeActionsOnSave": {
|
||||||
|
"notebook.source.fixAll": "explicit",
|
||||||
|
"notebook.source.organizeImports": "explicit"
|
||||||
|
},
|
||||||
|
|
||||||
|
"editor.rulers": [120],
|
||||||
|
"editor.wordWrap": "on",
|
||||||
|
"editor.wordWrapColumn": 120,
|
||||||
|
// https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
|
||||||
|
// https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, lib, userSettings, systemSettings, ... }:
|
{ pkgs, lib, userSettings, systemSettings, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(import ./home-manager/home.nix {inherit systemSettings userSettings lib;})
|
# (import ./home-manager {inherit systemSettings userSettings lib pkgs;})
|
||||||
./nixos
|
./nixos
|
||||||
./scripts
|
./scripts
|
||||||
];
|
];
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
nix.settings.download-buffer-size = 524288000; # 500MB
|
||||||
|
|
||||||
programs.nix-ld.enable = true;
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
@@ -22,11 +23,8 @@
|
|||||||
# sops.age.keyFile = "${userSettings.adHome}/.config/sops/age/keys.txt";
|
# sops.age.keyFile = "${userSettings.adHome}/.config/sops/age/keys.txt";
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
bash
|
|
||||||
git
|
|
||||||
eza
|
|
||||||
gh
|
|
||||||
sops
|
sops
|
||||||
|
gdbm
|
||||||
];
|
];
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
@@ -35,4 +33,43 @@
|
|||||||
services.vscode-server.enable = true;
|
services.vscode-server.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.tailscale.enable = true;
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
|
# services.cron = {
|
||||||
|
# enable = true;
|
||||||
|
# systemCronJobs = [
|
||||||
|
# "30 2 * * * /run/current-system/sw/bin/nfsu > /etc/nixos/auto_update.log 2>&1"
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# systemd.timers."auto-update" = {
|
||||||
|
# wantedBy = [ "timers.target" ];
|
||||||
|
# timerConfig = {
|
||||||
|
# OnCalendar="*-*-* 4:00:00";
|
||||||
|
# Unit = "auto-update.service";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# systemd.services."auto-update" = {
|
||||||
|
# script = ''
|
||||||
|
# ${pkgs.coreutils}/bin/echo "Running auto-update"
|
||||||
|
# FLAKE=$(${pkgs.coreutils}/bin/readlink -f /etc/nixos)
|
||||||
|
# ${pkgs.coreutils}/bin/echo "FLAKE: $FLAKE"
|
||||||
|
# ${pkgs.nix}/bin/nix flake update --flake $FLAKE --impure
|
||||||
|
# ${pkgs.git}/bin/git -C $FLAKE add "$FLAKE/flake.lock" > /dev/null 2>&1
|
||||||
|
# ${pkgs.sudo}/bin/sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake $FLAKE#${systemSettings.hostName} --impure
|
||||||
|
# '';
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "oneshot";
|
||||||
|
# User = "${userSettings.userName}";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
# https://nixos.wiki/wiki/Storage_optimization
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 30d";
|
||||||
|
};
|
||||||
|
nix.optimise.automatic = true;
|
||||||
|
nix.optimise.dates = [ "Mon *-*-* 05:00:00" ];
|
||||||
}
|
}
|
||||||
|
|||||||
189
flake.lock
generated
189
flake.lock
generated
@@ -9,16 +9,20 @@
|
|||||||
"devenv"
|
"devenv"
|
||||||
],
|
],
|
||||||
"git-hooks": [
|
"git-hooks": [
|
||||||
"devenv"
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
],
|
],
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728672398,
|
"lastModified": 1748883665,
|
||||||
"narHash": "sha256-KxuGSoVUFnQLB2ZcYODW7AVPAh9JqRlD5BrfsC/Q4qs=",
|
"narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "cachix",
|
"repo": "cachix",
|
||||||
"rev": "aac51f698309fd0f381149214b7eee213c66ef0a",
|
"rev": "f707778d902af4d62d8dd92c269f8e70de09acbe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -39,11 +43,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734441494,
|
"lastModified": 1756048064,
|
||||||
"narHash": "sha256-/SZXjdKlo6NgVR+/RT0eYCUUJLcQndy7lIl2Bc0qjlY=",
|
"narHash": "sha256-mVgB6qWhLrCW6AciLyFXosDKKZFtBgqvixcA8a07s+g=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "bdc1a2cefdda8f89e31b1a0f3771786ba9e5d052",
|
"rev": "3fb20c149d329b01a2b519fbb2a9ca3e6e6e1b05",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -55,11 +59,11 @@
|
|||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1747046372,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -71,11 +75,11 @@
|
|||||||
"flake-compat_2": {
|
"flake-compat_2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1747046372,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -93,11 +97,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712014858,
|
"lastModified": 1733312601,
|
||||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -127,23 +131,21 @@
|
|||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"devenv"
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"devenv",
|
"devenv",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
|
||||||
"nixpkgs-stable": [
|
|
||||||
"devenv"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730302582,
|
"lastModified": 1750779888,
|
||||||
"narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=",
|
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
|
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -181,11 +183,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734344598,
|
"lastModified": 1756022458,
|
||||||
"narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=",
|
"narHash": "sha256-J1i35r4HfNDdPpwL0vOBaZopQudAUVtartEerc1Jryc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "83ecd50915a09dca928971139d3a102377a8d242",
|
"rev": "9e3a33c0bcbc25619e540b9dfea372282f8a9740",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -194,62 +196,92 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libgit2": {
|
"home-manager_2": {
|
||||||
"flake": false,
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nix-home",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1697646580,
|
"lastModified": 1750033262,
|
||||||
"narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=",
|
"narHash": "sha256-TcFN78w6kPspxpbPsxW/8vQ1GAtY8Y3mjBaC+oB8jo4=",
|
||||||
"owner": "libgit2",
|
"owner": "nix-community",
|
||||||
"repo": "libgit2",
|
"repo": "home-manager",
|
||||||
"rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5",
|
"rev": "66523b0efe93ce5b0ba96dcddcda15d36673c1f0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "libgit2",
|
"owner": "nix-community",
|
||||||
"repo": "libgit2",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix": {
|
"nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"devenv"
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"libgit2": "libgit2",
|
"git-hooks-nix": [
|
||||||
"nixpkgs": "nixpkgs_2",
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
"nixpkgs-23-11": [
|
"nixpkgs-23-11": [
|
||||||
"devenv"
|
"devenv"
|
||||||
],
|
],
|
||||||
"nixpkgs-regression": [
|
"nixpkgs-regression": [
|
||||||
"devenv"
|
"devenv"
|
||||||
],
|
|
||||||
"pre-commit-hooks": [
|
|
||||||
"devenv"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727438425,
|
"lastModified": 1755029779,
|
||||||
"narHash": "sha256-X8ES7I1cfNhR9oKp06F6ir4Np70WGZU5sfCOuNBEwMg=",
|
"narHash": "sha256-3+GHIYGg4U9XKUN4rg473frIVNn8YD06bjwxKS1IPrU=",
|
||||||
"owner": "domenkozar",
|
"owner": "cachix",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"rev": "f6c5ae4c1b2e411e6b1e6a8181cc84363d6a7546",
|
"rev": "b0972b0eee6726081d10b1199f54de6d2917f861",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "domenkozar",
|
"owner": "cachix",
|
||||||
"ref": "devenv-2.24",
|
"ref": "devenv-2.30",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-home": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750825763,
|
||||||
|
"narHash": "sha256-gUtcO/8Bcw4YerJpSIRu+Q2MYKxWrtT+8Bp3Mh1Qfmw=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "1ab1e4b9e610dcd40a3d728f377b6ac8a302d977",
|
||||||
|
"revCount": 26,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.john-stream.com/john/nix-home"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.john-stream.com/john/nix-home"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730531603,
|
"lastModified": 1755615617,
|
||||||
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
|
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
|
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -267,11 +299,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733319315,
|
"lastModified": 1755249745,
|
||||||
"narHash": "sha256-cFQBdRmtIZFVjr2P6NkaCOp7dddF93BC0CXBwFZFaN0=",
|
"narHash": "sha256-lDIbUfJ8xK62ekG+qojTlA1raHpKdScBTx8IFlQYx9U=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "nixpkgs-python",
|
"repo": "nixpkgs-python",
|
||||||
"rev": "01263eeb28c09f143d59cd6b0b7c4cc8478efd48",
|
"rev": "b6632af2db9f47c79dac8f4466388c7b1b6c3071",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -281,38 +313,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1717432640,
|
|
||||||
"narHash": "sha256-+f9c4/ZX5MWDOuB1rKoWj+lBNm0z0rs4CK47HBLxy1o=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "88269ab3044128b7c2f4c7d68448b2fb50456870",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "release-24.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1734119587,
|
|
||||||
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_4": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682134069,
|
"lastModified": 1682134069,
|
||||||
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
|
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
|
||||||
@@ -330,7 +330,8 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"devenv": "devenv",
|
"devenv": "devenv",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nix-home": "nix-home",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-python": "nixpkgs-python",
|
"nixpkgs-python": "nixpkgs-python",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"vscode-server": "vscode-server"
|
"vscode-server": "vscode-server"
|
||||||
@@ -343,11 +344,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733965552,
|
"lastModified": 1754988908,
|
||||||
"narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=",
|
"narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004",
|
"rev": "3223c7a92724b5d804e9988c6b447a0d09017d48",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -374,14 +375,14 @@
|
|||||||
"vscode-server": {
|
"vscode-server": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729422940,
|
"lastModified": 1753541826,
|
||||||
"narHash": "sha256-DlvJv33ml5UTKgu4b0HauOfFIoDx6QXtbqUF3vWeRCY=",
|
"narHash": "sha256-foGgZu8+bCNIGeuDqQ84jNbmKZpd+JvnrL2WlyU4tuU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-vscode-server",
|
"repo": "nixos-vscode-server",
|
||||||
"rev": "8b6db451de46ecf9b4ab3d01ef76e59957ff549f",
|
"rev": "6d5f074e4811d143d44169ba4af09b20ddb6937d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
131
flake.nix
131
flake.nix
@@ -18,6 +18,10 @@
|
|||||||
url = "github:cachix/devenv";
|
url = "github:cachix/devenv";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
nix-home = {
|
||||||
|
url = "git+https://gitea.john-stream.com/john/nix-home";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
@@ -25,16 +29,12 @@
|
|||||||
extra-substituters = "https://devenv.cachix.org";
|
extra-substituters = "https://devenv.cachix.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ... }@args:
|
outputs = { self, ... }@inputs:
|
||||||
let
|
let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
nixosSystem = args.nixpkgs.lib.nixosSystem;
|
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
|
||||||
|
|
||||||
userSettings = {
|
userSettings = {
|
||||||
gitUserName = "John Lancaster";
|
|
||||||
gitUserEmail = "32917998+jsl12@users.noreply.github.com";
|
|
||||||
adRepo = "https://github.com/jsl12/appdaemon";
|
|
||||||
adBranch = "hass";
|
|
||||||
userName = "appdaemon";
|
userName = "appdaemon";
|
||||||
adHome = "/home/appdaemon";
|
adHome = "/home/appdaemon";
|
||||||
};
|
};
|
||||||
@@ -45,29 +45,26 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
timeZone = "America/Chicago";
|
timeZone = "America/Chicago";
|
||||||
locale = "en_US.UTF-8";
|
locale = "en_US.UTF-8";
|
||||||
pythonVersion = "3.12.7";
|
pythonVersion = "3.12"; # This is largely irrelevant because uv will handle it
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgs = args.nixpkgs.legacyPackages.${systemSettings.system};
|
pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.${systemSettings.hostName} = nixosSystem {
|
nixosConfigurations.${systemSettings.hostName} = nixosSystem {
|
||||||
system = systemSettings.system;
|
system = systemSettings.system;
|
||||||
specialArgs =
|
specialArgs = {
|
||||||
let
|
|
||||||
inputs = args;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
inherit systemSettings;
|
inherit systemSettings;
|
||||||
inherit userSettings;
|
inherit userSettings;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
(args.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
|
(inputs.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
|
||||||
args.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
args.vscode-server.nixosModules.default
|
inputs.nix-home.nixosModules.default { user = "${userSettings.userName}"; }
|
||||||
args.sops-nix.nixosModules.sops
|
inputs.vscode-server.nixosModules.default
|
||||||
|
inputs.sops-nix.nixosModules.sops
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -78,67 +75,67 @@
|
|||||||
devenv-test = self.devShells.${systemSettings.system}.default.config.test;
|
devenv-test = self.devShells.${systemSettings.system}.default.config.test;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.${systemSettings.system}.default =
|
devShells.${systemSettings.system}.default = inputs.devenv.lib.mkShell {
|
||||||
let
|
inherit inputs pkgs;
|
||||||
inputs = args;
|
modules = [
|
||||||
in
|
({ pkgs, config, ... }: {
|
||||||
args.devenv.lib.mkShell {
|
# This is your devenv configuration
|
||||||
inherit inputs pkgs;
|
|
||||||
modules = [
|
|
||||||
({ pkgs, config, ... }: {
|
|
||||||
# This is your devenv configuration
|
|
||||||
|
|
||||||
# https://devenv.sh/reference/options/#pre-commithooks
|
# https://devenv.sh/reference/options/#pre-commithooks
|
||||||
pre-commit.hooks = {
|
git-hooks.hooks = {
|
||||||
end-of-file-fixer.enable = true;
|
end-of-file-fixer.enable = true;
|
||||||
trim-trailing-whitespace.enable = true;
|
trim-trailing-whitespace.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://devenv.sh/supported-languages/python/
|
# https://devenv.sh/supported-languages/python/
|
||||||
languages.python = {
|
languages.python = {
|
||||||
|
enable = true;
|
||||||
|
version = systemSettings.pythonVersion;
|
||||||
|
uv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
version = systemSettings.pythonVersion;
|
package = pkgs.uv;
|
||||||
uv = {
|
sync = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.uv;
|
allExtras = true;
|
||||||
sync = {
|
arguments = [ "-U" ];
|
||||||
enable = true;
|
|
||||||
allExtras = true;
|
|
||||||
arguments = [ "-U" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
git
|
git
|
||||||
(pkgs.python312.withPackages (python-pkgs: with python-pkgs; [
|
gdbm
|
||||||
pip
|
# (python312.withPackages (python-pkgs: with python-pkgs; [ gdbm ]))
|
||||||
setuptools
|
(python312.withPackages (python-pkgs: with python-pkgs; [
|
||||||
wheel
|
gdbm
|
||||||
notebook
|
notebook # kinda hacky, but needed so that jupyter notebook has some shared library it needs?
|
||||||
rich
|
]))
|
||||||
]))
|
(writeShellScriptBin "docs" "${pkgs.uv}/bin/uv run sphinx-autobuild -E ./docs/ ./docs_build --port 9999")
|
||||||
];
|
(writeShellScriptBin "ab" "${pkgs.uv}/bin/uv build --wheel --refresh")
|
||||||
|
(writeShellScriptBin "adb" "ab && ${pkgs.docker}/bin/docker build -t acockburn/appdaemon:local-dev .")
|
||||||
|
# (writeShellScriptBin "ad-nb" "cd $(readlink -f /etc/nixos) && devenv up")
|
||||||
|
];
|
||||||
|
|
||||||
processes = {
|
# processes = {
|
||||||
my-jup.exec = "uv run jupyter notebook";
|
# my-jup.exec = "uv run jupyter notebook";
|
||||||
};
|
# };
|
||||||
|
|
||||||
enterShell = ''
|
enterShell = ''
|
||||||
alias appdaemon="${pkgs.uv}/bin/uv run --frozen python -m appdaemon"
|
alias fix="${pkgs.uv}/bin/uv run ruff check --fix"
|
||||||
alias ad="appdaemon"
|
alias appdaemon="${pkgs.uv}/bin/uv run --frozen appdaemon"
|
||||||
|
# alias ad="appdaemon"
|
||||||
|
|
||||||
export PS1="\[\e[0;34m\](AppDaemon)\[\e[0m\] ''${PS1-}"
|
export PS1="\[\e[0;34m\](AppDaemon)\[\e[0m\] \[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] "
|
||||||
|
|
||||||
export VIRTUAL_ENV=$UV_PROJECT_ENVIRONMENT
|
export VIRTUAL_ENV=$UV_PROJECT_ENVIRONMENT
|
||||||
|
|
||||||
echo -e "URL: \e[34m$(${pkgs.git}/bin/git config --get remote.origin.url)\e[0m"
|
echo -e "URL: \e[34m$(${pkgs.git}/bin/git config --get remote.origin.url)\e[0m"
|
||||||
echo -e "Branch/Tag: \e[32m$(${pkgs.git}/bin/git describe --tags --exact-match 2>/dev/null || ${pkgs.git}/bin/git rev-parse --abbrev-ref HEAD)\e[0m"
|
echo -e "Branch/Tag: \e[32m$(${pkgs.git}/bin/git describe --tags --exact-match 2>/dev/null || ${pkgs.git}/bin/git rev-parse --abbrev-ref HEAD)\e[0m"
|
||||||
echo -e "Hash: \e[33m$(${pkgs.git}/bin/git rev-parse --short HEAD)\e[0m"
|
echo -e "Hash: \e[33m$(${pkgs.git}/bin/git rev-parse --short HEAD)\e[0m"
|
||||||
echo "AppDaemon v$(${pkgs.uv}/bin/uv pip show appdaemon | awk '/^Version:/ {print $2}') development shell started"
|
echo "AppDaemon v$(${pkgs.uv}/bin/uv pip show appdaemon | awk '/^Version:/ {print $2}') development shell started"
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{ userSettings, ... }:
|
|
||||||
{
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig.credential.helper = "store --file ~/.git-credentials";
|
|
||||||
userName = "${userSettings.gitUserName}";
|
|
||||||
userEmail = "${userSettings.gitUserEmail}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./home-manager.nix
|
||||||
./docker
|
./docker
|
||||||
./services
|
./services
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ lib, systemSettings, userSettings, ... }:
|
{ lib, pkgs, systemSettings, userSettings, ... }:
|
||||||
{
|
{
|
||||||
security.sudo-rs = {
|
security.sudo-rs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -9,20 +9,19 @@
|
|||||||
users.users.${userSettings.userName} = {
|
users.users.${userSettings.userName} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "docker" ];
|
extraGroups = [ "wheel" "docker" ];
|
||||||
openssh.authorizedKeys.keyFiles = [ ../secrets/authorized_keys ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
users.${userSettings.userName} = { ... }: {
|
users.${userSettings.userName} = {
|
||||||
home.stateVersion = systemSettings.stateVersion;
|
home.stateVersion = systemSettings.stateVersion;
|
||||||
home.homeDirectory = lib.mkForce "${userSettings.adHome}";
|
home.homeDirectory = lib.mkForce "${userSettings.adHome}";
|
||||||
systemd.user.startServices = "sd-switch"; # helps with handling systemd services when switching
|
systemd.user.startServices = "sd-switch"; # helps with handling systemd services when switching
|
||||||
imports = [ (import ./git.nix {inherit userSettings;}) ];
|
programs.gh.enable = true;
|
||||||
programs = {
|
programs.git.extraConfig.safe.directory = "/home/appdaemon/ad-nix";
|
||||||
ssh.enable = true;
|
home.packages = with pkgs; [
|
||||||
bash.enable = true;
|
lazydocker
|
||||||
};
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./promtail.nix
|
./promtail.nix
|
||||||
./telegraf.nix
|
./telegraf.nix
|
||||||
|
./restic.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
lokiHost = "192.168.1.174:3100";
|
lokiHost = "https://loki.john-stream.com";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.services.promtail.serviceConfig = {
|
systemd.services.promtail.serviceConfig = {
|
||||||
@@ -22,7 +22,7 @@ in
|
|||||||
positions = {
|
positions = {
|
||||||
filename = "/tmp/positions.yaml";
|
filename = "/tmp/positions.yaml";
|
||||||
};
|
};
|
||||||
clients = [{url = "http://${lokiHost}/loki/api/v1/push";}];
|
clients = [{url = "${lokiHost}/loki/api/v1/push";}];
|
||||||
scrape_configs = [
|
scrape_configs = [
|
||||||
{
|
{
|
||||||
job_name = "journal";
|
job_name = "journal";
|
||||||
|
|||||||
49
nixos/services/restic.nix
Normal file
49
nixos/services/restic.nix
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{ config, pkgs, userSettings, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
sops.secrets.restic_password = {
|
||||||
|
owner = config.users.users.${userSettings.userName}.name;
|
||||||
|
mode = "0440";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
restic
|
||||||
|
(pkgs.writeShellScriptBin "restic-backup" "sudo systemctl start restic-backups-localBackup.service")
|
||||||
|
(pkgs.writeShellScriptBin "restic-backup-check" "sudo journalctl -b -u restic-backups-localBackup.service")
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.variables = {
|
||||||
|
RESTIC_REPOSITORY = "/mnt/restic/appdaemon";
|
||||||
|
RESTIC_PASSWORD = "${builtins.readFile config.sops.secrets."restic_password".path}";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.restic.backups = {
|
||||||
|
localBackup = {
|
||||||
|
repository = "/mnt/restic/appdaemon";
|
||||||
|
passwordFile = config.sops.secrets."restic_password".path;
|
||||||
|
initialize = true;
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "03:00";
|
||||||
|
RandomizedDelaySec = "2h";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
paths = [
|
||||||
|
"/home"
|
||||||
|
"/conf"
|
||||||
|
"/etc/nixos"
|
||||||
|
"/etc/ssh" # necessary for SOPS nix to have the same keys
|
||||||
|
];
|
||||||
|
exclude = [
|
||||||
|
".cache"
|
||||||
|
".vscode*"
|
||||||
|
".devenv"
|
||||||
|
".venv"
|
||||||
|
"build"
|
||||||
|
"dist"
|
||||||
|
"__pycache__"
|
||||||
|
"*.egg-info"
|
||||||
|
"namespaces"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
influxURL = "http://panoptes.john-stream.com:8086";
|
influxURL = "https://influxdb.john-stream.com";
|
||||||
organization = "homelab";
|
organization = "homelab";
|
||||||
bucket = "docker";
|
bucket = "docker";
|
||||||
token = "${builtins.readFile config.sops.secrets."telegraf_influx_token".path}";
|
token = "${builtins.readFile config.sops.secrets."telegraf_influx_token".path}";
|
||||||
@@ -14,9 +14,7 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.telegraf = {
|
systemd.services.telegraf = {
|
||||||
environment = {
|
environment.INFLUX_WRITE_TOKEN = token;
|
||||||
INFLUX_WRITE_TOKEN = token;
|
|
||||||
};
|
|
||||||
serviceConfig.SupplementaryGroups = [ "docker" ];
|
serviceConfig.SupplementaryGroups = [ "docker" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -43,7 +41,6 @@ in
|
|||||||
container_name_include = [];
|
container_name_include = [];
|
||||||
timeout = "5s";
|
timeout = "5s";
|
||||||
perdevice_include = ["cpu" "blkio" "network"];
|
perdevice_include = ["cpu" "blkio" "network"];
|
||||||
total = false;
|
|
||||||
docker_label_include = [];
|
docker_label_include = [];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
{ pkgs, systemSettings, ... }:
|
{ pkgs, systemSettings, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
|
|
||||||
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
|
|
||||||
(pkgs.writeShellScriptBin "nfs" ''
|
|
||||||
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${systemSettings.hostName} --impure
|
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
|
(pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
|
||||||
(pkgs.writeShellScriptBin "link-nix" "${builtins.readFile ./link-nix.sh}")
|
(pkgs.writeShellScriptBin "link-nix" "${builtins.readFile ./link-nix.sh}")
|
||||||
(pkgs.writeShellScriptBin "sops-ad" "sops $(readlink -f /etc/nixos)/secrets/secrets.yaml")
|
(pkgs.writeShellScriptBin "sops-ad" "sops $(readlink -f /etc/nixos)/secrets/encrypted_secrets.yaml")
|
||||||
|
(pkgs.writeShellScriptBin "lola-up" "docker compose -f /conf/lola/docker-compose.yml up -d")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,9 @@ exit 1
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT=$(readlink -f /etc/nixos)
|
CURRENT=$(readlink -f /etc/nixos)
|
||||||
sudo rm /etc/nixos
|
if [ -d "/etc/nixos" ]; then
|
||||||
|
sudo rm -r /etc/nixos
|
||||||
|
fi
|
||||||
echo "Unlinked $CURRENT"
|
echo "Unlinked $CURRENT"
|
||||||
|
|
||||||
sudo ln -s $1 /etc/nixos
|
sudo ln -s $1 /etc/nixos
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
telegraf_influx_token: ENC[AES256_GCM,data:XHT7lvRrw9MeC0Jxe2EYTTa/iB5QLVTzp9TDJaljssRR+kGdK3va1u14NX5b6jFrHnAXLiMdMQ5UTdbsnYH43TnRkY29mcVHxwaQv+rbCgEIKOAYFeIw0g==,iv:uzBYXWYRDH6bHZ3pubWh5Qn/2dN2Rz+sjEmrqpKhA4o=,tag:wemgU05aTl9S1rwt+fVQug==,type:str]
|
telegraf_influx_token: ENC[AES256_GCM,data:XHT7lvRrw9MeC0Jxe2EYTTa/iB5QLVTzp9TDJaljssRR+kGdK3va1u14NX5b6jFrHnAXLiMdMQ5UTdbsnYH43TnRkY29mcVHxwaQv+rbCgEIKOAYFeIw0g==,iv:uzBYXWYRDH6bHZ3pubWh5Qn/2dN2Rz+sjEmrqpKhA4o=,tag:wemgU05aTl9S1rwt+fVQug==,type:str]
|
||||||
|
restic_password: ENC[AES256_GCM,data:8ArxlyulTejzZ2eA9LqLptAZdBfBZJpeNmaw7r9H2ZPQsPAuT4uMcGRgvYF3tD1d9msyUC5yFy5trQfUxUMhXUrnPnFgZEYUrq+BVG/VraYjH74N1YTSKHksz7kqEGmTpMh6DpNLSq3JWfUT/T2GWDhIjRfQf1O++nlAWHDLT0+aEPT633+o63k8+GZuC38Khsv22dYHki1U57QQusk8x5Rj/0ZwuftJe7ItKs28nXZyLejFq+c+OTvJxjQb70FvHY0QfrGFA8RPteJgoLuTDrnKtkw2CuTpfnfhQXQw9oxUnT6x3L34RMY6Tla1PZt/xp07VZC1vnmmLB1prwJtUgvtQfzp8hLVNipoNAfg9ujg7eTq0Dwm7yHVe5hSkOxp1qh47mwA7Og9yb0t7FZE3ZiVT0P5dH/+Qvp76KhCCQUDA4ttKKw8TNjsiqrcEMyDBj+c1mXRpcXfgoAhJpgtEgHT28GEwVl927Zz3zpGG23Gu9pn5ow09GRWJOzvInwnEI/3Thz+DKySzKB2xDK/Nu8hXsmF37iYafLBSnDRGw8RPp6DQBBFNT84WlncCz71yNt7diiAmdxFVESIv3P0sXMVEXEJ3yx/8ke/2quGiCvYUfvxFsU8xsPIkA3gQodHJY+8q16kjafuMUZkuhZxhFZuScKEThlSkJcvlX+C19dlJYbQM/NoLN8KEeJ+ULoTd+CgGtlK7gXEE9GC5i+rTW/9pZrsg8MaPJAxw/jnZO9ikxJtxRPiJGJ7r2zkEwM9DdlPNlbPWw3BQO/ikOS6UhtcuQI2dj0KJC1b4jzrHCALa7h4tRZmT40isEC1KuGcj02CR0QFAVYWWCz9S6TE2RR8y+OiEJosRfTWFg1CbWyGjBAsZ8WbyAhufB6EhF2F5CA3bMnGc1D6JAgrQw0rowce1Znzs2hYQP4ysaDMLoUhRfDjdfUlb9byOeRwKnLFxg67mAHO1ON8DUT+ZnLeNH3rEmams5g9irtLcH3nxV45ESZfFDqVLr645gmfPNs92a8K1ZUwU3XpO6mOR7+iLiKpFIhlVavtsJPKE1XAxnhilH6Hekd78PAdKc+aZLeDGHUZcTZYEN76mxRfBe20GpkUlx9ekHN4ZP1qvQl301vefNpmfflcJheJ/fgsLjDW5US5hyG6PZ/+GG1xAEhBEmSKH9GvN7sk+FwaxdVSzZwcL7Dj2fyX89kSWoZdKMbE6RwsUHNo1Pdfc1w1M8RxSnOLZL7ijG/nJFLn0T6I5cjnKQ+qscsRQz+62aUczTRp80jFHnNo1VOrsO9Oz0YX1/t9Pnq1mR/X/UzZFwiRKrdLacTwRSEWUFi5zf4PX5rcd6EeZbp5DuvP7RZt39npAmzNz+TBKZP06RymG5CdDVzO41xNJWt7bQ/sd3tw3MUXJaz87Glbg7xq+5EdoUE9J/PaJfO5i+9CAaKCOiFBUfr/NjWv3zpfMCZ50HzqlsQCLnOMWS8S65V5xh2a1h77sOYsrWESvUcdg1ryfGd98znyNE5P7BEBo83P8DIKdYrRoPaWPWHRC6ldOOvFDEeaHy6GedV6k0qKcueGHNYRHG4aMOV9lnlc3qMOpXkNFWk45Mv5pmFgGlgrmutjXzi3ljxa0cGe5UUdPbr4lDZ+U2yPvCOu7Lg7FpVyCR77QMerF0xENKrhB4G57QBUhtx8TUdYH/B6+vka1LiKz/i09VEDiQ2K1q5831hUfrS6GyXN8p7JdhCQ3C66V8cMpb9/llO06LLV5Cc4ooB0svSigMuQ4UFDO5bTkrt7wGJLG/mHrb8DjDPI5nuWhyoxs6OqCvg2t2/HJwK9,iv:wiW/f7wLO7kfd3CKDfoYZnXj697qIFRokAut7VXALVM=,tag:VzKJ/BrCL6zNbglsDqJx9w==,type:str]
|
||||||
sops:
|
sops:
|
||||||
kms: []
|
kms: []
|
||||||
gcp_kms: []
|
gcp_kms: []
|
||||||
@@ -23,8 +24,8 @@ sops:
|
|||||||
Vm1ldGhPRmNyZHErekRlbFBZQy8wK0EKY2vsWzqtX5w4vM0aLGEN2ZO0Rm9slcKk
|
Vm1ldGhPRmNyZHErekRlbFBZQy8wK0EKY2vsWzqtX5w4vM0aLGEN2ZO0Rm9slcKk
|
||||||
6Yx2KvJAT6dNg2lqjzXYYS/MvnpOrW6fA46bmWKaAl9IzKhyW+2avw==
|
6Yx2KvJAT6dNg2lqjzXYYS/MvnpOrW6fA46bmWKaAl9IzKhyW+2avw==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2024-12-18T02:36:09Z"
|
lastmodified: "2025-02-17T06:15:17Z"
|
||||||
mac: ENC[AES256_GCM,data:lXFJxFQJy9qNu2dVo+UBIfDNAeZ4U2n5c085qYmAShJrY2OiX0+Dv6n4kLg1ohgPni0VG6tAayPghHkStQPT7chFZwlAlvRol1kELWDukygWgPfZqvooDlPlH3ews16TtEM/B/cTOYFZA3X82nJgjcoEFjUHasWg2Ryic5mWe0I=,iv:ys1nRfNV6gawPjPfjfJfLGSSSsiauNEJVMMTAzcoGf4=,tag:UowQI9F59EzDEyTROACI0A==,type:str]
|
mac: ENC[AES256_GCM,data:zbnP62SqnI7UUb5lP4UlgzWPDkUegvVX2lAbRcDqWqZJsXTkRPefdUIFPO3aZn2EW0aKlFQGEwARTtOtQ9hLYhbqcvAvh5Ur5eFh3szp9ejgF59JBdYGH8PTR/6FkCaVnyuMA1t3940gVhs8eIRdfdjihTHsIe254/3xzBtVG4o=,iv:j7EImL80FgAt7bjlkgB5KIKduKniUaoyz8fnHr/v2rM=,tag:5vK0s6Qf6t2HRhDPaZkT6Q==,type:str]
|
||||||
pgp: []
|
pgp: []
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.9.2
|
version: 3.9.4
|
||||||
|
|||||||
Reference in New Issue
Block a user