mirror of
https://github.com/youwen5/nixos.git
synced 2025-02-07 21:11:11 -08:00
feat: add systemd units to automatically set system colorscheme
This commit is contained in:
parent
24aa4ea3f6
commit
4930320599
1 changed files with 82 additions and 3 deletions
|
@ -11,12 +11,91 @@
|
||||||
../users/youwen/nixos.nix
|
../users/youwen/nixos.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# systemd.services.suntheme = {
|
||||||
|
# wantedBy = [ "default.target" ];
|
||||||
|
# after = [
|
||||||
|
# "network.target"
|
||||||
|
# "atd.service"
|
||||||
|
# ];
|
||||||
|
# wants = [ "atd.service" ];
|
||||||
|
# description = "Run suntheme to set daemons";
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "oneshot";
|
||||||
|
# RemainAfterExit = "yes";
|
||||||
|
# ExecStart = ''${inputs.suntheme.packages.${pkgs.system}.default}/bin/suntheme'';
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# environment.systemPackages = [
|
||||||
|
# (pkgs.writeShellScriptBin "light.sh" ''
|
||||||
|
# /nix/var/nix/profiles/system/specialisation/dawn/bin/switch-to-configuration test
|
||||||
|
# '')
|
||||||
|
# (pkgs.writeShellScriptBin "dark.sh" ''
|
||||||
|
# /nix/var/nix/profiles/nix/system/bin/switch-to-configuration test
|
||||||
|
# '')
|
||||||
|
# ];
|
||||||
|
|
||||||
|
systemd.services = {
|
||||||
|
colorscheme-dawn = {
|
||||||
|
description = "Set system colorscheme to dawn";
|
||||||
|
unitConfig = {
|
||||||
|
ConditionPathExists = [
|
||||||
|
"/etc/polarity"
|
||||||
|
"/nix/var/nix/profiles/system/specialisation/dawn/bin/switch-to-configuration"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "root";
|
||||||
|
PermissionsStartOnly = true;
|
||||||
|
ExecStart = "/nix/var/nix/profiles/system/specialisation/dawn/bin/switch-to-configuration test";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
colorscheme-dusk = {
|
||||||
|
description = "Set system colorscheme to dusk";
|
||||||
|
unitConfig = {
|
||||||
|
ConditionPathExists = [
|
||||||
|
"/etc/polarity"
|
||||||
|
"/nix/var/nix/profiles/system/bin/switch-to-configuration"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "root";
|
||||||
|
PermissionsStartOnly = true;
|
||||||
|
ExecStart = "/nix/var/nix/profiles/system/bin/switch-to-configuration test";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers = {
|
||||||
|
colorscheme-dawn = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
description = "Schedule system colorscheme change to dawn at 7 AM";
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-*-* 07:00:00";
|
||||||
|
Persistent = true;
|
||||||
|
Unit = "colorscheme-dawn.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
colorscheme-dusk = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
description = "Schedule system colorscheme change to dusk at 7 PM";
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-*-* 19:00:00";
|
||||||
|
Persistent = true;
|
||||||
|
Unit = "colorscheme-dusk.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
!include ${config.age.secrets.nix_config_github_pat.path}
|
!include ${config.age.secrets.nix_config_github_pat.path}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nix.settings.trusted-users = [ "youwen" ];
|
nix.settings.trusted-users = [ "youwen" ];
|
||||||
|
|
||||||
|
services.atd.enable = true;
|
||||||
|
|
||||||
liminalOS.theming = {
|
liminalOS.theming = {
|
||||||
# wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png";
|
# wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png";
|
||||||
# wallpaper = "${
|
# wallpaper = "${
|
||||||
|
@ -40,9 +119,12 @@
|
||||||
polarity = lib.mkDefault "dark";
|
polarity = lib.mkDefault "dark";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.etc.polarity.text = "dusk";
|
||||||
|
|
||||||
specialisation = {
|
specialisation = {
|
||||||
dawn.configuration = {
|
dawn.configuration = {
|
||||||
environment.etc."specialisation".text = "dawn";
|
environment.etc."specialisation".text = "dawn";
|
||||||
|
environment.etc.polarity.text = "dawn";
|
||||||
liminalOS.theming = {
|
liminalOS.theming = {
|
||||||
wallpaper = pkgs.fetchurl {
|
wallpaper = pkgs.fetchurl {
|
||||||
url = "https://w.wallhaven.cc/full/kx/wallhaven-kxoqx6.jpg";
|
url = "https://w.wallhaven.cc/full/kx/wallhaven-kxoqx6.jpg";
|
||||||
|
@ -53,8 +135,5 @@
|
||||||
polarity = "light";
|
polarity = "light";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
dusk.configuration = {
|
|
||||||
environment.etc."specialisation".text = "dusk";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue