feat(nix): use nix-monitored

Automatically pipes all nix output through `nix-output-monitor`
Deprecates the manual pipe in the `rebuild` script
This commit is contained in:
reo101 2023-12-25 18:49:26 +02:00
parent 8feb5245ea
commit ac66ed6530
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
4 changed files with 32 additions and 3 deletions

View file

@ -36,6 +36,10 @@
flake = false;
};
nix-monitored = {
url = "github:ners/nix-monitored";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
@ -110,6 +114,7 @@
, nix-darwin
, mac-app-util
, home-manager
, nix-monitored
, disko
, deploy-rs
, agenix

View file

@ -33,7 +33,7 @@ let
if cfg.hostname != null
then "${cfg.flakePath}#${cfg.hostname}"
else "${cfg.flakePath}"
} ''$''\{1:-switch''\} "''$''\{@:2''\}" |& nix run nixpkgs#nix-output-monitor
} ''$''\{1:-switch''\} "''$''\{@:2''\}" # |& nix run nixpkgs#nix-output-monitor
'';
in
"${rebuild_script}";

View file

@ -30,6 +30,16 @@
};
};
nix = inputs.nix-monitored.packages.${final.system}.default.override {
nix = prev.nix;
nix-output-monitor = prev.nix-output-monitor;
};
nixUnstable = inputs.nix-monitored.packages.${final.system}.default.override {
nix = prev.nixUnstable;
nix-output-monitor = prev.nix-output-monitor;
};
himalaya = prev.himalaya.overrideAttrs (oldAttrs: rec {
buildInputs =
(prev.buildInputs or [ ]) ++

View file

@ -118,6 +118,9 @@ rec {
modules = [
(lib.path.append root "configuration.nix")
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = builtins.attrValues outputs.overlays;
}
{
home-manager = {
useGlobalPkgs = false;
@ -154,6 +157,9 @@ rec {
modules = [
(lib.path.append root "configuration.nix")
{ nix.registry.nixpkgs.flake = nixpkgs; }
{
nixpkgs.overlays = builtins.attrValues outputs.overlays;
}
{
home-manager = {
config = (lib.path.append root "home.nix");
@ -183,6 +189,12 @@ rec {
modules = [
(lib.path.append root "configuration.nix")
{
nixpkgs.hostPlatform = system;
}
{
nixpkgs.overlays = builtins.attrValues outputs.overlays;
}
inputs.home-manager.darwinModules.home-manager
{
home-manager = {
@ -200,9 +212,8 @@ rec {
}
] ++ (builtins.attrValues nixDarwinModules);
inputs = {
specialArgs = {
inherit inputs outputs;
inherit nixpkgs;
};
};
@ -211,6 +222,9 @@ rec {
modules = [
(lib.path.append root "home.nix")
{
nixpkgs.overlays = builtins.attrValues outputs.overlays;
}
] ++ (builtins.attrValues homeManagerModules);
extraSpecialArgs = {