Add nix-output-monitor
Use nix-output-monitor for things like my rebuilds
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# vim: set ft=python :
|
# vim: set ft=xonsh :
|
||||||
|
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile, TemporaryDirectory
|
||||||
|
|
||||||
def bw_unlock():
|
def bw_unlock():
|
||||||
"""Unlocks the BitWarden CLI and adds the resulting session code to the
|
"""Unlocks the BitWarden CLI and adds the resulting session code to the
|
||||||
@@ -48,7 +48,7 @@ aliases['glrestart'] = _glrestart
|
|||||||
|
|
||||||
def _cfetch(args):
|
def _cfetch(args):
|
||||||
bw_unlock()
|
bw_unlock()
|
||||||
$CIRCLECI_CLI_TOKEN=$(bw get password CircleCI)
|
$CIRCLECI_CLI_TOKEN=$(bw get password CircleCI)
|
||||||
compass workspace exec bazel run src/go/compass.com/tools/circleci_results_cache/fetch/cmd/fetch:fetch
|
compass workspace exec bazel run src/go/compass.com/tools/circleci_results_cache/fetch/cmd/fetch:fetch
|
||||||
aliases['cfetch'] = _cfetch
|
aliases['cfetch'] = _cfetch
|
||||||
|
|
||||||
@@ -59,10 +59,18 @@ aliases['aws_creds'] = _aws_creds
|
|||||||
|
|
||||||
def _rebuild(args):
|
def _rebuild(args):
|
||||||
system = uname()
|
system = uname()
|
||||||
|
hostname = system.nodename
|
||||||
if system.sysname == 'Darwin':
|
if system.sysname == 'Darwin':
|
||||||
darwin-rebuild --flake ~/.config/darwin switch
|
darwin-rebuild --flake ~/.config/darwin switch
|
||||||
else:
|
else:
|
||||||
sudo nixos-rebuild switch
|
with TemporaryDirectory() as td:
|
||||||
|
pushd @(td)
|
||||||
|
import platform
|
||||||
|
nom build f"/etc/nixos#nixosConfigurations.{hostname}.config.build.toplevel"
|
||||||
|
if g`result`:
|
||||||
|
nvd diff /run/current-system result
|
||||||
|
sudo result/bin/switch-to-configuration switch
|
||||||
|
popd
|
||||||
aliases['rebuild'] = _rebuild
|
aliases['rebuild'] = _rebuild
|
||||||
|
|
||||||
def _yaml2json(args, stdin=None, stdout=None):
|
def _yaml2json(args, stdin=None, stdout=None):
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ in
|
|||||||
iperf
|
iperf
|
||||||
killall
|
killall
|
||||||
nano
|
nano
|
||||||
|
nix-output-monitor
|
||||||
pciutils
|
pciutils
|
||||||
pwgen
|
pwgen
|
||||||
unzip
|
unzip
|
||||||
|
|||||||
Reference in New Issue
Block a user