From b5fc3ce865c15070e6b29eef01299375f3faccb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 2 Feb 2024 10:47:48 +0200 Subject: [PATCH] nicer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ nix build .#homeConfigurations.x86_64-linux.motiejusja.activationPackage warning: Git tree '/home/motiejus/code/config' is dirty error: … while calling the 'derivationStrict' builtin at /builtin/derivation.nix:9:12: (source not available) … while evaluating derivation 'home-manager-generation' whose name attribute is located at /nix/store/sb3x0gk95v9h285ch8cdqv3gfjp97p1b-source/pkgs/stdenv/generic/make-derivation.nix:348:7 … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation' at /nix/store/sb3x0gk95v9h285ch8cdqv3gfjp97p1b-source/pkgs/build-support/trivial-builders/default.nix:87:14: 86| enableParallelBuilding = true; 87| inherit buildCommand name; | ^ 88| passAsFile = [ "buildCommand" ] (stack trace truncated; use '--show-trace' to show the full trace) error: A definition for option `home.packages' is not of type `list of package'. Definition values: - In `/nix/store/2mk1zyrkzf2cnhqhlvqr9wlbxfa4gymi-source/shared/home': --- shared/home/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/shared/home/default.nix b/shared/home/default.nix index 3e81abb..6f1639a 100644 --- a/shared/home/default.nix +++ b/shared/home/default.nix @@ -20,6 +20,31 @@ go zig ]) + (writeShellApplication { + name = "nicer"; + text = '' + set -e + f=$(${coreutils}/bin/mktemp) + trap 'rm -f "$f"' EXIT + ${coreutils}/bin/env > "$f" + systemd-run \ + --user \ + --same-dir \ + --slice nicer \ + --nice=19 \ + --property CPUSchedulingPolicy=idle \ + --property IOSchedulingClass=idle \ + --property IOSchedulingPriority=7 \ + --pty \ + --pipe \ + --wait \ + --collect \ + --quiet \ + --property EnvironmentFile="$f" \ + --service-type=exec \ + -- "$@" + ''; + }) (lib.mkIf hmOnly [ pkgs.nixgl.nixGLIntel ncdu