Add scripts to check the status of nix_builder.
This commit is contained in:
@@ -10,6 +10,19 @@
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
patchScriptBin =
|
||||
filename: contents:
|
||||
((pkgs.writeScriptBin filename contents).overrideAttrs (old: {
|
||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||
}));
|
||||
cache_status_full = (
|
||||
patchScriptBin "cache_status_full" (builtins.readFile ./files/cache_status_full.bash)
|
||||
);
|
||||
cache_status_latest = (
|
||||
patchScriptBin "cache_status_latest" (builtins.readFile ./files/cache_status_latest.bash)
|
||||
);
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
@@ -26,6 +39,8 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix_builder.packages.x86_64-linux.default
|
||||
sqlite # For manually inspecting the database.
|
||||
cache_status_full
|
||||
cache_status_latest
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Shows the status of all builds in nix_builder.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
doas -u nixworker env NIX_REMOTE='local?root=/.disk/root' RUST_BACKTRACE=1 RUST_LOG=nix_builder=DEBUG sqlite3 -header -box /home/nixworker/persist/nix_builder/nix_builder.sqlite "select * from (select build.id, datetime(build.start_time, 'unixepoch') as start_time, datetime(build.end_time, 'unixepoch') as end_time, build.status, build.target, flake_inputs.rev from build left outer join flake_inputs on build.id=flake_inputs.build_id and flake_inputs.input_name='nixpkgs' order by build.id desc
|
||||
limit 45) order by id asc;"
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Shows the status of all builds in nix_builder.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
doas -u nixworker env NIX_REMOTE='local?root=/.disk/root' RUST_BACKTRACE=1 RUST_LOG=nix_builder=DEBUG sqlite3 -header -box /home/nixworker/persist/nix_builder/nix_builder.sqlite "select * from (select build.id, datetime(build.start_time, 'unixepoch') as start_time, datetime(build.end_time, 'unixepoch') as end_time, build.status, build.target, flake_inputs.rev from build left outer join flake_inputs on build.id=flake_inputs.build_id and flake_inputs.input_name='nixpkgs' order by build.id desc
|
||||
limit 45) order by id asc;"
|
||||
Reference in New Issue
Block a user