From 8920ce2ec59ae3e1472eaa693331daeb0da2beeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 24 Feb 2023 12:04:53 +0100 Subject: [PATCH] shell: add nom to monitor nixos-rebuild --- modules/profiles/base.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 2f971c6..e40adbd 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -5,6 +5,16 @@ }: with lib; +let + nom-system = pkgs.writeShellApplication { + name = "nom-system"; + runtimeInputs = with pkgs; [ nix-output-monitor ]; + text = '' + nom build --no-link "/home/moritz/.dotfiles#nixosConfigurations.$(hostname).config.system.build.toplevel" + ''; + }; + nom-system-command = command: "${nom-system}/bin/nom-system && ${command}"; +in { users.users.moritz = { isNormalUser = true; @@ -39,8 +49,8 @@ with lib; rm = "rm -i"; mv = "mv -i"; - nixos-switch = "sudo nixos-rebuild switch --flake ~/.dotfiles"; - nixos-boot = "sudo nixos-rebuild boot --flake ~/.dotfiles"; + nixos-switch = nom-system-command "sudo nixos-rebuild switch --flake ~/.dotfiles"; + nixos-boot = nom-system-command "sudo nixos-rebuild boot --flake ~/.dotfiles"; nixos-update = "pushd ~/.dotfiles && nix flake update && popd"; latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent''; @@ -77,6 +87,7 @@ with lib; nixpkgs-fmt statix manix + nix-output-monitor # other bat