feat: use nix-output-monitor for builds #18

merged
opened by a.starrysky.fyi targeting main from private/minion/push-tqrsnzyqotlz

It'd be nice to use nix output monitor for builds - there's a project which automatically uses nix output monitor when nix is called (even supporting nix-direnv/nixos-rebuild)... this looks probably good for us to use.

There is one issue of some importance on the nix-monitored tracker which suggests that nix-monitored incorrectly transforms some 'nix run' invocations... fortunately, we don't use flakes so this shouldn't be a huge issue

If it is, using

NIX_MONITOR=disable

will temporarily disable nix monitor, allowing you to run whatever you needed without issue while using nom for everything else

Changed files
+36 -1
packetmix
npins
systems
common
+13
packetmix/npins/sources.json
··· 274 274 "url": "https://github.com/nix-community/nix-index-database/archive/050a5feb5d1bb5b6e5fc04a7d3d816923a87c9ea.tar.gz", 275 275 "hash": "sha256-3HIpe3P2h1AUPYcAH9cjuX0tZOqJpX01c0iDwoUYNZ8=" 276 276 }, 277 + "nix-monitored": { 278 + "type": "Git", 279 + "repository": { 280 + "type": "GitHub", 281 + "owner": "ners", 282 + "repo": "nix-monitored" 283 + }, 284 + "branch": "master", 285 + "submodules": false, 286 + "revision": "60f3baa4701d58eab86c2d1d9c3d7e820074d461", 287 + "url": "https://github.com/ners/nix-monitored/archive/60f3baa4701d58eab86c2d1d9c3d7e820074d461.tar.gz", 288 + "hash": "sha256-Z8PknjkmIr/8ZCH+dmc2Pc+UltiOr7/oKg37PXuVvuU=" 289 + }, 277 290 "nixos-unstable": { 278 291 "type": "Channel", 279 292 "name": "nixos-unstable",
+23 -1
packetmix/systems/common/lix.nix
··· 2 2 # 3 3 # SPDX-License-Identifier: MIT 4 4 5 - { project, ... }: 5 + { 6 + project, 7 + pkgs, 8 + system, 9 + ... 10 + }: 6 11 { 7 12 imports = [ 8 13 (import "${project.inputs.lix-module.result}/module.nix" { lix = project.inputs.lix.src; }) ··· 16 21 options = "--delete-older-than 7d"; 17 22 dates = "08:30"; 18 23 }; 24 + 25 + nixpkgs.overlays = [ 26 + (final: prev: { 27 + nix-monitored = project.inputs.nix-monitored.result.packages.${system}.default.override { 28 + nix = final.lix; 29 + withNotify = pkgs.stdenv.isLinux; 30 + }; 31 + nixos-rebuild = prev.nixos-rebuild.override { 32 + nix = final.nix-monitored; 33 + }; 34 + nix-direnv = prev.nix-direnv.override { 35 + nix = final.nix-monitored; 36 + }; 37 + }) 38 + ]; 39 + 40 + nix.package = pkgs.nix-monitored; 19 41 }