Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 398d72bf74 |
@@ -23,10 +23,7 @@
|
|||||||
boot = {
|
boot = {
|
||||||
tmp.useTmpfs = true;
|
tmp.useTmpfs = true;
|
||||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12;
|
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12;
|
||||||
zfs = {
|
zfs.package = lib.mkDefault pkgs.zfs_2_4;
|
||||||
package = lib.mkDefault pkgs.zfs_2_4;
|
|
||||||
forceImportRoot = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
# ZFS failed root import recovery
|
|
||||||
|
|
||||||
## Fast path
|
|
||||||
|
|
||||||
If the machine fails to boot because ZFS refuses to import `root_pool`:
|
|
||||||
|
|
||||||
### GRUB
|
|
||||||
|
|
||||||
1. At the bootloader menu, select the normal NixOS entry.
|
|
||||||
2. Press `e`.
|
|
||||||
3. Find the line that starts with `linux`.
|
|
||||||
4. Append this to the end of that line:
|
|
||||||
|
|
||||||
```text
|
|
||||||
zfs_force=1
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Boot once with `Ctrl+x` or `F10`.
|
|
||||||
|
|
||||||
### systemd-boot
|
|
||||||
|
|
||||||
1. At the bootloader menu, highlight the normal NixOS entry.
|
|
||||||
2. Press `e`.
|
|
||||||
3. Append this to the end of the options line:
|
|
||||||
|
|
||||||
```text
|
|
||||||
zfs_force=1
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Press `Enter` to boot once.
|
|
||||||
|
|
||||||
## After boot
|
|
||||||
|
|
||||||
Run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo zpool status
|
|
||||||
sudo zpool import
|
|
||||||
journalctl -b | rg "ZFS|zfs|import|root_pool"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Expected result
|
|
||||||
|
|
||||||
`sudo zpool status` should show `root_pool` as `ONLINE`.
|
|
||||||
|
|
||||||
## Reboot test
|
|
||||||
|
|
||||||
Run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
Do not add `zfs_force=1` the second time.
|
|
||||||
|
|
||||||
## If it still fails
|
|
||||||
|
|
||||||
Boot once more with:
|
|
||||||
|
|
||||||
```text
|
|
||||||
zfs_force=1
|
|
||||||
```
|
|
||||||
|
|
||||||
Then run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo zpool status -v
|
|
||||||
sudo zpool history | tail -n 50
|
|
||||||
journalctl -b | rg "ZFS|zfs|import|root_pool"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
- Root pool name is `root_pool`.
|
|
||||||
- This is a one-time recovery path after disk moves, controller changes, dirty exports, or interrupted imports.
|
|
||||||
- Some hosts also need the LUKS unlock USB key inserted before boot.
|
|
||||||
@@ -3,6 +3,5 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
filebot
|
filebot
|
||||||
docker-compose
|
docker-compose
|
||||||
ffmpeg
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ let
|
|||||||
vars = import ../vars.nix;
|
vars = import ../vars.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.audiobookshelf = {
|
services.audiobookshelf.enable = true;
|
||||||
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";
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
{ 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,14 +10,6 @@ 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 127.0.0.1:8001
|
server server 192.168.90.49:8000
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"${inputs.self}/common/optional/zerotier.nix"
|
"${inputs.self}/common/optional/zerotier.nix"
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./open_webui.nix
|
./open_webui.nix
|
||||||
./programs.nix
|
|
||||||
./qmk.nix
|
./qmk.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
ffmpeg
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -39,14 +39,6 @@
|
|||||||
];
|
];
|
||||||
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";
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
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";
|
||||||
|
|||||||
Reference in New Issue
Block a user