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, ... }:
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

View file

@ -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