From d5917b126462b6ae8b8b705ca3939ad830d89a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 10 Jun 2024 02:21:32 +0200 Subject: [PATCH] Remove duplicate specialisation Saves 16s on eval time --- hm/brightness/default.nix | 8 ++++---- os/geoffrey.nix | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hm/brightness/default.nix b/hm/brightness/default.nix index 8fbc60e..6810d09 100644 --- a/hm/brightness/default.nix +++ b/hm/brightness/default.nix @@ -2,9 +2,9 @@ { pkgs, lib, config, ... }: let phases = [ - { command = "jour"; polarity = "light"; } - { command = "crepuscule"; polarity = "dark"; } - { command = "nuit"; polarity = "dark"; } + { command = "jour"; specialisation = null; } + { command = "crepuscule"; specialisation = "dark"; } + { command = "nuit"; specialisation = "dark"; } ]; phasesBrightness = config.frogeye.desktop.phasesBrightness; in @@ -17,7 +17,7 @@ in text = (lib.optionalString phasesBrightness.enable '' brightnessctl set ${builtins.getAttr phase.command phasesBrightness} '') + '' - switch="/nix/var/nix/profiles/system/specialisation/${phase.polarity}/bin/switch-to-configuration" + switch="/nix/var/nix/profiles/system${lib.strings.optionalString (phase.specialisation != null) "/specialisation/${phase.specialisation}"}/bin/switch-to-configuration" if [ -x "$switch" ] then # In two steps to get the visual changes slightly earlier diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 4b29474..85a75c3 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -34,7 +34,6 @@ specialisation = { dark.configuration.frogeye.polarity = "dark"; - light.configuration.frogeye.polarity = "light"; }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal