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():
|
||||
"""Unlocks the BitWarden CLI and adds the resulting session code to the
|
||||
@@ -48,7 +48,7 @@ aliases['glrestart'] = _glrestart
|
||||
|
||||
def _cfetch(args):
|
||||
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
|
||||
aliases['cfetch'] = _cfetch
|
||||
|
||||
@@ -59,10 +59,18 @@ aliases['aws_creds'] = _aws_creds
|
||||
|
||||
def _rebuild(args):
|
||||
system = uname()
|
||||
hostname = system.nodename
|
||||
if system.sysname == 'Darwin':
|
||||
darwin-rebuild --flake ~/.config/darwin switch
|
||||
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
|
||||
|
||||
def _yaml2json(args, stdin=None, stdout=None):
|
||||
|
||||
Reference in New Issue
Block a user