Personal Nix setup
0
fork

Configure Feed

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

Merge branch 'niri'

+501 -800
+18 -87
flake.lock
··· 43 43 "type": "github" 44 44 } 45 45 }, 46 - "ags": { 47 - "inputs": { 48 - "astal": "astal", 49 - "nixpkgs": [ 50 - "system-shell", 51 - "nixpkgs" 52 - ] 53 - }, 54 - "locked": { 55 - "lastModified": 1744557573, 56 - "narHash": "sha256-XAyj0iDuI51BytJ1PwN53uLpzTDdznPDQFG4RwihlTQ=", 57 - "owner": "aylur", 58 - "repo": "ags", 59 - "rev": "3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6", 60 - "type": "github" 61 - }, 62 - "original": { 63 - "owner": "aylur", 64 - "repo": "ags", 65 - "type": "github" 66 - } 67 - }, 68 46 "android-sdk": { 69 47 "inputs": { 70 48 "devshell": "devshell", ··· 76 54 ] 77 55 }, 78 56 "locked": { 79 - "lastModified": 1767212595, 80 - "narHash": "sha256-KzKh609ORROs7Ff9WPDy4a4wbV2cj7emWCmK+hRGHYU=", 57 + "lastModified": 1767385394, 58 + "narHash": "sha256-OmairXulwDK1u54QEqdsQeFmowb3LRibo5lW3oBN0UQ=", 81 59 "owner": "tadfisher", 82 60 "repo": "android-nixpkgs", 83 - "rev": "9e19c7f874c25d21a6ee57a8a730d4a1544a9699", 61 + "rev": "9eacd1f5d0dd71004032487861d7e9676729b4d4", 84 62 "type": "github" 85 63 }, 86 64 "original": { ··· 98 76 ] 99 77 }, 100 78 "locked": { 101 - "lastModified": 1766064315, 102 - "narHash": "sha256-aMoYLYIj+yYGhDKuSromj+VZYnMyN3lRRAZ+dk1IOiE=", 79 + "lastModified": 1767441081, 80 + "narHash": "sha256-Y4T5OR+R4QBFvRnMsZK7Bol4yk4TLuBo8l7KhrXoGjQ=", 103 81 "owner": "nix-community", 104 82 "repo": "nixos-apple-silicon", 105 - "rev": "f94f4496775f9ca6e8a9e9e83f5aa4e4210fbb5d", 83 + "rev": "612258d7a123a727b908fb9cdbbe49182ca9a2fe", 106 84 "type": "github" 107 85 }, 108 86 "original": { ··· 111 89 "type": "github" 112 90 } 113 91 }, 114 - "astal": { 115 - "inputs": { 116 - "nixpkgs": [ 117 - "system-shell", 118 - "ags", 119 - "nixpkgs" 120 - ] 121 - }, 122 - "locked": { 123 - "lastModified": 1742571008, 124 - "narHash": "sha256-5WgfJAeBpxiKbTR/gJvxrGYfqQRge5aUDcGKmU1YZ1Q=", 125 - "owner": "aylur", 126 - "repo": "astal", 127 - "rev": "dc0e5d37abe9424c53dcbd2506a4886ffee6296e", 128 - "type": "github" 129 - }, 130 - "original": { 131 - "owner": "aylur", 132 - "repo": "astal", 133 - "type": "github" 134 - } 135 - }, 136 92 "autocomplete-nvim": { 137 93 "flake": false, 138 94 "locked": { ··· 224 180 }, 225 181 "flake-compat": { 226 182 "locked": { 227 - "lastModified": 1746162366, 228 - "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", 183 + "lastModified": 1761640442, 184 + "narHash": "sha256-AtrEP6Jmdvrqiv4x2xa5mrtaIp3OEe8uBYCDZDS+hu8=", 229 185 "owner": "nix-community", 230 186 "repo": "flake-compat", 231 - "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", 187 + "rev": "4a56054d8ffc173222d09dad23adf4ba946c8884", 232 188 "type": "github" 233 189 }, 234 190 "original": { ··· 387 343 ] 388 344 }, 389 345 "locked": { 390 - "lastModified": 1767104570, 391 - "narHash": "sha256-GKgwu5//R+cLdKysZjGqvUEEOGXXLdt93sNXeb2M/Lk=", 346 + "lastModified": 1767437240, 347 + "narHash": "sha256-OA0dBHhccdupFXp+/eaFfb8K1dQxk61in4aF5ITGVX8=", 392 348 "owner": "nix-community", 393 349 "repo": "home-manager", 394 - "rev": "e4e78a2cbeaddd07ab7238971b16468cc1d14daf", 350 + "rev": "1cfa305fba94468f665de1bd1b62dddf2e0cb012", 395 351 "type": "github" 396 352 }, 397 353 "original": { ··· 592 548 }, 593 549 "nixpkgs": { 594 550 "locked": { 595 - "lastModified": 1767242400, 596 - "narHash": "sha256-knFaYjeg7swqG1dljj1hOxfg39zrIy8pfGuicjm9s+o=", 551 + "lastModified": 1767364772, 552 + "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", 597 553 "owner": "nixos", 598 554 "repo": "nixpkgs", 599 - "rev": "c04833a1e584401bb63c1a63ddc51a71e6aa457a", 555 + "rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa", 600 556 "type": "github" 601 557 }, 602 558 "original": { ··· 901 857 "nixos-hardware": "nixos-hardware", 902 858 "nixpkgs": "nixpkgs", 903 859 "nvim-plugins": "nvim-plugins", 904 - "system-shell": "system-shell", 905 860 "tangled": "tangled", 906 861 "yeetmouse": "yeetmouse", 907 862 "zen-browser": "zen-browser" ··· 941 896 "url": "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip" 942 897 } 943 898 }, 944 - "system-shell": { 945 - "inputs": { 946 - "ags": "ags", 947 - "flake-utils": [ 948 - "flake-utils" 949 - ], 950 - "nixpkgs": [ 951 - "nixpkgs" 952 - ] 953 - }, 954 - "locked": { 955 - "lastModified": 1747901587, 956 - "narHash": "sha256-woibJpFc92skmZdLRC1NtLOq/g15fe3HzHTWlx15K1c=", 957 - "owner": "kitten", 958 - "repo": "system-shell", 959 - "rev": "dcf54ab46c3bb697f9c36e210a51f34f47985d6c", 960 - "type": "github" 961 - }, 962 - "original": { 963 - "owner": "kitten", 964 - "repo": "system-shell", 965 - "type": "github" 966 - } 967 - }, 968 899 "systems": { 969 900 "locked": { 970 901 "lastModified": 1681028828, ··· 1186 1117 ] 1187 1118 }, 1188 1119 "locked": { 1189 - "lastModified": 1767239595, 1190 - "narHash": "sha256-QUfbe5AJP2f190ugNNb4y12ZzOWTnCi66yuM3iYRBzE=", 1120 + "lastModified": 1767428887, 1121 + "narHash": "sha256-lAUdnQiHP6bywCsCnPdT3BYYsivclrnmgGFX2wUif0g=", 1191 1122 "owner": "0xc000022070", 1192 1123 "repo": "zen-browser-flake", 1193 - "rev": "5776ae08801a16562b5626a64dedc57032f9a430", 1124 + "rev": "c1bd63771a866f29fdc33e0fa80e7fb8536ba5f0", 1194 1125 "type": "github" 1195 1126 }, 1196 1127 "original": {
-9
flake.nix
··· 46 46 }; 47 47 }; 48 48 49 - system-shell = { 50 - url = "github:kitten/system-shell"; 51 - inputs = { 52 - nixpkgs.follows = "nixpkgs"; 53 - flake-utils.follows = "flake-utils"; 54 - }; 55 - }; 56 - 57 49 nvim-plugins = { 58 50 url = "github:kitten/system-nvim-plugins.nix"; 59 51 inputs = { ··· 99 91 inputs.nvim-plugins.overlays.default 100 92 inputs.android-sdk.overlays.default 101 93 inputs.language-servers.overlays.default 102 - inputs.system-shell.overlays.default 103 94 (self: super: { 104 95 zen-browser = inputs.zen-browser.packages.${self.system}.beta; 105 96 })
+22 -1
home/apps/discord.nix
··· 14 14 15 15 config = mkIf (cfg.enable && cfg.discord.enable) (mkMerge [ 16 16 { 17 - home.packages = with pkgs; [ vesktop ]; 17 + home.packages = with pkgs; let 18 + pkg = vesktop.overrideAttrs (old: { 19 + # electron builds must be writable 20 + preBuild = optionalString stdenv.hostPlatform.isDarwin '' 21 + cp -r ${electron.dist}/Electron.app . 22 + chmod -R u+w Electron.app 23 + '' + optionalString stdenv.hostPlatform.isLinux '' 24 + cp -r ${electron.dist} electron-dist 25 + chmod -R u+w electron-dist 26 + ''; 27 + buildPhase = '' 28 + runHook preBuild 29 + pnpm build 30 + pnpm exec electron-builder \ 31 + --dir \ 32 + -c.asarUnpack="**/*.node" \ 33 + -c.electronDist=${if stdenv.hostPlatform.isDarwin then "." else "electron-dist"} \ 34 + -c.electronVersion=${electron.version} 35 + runHook postBuild 36 + ''; 37 + }); 38 + in [ pkg ]; 18 39 } 19 40 20 41 (helpers.mkIfLinux {
-1
home/apps/ghostty.nix
··· 108 108 109 109 mouse-hide-while-typing = true 110 110 mouse-shift-capture = true 111 - mouse-scroll-multiplier = 0.7 112 111 113 112 clipboard-read = allow 114 113 clipboard-paste-protection = false
+1 -1
home/base/gpg.nix
··· 43 43 program = "pinentry-touchid"; 44 44 }) 45 45 (helpers.mkIfLinux { 46 - package = pkgs.pinentry-all; 46 + package = pkgs.pinentry-gnome3; 47 47 program = "pinentry"; 48 48 }) 49 49 ];
+1 -2
home/desktop/default.nix
··· 11 11 }; 12 12 13 13 imports = [ 14 - ./hyprland.nix 15 - ./theme.nix 14 + ./niri/default.nix 16 15 ./tools.nix 17 16 ]; 18 17 }
-351
home/desktop/hyprland.nix
··· 1 - { lib, config, pkgs, ... }: 2 - 3 - with lib; 4 - let 5 - cfg = config.modules.desktop; 6 - 7 - system-shell = "${getExe pkgs.system-shell}"; 8 - wpctl = "${pkgs.wireplumber}/bin/wpctl"; 9 - brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; 10 - 11 - hyprshot = getExe (pkgs.hyprshot.overrideAttrs (oldAttrs: { 12 - postInstall = (oldAttrs.postInstall or "") + '' 13 - wrapProgram $out/bin/hyprshot \ 14 - --set HYPRSHOT_DIR "${config.xdg.userDirs.pictures}/Screenshots" 15 - ''; 16 - })); 17 - in { 18 - options.modules.desktop.hyprland = { 19 - enable = mkOption { 20 - default = cfg.enable; 21 - example = true; 22 - description = "Whether to enable Hyprland configuration."; 23 - type = types.bool; 24 - }; 25 - }; 26 - 27 - config = mkIf cfg.hyprland.enable { 28 - wayland.windowManager.hyprland = { 29 - enable = true; 30 - 31 - package = null; 32 - portalPackage = null; 33 - systemd.enable = false; 34 - xwayland.enable = false; 35 - plugins = with pkgs.hyprlandPlugins; [ hyprspace ]; 36 - 37 - settings = { 38 - source = [ "/etc/hypr/hyprland.conf" ]; 39 - 40 - general = { 41 - gaps_out = 9; 42 - gaps_in = 4; 43 - allow_tearing = true; 44 - resize_on_border = true; 45 - hover_icon_on_border = false; 46 - no_border_on_floating = true; 47 - extend_border_grab_area = 10; 48 - border_size = 1; 49 - "col.active_border" = "0xB35A5A5A"; 50 - "col.inactive_border" = "0x8C3A3A3A"; 51 - }; 52 - 53 - decoration = { 54 - rounding = 9; 55 - dim_inactive = true; 56 - dim_strength = 0.12; 57 - 58 - blur = { 59 - enabled = true; 60 - size = 6; 61 - passes = 4; 62 - contrast = 0.74; 63 - brightness = 0.45; 64 - vibrancy = 0.15; 65 - vibrancy_darkness = 0.1; 66 - ignore_opacity = false; 67 - popups_ignorealpha = 0.1; 68 - input_methods_ignorealpha = 0.1; 69 - noise = 0.012; 70 - }; 71 - 72 - shadow = { 73 - color = "0x81000000"; 74 - range = 40; 75 - render_power = 2; 76 - offset = "5, 5"; 77 - }; 78 - }; 79 - 80 - gestures = { 81 - workspace_swipe = true; 82 - workspace_swipe_invert = false; 83 - workspace_swipe_cancel_ratio = 0.2; 84 - workspace_swipe_distance = 560; 85 - }; 86 - 87 - misc = { 88 - middle_click_paste = false; 89 - focus_on_activate = true; 90 - key_press_enables_dpms = true; 91 - disable_hyprland_logo = true; 92 - disable_splash_rendering = true; 93 - vrr = 1; 94 - }; 95 - 96 - debug.error_position = 1; 97 - 98 - plugin.overview = { 99 - autoDrag = true; 100 - hideOverlayLayers = false; 101 - exitOnSwitch = true; 102 - reverseSwipe = true; 103 - dragAlpha = 0.85; 104 - workspaceMargin = 16; 105 - panelHeight = 150; 106 - reservedArea = 38; 107 - }; 108 - 109 - bindm = [ 110 - "SUPER, mouse:272, movewindow" 111 - "SUPERSHIFT, mouse:272, resizewindow" 112 - ]; 113 - 114 - bindel = [ 115 - ", XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 3%+" 116 - ", XF86AudioLowerVolume, exec, ${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 3%-" 117 - ", XF86MonBrightnessDown, exec, ${brightnessctl} set 3%-" 118 - ", XF86MonBrightnessUp, exec, ${brightnessctl} set +3%" 119 - ]; 120 - 121 - bindl = [ 122 - ", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" 123 - ", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" 124 - ", XF86AudioPlay, exec, ${system-shell} play_pause" 125 - ", XF86AudioPause, exec, ${system-shell} play_pause" 126 - ", XF86AudioNext, exec, ${system-shell} play_next" 127 - ", XF86AudioPrev, exec, ${system-shell} play_previous" 128 - ]; 129 - 130 - bindp = [ 131 - ", F11, fullscreen, 0" 132 - "SUPER, W, killactive" 133 - 134 - "SUPER, H, movefocus, l" 135 - "SUPER, J, movefocus, d" 136 - "SUPER, K, movefocus, u" 137 - "SUPER, L, movefocus, r" 138 - "SUPER_SHIFT, H, movewindow, l" 139 - "SUPER_SHIFT, J, movewindow, d" 140 - "SUPER_SHIFT, K, movewindow, u" 141 - "SUPER_SHIFT, L, movewindow, r" 142 - 143 - "SUPER_CONTROL, K, overview:toggle, all" 144 - "SUPER_CONTROL, H, workspace, m-1" 145 - "SUPER_CONTROL, L, workspace, m+1" 146 - "SUPER_CONTROL_SHIFT, H, movetoworkspace, -1" 147 - "SUPER_CONTROL_SHIFT, L, movetoworkspace, +1" 148 - 149 - "SUPER, up, overview:toggle, all" 150 - "SUPER, left, workspace, m-1" 151 - "SUPER, right, workspace, m+1" 152 - "SUPER_SHIFT, left, movetoworkspace, m-1" 153 - "SUPER_SHIFT, right, movetoworkspace, m+1" 154 - 155 - "SUPER_CONTROL, left, focusmonitor, -1" 156 - "SUPER_CONTROL, right, focusmonitor, +1" 157 - "SUPER_CONTROL_SHIFT, left, movecurrentworkspacetomonitor, -1" 158 - "SUPER_CONTROL_SHIFT, right, movecurrentworkspacetomonitor, +1" 159 - ]; 160 - 161 - bind = [ 162 - "SUPER, SUPER_L, exec, ${system-shell} launcher" 163 - 164 - "SUPER, T, exec, uwsm-app ghostty" 165 - "SUPER, B, exec, uwsm-app zen-beta" 166 - 167 - "SUPER_SHIFT, F, fullscreen, 1" 168 - 169 - "SUPER, 1, workspace, 1" 170 - "SUPER, 2, workspace, 2" 171 - "SUPER, 3, workspace, 3" 172 - "SUPER, 4, workspace, 4" 173 - "SUPER, 5, workspace, 5" 174 - "SUPER, 6, workspace, 6" 175 - "SUPER, 7, workspace, 7" 176 - "SUPER, 8, workspace, 8" 177 - "SUPER, 9, workspace, 9" 178 - "SUPER, 0, workspace, 10" 179 - 180 - "SUPER_SHIFT, 2, exec, ${hyprshot} -z -m window -m active" 181 - "SUPER_SHIFT, 3, exec, ${hyprshot} -z -m output -m active" 182 - "SUPER_SHIFT, 4, exec, ${hyprshot} -z -m region" 183 - ", Print, exec, ${hyprshot} -z -m window -m active" 184 - "SUPER, Print, exec, ${hyprshot} -z -m output -m active" 185 - "SUPER_SHIFT, Print, exec, ${hyprshot} -z -m region" 186 - ]; 187 - 188 - windowrule = [ 189 - "suppressevent maximize, class:.*" 190 - 191 - "nofocus, class:^$, title:^$, xwayland:1, floating:1, fullscreen:0, pinned:0" 192 - "tag +games, initialClass:^(.*)[.]exe$, fullscreenstate:* 2" 193 - 194 - "immediate, fullscreenstate:2" 195 - "immediate, fullscreenstate:3" 196 - "syncfullscreen, fullscreen:1" 197 - "idleinhibit, fullscreen:1" 198 - 199 - "content game, tag:games" 200 - "tag +games, content:game" 201 - 202 - "opaque, tag:games" 203 - "immediate, tag:games" 204 - "idleinhibit fullscreen, tag:games" 205 - "fullscreenstate:3 3, tag:games, fullscreen:1" 206 - "float, tag:games, fullscreen:1" 207 - 208 - "float, class:zen-beta,initialTitle:^(Picture-in-Picture)$" 209 - "pin, class:zen-beta,initialTitle:^(Picture-in-Picture)$" 210 - "idleinhibit fullscreen,class:zen-beta" 211 - 212 - "float,title:^(Open)$" 213 - "float,title:^(Choose Files)$" 214 - "float,title:^(Save As)$" 215 - "float,title:^(Confirm to replace files)$" 216 - "float,title:^(File Operation Progress)$" 217 - ]; 218 - 219 - layerrule = [ 220 - "blur, system-shell" 221 - "ignorezero, system-shell" 222 - "animation slide, system-shell" 223 - "abovelock, system-shell" 224 - 225 - "blur, system-bar" 226 - "xray on, system-bar" 227 - "ignorezero, system-bar" 228 - "animation slide, system-bar" 229 - ]; 230 - }; 231 - }; 232 - 233 - home.packages = with pkgs; [ nautilus ]; 234 - 235 - xdg.configFile."uwsm/env".source = let 236 - inherit (config.home) sessionVariables; 237 - export = k: v: "export ${builtins.toString k}=${builtins.toString v}"; 238 - env = strings.concatLines (attrsets.mapAttrsToList export sessionVariables); 239 - in pkgs.writeText "env" env; 240 - 241 - services = { 242 - hyprpolkitagent.enable = true; 243 - hypridle = { 244 - enable = true; 245 - settings = { 246 - general = { 247 - lock_cmd = "pidof hyprlock || hyprlock"; 248 - before_sleep_cmd = "loginctl lock-session"; 249 - after_sleep_cmd = "hyprctl dispatch dpms on"; 250 - }; 251 - listener = [ 252 - { 253 - timeout = 300; 254 - on-timeout = "loginctl lock-session"; 255 - } 256 - { 257 - timeout = 330; 258 - on-timeout = "hyprctl dispatch dpms off"; 259 - on-resume = "hyprctl dispatch dpms on"; 260 - } 261 - { 262 - timeout = 600; 263 - on-timeout = "systemctl suspend"; 264 - } 265 - ]; 266 - }; 267 - }; 268 - wpaperd = { 269 - enable = true; 270 - package = pkgs.wpaperd.overrideAttrs (old: { 271 - cargoBuildFlags = [ "--no-default-features" ]; 272 - }); 273 - settings.default = { 274 - path = "${config.xdg.userDirs.pictures}/Wallpapers"; 275 - mode = "center"; 276 - duration = "8h"; 277 - sorting = "random"; 278 - }; 279 - }; 280 - }; 281 - 282 - programs.hyprlock = { 283 - enable = true; 284 - package = null; 285 - settings = { 286 - general = { 287 - disable_loading_bar = true; 288 - grace = 10; 289 - hide_cursor = true; 290 - no_fade_in = false; 291 - }; 292 - background = [ 293 - { 294 - path = ""; 295 - blur_passes = 3; 296 - blur_size = 8; 297 - } 298 - ]; 299 - input-field = [ 300 - { 301 - size = "200, 50"; 302 - position = "0, -80"; 303 - dots_center = true; 304 - fade_on_empty = false; 305 - font_color = "rgb(202, 211, 245)"; 306 - inner_color = "rgb(91, 96, 120)"; 307 - outer_color = "rgb(24, 25, 38)"; 308 - outline_thickness = 5; 309 - shadow_passes = 2; 310 - } 311 - ]; 312 - }; 313 - }; 314 - 315 - systemd.user.services = { 316 - hyprpolkitagent.Service.Slice = "session.slice"; 317 - hypridle.Service.Slice = "session.slice"; 318 - wpaperd.Service.Slice = "session.slice"; 319 - 320 - system-shell-notifd = { 321 - Install.WantedBy = [ "system-shell.service" ]; 322 - Service = { 323 - ExecStart = "${pkgs.astal.notifd}/bin/astal-notifd -d"; 324 - Restart = "on-failure"; 325 - RestartSec = 5; 326 - Slice = "background.slice"; 327 - }; 328 - Unit = { 329 - After = [ config.wayland.systemd.target ]; 330 - PartOf = [ config.wayland.systemd.target ]; 331 - }; 332 - }; 333 - 334 - system-shell = { 335 - Install.WantedBy = [ "graphical-session.target" ]; 336 - Service = { 337 - ExecStart = "${system-shell}"; 338 - Restart = "on-failure"; 339 - RestartSec = 10; 340 - Environment = [ "GSK_RENDERER=ngl" ]; 341 - Slice = "session.slice"; 342 - }; 343 - Unit = { 344 - After = [ config.wayland.systemd.target ]; 345 - ConditionEnvironment = "WAYLAND_DISPLAY"; 346 - PartOf = [ config.wayland.systemd.target ]; 347 - }; 348 - }; 349 - }; 350 - }; 351 - }
+118
home/desktop/niri/config.kdl
··· 1 + prefer-no-csd 2 + 3 + binds { 4 + Mod+T { spawn "ghostty"; } 5 + Mod+Space { spawn "cosmic-launcher"; } 6 + Mod+Shift+Space { spawn "cosmic-app-library"; } 7 + 8 + Mod+Escape repeat=false { toggle-keyboard-shortcuts-inhibit; } 9 + 10 + Mod+O repeat=false { toggle-overview; } 11 + Mod+W repeat=false { close-window; } 12 + 13 + Mod+F { maximize-column; } 14 + Mod+Shift+F { fullscreen-window; } 15 + Mod+Z { center-column; } 16 + 17 + Mod+Minus { set-column-width "-10%"; } 18 + Mod+Equal { set-column-width "+10%"; } 19 + 20 + Mod+Left { focus-column-left; } 21 + Mod+Down { focus-window-down; } 22 + Mod+Up { focus-window-up; } 23 + Mod+Right { focus-column-right; } 24 + Mod+H { focus-column-left; } 25 + Mod+J { focus-window-or-workspace-down; } 26 + Mod+K { focus-window-or-workspace-up; } 27 + Mod+L { focus-column-right; } 28 + 29 + Mod+Ctrl+Left { move-column-left; } 30 + Mod+Ctrl+Down { move-window-down; } 31 + Mod+Ctrl+Up { move-window-up; } 32 + Mod+Ctrl+Right { move-column-right; } 33 + Mod+Ctrl+H { move-column-left; } 34 + Mod+Ctrl+J { move-window-down-or-to-workspace-down; } 35 + Mod+Ctrl+K { move-window-up-or-to-workspace-up; } 36 + Mod+Ctrl+L { move-column-right; } 37 + 38 + Mod+Shift+Left { focus-monitor-left; } 39 + Mod+Shift+Down { focus-monitor-down; } 40 + Mod+Shift+Up { focus-monitor-up; } 41 + Mod+Shift+Right { focus-monitor-right; } 42 + Mod+Shift+H { focus-monitor-left; } 43 + Mod+Shift+J { focus-monitor-down; } 44 + Mod+Shift+K { focus-monitor-up; } 45 + Mod+Shift+L { focus-monitor-right; } 46 + 47 + Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } 48 + Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } 49 + Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } 50 + Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } 51 + Mod+Shift+Ctrl+H { move-column-to-monitor-left; } 52 + Mod+Shift+Ctrl+J { move-column-to-monitor-down; } 53 + Mod+Shift+Ctrl+K { move-column-to-monitor-up; } 54 + Mod+Shift+Ctrl+L { move-column-to-monitor-right; } 55 + 56 + Mod+Page_Down { focus-workspace-down; } 57 + Mod+Page_Up { focus-workspace-up; } 58 + Mod+U { focus-workspace-down; } 59 + Mod+I { focus-workspace-up; } 60 + Mod+Ctrl+Page_Down { move-column-to-workspace-down; } 61 + Mod+Ctrl+Page_Up { move-column-to-workspace-up; } 62 + Mod+Ctrl+U { move-column-to-workspace-down; } 63 + Mod+Ctrl+I { move-column-to-workspace-up; } 64 + 65 + Mod+Shift+Page_Down { move-workspace-down; } 66 + Mod+Shift+Page_Up { move-workspace-up; } 67 + Mod+Shift+U { move-workspace-down; } 68 + Mod+Shift+I { move-workspace-up; } 69 + 70 + Mod+WheelScrollDown { focus-column-right; } 71 + Mod+WheelScrollUp { focus-column-left; } 72 + 73 + Mod+BracketLeft { consume-or-expel-window-left; } 74 + Mod+BracketRight { consume-or-expel-window-right; } 75 + Mod+Comma { consume-window-into-column; } 76 + Mod+Period { expel-window-from-column; } 77 + 78 + Print { screenshot; } 79 + Ctrl+Print { screenshot-screen; } 80 + Alt+Print { screenshot-window; } 81 + } 82 + 83 + input { 84 + warp-mouse-to-focus 85 + } 86 + 87 + layout { 88 + gaps 16 89 + center-focused-column "never" 90 + 91 + focus-ring { 92 + width 2 93 + } 94 + } 95 + 96 + cursor { 97 + hide-after-inactive-ms 2000 98 + } 99 + 100 + hotkey-overlay { 101 + hide-not-bound 102 + } 103 + 104 + window-rule { 105 + match title="^Picture-in-Picture$" 106 + open-floating true 107 + } 108 + 109 + window-rule { 110 + match is-urgent=true 111 + match is-floating=true 112 + open-focused true 113 + } 114 + 115 + window-rule { 116 + geometry-corner-radius 9 117 + clip-to-geometry true 118 + }
+25
home/desktop/niri/default.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.desktop; 6 + in { 7 + options.modules.desktop.niri = { 8 + enable = mkOption { 9 + default = cfg.enable; 10 + example = true; 11 + description = "Whether to enable Niri configuration."; 12 + type = types.bool; 13 + }; 14 + }; 15 + 16 + config = mkIf cfg.niri.enable { 17 + xdg.configFile."niri/config.kdl".text = (builtins.readFile ./config.kdl); 18 + 19 + systemd.user.sessionVariables = { 20 + XCURSOR_THEME = "Cosmic"; 21 + GTK_THEME = "Adwaita:dark"; 22 + QT_STYLE_OVERRIDE = "adwaita-dark"; 23 + }; 24 + }; 25 + }
-80
home/desktop/theme.nix
··· 1 - { lib, config, pkgs, ... } @ inputs: 2 - 3 - with lib; 4 - let 5 - inherit (import ../../lib/theme.nix inputs) cursorTheme defaultFont iconTheme gtkTheme kvantumTheme; 6 - cfg = config.modules.desktop; 7 - in { 8 - options.modules.desktop.theme = { 9 - enable = mkOption { 10 - default = cfg.enable; 11 - example = true; 12 - description = "Whether to enable theming configuration."; 13 - type = types.bool; 14 - }; 15 - }; 16 - 17 - config = mkIf cfg.theme.enable { 18 - home.pointerCursor = { 19 - inherit (cursorTheme) package name; 20 - gtk.enable = true; 21 - hyprcursor.enable = true; 22 - x11.enable = true; 23 - size = 24; 24 - }; 25 - 26 - home.packages = with pkgs; [ 27 - libsForQt5.qtstyleplugin-kvantum 28 - libsForQt5.qt5ct 29 - ]; 30 - 31 - qt = { 32 - enable = true; 33 - platformTheme.name = "gtk"; 34 - style.name = "kvantum"; 35 - }; 36 - 37 - xdg.configFile = { 38 - "Kvantum/${kvantumTheme.name}".source = "${kvantumTheme.package}/share/Kvantum/${kvantumTheme.name}"; 39 - "Kvantum/kvantum.kvconfig".text = '' 40 - [General] 41 - theme=${kvantumTheme.name} 42 - ''; 43 - "qt5ct/qt5ct.conf".text = '' 44 - [Appearance] 45 - icon_theme=${iconTheme.name} 46 - ''; 47 - "qt6ct/qt6ct.conf".text = '' 48 - [Appearance] 49 - icon_theme=${iconTheme.name} 50 - ''; 51 - }; 52 - 53 - gtk = { 54 - enable = true; 55 - inherit iconTheme; 56 - theme = gtkTheme; 57 - font = defaultFont; 58 - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; 59 - gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; 60 - gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; 61 - }; 62 - 63 - dconf = { 64 - enable = true; 65 - settings = { 66 - "org/gnome/desktop/interface".color-scheme = "prefer-dark"; 67 - }; 68 - }; 69 - 70 - fonts.fontconfig = { 71 - enable = true; 72 - defaultFonts = { 73 - serif = [ "New York" "Noto Serif" "Noto Color Emoji" ]; 74 - sansSerif = [ "SF Pro Display" "Inter" "Noto Color Emoji" ]; 75 - monospace = [ "Dank Mono" "SF Mono" "Noto Color Emoji" ]; 76 - emoji = [ "Noto Color Emoji" ]; 77 - }; 78 - }; 79 - }; 80 - }
+1 -11
home/desktop/tools.nix
··· 14 14 }; 15 15 16 16 config = mkIf cfg.tools.enable { 17 - home.packages = with pkgs; let 18 - switchboard = (pkgs.pantheon.switchboard-with-plugs.override { 19 - useDefaultPlugs = false; 20 - plugs = with pkgs.pantheon; [ 21 - switchboard-plug-sound 22 - switchboard-plug-network 23 - switchboard-plug-bluetooth 24 - ]; 25 - }); 26 - in [ 17 + home.packages = with pkgs; [ 27 18 pwvucontrol 28 19 mission-center 29 - switchboard 30 20 ]; 31 21 }; 32 22 }
-36
lib/theme.nix
··· 1 - { pkgs, ... }: 2 - 3 - { 4 - cursorTheme = { 5 - name = "macOS"; 6 - package = pkgs.apple-cursor; 7 - }; 8 - defaultFont = { 9 - name = "SF Pro Display"; 10 - package = pkgs.sf-pro; 11 - size = 11; 12 - }; 13 - iconTheme = { 14 - name = "WhiteSur"; 15 - package = pkgs.whitesur-icon-theme.override { 16 - boldPanelIcons = true; 17 - alternativeIcons = true; 18 - }; 19 - }; 20 - gtkTheme = { 21 - name = "WhiteSur-Dark-solid"; 22 - package = pkgs.whitesur-gtk-theme; 23 - }; 24 - kvantumTheme = rec { 25 - name = "WhiteSur-opaqueDark"; 26 - package = pkgs.stdenv.mkDerivation { 27 - pname = "whitesur-kde"; 28 - version = pkgs.whitesur-kde.version; 29 - src = pkgs.whitesur-kde.src; 30 - installPhase = /*sh*/'' 31 - mkdir -p "$out/share/Kvantum/${name}" 32 - cp -R Kvantum/**/* "$out/share/Kvantum/${name}" 33 - ''; 34 - }; 35 - }; 36 - }
-10
machines/pepper/configuration.nix
··· 14 14 modules = { 15 15 desktop = { 16 16 enable = true; 17 - hyprland = { 18 - input = { 19 - sensitivity = -0.5; 20 - kb_layout = "us"; 21 - }; 22 - monitor = [ 23 - "desc:Samsung Electric Company Odyssey G60SD HNAX300205, 2560x1440@360, 0x0, 1, vrr, 1, bitdepth, 10" 24 - "desc:LG Electronics 27GL850 005NTPC4Q200, preferred, auto, 1, transform, 1, vrr, 1" 25 - ]; 26 - }; 27 17 }; 28 18 server = { 29 19 enable = true;
+2
modules/desktop/audio.nix
··· 36 36 }; 37 37 38 38 config = mkIf cfg.audio.enable { 39 + xdg.sounds.enable = true; 40 + 39 41 security.rtkit.enable = true; 40 42 41 43 services = {
+1 -6
modules/desktop/default.nix
··· 18 18 }; 19 19 } // helpers.linuxAttrs { 20 20 imports = [ 21 - ./session.nix 22 21 ./affinity.nix 23 22 ./fonts.nix 24 23 ./rawaccel.nix 25 24 ./audio.nix 26 25 ./networking.nix 27 - ./hyprland.nix 26 + ./niri-cosmic.nix 28 27 ]; 29 - 30 - config = mkIf cfg.enable { 31 - users.users."${user}".extraGroups = [ "video" ]; 32 - }; 33 28 }
-127
modules/desktop/hyprland.nix
··· 1 - { lib, pkgs, config, ... }: 2 - 3 - with lib; 4 - let 5 - cfg = config.modules.desktop; 6 - 7 - mkConfig = input: monitor: pkgs.writeText "hyprland.conf" '' 8 - debug { 9 - error_position=1 10 - } 11 - 12 - general { 13 - allow_tearing=true 14 - } 15 - 16 - input { 17 - touchpad { 18 - clickfinger_behavior=true 19 - scroll_factor=0.180000 20 - tap-and-drag=false 21 - tap-to-click=false 22 - } 23 - kb_options=ctrl:nocaps,lv3:ralt_switch 24 - kb_layout=${cfg.hyprland.input.kb_layout} 25 - kb_model=${cfg.hyprland.input.kb_model} 26 - kb_variant=${cfg.hyprland.input.kb_variant} 27 - sensitivity=${toString cfg.hyprland.input.sensitivity} 28 - accel_profile = "flat" 29 - } 30 - 31 - misc { 32 - disable_hyprland_logo=true 33 - disable_splash_rendering=true 34 - vrr=1 35 - } 36 - 37 - render { 38 - direct_scanout=1 39 - expand_undersized_textures=false 40 - cm_fs_passthrough=1 41 - cm_enabled=true 42 - } 43 - 44 - experimental { 45 - xx_color_management_v4=true 46 - } 47 - 48 - cursor { 49 - sync_gsettings_theme=false 50 - } 51 - 52 - ecosystem { 53 - no_update_news = true 54 - no_donation_nag = true 55 - } 56 - 57 - ${concatMapStringsSep "\n" (x: "monitor=${x}") cfg.hyprland.monitor} 58 - monitor=, preferred, auto, 1 59 - ''; 60 - in { 61 - options.modules.desktop.hyprland = { 62 - enable = mkOption { 63 - default = cfg.enable; 64 - example = true; 65 - description = "Whether to enable Hyprland"; 66 - type = types.bool; 67 - }; 68 - 69 - input = mkOption { 70 - default = { }; 71 - type = types.submodule { 72 - options = { 73 - sensitivity = mkOption { 74 - default = 0.0; 75 - type = types.float; 76 - }; 77 - kb_model = mkOption { 78 - default = "apple"; 79 - type = types.str; 80 - }; 81 - kb_variant = mkOption { 82 - default = "mac"; 83 - type = types.str; 84 - }; 85 - kb_layout = mkOption { 86 - default = "gb"; 87 - type = types.str; 88 - }; 89 - }; 90 - }; 91 - }; 92 - 93 - monitor = mkOption { 94 - description = "Monitor configuration"; 95 - default = [ ]; 96 - type = lib.types.listOf lib.types.str; 97 - }; 98 - 99 - configFile = mkOption { 100 - default = mkConfig cfg.hyprland.input cfg.hyprland.monitor; 101 - }; 102 - }; 103 - 104 - config = mkIf cfg.hyprland.enable { 105 - programs = { 106 - hyprlock.enable = true; 107 - hyprland = { 108 - enable = true; 109 - withUWSM = true; 110 - xwayland.enable = true; 111 - }; 112 - }; 113 - 114 - security.pam.services.hyprlock = {}; 115 - 116 - xdg.portal = { 117 - enable = true; 118 - xdgOpenUsePortal = true; 119 - extraPortals = with pkgs; [ 120 - xdg-desktop-portal-hyprland 121 - xdg-desktop-portal-gtk 122 - ]; 123 - }; 124 - 125 - environment.etc."hypr/hyprland.conf".source = cfg.hyprland.configFile; 126 - }; 127 - }
+312
modules/desktop/niri-cosmic.nix
··· 1 + { lib, pkgs, config, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.desktop; 6 + 7 + corePackages = with pkgs; [ 8 + niri 9 + config.services.displayManager.cosmic-greeter.package 10 + cosmic-applets 11 + cosmic-applibrary 12 + cosmic-bg 13 + cosmic-comp 14 + cosmic-files 15 + cosmic-idle 16 + cosmic-initial-setup 17 + cosmic-launcher 18 + cosmic-notifications 19 + cosmic-osd 20 + cosmic-panel 21 + cosmic-randr 22 + cosmic-session 23 + cosmic-settings 24 + cosmic-settings-daemon 25 + cosmic-workspaces-epoch 26 + pop-icon-theme 27 + pop-launcher 28 + ]; 29 + 30 + optionalPackages = with pkgs; [ 31 + xwayland-satellite 32 + xdg-user-dirs 33 + cosmic-icons 34 + cosmic-player 35 + cosmic-screenshot 36 + cosmic-wallpapers 37 + ]; 38 + 39 + cosmic-configs = { 40 + "com.system76.CosmicComp/v1/workspaces" = '' 41 + ( 42 + workspace_mode: OutputBound, 43 + workspace_layout: Horizontal, 44 + ) 45 + ''; 46 + "com.system76.CosmicComp/v1/autotile_behavior" = '' 47 + PerWorkspace 48 + ''; 49 + "com.system76.CosmicPanel/v1/entries" = '' 50 + [ 51 + "Panel", 52 + ] 53 + ''; 54 + "com.system76.CosmicTk/v1/interface_font" = let 55 + defaultFont = head config.fonts.fontconfig.defaultFonts.sansSerif; 56 + in '' 57 + ( 58 + family: "${defaultFont}", 59 + weight: Normal, 60 + stretch: Normal, 61 + style: Normal, 62 + ) 63 + ''; 64 + "com.system76.CosmicTk/v1/monospace_font" = let 65 + defaultFont = head config.fonts.fontconfig.defaultFonts.monospace; 66 + in '' 67 + ( 68 + family: "${defaultFont}", 69 + weight: Normal, 70 + stretch: Normal, 71 + style: Normal, 72 + ) 73 + ''; 74 + }; 75 + 76 + cosmic-base-config = let 77 + fileDrvs = 78 + attrsets.mapAttrsToList 79 + (name: text: pkgs.writeTextDir "share/cosmic/${name}" text) 80 + cosmic-configs; 81 + in pkgs.buildEnv { 82 + name = "cosmic-base-config"; 83 + paths = fileDrvs; 84 + pathsToLink = [ "/share/cosmic" ]; 85 + }; 86 + 87 + cosmic-ext-niri-desktop = let 88 + startCosmicExtNiri = pkgs.writeShellApplication { 89 + name = "start-cosmic-ext-niri"; 90 + runtimeInputs = with pkgs; [ systemd coreutils ]; 91 + text = with pkgs; let 92 + cleanupCosmicConfigs = 93 + concatMapAttrsStringSep "\n" 94 + (name: _value: ''rm -f "$XDG_CONFIG_HOME/cosmic/${name}"'') 95 + cosmic-configs; 96 + in /*sh*/'' 97 + set -e 98 + 99 + if systemctl --user -q is-active cosmic-niri-session.service; then 100 + exit 1 101 + fi 102 + 103 + for unit in $(systemctl --user --no-legend --state=failed --plain list-units | cut -f1 -d' '); do 104 + partof="$(systemctl --user show -p PartOf --value "$unit")" 105 + for target in cosmic-session.target graphical-session.target; do 106 + if [ "$partof" = "$target" ]; then 107 + systemctl --user reset-failed "$unit" 108 + break 109 + fi 110 + done 111 + done 112 + 113 + XDG_CONFIG_HOME="''${XDG_CONFIG_HOME:-$HOME/.config}" 114 + touch "$XDG_CONFIG_HOME/cosmic-initial-setup-done" 115 + ${cleanupCosmicConfigs} 116 + 117 + export XDG_CURRENT_DESKTOP="''${XDG_CURRENT_DESKTOP:=niri}" 118 + export XDG_SESSION_TYPE="''${XDG_SESSION_TYPE:=wayland}" 119 + export DCONF_PROFILE=cosmic 120 + 121 + systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP DCONF_PROFILE 122 + systemctl --user --wait start cosmic-niri-session.service 123 + 124 + systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target 125 + systemctl --user unset-environment WAYLAND_DISPLAY DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET 126 + ''; 127 + }; 128 + in (pkgs.writeTextFile { 129 + name = "cosmic-on-niri"; 130 + destination = "/share/wayland-sessions/COSMIC-on-niri.desktop"; 131 + text = '' 132 + [Desktop Entry] 133 + Name=COSMIC-on-niri 134 + Comment=This session logs you into the COSMIC desktop on niri 135 + Type=Application 136 + DesktopNames=niri 137 + Exec=${getExe startCosmicExtNiri} 138 + ''; 139 + }).overrideAttrs (old: { 140 + passthru.providedSessions = [ "COSMIC-on-niri" ]; 141 + }); 142 + 143 + cosmic-ext-alternative-startup = pkgs.rustPlatform.buildRustPackage rec { 144 + pname = "cosmic-ext-alternative-startup"; 145 + version = "unstable-2024-11-24"; 146 + src = pkgs.fetchFromGitHub { 147 + owner = "drakulix"; 148 + repo = pname; 149 + rev = "8ceda00197c7ec0905cf1dccdc2d67d738e45417"; 150 + hash = "sha256-0kqn3hZ58uQMl39XXF94yQS1EWmGIK45/JFTAigg/3M="; 151 + }; 152 + cargoHash = "sha256-DeMkAG2iINGden0Up013M9mWDN4QHrF+FXoNqpGB+mg="; 153 + meta.mainProgram = pname; 154 + }; 155 + in { 156 + options.modules.desktop.niri-cosmic = { 157 + enable = mkOption { 158 + default = cfg.enable; 159 + example = true; 160 + description = "Whether to enable COSMIC on Niri"; 161 + type = types.bool; 162 + }; 163 + }; 164 + 165 + config = mkIf cfg.niri-cosmic.enable { 166 + boot = { 167 + plymouth.enable = true; 168 + initrd.verbose = mkDefault false; 169 + consoleLogLevel = 0; 170 + }; 171 + 172 + programs = { 173 + dconf = { 174 + enable = true; 175 + packages = [ pkgs.cosmic-session ]; 176 + }; 177 + }; 178 + 179 + environment = { 180 + pathsToLink = [ 181 + "/share/backgrounds" 182 + "/share/cosmic" 183 + "/share/cosmic-layouts" 184 + "/share/cosmic-themes" 185 + ]; 186 + systemPackages = corePackages ++ optionalPackages ++ [ 187 + cosmic-base-config 188 + ]; 189 + sessionVariables = { 190 + X11_BASE_RULES_XML = "${config.services.xserver.xkb.dir}/rules/base.xml"; 191 + X11_EXTRA_RULES_XML = "${config.services.xserver.xkb.dir}/rules/base.extras.xml"; 192 + 193 + _JAVA_AWT_WM_NONREPARENTING = mkDefault 1; 194 + QT_AUTO_SCREEN_SCALE_FACTOR = mkDefault 1; 195 + QT_ENABLE_HIGHDPI_SCALING = mkDefault 1; 196 + QT_QPA_PLATFORM = mkDefault "wayland;xcb"; 197 + GDK_BACKEND = mkDefault "wayland,x11,*"; 198 + SDL_VIDEODRIVER = mkDefault "wayland,x11"; 199 + NIXOS_OZONE_WL = mkDefault 1; 200 + MOZ_ENABLE_WAYLAND = mkDefault 1; 201 + COSMIC_DATA_CONTROL_ENABLED = mkDefault 1; 202 + }; 203 + }; 204 + 205 + hardware.system76.power-daemon.enable = mkDefault true; 206 + 207 + services = { 208 + graphical-desktop.enable = true; 209 + displayManager = { 210 + cosmic-greeter.enable = true; 211 + sessionPackages = [ cosmic-ext-niri-desktop ]; 212 + }; 213 + 214 + dbus = { 215 + enable = true; 216 + implementation = mkDefault "broker"; 217 + }; 218 + 219 + accounts-daemon.enable = true; 220 + libinput.enable = true; 221 + upower.enable = true; 222 + 223 + acpid.enable = mkDefault true; 224 + gvfs.enable = mkDefault true; 225 + gnome = { 226 + gnome-keyring.enable = mkDefault true; 227 + gcr-ssh-agent.enable = mkDefault false; 228 + }; 229 + 230 + logind.settings.Login = { 231 + powerKey = mkDefault "suspend"; 232 + powerKeyLongPress = mkDefault "poweroff"; 233 + lidSwitch = mkDefault "suspend"; 234 + }; 235 + 236 + geoclue2 = { 237 + enable = true; 238 + enableDemoAgent = false; 239 + whitelistedAgents = [ "geoclue-demo-agent" ]; 240 + }; 241 + }; 242 + 243 + security = { 244 + polkit.enable = true; 245 + rtkit.enable = true; 246 + pam.services.cosmic-greeter = { }; 247 + }; 248 + 249 + systemd = { 250 + packages = with pkgs; [ cosmic-session niri ]; 251 + user.services = { 252 + cosmic-niri-session = let 253 + set-environment = config.system.build.setEnvironment; 254 + init-session = pkgs.writeShellScriptBin "init-cosmic-niri-session" /*sh*/ '' 255 + XDG_CONFIG_HOME="''${XDG_CONFIG_HOME:-$HOME/.config}" 256 + NIRI_CONFIG="''${NIRI_CONFIG:-$XDG_CONFIG_HOME/niri/config.kdl}" 257 + printf "%s\n" \ 258 + "spawn-at-startup \"${getExe cosmic-ext-alternative-startup}\"" \ 259 + "include \"$NIRI_CONFIG\"" \ 260 + > "$RUNTIME_DIRECTORY/.niri-config.kdl" 261 + ''; 262 + run-session = pkgs.writeShellScriptBin "run-cosmic-niri-session" /*sh*/'' 263 + source ${set-environment} 264 + ${getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all 265 + export NIRI_CONFIG="$RUNTIME_DIRECTORY/.niri-config.kdl" 266 + exec ${getBin pkgs.cosmic-session}/bin/cosmic-session ${getBin pkgs.niri}/bin/niri --session 267 + ''; 268 + in { 269 + bindsTo = [ "graphical-session.target" ]; 270 + serviceConfig = { 271 + RuntimeDirectory = "cosmic-niri-session"; 272 + RuntimeDirectoryMode = "0700"; 273 + Type = "notify"; 274 + NotifyAccess = "all"; 275 + Slice = "session.slice"; 276 + Restart = "on-failure"; 277 + ExecStartPre = getExe init-session; 278 + ExecStart = getExe run-session; 279 + }; 280 + }; 281 + }; 282 + }; 283 + 284 + xdg = { 285 + sounds.enable = true; 286 + icons.fallbackCursorThemes = mkDefault [ "Cosmic" ]; 287 + portal = { 288 + enable = true; 289 + xdgOpenUsePortal = true; 290 + extraPortals = with pkgs; [ 291 + xdg-desktop-portal-gnome 292 + xdg-desktop-portal-gtk 293 + ]; 294 + config.niri = { 295 + default = [ "gnome" "gtk" ]; 296 + "org.freedesktop.impl.portal.Access" = "gtk"; 297 + "org.freedesktop.impl.portal.Notification" = "gtk"; 298 + "org.freedesktop.impl.portal.Secret" = "gnome-keyring"; 299 + "org.freedesktop.impl.portal.FileChooser" = "gtk"; 300 + "org.freedesktop.impl.portal.ScreenCast" = "gnome"; 301 + "org.freedesktop.impl.portal.Screenshot" = "gnome"; 302 + }; 303 + }; 304 + }; 305 + 306 + fonts.packages = with pkgs; [ 307 + fira 308 + noto-fonts 309 + open-sans 310 + ]; 311 + }; 312 + }
-78
modules/desktop/session.nix
··· 1 - { lib, config, pkgs, user, ... } @ inputs: 2 - 3 - with lib; 4 - let 5 - inherit (import ../../lib/theme.nix inputs) cursorTheme defaultFont iconTheme gtkTheme kvantumTheme; 6 - cfg = config.modules.desktop; 7 - in { 8 - options.modules.desktop.session = { 9 - enable = mkOption { 10 - default = cfg.enable; 11 - example = true; 12 - description = "Whether to enable session and desktop environment."; 13 - type = types.bool; 14 - }; 15 - }; 16 - 17 - config = mkIf cfg.session.enable { 18 - users.users."${user}".extraGroups = [ "video" ]; 19 - 20 - boot = { 21 - plymouth.enable = true; 22 - initrd.verbose = mkDefault false; 23 - consoleLogLevel = 0; 24 - }; 25 - 26 - environment.sessionVariables = { 27 - GSK_RENDERER = mkDefault "ngl"; 28 - QT_QPA_PLATFORM = mkDefault "wayland;xcb"; 29 - GDK_BACKEND = mkDefault "wayland,x11,*"; 30 - SDL_VIDEODRIVER = mkDefault "wayland,x11"; 31 - NIXOS_OZONE_WL = mkDefault "1"; 32 - }; 33 - 34 - services = { 35 - greetd = { 36 - enable = true; 37 - settings = { 38 - terminal.vt = 1; 39 - default_session.command = let 40 - hyprConfig = pkgs.writeTextFile { 41 - name = "hyprland-greeter.conf"; 42 - text = '' 43 - source=${toString cfg.hyprland.configFile} 44 - exec-once = ${getExe config.programs.regreet.package}; hyprctl dispatch exit 45 - animations { 46 - enabled = false 47 - } 48 - ''; 49 - }; 50 - in escapeShellArgs [ 51 - "${pkgs.dbus}/bin/dbus-run-session" 52 - "${getExe pkgs.hyprland}" 53 - "-c" (toString hyprConfig) 54 - ]; 55 - }; 56 - }; 57 - upower.enable = true; 58 - gvfs.enable = true; 59 - logind.settings.Login = { 60 - powerKey = "suspend"; 61 - powerKeyLongPress = "poweroff"; 62 - lidSwitch = "suspend"; 63 - }; 64 - }; 65 - 66 - programs = { 67 - regreet = { 68 - enable = true; 69 - inherit cursorTheme iconTheme; 70 - font = defaultFont; 71 - theme = gtkTheme; 72 - settings.GTK.application_prefer_dark_theme = true; 73 - }; 74 - }; 75 - 76 - security.polkit.enable = true; 77 - }; 78 - }