home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

sway.nix (1068B)


      1 { config, lib, pkgs, ... }:
      2 let
      3   inherit (lib) mkIf mkEnableOption mkDefault;
      4   cfg = config.modules.desktop.wayland.sway;
      5 in
      6 {
      7   options = {
      8     modules.desktop.wayland.sway = {
      9       enable = mkEnableOption "Enable sway desktop profile";
     10     };
     11   };
     12   config = mkIf cfg.enable {
     13     # Enable wayland desktop modules if not already
     14     modules.desktop.wayland.enable = true;
     15 
     16     # Enable pipewire
     17     modules.hardware.audio = {
     18       enable = true;
     19       pipewire.enable = true;
     20     };
     21 
     22     services.blueman.enable = config.modules.hardware.bluetooth.enable;
     23 
     24     xdg = {
     25       portal = {
     26         enable = true;
     27         wlr.enable = true;
     28         extraPortals = with pkgs; [
     29           xdg-desktop-portal-wlr
     30           xdg-desktop-portal-gtk
     31         ];
     32       };
     33     };
     34 
     35     # Allow swaylock to unlock the computer for us
     36     security.pam.services.swaylock = {
     37       text = "auth include login";
     38     };
     39 
     40     # FIXME are those needed
     41     programs.dconf.enable = true;
     42     services.dbus = {
     43       enable = true;
     44       packages = [ pkgs.dconf pkgs.gcr ];
     45     };
     46   };
     47 }
     48