From 6e2d89c5e00a63699527853d15db2a73e33ec283 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 2 Nov 2026 14:01:09 +0100 Subject: modules/nix: Add nix wrapper, that checks nix store size before working --- modules/by-name/ni/nix/module.nix | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'modules/by-name/ni/nix/module.nix') diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index b7e64989..e46d6e85 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -21,6 +21,38 @@ }: let inherit (sources) nixpkgs; + lix = + pkgs.lixPackageSets.latest.lix; + + nixWrapperBase = pkgs.writeShellApplication { + inherit (lix) name; + + text = builtins.readFile ./nix_wrapper.sh; + inheritPath = false; + runtimeInputs = [ + pkgs.lixPackageSets.latest.lix + pkgs.libnotify + pkgs.btrfs-progs + pkgs.coreutils + pkgs.gnused + pkgs.gnugrep + pkgs.bc + ]; + + derivationArgs = { + inherit (lix) meta pname version; + }; + }; + + nixWrapper = pkgs.symlinkJoin { + inherit (lix) name; + paths = [ + nixWrapperBase + pkgs.lixPackageSets.latest.lix + ]; + inherit (lix) meta pname version; + }; + cfg = config.soispha.nix; in { options.soispha.nix = { @@ -29,7 +61,7 @@ in { config = lib.mkIf cfg.enable { nix = { - package = pkgs.lixPackageSets.latest.lix; + package = nixWrapper; # Disable nix channels (this is a remnant of old days) channel.enable = false; -- cgit v1.3.1