Nix configurations for my homelab
1{
2 lib,
3 pkgs,
4 yemou-scripts,
5 ...
6}:
7{
8 nixpkgs.overlays = [
9 yemou-scripts.overlays.default
10 (final: prev: {
11 nautilus = prev.nautilus.overrideAttrs (
12 finalAttrs: prevAttrs: {
13 postInstall = (prevAttrs.postInstall or "") + ''
14 mkdir -p $out/share/xdg-desktop-portal/portals
15 cat > $out/share/xdg-desktop-portal/portals/nautilus.portal <<EOF
16 [portal]
17 DBusName=org.gnome.Nautilus
18 Interfaces=org.freedesktop.impl.portal.FileChooser
19 EOF
20 '';
21 }
22 );
23 xdg-desktop-portal-wlr = prev.xdg-desktop-portal-wlr.overrideAttrs (
24 finalAttrs: prevAttrs: {
25 version = "896cee82a6f14ee996fb870c0fc5e27533e37907";
26
27 src = prev.fetchFromGitHub {
28 owner = "emersion";
29 repo = "xdg-desktop-portal-wlr";
30 rev = "${finalAttrs.version}";
31 sha256 = "sha256-uQYXGiMmrMHCygh5IHt90NSZLPbY7uVMyDx8zUTHXaM=";
32 };
33
34 patches = (prevAttrs.patches or [ ]) ++ [ ../patches/${prevAttrs.pname}/pw-graph-driver.patch ];
35 }
36 );
37 })
38 ];
39
40 # TODO: Create wrapper scripts to better manage the graphical-session-pre and graphical-session systemd targets
41 # TODO: Make river execute the init.roc file I have instead of just init
42 # TODO: switch to river when 0.4.0 releases
43 programs.river-classic = {
44 enable = true;
45 package = pkgs.river-classic.overrideAttrs (
46 final: prev: {
47 postInstall = ''
48 substituteInPlace contrib/river.desktop --replace-fail "Exec=river" "Exec=env WLR_RENDERER=vulkan river"
49 echo 'DesktopNames=river;wlroots' >> contrib/river.desktop
50 ${prev.postInstall}
51 '';
52 }
53 );
54 # TODO: Move organize these some how
55 extraPackages = with pkgs; [
56 bemenu
57 chayang
58 ffmpegthumbnailer
59 kanshi
60 lswt
61 mako
62 nautilus
63 roc
64 scr
65 slurp
66 swaybg
67 swayidle
68 swaylock
69 wlopm
70 wlsunset
71 xrandr # Needed to set xwayland primary output
72 ];
73 };
74
75 # TODO: make a script that will start river using these targets properly
76 # Will need a Desktop Entry, the script will first call call `river-session-pre` and then once river is started,
77 # `river-session` will be called from inside river. When river terminates, both `river-session` and
78 # `river-session-pre` will be un called
79 systemd.user.targets = {
80 "river-session-pre" = {
81 description = "River compositor session";
82 bindsTo = [ "graphical-session-pre.target" ];
83 };
84 "river-session" = {
85 description = "River compositor session";
86 bindsTo = [ "graphical-session.target" ];
87 wants = [ "graphical-session-pre.target" ];
88 after = [ "graphical-session-pre.target" ];
89 };
90 };
91
92 xdg.portal = {
93 wlr.enable = true;
94 extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
95 config.river = {
96 default = lib.mkForce "gtk";
97 "org.freedesktop.impl.portal.FileChooser" = [ "nautilus" ];
98 "org.freedesktop.impl.portal.ScreenCast" = [ "wlr" ];
99 "org.freedesktop.impl.portal.Screenshot" = [ "wlr" ];
100 };
101 };
102}