{ lib, inputs, config, pkgs, hostname, gpu, ... }: { imports = [ inputs.kde2nix.nixosModules.plasma6 ]; # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; }; # Configure keymap in X11 services.xserver = { enable = true; layout = "us"; xkbVariant = ""; autorun = true; videoDrivers = [ ] ++ lib.optional (builtins.isString gpu) gpu; }; services.xserver = { # https://nixos.org/manual/nixos/stable/index.html#chap-gnome # Enable the KDE Plasma 6 Desktop Environment. desktopManager.plasma6.enable = true; }; environment.systemPackages = with pkgs; [ arc-kde-theme arc-theme papirus-icon-theme plasma-theme-switcher tailscale-systray ]; systemd.services = { "get-theme-times" = { enable = true; path = [ pkgs.curl ]; script = "curl wttr.in > /tmp/wttr.in"; after = [ "networking-online.target" ]; serviceConfig.Type = "oneshot"; onSucces = [ "light-theme.service" "dark-theme.service" ]; }; light-theme = { enable = true; path = [ pkgs.at pkgs.fx]; script = ''echo "plasma-apply-colorscheme -platform offscreen Arc" | at `fx /tmp/wttr.in .weather[0].astronomy[0].sunrise`''; serviceConfig.Type = "oneshot"; }; dark-theme = { enable = true; path = [ pkgs.at pkgs.fx]; script = ''echo "plasma-apply-colorscheme -platform offscreen ArcDark" | at `fx /tmp/wttr.in .weather[0].astronomy[0].sunset`''; serviceConfig.Type = "oneshot"; }; }; systemd.timers = { "light-theme" = { enable = true; partOf = [ "light-theme.service" ]; timerConfig.OnCalendar = [ "*-*-* *:*:00" ]; }; "dark-theme" = { enable = true; partOf = [ "dark-theme.service" ]; timerConfig.OnCalendar = [ "*-*-* *:*:00" ]; }; }; }