liminalOS/reference/modules/default.nix

161 lines
4.9 KiB
Nix
Raw Normal View History

2024-12-30 18:38:42 -08:00
{
config,
pkgs,
lib,
2024-12-31 17:52:29 -08:00
inputs,
2024-12-30 18:38:42 -08:00
...
}:
{
imports = [
../secrets/nixos
../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" ];
2025-02-11 17:23:07 -08:00
description = "Schedule system colorscheme change to dusk at 6 PM";
timerConfig = {
2025-02-11 17:23:07 -08:00
OnCalendar = "*-*-* 18:00:00";
Persistent = true;
Unit = "colorscheme-dusk.service";
};
};
};
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units") {
var unit = action.lookup("unit");
if (unit == "colorscheme-dawn.service" || unit == "colorscheme-dusk.service") {
if (subject.active && subject.local) {
return polkit.Result.YES;
} else {
return polkit.Result.AUTH_ADMIN_KEEP;
}
}
}
return polkit.Result.NOT_HANDLED;
});
'';
nix.extraOptions = ''
!include ${config.age.secrets.nix_config_github_pat.path}
'';
2024-12-27 21:12:09 -08:00
nix.settings.trusted-users = [ "youwen" ];
2024-12-30 18:38:42 -08:00
liminalOS.theming = {
2024-12-30 18:38:42 -08:00
# wallpaper = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png";
2024-12-31 17:52:29 -08:00
# wallpaper = "${
# pkgs.fetchFromGitHub {
# owner = "dharmx";
# repo = "walls";
# rev = "6bf4d733ebf2b484a37c17d742eb47e5139e6a14";
# hash = "sha256-YdPkJ+Bm0wq/9LpuST6s3Aj13ef670cQOxAEIhJg26E=";
# sparseCheckout = [ "radium" ];
# }
# }/radium/a_mountain_range_at_night.png";
wallpaper = lib.mkDefault (
pkgs.fetchurl {
# url = "https://code.youwen.dev/youwen5/wallpapers/raw/branch/main/anime-with-people/eternal-blue.jpg";
2025-04-20 00:19:17 -07:00
# url = "https://w.wallhaven.cc/full/rr/wallhaven-rrv23j.jpg";
# hash = "sha256-PCyWyFgMxVYgDjPMtFbQoMTzN61zdUtiP6Lmgc3dRfk=";
2025-04-20 00:19:17 -07:00
# hash = "sha256-PcE9TR82IupRl/zqAZ028GMuARAk2CQaU0XUNfw4gkI=";
url = "https://i.imgur.com/jlKXCA3.jpeg";
hash = "sha256-yJGYLqBLScJkUSbre8Ve3dWEj49f1RYNS/bnfXzRzbU=";
}
);
base16Scheme = lib.mkDefault "${pkgs.base16-schemes}/share/themes/oxocarbon-dark.yaml";
polarity = lib.mkDefault "dark";
2024-12-30 18:38:42 -08:00
};
environment.etc.polarity.text = lib.mkDefault "dusk";
specialisation = {
dawn.configuration = {
environment.etc."specialisation".text = "dawn";
environment.etc.polarity.text = "dawn";
liminalOS.theming = {
wallpaper = pkgs.fetchurl {
# url = "https://code.youwen.dev/youwen5/wallpapers/raw/branch/main/aesthetic/afterglow_city_skyline_at_night.png";
# hash = "sha256-fYMzoY3un4qGOSR4DMqVUAFmGGil+wUze31rLLrjcAc=";
url = "https://w.wallhaven.cc/full/vq/wallhaven-vq72xm.png";
hash = "sha256-K3Kej2COII8dmcZb8/PaDx2vxAvVVE3OtZORJbsCIc0=";
};
base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine-dawn.yaml";
# base16Scheme = null;
polarity = "light";
};
};
};
}