Compare commits
8 Commits
398d72bf74
...
07759353be
| Author | SHA1 | Date | |
|---|---|---|---|
| 07759353be | |||
| 38fb14520e | |||
| 006ae6079a | |||
| 7d507fb7e1 | |||
| 0f69022e51 | |||
| a260ae2470 | |||
| 820b4a53d2 | |||
| ea77e83f06 |
@@ -23,7 +23,10 @@
|
||||
boot = {
|
||||
tmp.useTmpfs = true;
|
||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12;
|
||||
zfs.package = lib.mkDefault pkgs.zfs_2_4;
|
||||
zfs = {
|
||||
package = lib.mkDefault pkgs.zfs_2_4;
|
||||
forceImportRoot = lib.mkDefault false;
|
||||
};
|
||||
};
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# 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.
|
||||
Generated
+39
-23
@@ -8,11 +8,11 @@
|
||||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1778385775,
|
||||
"narHash": "sha256-n0MUvWA2SML/qBB4hpShQ7i+i961MX4oPtaQfYo0+uU=",
|
||||
"lastModified": 1780027372,
|
||||
"narHash": "sha256-LQ3CUdVZoKQqWzS2eEpY0rp9bJuzqydNFJUiJ6De9r8=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "268324916742a48cd03b94fd63f2822d6b66d519",
|
||||
"rev": "ef18b76eabdf4f9b2ce8e99e78ce698923693300",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
@@ -29,11 +29,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778365864,
|
||||
"narHash": "sha256-ImoT/wqmgMImf2dAC+E0MverAdA4QXsedOeES9B7Ezw=",
|
||||
"lastModified": 1780099287,
|
||||
"narHash": "sha256-efIPwVGtIWIjWcznhaop6XN6HxnOL8800hF6CBNvlqQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2f419037039a152448c5f4ae9494154753d1b399",
|
||||
"rev": "7d8127d308c3fb9664f7e643eec944be74ebb37d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -43,12 +43,15 @@
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778143761,
|
||||
"narHash": "sha256-lkesY6x2X2qxlqLM7CT2iM/0rP2JB7fruPN3h8POXmI=",
|
||||
"lastModified": 1780065812,
|
||||
"narHash": "sha256-SCSLUKBmwlSLGQ8Xbr8PjRFtiHNk0l9ktqkcmqdBkfE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "3bcaa367d4c550d687a17ac792fd5cda214ee871",
|
||||
"rev": "b76b5639c0593e0aeb0b5879ad62d4b30596c144",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -60,27 +63,24 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1777954456,
|
||||
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||
"type": "github"
|
||||
"lastModified": 1767892417,
|
||||
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
|
||||
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"type": "tarball",
|
||||
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
||||
}
|
||||
},
|
||||
"nixpkgs-master": {
|
||||
"locked": {
|
||||
"lastModified": 1778434251,
|
||||
"narHash": "sha256-TznExR00uHvyeJsQW9cy8aBCW8W8sIvhzoVjAQTEyiw=",
|
||||
"lastModified": 1780101106,
|
||||
"narHash": "sha256-VcvUdRb9rzKBbF6oMaMiAt+6HZQ1gom9b2dUybhVTVY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4f90e32d9c535072f0a6a9ac4599f1e78b829eab",
|
||||
"rev": "26b82d423c4f6fda4a8015182516c938f8104337",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -106,12 +106,28 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1779560665,
|
||||
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"firefox-addons": "firefox-addons",
|
||||
"home-manager": "home-manager",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-master": "nixpkgs-master",
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"sops-nix": "sops-nix",
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
filebot
|
||||
docker-compose
|
||||
ffmpeg
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ let
|
||||
vars = import ../vars.nix;
|
||||
in
|
||||
{
|
||||
services.audiobookshelf.enable = true;
|
||||
services.audiobookshelf = {
|
||||
enable = true;
|
||||
port = 8000;
|
||||
};
|
||||
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
|
||||
lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
||||
users.users.audiobookshelf.home = lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
||||
|
||||
@@ -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 = {
|
||||
devices.davids-server.id = "7GXTDGR-AOXFW2O-K6J7NM3-XYZNRRW-AKHAFWM-GBOWUPQ-OA6JIWD-ER7RDQL"; # cspell:disable-line
|
||||
folders = {
|
||||
photos = {
|
||||
path = "${vars.syncthing}/important";
|
||||
devices = [
|
||||
"rhapsody-in-green"
|
||||
"phone"
|
||||
];
|
||||
fsWatcherEnabled = true;
|
||||
};
|
||||
"dotfiles" = {
|
||||
path = "/home/richie/dotfiles";
|
||||
devices = [
|
||||
|
||||
@@ -81,4 +81,4 @@ backend gitea
|
||||
|
||||
backend norn_sight
|
||||
mode http
|
||||
server server 192.168.90.49:8000
|
||||
server server 127.0.0.1:8001
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"${inputs.self}/common/optional/zerotier.nix"
|
||||
./hardware.nix
|
||||
./open_webui.nix
|
||||
./programs.nix
|
||||
./qmk.nix
|
||||
./syncthing.nix
|
||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
ffmpeg
|
||||
];
|
||||
}
|
||||
@@ -39,6 +39,14 @@
|
||||
];
|
||||
fsWatcherEnabled = true;
|
||||
};
|
||||
photos = {
|
||||
path = "/home/richie/photos";
|
||||
devices = [
|
||||
"jeeves"
|
||||
"phone"
|
||||
];
|
||||
fsWatcherEnabled = true;
|
||||
};
|
||||
"projects" = {
|
||||
id = "vyma6-lqqrz"; # cspell:disable-line
|
||||
path = "/home/richie/projects";
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
tab_bar_edge = "top";
|
||||
tab_bar_style = "powerline";
|
||||
enabled_layouts = "splits";
|
||||
enable_audio_bell = "no";
|
||||
};
|
||||
keybindings = {
|
||||
"ctrl+alt+1" = "launch --type=tab --tab-title jeeves kitten ssh jeeves";
|
||||
|
||||
Reference in New Issue
Block a user