river.nix 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. { config, pkgs, lib, ... }:
  2. {
  3. # include overlay
  4. imports = [ ./river/wayland-overlay.nix ];
  5. # move river configuration file to its directory...
  6. xdg.configFile."river/init".source =
  7. config.lib.file.mkOutOfStoreSymlink ./river/init;
  8. # lets create a target session for river
  9. systemd.user.targets.river-session = {
  10. Unit = {
  11. Description = "River Compositor Session";
  12. Documentation = [ "man:systemd.special(7)" ];
  13. BindsTo = [ "graphical-session.target" ];
  14. Wants = [ "graphical-session-pre.target" ];
  15. After = [ "graphical-session-pre.target" ];
  16. };
  17. };
  18. # lets create wallpaper service/timer
  19. #systemd.user.timers.wallpaper = {
  20. # Install = {
  21. # WantedBy = [ "river-session.target" ];
  22. # };
  23. # Timer = {
  24. # OnUnitActiveSec = [ "1s" ];
  25. # OnCalendar = [ "*:0/1" ];
  26. # Unit = [ "wallpaper.service" ];
  27. # };
  28. # Unit = {
  29. # Description = "Wallpaper Service for River";
  30. # };
  31. #};
  32. systemd.user.services.wallpaper = {
  33. Service = { ExecStart = [ "%h/.local/bin/waywall wall" ]; };
  34. Unit = { Description = "Wallpaper Service for River"; };
  35. Install = { WantedBy = [ "river-session.target" ]; };
  36. };
  37. # lets create a locker for river-session
  38. systemd.user.services.locker = {
  39. Unit = { Description = [ "Automatic Locker for river-session" ]; };
  40. Install = { WantedBy = [ "river-session.target" ]; };
  41. Service = {
  42. ExecStart = [
  43. "${pkgs.swayidle}/bin/swayidle -w timeout 60 '~/.local/bin/waywall lock' before-sleep '~/.local/bin/waywall lock' timeout 75 '${pkgs.light}/bin/light -O; ${pkgs.light}/bin/light -S 0' resume '${pkgs.light}/bin/light -I' lock '~/.local/bin/waywall lock'"
  44. ];
  45. };
  46. };
  47. }