Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f181557dc4 | |||
| f77c9657a3 | |||
| f908f969d3 | |||
| 3cf49c5479 | |||
| b34354f5e5 | |||
| 44826464de | |||
| 3de0ffccb0 | |||
| c6c98b3e26 | |||
| d459f3d675 | |||
| 33e4b37cce | |||
| 2a8e7e7f2b | |||
| 07759353be | |||
| 38fb14520e | |||
| 006ae6079a | |||
| 7d507fb7e1 | |||
| 0f69022e51 | |||
| a260ae2470 | |||
| 820b4a53d2 | |||
| ea77e83f06 | |||
| a9da208bc3 | |||
| 739d7dd28c | |||
| 651599796e | |||
| b9d440597c | |||
| 311cc5d7a7 | |||
| fb2519046d | |||
| bc6b1585ec | |||
| d71330a85a | |||
| df51aa5200 | |||
| e93cc816db | |||
| 19050b4cf4 | |||
| 6676c15f75 |
@@ -23,6 +23,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build default package
|
- name: Build default package
|
||||||
run: "nixos-rebuild build --flake ./#${{ matrix.system }}"
|
run: "nixos-rebuild build --accept-flake-config --flake ./#${{ matrix.system }}"
|
||||||
- name: copy to nix-cache
|
- name: copy to nix-cache
|
||||||
run: nix copy --accept-flake-config --to unix:///host-nix/var/nix/daemon-socket/socket .#nixosConfigurations.${{ matrix.system }}.config.system.build.toplevel
|
run: nix copy --accept-flake-config --to unix:///host-nix/var/nix/daemon-socket/socket .#nixosConfigurations.${{ matrix.system }}.config.system.build.toplevel
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
name: pytest
|
name: pytest
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ jobs:
|
|||||||
lockfile:
|
lockfile:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
permissions:
|
permissions:
|
||||||
|
actions: write
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Generated
+42
-26
@@ -8,11 +8,11 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "pkgs/firefox-addons",
|
"dir": "pkgs/firefox-addons",
|
||||||
"lastModified": 1777521781,
|
"lastModified": 1781270820,
|
||||||
"narHash": "sha256-bQ9oIcNyHsiagt7yptfe7OmfUDEyuXFUb7ajkrWNzSo=",
|
"narHash": "sha256-KuDdN/p4UtqUb1wnjo8a/YougmRXEaKvUoGHkYnuAq0=",
|
||||||
"owner": "rycee",
|
"owner": "rycee",
|
||||||
"repo": "nur-expressions",
|
"repo": "nur-expressions",
|
||||||
"rev": "8a444a5c02840666c9c2f92042bfbb7a10c68200",
|
"rev": "5f4259c0c832a93e13c5ec481d3318ce1394a8f9",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -29,11 +29,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777518431,
|
"lastModified": 1781305496,
|
||||||
"narHash": "sha256-SwgiG2T5pbyo33Vz7/vUCAhEMgwCK8Pa2nDSx5a6/WE=",
|
"narHash": "sha256-g8Vv4Qfc7n+lgov97REu3X6BeJtvYY0hlSUZR1GrGQQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2e54a938cdd4c8e414b2518edc3d82308027c670",
|
"rev": "c87a39aa979acc4848016d2220c6238390d84779",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -43,12 +43,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776983936,
|
"lastModified": 1781168557,
|
||||||
"narHash": "sha256-ZOQyNqSvJ8UdrrqU1p7vaFcdL53idK+LOM8oRWEWh6o=",
|
"narHash": "sha256-LOnLQ2tpYF9gqIDDr3+j3DbpJJr/QCH6zPRT2GzEUOE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "2096f3f411ce46e88a79ae4eafcfc9df8ed41c61",
|
"rev": "6358ff76821101c178e3ab4919a62799bfe3652e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -60,27 +63,24 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777268161,
|
"lastModified": 1767892417,
|
||||||
"narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=",
|
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
|
||||||
"owner": "nixos",
|
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
|
||||||
"repo": "nixpkgs",
|
"type": "tarball",
|
||||||
"rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76",
|
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"type": "tarball",
|
||||||
"ref": "nixos-unstable",
|
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-master": {
|
"nixpkgs-master": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777553282,
|
"lastModified": 1781306963,
|
||||||
"narHash": "sha256-GCJkEogieqOYJ1BBhG0w9fqezul1cGdEcmBbJ+34F4U=",
|
"narHash": "sha256-qWZ+XEwsf8pN4DnYyyLbmAyj1a74gOO/VNCff44MuB4=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0d93cb69a4fd4449088c69859e1836fda6eb9f6a",
|
"rev": "1eee1a273e2e3fdc3db5b1a4a66f06cd5749db69",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -106,12 +106,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781074563,
|
||||||
|
"narHash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9ae611a455b90cf061d8f332b977e387bda8e1ca",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"firefox-addons": "firefox-addons",
|
"firefox-addons": "firefox-addons",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-master": "nixpkgs-master",
|
"nixpkgs-master": "nixpkgs-master",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
@@ -125,11 +141,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777338324,
|
"lastModified": 1780547341,
|
||||||
"narHash": "sha256-bc+ZZCmOTNq86/svGnw0tVpH7vJaLYvGLLKFYP08Q8E=",
|
"narHash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "8eaee5c45428b28b8c47a83e4c09dccec5f279b5",
|
"rev": "9ed65852b6257fbeae4355bc24ecfea307ca759a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
apscheduler
|
apscheduler
|
||||||
fastapi
|
fastapi
|
||||||
fastapi-cli
|
fastapi-cli
|
||||||
faster-whisper
|
|
||||||
httpx
|
httpx
|
||||||
mypy
|
mypy
|
||||||
orjson
|
orjson
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Self
|
from typing import Self
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
DEFAULT_PAGE_SIZE = 100
|
DEFAULT_PAGE_SIZE = 100
|
||||||
|
EXPECTED_NO_CONTENT = 204
|
||||||
EXPECTED_CREATED = 201
|
EXPECTED_CREATED = 201
|
||||||
EXPECTED_OK = 200
|
EXPECTED_OK = 200
|
||||||
|
|
||||||
@@ -222,6 +224,16 @@ class GiteaClient:
|
|||||||
json=payload,
|
json=payload,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def dispatch_workflow(self, *, owner: str, repo: str, workflow_id: str, ref: str) -> None:
|
||||||
|
"""Trigger a workflow_dispatch run."""
|
||||||
|
workflow_path = quote(workflow_id, safe="")
|
||||||
|
self._request(
|
||||||
|
"POST",
|
||||||
|
f"/api/v1/repos/{owner}/{repo}/actions/workflows/{workflow_path}/dispatches",
|
||||||
|
expected_statuses={EXPECTED_OK, EXPECTED_NO_CONTENT},
|
||||||
|
json={"ref": ref},
|
||||||
|
)
|
||||||
|
|
||||||
def list_run_jobs(self, *, owner: str, repo: str, run_id: str | int) -> list[WorkflowJob]:
|
def list_run_jobs(self, *, owner: str, repo: str, run_id: str | int) -> list[WorkflowJob]:
|
||||||
"""List workflow jobs for a specific run."""
|
"""List workflow jobs for a specific run."""
|
||||||
jobs: list[WorkflowJob] = []
|
jobs: list[WorkflowJob] = []
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ DEFAULT_BASE_BRANCH = "main"
|
|||||||
DEFAULT_BRANCH = "automation/update-flake-lock"
|
DEFAULT_BRANCH = "automation/update-flake-lock"
|
||||||
DEFAULT_GITEA_URL = "https://gitea.tmmworkshop.com"
|
DEFAULT_GITEA_URL = "https://gitea.tmmworkshop.com"
|
||||||
PR_LABELS = ["dependencies", "automated", "flake_lock_update"]
|
PR_LABELS = ["dependencies", "automated", "flake_lock_update"]
|
||||||
|
PR_CHECK_WORKFLOWS = ["build_systems.yml", "treefmt.yml", "pytest.yml"]
|
||||||
PR_TITLE = "Update flake.lock"
|
PR_TITLE = "Update flake.lock"
|
||||||
PR_BODY = "Automated flake.lock update."
|
PR_BODY = "Automated flake.lock update."
|
||||||
|
|
||||||
@@ -57,6 +58,12 @@ def find_flake_lock_pull_request(client: GiteaClient, *, owner: str, repo: str)
|
|||||||
return pull_requests[0]
|
return pull_requests[0]
|
||||||
|
|
||||||
|
|
||||||
|
def dispatch_pull_request_checks(client: GiteaClient, *, owner: str, repo: str, branch: str) -> None:
|
||||||
|
"""Dispatch the workflows that normally run for pull requests."""
|
||||||
|
for workflow in PR_CHECK_WORKFLOWS:
|
||||||
|
client.dispatch_workflow(owner=owner, repo=repo, workflow_id=workflow, ref=branch)
|
||||||
|
|
||||||
|
|
||||||
def has_worktree_changes() -> bool:
|
def has_worktree_changes() -> bool:
|
||||||
"""Return whether `flake.lock` has worktree changes."""
|
"""Return whether `flake.lock` has worktree changes."""
|
||||||
result = run_cmd(["git", "diff", "--quiet", "--", "flake.lock"], check=False)
|
result = run_cmd(["git", "diff", "--quiet", "--", "flake.lock"], check=False)
|
||||||
@@ -113,6 +120,9 @@ def update(
|
|||||||
branch=branch,
|
branch=branch,
|
||||||
base=base,
|
base=base,
|
||||||
)
|
)
|
||||||
|
# We can remove this if Gitea fixes the following issue:
|
||||||
|
# https://github.com/go-gitea/gitea/issues/33963
|
||||||
|
dispatch_pull_request_checks(client, owner=owner, repo=repo_name, branch=branch)
|
||||||
typer.echo(pull_request.html_url or f"Pull request #{pull_request.number}")
|
typer.echo(pull_request.html_url or f"Pull request #{pull_request.number}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,12 @@
|
|||||||
networking = {
|
networking = {
|
||||||
hostName = "bob";
|
hostName = "bob";
|
||||||
hostId = "7c678a41";
|
hostId = "7c678a41";
|
||||||
firewall.enable = true;
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [
|
||||||
|
8000
|
||||||
|
];
|
||||||
|
};
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
keyFile = "/dev/disk/by-id/usb-Samsung_Flash_Drive_FIT_0374620080067131-0:0";
|
keyFile = "/dev/disk/by-id/usb-Samsung_Flash_Drive_FIT_0374620080067131-0:0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
zfs.extraPools = [
|
||||||
|
"storage"
|
||||||
|
];
|
||||||
|
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,11 +42,12 @@
|
|||||||
"qwen3:8b"
|
"qwen3:8b"
|
||||||
"qwen3.5:27b"
|
"qwen3.5:27b"
|
||||||
"qwen3.5:35b"
|
"qwen3.5:35b"
|
||||||
|
"qwen3.6:27b"
|
||||||
"qwen3.6:35b"
|
"qwen3.6:35b"
|
||||||
|
"rinex20/translategemma3:12b"
|
||||||
"translategemma:12b"
|
"translategemma:12b"
|
||||||
"translategemma:27b"
|
"translategemma:27b"
|
||||||
"translategemma:4b"
|
"translategemma:4b"
|
||||||
"rinex20/translategemma3:12b"
|
|
||||||
];
|
];
|
||||||
models = "/zfs/storage/models";
|
models = "/zfs/storage/models";
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
|||||||
@@ -43,11 +43,18 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
networks = {
|
networks = {
|
||||||
"10-1GB_Primary" = {
|
"10-Primary" = {
|
||||||
matchConfig.Name = "enp97s0f1";
|
matchConfig.Name = "enp97s0";
|
||||||
address = [ "192.168.99.14/24" ];
|
address = [ "192.168.99.14/24" ];
|
||||||
|
dns = [
|
||||||
|
"192.168.99.1"
|
||||||
|
"2600:4040:abfb:d700::1"
|
||||||
|
];
|
||||||
routes = [ { Gateway = "192.168.99.1"; } ];
|
routes = [ { Gateway = "192.168.99.1"; } ];
|
||||||
vlan = [ "internet-vlan" ];
|
vlan = [ "internet-vlan" ];
|
||||||
|
dhcpV4Config.UseDNS = false;
|
||||||
|
dhcpV6Config.UseDNS = false;
|
||||||
|
ipv6AcceptRAConfig.UseDNS = false;
|
||||||
linkConfig.RequiredForOnline = "routable";
|
linkConfig.RequiredForOnline = "routable";
|
||||||
};
|
};
|
||||||
"50-internet-vlan" = {
|
"50-internet-vlan" = {
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
filebot
|
filebot
|
||||||
docker-compose
|
docker-compose
|
||||||
|
ffmpeg
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ let
|
|||||||
vars = import ../vars.nix;
|
vars = import ../vars.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.audiobookshelf.enable = true;
|
services.audiobookshelf = {
|
||||||
|
enable = true;
|
||||||
|
port = 8000;
|
||||||
|
};
|
||||||
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
|
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
|
||||||
lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
||||||
users.users.audiobookshelf.home = lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
users.users.audiobookshelf.home = lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
vars = import ../vars.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${vars.docker_configs}/camofox-browser 0750 root root - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
containers.camofox-browser = {
|
||||||
|
autoStart = true;
|
||||||
|
privateNetwork = false;
|
||||||
|
bindMounts = {
|
||||||
|
camofox-browser = {
|
||||||
|
hostPath = "${vars.docker_configs}/camofox-browser";
|
||||||
|
mountPoint = "/var/lib/camofox-browser";
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
networking.hostName = "camofox-browser";
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
ffmpeg
|
||||||
|
git
|
||||||
|
nodejs
|
||||||
|
python3Packages.yt-dlp
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.camofox-browser = {
|
||||||
|
description = "Camofox browser server";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
environment = {
|
||||||
|
CAMOFOX_HOST = "127.0.0.1";
|
||||||
|
CAMOFOX_PORT = "9377";
|
||||||
|
HOME = "/var/lib/camofox-browser";
|
||||||
|
};
|
||||||
|
path = with pkgs; [
|
||||||
|
bash
|
||||||
|
coreutils
|
||||||
|
git
|
||||||
|
nodejs
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
|
WorkingDirectory = "/var/lib/camofox-browser";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
app_dir=/var/lib/camofox-browser/app
|
||||||
|
|
||||||
|
if [ ! -d "$app_dir/.git" ]; then
|
||||||
|
git clone --depth 1 https://github.com/jo-inc/camofox-browser "$app_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$app_dir"
|
||||||
|
|
||||||
|
if [ ! -d node_modules ]; then
|
||||||
|
npm install
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec npm start
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = lib.mkDefault "24.05";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
vars = import ../vars.nix;
|
||||||
|
stateDir = "${vars.services}/nornsight";
|
||||||
|
appDir = "${stateDir}/app";
|
||||||
|
binPath = pkgs.lib.makeBinPath [
|
||||||
|
pkgs.binutils
|
||||||
|
pkgs.libpq
|
||||||
|
pkgs.postgresql
|
||||||
|
pkgs.stdenv.cc
|
||||||
|
];
|
||||||
|
libraryPath = pkgs.lib.makeLibraryPath [
|
||||||
|
pkgs.libpq
|
||||||
|
pkgs.postgresql.lib
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${stateDir} 0750 nornsight nornsight - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.nornsight = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "nornsight";
|
||||||
|
home = stateDir;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.nornsight = {
|
||||||
|
description = "Norn Sight";
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
HOME = stateDir;
|
||||||
|
UV_CACHE_DIR = "${stateDir}/.cache/uv";
|
||||||
|
UV_PROJECT_ENVIRONMENT = "${appDir}/.venv";
|
||||||
|
UV_PYTHON = "${pkgs.python313}/bin/python3.13";
|
||||||
|
UV_PYTHON_DOWNLOADS = "never";
|
||||||
|
LD_LIBRARY_PATH = libraryPath;
|
||||||
|
LIBRARY_PATH = libraryPath;
|
||||||
|
PSYCOPG_IMPL = "python";
|
||||||
|
};
|
||||||
|
|
||||||
|
path = with pkgs; [
|
||||||
|
bash
|
||||||
|
coreutils
|
||||||
|
git
|
||||||
|
uv
|
||||||
|
];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
User = "nornsight";
|
||||||
|
Group = "nornsight";
|
||||||
|
EnvironmentFile = "-${vars.secrets}/services/nornsight";
|
||||||
|
WorkingDirectory = stateDir;
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
StandardOutput = "journal";
|
||||||
|
StandardError = "journal";
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
ReadWritePaths = [ stateDir ];
|
||||||
|
};
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
set -eu
|
||||||
|
export PATH="${binPath}:$PATH"
|
||||||
|
export LD_LIBRARY_PATH="${libraryPath}:''${LD_LIBRARY_PATH:-}"
|
||||||
|
export LIBRARY_PATH="${libraryPath}:''${LIBRARY_PATH:-}"
|
||||||
|
|
||||||
|
: "''${NORN_SIGHT_REPO_URL:?NORN_SIGHT_REPO_URL is required}"
|
||||||
|
branch="''${NORN_SIGHT_BRANCH:-main}"
|
||||||
|
|
||||||
|
if [ -d "${appDir}/.git" ]; then
|
||||||
|
current_origin="$(git -C "${appDir}" remote get-url origin)"
|
||||||
|
if [ "$current_origin" != "$NORN_SIGHT_REPO_URL" ]; then
|
||||||
|
rm -rf "${appDir}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${appDir}/.git" ]; then
|
||||||
|
git clone --branch "$branch" "$NORN_SIGHT_REPO_URL" "${appDir}"
|
||||||
|
else
|
||||||
|
cd "${appDir}"
|
||||||
|
git fetch origin "$branch"
|
||||||
|
git checkout "$branch"
|
||||||
|
git pull --ff-only origin "$branch"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${appDir}"
|
||||||
|
uv sync --upgrade
|
||||||
|
uv run python - <<'PY'
|
||||||
|
import ctypes.util
|
||||||
|
import os
|
||||||
|
|
||||||
|
print(f"LD_LIBRARY_PATH={os.environ.get('LD_LIBRARY_PATH')}")
|
||||||
|
print(f"LIBRARY_PATH={os.environ.get('LIBRARY_PATH')}")
|
||||||
|
print(f"libpq={ctypes.util.find_library('pq')}")
|
||||||
|
PY
|
||||||
|
exec uv run uvicorn pipelines.web.main:app --host 0.0.0.0 --port 8001
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,6 +10,14 @@ in
|
|||||||
settings = {
|
settings = {
|
||||||
devices.davids-server.id = "7GXTDGR-AOXFW2O-K6J7NM3-XYZNRRW-AKHAFWM-GBOWUPQ-OA6JIWD-ER7RDQL"; # cspell:disable-line
|
devices.davids-server.id = "7GXTDGR-AOXFW2O-K6J7NM3-XYZNRRW-AKHAFWM-GBOWUPQ-OA6JIWD-ER7RDQL"; # cspell:disable-line
|
||||||
folders = {
|
folders = {
|
||||||
|
photos = {
|
||||||
|
path = "${vars.syncthing}/important";
|
||||||
|
devices = [
|
||||||
|
"rhapsody-in-green"
|
||||||
|
"phone"
|
||||||
|
];
|
||||||
|
fsWatcherEnabled = true;
|
||||||
|
};
|
||||||
"dotfiles" = {
|
"dotfiles" = {
|
||||||
path = "/home/richie/dotfiles";
|
path = "/home/richie/dotfiles";
|
||||||
devices = [
|
devices = [
|
||||||
|
|||||||
@@ -81,4 +81,4 @@ backend gitea
|
|||||||
|
|
||||||
backend norn_sight
|
backend norn_sight
|
||||||
mode http
|
mode http
|
||||||
server server 192.168.90.49:8000
|
server server 127.0.0.1:8001
|
||||||
|
|||||||
@@ -11,10 +11,9 @@
|
|||||||
"${inputs.self}/common/optional/yubikey.nix"
|
"${inputs.self}/common/optional/yubikey.nix"
|
||||||
"${inputs.self}/common/optional/zerotier.nix"
|
"${inputs.self}/common/optional/zerotier.nix"
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./llms.nix
|
|
||||||
./open_webui.nix
|
./open_webui.nix
|
||||||
|
./programs.nix
|
||||||
./qmk.nix
|
./qmk.nix
|
||||||
./sunshine.nix
|
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||||
];
|
];
|
||||||
@@ -27,6 +26,7 @@
|
|||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
8000
|
8000
|
||||||
8080
|
8080
|
||||||
|
8081
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
|
|||||||
Binary file not shown.
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
services.ollama = {
|
|
||||||
user = "ollama";
|
|
||||||
enable = true;
|
|
||||||
host = "127.0.0.1";
|
|
||||||
syncModels = true;
|
|
||||||
loadModels = [
|
|
||||||
"deepscaler:1.5b"
|
|
||||||
"deepseek-r1:8b"
|
|
||||||
"gemma3:12b"
|
|
||||||
"lfm2:24b"
|
|
||||||
"nemotron-3-nano:4b"
|
|
||||||
"qwen3:14b"
|
|
||||||
"qwen3.5:27b"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
systemd.services = {
|
|
||||||
ollama.serviceConfig = {
|
|
||||||
Nice = 19;
|
|
||||||
IOSchedulingPriority = 7;
|
|
||||||
};
|
|
||||||
ollama-model-loader.serviceConfig = {
|
|
||||||
Nice = 19;
|
|
||||||
CPUWeight = 50;
|
|
||||||
IOSchedulingClass = "idle";
|
|
||||||
IOSchedulingPriority = 7;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
ffmpeg
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
capSysAdmin = true;
|
|
||||||
};
|
|
||||||
environment.systemPackages = [ pkgs.kdePackages.libkscreen ];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
kernelParams = [
|
|
||||||
"drm.edid_firmware=DP-4:edid/virtual-display.bin"
|
|
||||||
"video=DP-4:e"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.firmware = [
|
|
||||||
(pkgs.runCommandLocal "virtual-display-edid"
|
|
||||||
{
|
|
||||||
compressFirmware = false;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
mkdir -p $out/lib/firmware/edid
|
|
||||||
cp ${./edid/virtual-display.bin} $out/lib/firmware/edid/virtual-display.bin
|
|
||||||
''
|
|
||||||
)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -39,6 +39,14 @@
|
|||||||
];
|
];
|
||||||
fsWatcherEnabled = true;
|
fsWatcherEnabled = true;
|
||||||
};
|
};
|
||||||
|
photos = {
|
||||||
|
path = "/home/richie/photos";
|
||||||
|
devices = [
|
||||||
|
"jeeves"
|
||||||
|
"phone"
|
||||||
|
];
|
||||||
|
fsWatcherEnabled = true;
|
||||||
|
};
|
||||||
"projects" = {
|
"projects" = {
|
||||||
id = "vyma6-lqqrz"; # cspell:disable-line
|
id = "vyma6-lqqrz"; # cspell:disable-line
|
||||||
path = "/home/richie/projects";
|
path = "/home/richie/projects";
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
"""Tests for Gitea flake.lock automation."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from python.gitea import PullRequest
|
||||||
|
from python.gitea_flake_lock import (
|
||||||
|
PR_CHECK_WORKFLOWS,
|
||||||
|
PR_LABELS,
|
||||||
|
dispatch_pull_request_checks,
|
||||||
|
ensure_flake_lock_pull_request,
|
||||||
|
find_flake_lock_pull_request,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _pull_request(number=1, head_branch="automation/update-flake-lock"):
|
||||||
|
return PullRequest(
|
||||||
|
number=number,
|
||||||
|
title="Update flake.lock",
|
||||||
|
html_url=f"https://gitea.example.test/pulls/{number}",
|
||||||
|
labels=(),
|
||||||
|
head_branch=head_branch,
|
||||||
|
base_branch="main",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class FakeGiteaClient:
|
||||||
|
def __init__(self, pull_requests=None):
|
||||||
|
self.pull_requests = pull_requests or []
|
||||||
|
self.dispatch_calls = []
|
||||||
|
self.list_calls = []
|
||||||
|
self.create_calls = []
|
||||||
|
|
||||||
|
def list_open_pull_requests(self, **kwargs):
|
||||||
|
self.list_calls.append(kwargs)
|
||||||
|
return self.pull_requests
|
||||||
|
|
||||||
|
def create_pull_request(self, **kwargs):
|
||||||
|
self.create_calls.append(kwargs)
|
||||||
|
return _pull_request()
|
||||||
|
|
||||||
|
def dispatch_workflow(self, **kwargs):
|
||||||
|
self.dispatch_calls.append(kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def test_ensure_flake_lock_pull_request_finds_by_branch():
|
||||||
|
pull_request = _pull_request()
|
||||||
|
client = FakeGiteaClient([pull_request])
|
||||||
|
|
||||||
|
result = ensure_flake_lock_pull_request(
|
||||||
|
client,
|
||||||
|
owner="Richie",
|
||||||
|
repo="dotfiles",
|
||||||
|
branch="automation/update-flake-lock",
|
||||||
|
base="main",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result == pull_request
|
||||||
|
assert client.list_calls == [
|
||||||
|
{"owner": "Richie", "repo": "dotfiles", "head": "automation/update-flake-lock"},
|
||||||
|
]
|
||||||
|
assert client.create_calls == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_ensure_flake_lock_pull_request_creates_with_labels():
|
||||||
|
client = FakeGiteaClient()
|
||||||
|
|
||||||
|
ensure_flake_lock_pull_request(
|
||||||
|
client,
|
||||||
|
owner="Richie",
|
||||||
|
repo="dotfiles",
|
||||||
|
branch="automation/update-flake-lock",
|
||||||
|
base="main",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert client.create_calls == [
|
||||||
|
{
|
||||||
|
"owner": "Richie",
|
||||||
|
"repo": "dotfiles",
|
||||||
|
"title": "Update flake.lock",
|
||||||
|
"body": "Automated flake.lock update.",
|
||||||
|
"head": "automation/update-flake-lock",
|
||||||
|
"base": "main",
|
||||||
|
"labels": PR_LABELS,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def test_find_flake_lock_pull_request_finds_by_label():
|
||||||
|
pull_request = _pull_request()
|
||||||
|
client = FakeGiteaClient([pull_request])
|
||||||
|
|
||||||
|
result = find_flake_lock_pull_request(client, owner="Richie", repo="dotfiles")
|
||||||
|
|
||||||
|
assert result == pull_request
|
||||||
|
assert client.list_calls == [
|
||||||
|
{"owner": "Richie", "repo": "dotfiles", "labels": ["flake_lock_update"]},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def test_dispatch_pull_request_checks_runs_each_workflow():
|
||||||
|
client = FakeGiteaClient()
|
||||||
|
|
||||||
|
dispatch_pull_request_checks(client, owner="Richie", repo="dotfiles", branch="automation/update-flake-lock")
|
||||||
|
|
||||||
|
assert client.dispatch_calls == [
|
||||||
|
{
|
||||||
|
"owner": "Richie",
|
||||||
|
"repo": "dotfiles",
|
||||||
|
"workflow_id": workflow,
|
||||||
|
"ref": "automation/update-flake-lock",
|
||||||
|
}
|
||||||
|
for workflow in PR_CHECK_WORKFLOWS
|
||||||
|
]
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"${inputs.self}/users/shared/sweet.nix"
|
"${inputs.self}/users/shared/sweet.nix"
|
||||||
./firefox
|
./firefox
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
|
./llm_tools.nix
|
||||||
./vscode
|
./vscode
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -19,13 +20,11 @@
|
|||||||
qalculate-gtk
|
qalculate-gtk
|
||||||
vlc
|
vlc
|
||||||
# browser
|
# browser
|
||||||
|
brave
|
||||||
chromium
|
chromium
|
||||||
# dev tools
|
# dev tools
|
||||||
claude-code
|
|
||||||
codex
|
|
||||||
gparted
|
gparted
|
||||||
jetbrains.datagrip
|
jetbrains.datagrip
|
||||||
opencode
|
|
||||||
proxychains
|
proxychains
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{ inputs, ... }:
|
{ config, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./search_engines.nix ];
|
imports = [ ./search_engines.nix ];
|
||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
|
configPath = "${config.xdg.configHome}/mozilla/firefox";
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles.richie = {
|
profiles.richie = {
|
||||||
extensions.packages = with inputs.firefox-addons.packages.x86_64-linux; [
|
extensions.packages = with inputs.firefox-addons.packages.x86_64-linux; [
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
tab_bar_edge = "top";
|
tab_bar_edge = "top";
|
||||||
tab_bar_style = "powerline";
|
tab_bar_style = "powerline";
|
||||||
enabled_layouts = "splits";
|
enabled_layouts = "splits";
|
||||||
|
enable_audio_bell = "no";
|
||||||
};
|
};
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"ctrl+alt+1" = "launch --type=tab --tab-title jeeves kitten ssh jeeves";
|
"ctrl+alt+1" = "launch --type=tab --tab-title jeeves kitten ssh jeeves";
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
pkgs.master.claude-code
|
||||||
|
pkgs.master.codex
|
||||||
|
pkgs.master.opencode
|
||||||
|
pkgs.master.pi-coding-agent
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -2,46 +2,46 @@
|
|||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableDefaultConfig = false;
|
enableDefaultConfig = false;
|
||||||
matchBlocks = {
|
settings = {
|
||||||
jeeves = {
|
jeeves = {
|
||||||
hostname = "192.168.90.40";
|
HostName = "192.168.90.40";
|
||||||
user = "richie";
|
User = "richie";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 629;
|
Port = 629;
|
||||||
dynamicForwards = [ { port = 9050; } ];
|
DynamicForward = [ { port = 9050; } ];
|
||||||
compression = true;
|
Compression = true;
|
||||||
};
|
};
|
||||||
unlock-jeeves = {
|
unlock-jeeves = {
|
||||||
hostname = "192.168.99.14";
|
HostName = "192.168.99.14";
|
||||||
user = "root";
|
User = "root";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 2222;
|
Port = 2222;
|
||||||
};
|
};
|
||||||
brain = {
|
brain = {
|
||||||
hostname = "192.168.90.35";
|
HostName = "192.168.90.35";
|
||||||
user = "richie";
|
User = "richie";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 129;
|
Port = 129;
|
||||||
dynamicForwards = [ { port = 9050; } ];
|
DynamicForward = [ { port = 9050; } ];
|
||||||
};
|
};
|
||||||
unlock-brain = {
|
unlock-brain = {
|
||||||
hostname = "192.168.95.35";
|
HostName = "192.168.95.35";
|
||||||
user = "root";
|
User = "root";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 2222;
|
Port = 2222;
|
||||||
};
|
};
|
||||||
bob = {
|
bob = {
|
||||||
hostname = "192.168.90.25";
|
HostName = "192.168.90.25";
|
||||||
user = "richie";
|
User = "richie";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 262;
|
Port = 262;
|
||||||
dynamicForwards = [ { port = 9050; } ];
|
DynamicForward = [ { port = 9050; } ];
|
||||||
};
|
};
|
||||||
rhapsody-in-green = {
|
rhapsody-in-green = {
|
||||||
hostname = "192.168.90.221";
|
HostName = "192.168.90.221";
|
||||||
user = "richie";
|
User = "richie";
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
IdentityFile = "~/.ssh/id_ed25519";
|
||||||
port = 922;
|
Port = 922;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user