Remove duplicate specialisation

Saves 16s on eval time
This commit is contained in:
Geoffrey Frogeye 2024-06-10 02:21:32 +02:00
parent 17f0ba3370
commit d5917b1264
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
2 changed files with 4 additions and 5 deletions

View file

@ -2,9 +2,9 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let let
phases = [ phases = [
{ command = "jour"; polarity = "light"; } { command = "jour"; specialisation = null; }
{ command = "crepuscule"; polarity = "dark"; } { command = "crepuscule"; specialisation = "dark"; }
{ command = "nuit"; polarity = "dark"; } { command = "nuit"; specialisation = "dark"; }
]; ];
phasesBrightness = config.frogeye.desktop.phasesBrightness; phasesBrightness = config.frogeye.desktop.phasesBrightness;
in in
@ -17,7 +17,7 @@ in
text = (lib.optionalString phasesBrightness.enable '' text = (lib.optionalString phasesBrightness.enable ''
brightnessctl set ${builtins.getAttr phase.command phasesBrightness} 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" ] if [ -x "$switch" ]
then then
# In two steps to get the visual changes slightly earlier # In two steps to get the visual changes slightly earlier

View file

@ -34,7 +34,6 @@
specialisation = { specialisation = {
dark.configuration.frogeye.polarity = "dark"; 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 # 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