Nix Flakes configuration for MacOS, NixOS and WSL
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip: riverwm

+233 -49
-17
flake.lock
··· 20 20 "type": "github" 21 21 } 22 22 }, 23 - "hardware": { 24 - "locked": { 25 - "lastModified": 1735388221, 26 - "narHash": "sha256-e5IOgjQf0SZcFCEV/gMGrsI0gCJyqOKShBQU0iiM3Kg=", 27 - "owner": "NixOS", 28 - "repo": "nixos-hardware", 29 - "rev": "7c674c6734f61157e321db595dbfcd8523e04e19", 30 - "type": "github" 31 - }, 32 - "original": { 33 - "owner": "NixOS", 34 - "ref": "master", 35 - "repo": "nixos-hardware", 36 - "type": "github" 37 - } 38 - }, 39 23 "home-manager": { 40 24 "inputs": { 41 25 "nixpkgs": [ ··· 76 60 "root": { 77 61 "inputs": { 78 62 "darwin": "darwin", 79 - "hardware": "hardware", 80 63 "home-manager": "home-manager", 81 64 "nixpkgs": "nixpkgs", 82 65 "unstable": "unstable"
+1 -3
flake.nix
··· 27 27 loki = nixpkgs.lib.nixosSystem { 28 28 system = "x86_64-linux"; 29 29 specialArgs = { inherit inputs self; }; 30 - modules = [ 31 - ./hosts/x86_64-linux/loki 32 - ./modules/nixos/desktop/dwl 30 + modules = [ ./hosts/x86_64-linux/loki 33 31 ]; 34 32 }; 35 33
+1 -1
homes/x86_64-linux/loki/cosmeak/default.nix
··· 1 1 { inputs, pkgs, ... }: 2 2 { 3 - imports = [ ./../../../_shared/cosmeak ]; 3 + imports = [ ./../../../_shared/cosmeak ./river ]; 4 4 5 5 programs.home-manager.enable = true; 6 6
+168
homes/x86_64-linux/loki/cosmeak/river/default.nix
··· 1 + _: 2 + { 3 + wayland.windowManager.river.enable = true; 4 + wayland.windowManager.river.xwayland.enable = true; 5 + wayland.windowManager.river.systemd.enable = true; 6 + wayland.windowManager.river.extraConfig = '' 7 + #!/bin/sh 8 + # See the river(1), riverctl(1), and rivertile(1) man pages for complete 9 + # documentation. 10 + 11 + # Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc. 12 + 13 + # Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) 14 + riverctl map normal Super+Shift Return spawn foot 15 + 16 + # Super+P to open application launcher 17 + # riverctl map normal Super P spawn dmenu 18 + riverctl map normal Super P spawn fuzzel 19 + 20 + # Super+Q to close the focused view 21 + riverctl map normal Super Q close 22 + 23 + # Super+Shift+E to exit river 24 + riverctl map normal Super+Shift E exit 25 + 26 + # Super+J and Super+K to focus the next/previous view in the layout stack 27 + riverctl map normal Super J focus-view next 28 + riverctl map normal Super K focus-view previous 29 + 30 + # Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous 31 + # view in the layout stack 32 + riverctl map normal Super+Shift J swap next 33 + riverctl map normal Super+Shift K swap previousriv 34 + 35 + # Super+Period and Super+Comma to focus the next/previous output 36 + riverctl map normal Super Period focus-output next 37 + riverctl map normal Super Comma focus-output previous 38 + 39 + # Super+Shift+{Period,Comma} to send the focused view to the next/previous output 40 + riverctl map normal Super+Shift Period send-to-output next 41 + riverctl map normal Super+Shift Comma send-to-output previous 42 + 43 + # Super+Return to bump the focused view to the top of the layout stack 44 + riverctl map normal Super Return zoom 45 + 46 + # Super+H and Super+L to decrease/increase the main ratio of rivertile(1) 47 + riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" 48 + riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" 49 + 50 + # Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) 51 + riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" 52 + riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" 53 + 54 + # Super+Alt+{H,J,K,L} to move views 55 + riverctl map normal Super+Alt H move left 100 56 + riverctl map normal Super+Alt J move down 100 57 + riverctl map normal Super+Alt K move up 100 58 + riverctl map normal Super+Alt L move right 100 59 + 60 + # Super+Alt+Control+{H,J,K,L} to snap views to screen edges 61 + riverctl map normal Super+Alt+Control H snap left 62 + riverctl map normal Super+Alt+Control J snap down 63 + riverctl map normal Super+Alt+Control K snap up 64 + riverctl map normal Super+Alt+Control L snap right 65 + 66 + # Super+Alt+Shift+{H,J,K,L} to resize views 67 + riverctl map normal Super+Alt+Shift H resize horizontal -100 68 + riverctl map normal Super+Alt+Shift J resize vertical 100 69 + riverctl map normal Super+Alt+Shift K resize vertical -100 70 + riverctl map normal Super+Alt+Shift L resize horizontal 100 71 + 72 + # Super + Left Mouse Button to move views 73 + riverctl map-pointer normal Super BTN_LEFT move-view 74 + 75 + # Super + Right Mouse Button to resize views 76 + riverctl map-pointer normal Super BTN_RIGHT resize-view 77 + 78 + # Super + Middle Mouse Button to toggle float 79 + riverctl map-pointer normal Super BTN_MIDDLE toggle-float 80 + 81 + for i in $(seq 1 9) 82 + do 83 + tags=$((1 << ($i - 1))) 84 + 85 + # Super+[1-9] to focus tag [0-8] 86 + riverctl map normal Super $i set-focused-tags $tags 87 + 88 + # Super+Shift+[1-9] to tag focused view with tag [0-8] 89 + riverctl map normal Super+Shift $i set-view-tags $tags 90 + 91 + # Super+Control+[1-9] to toggle focus of tag [0-8] 92 + riverctl map normal Super+Control $i toggle-focused-tags $tags 93 + 94 + # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view 95 + riverctl map normal Super+Shift+Control $i toggle-view-tags $tags 96 + done 97 + 98 + # Super+0 to focus all tags 99 + # Super+Shift+0 to tag focused view with all tags 100 + all_tags=$(((1 << 32) - 1)) 101 + riverctl map normal Super 0 set-focused-tags $all_tags 102 + riverctl map normal Super+Shift 0 set-view-tags $all_tags 103 + 104 + # Super+Space to toggle float 105 + riverctl map normal Super Space toggle-float 106 + 107 + # Super+F to toggle fullscreen 108 + riverctl map normal Super F toggle-fullscreen 109 + 110 + # Super+{Up,Right,Down,Left} to change layout orientation 111 + riverctl map normal Super Up send-layout-cmd rivertile "main-location top" 112 + riverctl map normal Super Right send-layout-cmd rivertile "main-location right" 113 + riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" 114 + riverctl map normal Super Left send-layout-cmd rivertile "main-location left" 115 + 116 + # Declare a passthrough mode. This mode has only a single mapping to return to 117 + # normal mode. This makes it useful for testing a nested wayland compositor 118 + riverctl declare-mode passthrough 119 + 120 + # Super+F11 to enter passthrough mode 121 + riverctl map normal Super F11 enter-mode passthrough 122 + 123 + # Super+F11 to return to normal mode 124 + riverctl map passthrough Super F11 enter-mode normal 125 + 126 + # Various media key mapping examples for both normal and locked mode which do 127 + # not have a modifier 128 + for mode in normal locked 129 + do 130 + # Eject the optical drive (well if you still have one that is) 131 + riverctl map $mode None XF86Eject spawn 'eject -T' 132 + 133 + # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) 134 + riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5' 135 + riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5' 136 + riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute' 137 + 138 + # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) 139 + riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' 140 + riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' 141 + riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' 142 + riverctl map $mode None XF86AudioNext spawn 'playerctl next' 143 + 144 + # Control screen backlight brightness with brightnessctl (https://github.com/Hummer12007/brightnessctl) 145 + riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl set +5%' 146 + riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl set 5%-' 147 + done 148 + 149 + # Set background and border color 150 + riverctl background-color 0x002b36 151 + riverctl border-color-focused 0x93a1a1 152 + riverctl border-color-unfocused 0x586e75 153 + 154 + # Set keyboard repeat rate 155 + riverctl set-repeat 50 300 156 + 157 + # Make all views with an app-id that starts with "float" and title "foo" start floating. 158 + riverctl rule-add -app-id 'float*' -title 'foo' float 159 + 160 + # Make all views with app-id "bar" and any title use client-side decorations 161 + riverctl rule-add -app-id "bar" csd 162 + 163 + # Set the default layout generator to be rivertile and start it. 164 + # River will send the process group of the init executable SIGTERM on exit. 165 + riverctl default-layout rivertile 166 + rivertile -view-padding 6 -outer-padding 6 & 167 + ''; 168 + }
+6 -14
hosts/x86_64-linux/loki/default.nix
··· 2 2 { 3 3 imports = [ 4 4 ./hardware.nix 5 + ./../../../modules/nixos/services/window-managers/river 5 6 inputs.home-manager.nixosModules.home-manager 6 7 ]; 7 8 8 - security.polkit.enable = true; 9 - programs.xwayland.enable = true; 10 - 11 - # Desktop Environment 12 - # services.xserver = { 13 - # enable = true; 14 - # desktopManager = { 15 - # xterm.enable = false; 16 - # xfce.enable = true; 17 - # # budgie.enable = true; 18 - # # lightdm.enable = true; 19 - # }; 20 - # }; 21 - # services.displayManager.defaultSession = "xfce"; 9 + # Window manager 10 + services.windowManager.river.enable = true; 22 11 23 12 programs.firefox.enable = true; 24 13 ··· 127 116 # For gaming purposes 128 117 ananicy-cpp 129 118 ananicy-rules-cachyos 119 + 120 + # Desktop 121 + swaybg 130 122 ]; 131 123 132 124 # Define a user account. Don't forget to set a password with ‘passwd’.
lib/.gitkeep modules/home-manager/.gitkeep
lib/default.nix

This is a binary file and will not be displayed.

-10
modules/nixos/desktop/dwl/default.nix
··· 1 - { inputs, pkgs, ... }: 2 - { 3 - environment.systemPackages = with pkgs; [ 4 - dwl 5 - wmenu 6 - ]; 7 - 8 - programs.waybar.enable = true; 9 - programs.foot.enable = true; 10 - }
+30
modules/nixos/services/window-managers/dwl/default.nix
··· 1 + { config, lib, pkgs, ... }: 2 + let cfg = config.services.windowManager.dwl; in 3 + { 4 + options.services.windowManager.dwl = { 5 + enable = lib.mkEnableOption "DWL Window Manager"; 6 + 7 + xwayland.enable = lib.mkEnableOption "XWayland" // { 8 + default = true; 9 + }; 10 + 11 + # Move dwl overlay here to give access to override patches 12 + # packages = lib.mkPackageOption pkgs "dwl" { 13 + 14 + # }; 15 + 16 + extraPackages = lib.mkOptions { 17 + type = with lib.types; listOf package; 18 + default = with pkgs; [ wmenu foot ]; 19 + }; 20 + }; 21 + 22 + config = lib.mkIf cfg.enable ({ 23 + environment.systemPackages = [ pkgs.dwm ] ++ cfg.extraPackages; 24 + security.polkit.enable = true; 25 + programs.xwayland.enable = cfg.xwayland.enable; 26 + 27 + # TODO: import and merge wayland-session.nix from nixpkgs nixos modules 28 + # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/wayland/wayland-session.nix 29 + }); 30 + }
+19
modules/nixos/services/window-managers/river/default.nix
··· 1 + { config, lib, pkgs, ... }: 2 + let cfg = config.services.windowManager.river; in 3 + { 4 + options.services.windowManager.river = { 5 + enable = lib.mkEnableOption "River - A Wayland Window Manager"; 6 + extraPackages = lib.mkOption { 7 + type = with lib.types; listOf package; 8 + default = with pkgs; [ swaylock swaybg swayidle dmenu fuzzel waybar foot ]; 9 + }; 10 + }; 11 + 12 + config = lib.mkIf cfg.enable ({ 13 + programs.river = { 14 + enable = true; 15 + xwayland.enable = true; 16 + extraPackages = cfg.extraPackages; 17 + }; 18 + }); 19 + }
modules/shared/.gitkeep modules/common/.gitkeep
+8 -4
overlays/dwl/default.nix
··· 3 3 dwl = prev.dwl.overrideAttrs (finalAttrs: previousAttrs: { 4 4 patches = [ 5 5 # Add custom patches here and fetch them from https://www.codeberg.org/dwl/dwl-patches 6 - # (inputs.nixpkgs.legacyPackages.x86_64-linux.fetchpatch { 7 - # url = "https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/ipc/ipc.patch"; 8 - # hash = "sha256-JOncRH9DxJtN5ZzMUexB2PpGaJUxwdHbDtZUYxYQh5A="; 9 - # }) 6 + (inputs.nixpkgs.legacyPackages.x86_64-linux.fetchpatch { 7 + url = "https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/ipc/ipc.patch"; 8 + hash = "sha256-JOncRH9DxJtN5ZzMUexB2PpGaJUxwdHbDtZUYxYQh5A="; 9 + }) 10 10 (inputs.nixpkgs.legacyPackages.x86_64-linux.fetchpatch { 11 11 url = "https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch"; 12 12 hash = "sha256-JaM/YAXioRi16TRKLvDvHAsn4HQ9jpaBAhvHyp/r/+I="; ··· 14 14 (inputs.nixpkgs.legacyPackages.x86_64-linux.fetchpatch { 15 15 url = "https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/gaps/gaps.patch"; 16 16 hash = "sha256-6knXrYblzaqjy5ZG8YG2VKwHeaHB+rij+8ZxXe5LqTE="; 17 + }) 18 + (inputs.nixpkgs.legacyPackages.x86_64-linux.fetchpatch { 19 + url = "https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/xwayland-handle-minimize/xwayland-handle-minimize.patch"; 20 + hash = "sha256-u///eiy98ov90BOowSHnX0lE8YCh2kS8kCDVs+uo1gI="; 17 21 }) 18 22 ]; 19 23 });