2017-10-17 00:32:48 +02:00
|
|
|
# Configuration for the desktop environment
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let wallpapers = import ./pkgs/wallpapers.nix;
|
|
|
|
in {
|
|
|
|
# Configure basic X-server stuff:
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.layout = "us,no";
|
|
|
|
services.xserver.xkbOptions = "caps:super, grp:shifts_toggle";
|
|
|
|
|
|
|
|
# configure desktop environment:
|
|
|
|
services.xserver.windowManager.i3.enable = true;
|
|
|
|
services.compton.enable = true;
|
|
|
|
services.compton.backend = "xrender"; # this should be the default!
|
|
|
|
|
|
|
|
# Configure Redshift for Oslo
|
|
|
|
services.redshift.enable = true;
|
|
|
|
services.redshift.latitude = "59.911491";
|
|
|
|
services.redshift.longitude = "10.757933";
|
|
|
|
|
|
|
|
# Configure fonts
|
|
|
|
fonts = {
|
|
|
|
fonts = with pkgs; [
|
|
|
|
input-fonts
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Ensure wallpapers are "installed"
|
|
|
|
environment.systemPackages = [ wallpapers ];
|
|
|
|
|
|
|
|
# Configure random setting of wallpapers
|
|
|
|
systemd.user.services.feh-wp = {
|
|
|
|
description = "Randomly set wallpaper via feh";
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
WorkingDirectory = "${wallpapers}/share/wallpapers";
|
|
|
|
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.feh-wp = {
|
|
|
|
description = "Set a random wallpaper every hour";
|
2017-10-17 00:41:00 +02:00
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
partOf = [ "graphical-session.target" ];
|
2017-10-17 00:32:48 +02:00
|
|
|
|
|
|
|
timerConfig = {
|
2017-10-17 00:43:14 +02:00
|
|
|
OnActiveSec = "1second";
|
2017-10-17 00:32:48 +02:00
|
|
|
OnUnitActiveSec = "1hour";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|