about summary refs log tree commit diff
path: root/desktop.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-10-16T22·32+0200
committerVincent Ambo <tazjin@gmail.com>2017-10-16T22·34+0200
commit4327d0e0b982f8ab7ad43b3ddc784a9a8907a158 (patch)
tree9137b7a4079ffb807e6cc397d0db298ec5c91c36 /desktop.nix
parent296ae9f1fdd6ca499358e49901faeb985f5e926b (diff)
refactor(desktop): Split out desktop configuration
* move desktop configuration to own nix file
* remove old clone-wallpapers service
* use wallpapers nix package for randomly setting wallpaper
Diffstat (limited to 'desktop.nix')
-rw-r--r--desktop.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/desktop.nix b/desktop.nix
new file mode 100644
index 000000000000..335e15d87d88
--- /dev/null
+++ b/desktop.nix
@@ -0,0 +1,51 @@
+# 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";
+    wantedBy = [ "timers.target" ];
+
+    timerConfig = {
+      OnActiveSec = "3second";
+      OnUnitActiveSec = "1hour";
+    };
+  };
+}