1{ 2 pkgs, 3 config, 4 lib, 5 i3-workspace-history, 6 ... 7}: 8 9let 10 cfg = config.custom.gui; 11in 12{ 13 options.custom.gui.enable = lib.mkOption { 14 type = lib.types.bool; 15 default = cfg.i3 || cfg.sway || cfg.kde; 16 }; 17 18 config = lib.mkIf cfg.enable { 19 home-manager.users.${config.custom.username} = 20 { config, ... }: 21 { 22 config.custom.gui.enable = true; 23 }; 24 25 networking.networkmanager.enable = true; 26 27 i18n = { 28 defaultLocale = "en_GB.UTF-8"; 29 inputMethod = { 30 enable = true; 31 type = "fcitx5"; 32 fcitx5.addons = with pkgs; [ 33 fcitx5-rime 34 fcitx5-chinese-addons 35 fcitx5-m17n 36 ]; 37 }; 38 }; 39 console = { 40 font = "Lat2-Terminus16"; 41 keyMap = "uk"; 42 }; 43 44 # Needed for Keychron K2 45 boot.extraModprobeConfig = '' 46 options hid_apple fnmode=2 47 options i915 enable_psr=0 48 ''; 49 boot.kernelModules = [ "hid-apple" ]; 50 51 services.xserver = { 52 excludePackages = with pkgs; [ xterm ]; 53 displayManager.startx.enable = true; 54 xkb.layout = "gb"; 55 }; 56 57 security.rtkit.enable = true; 58 services.pipewire = { 59 enable = true; 60 alsa.enable = true; 61 alsa.support32Bit = true; 62 pulse.enable = true; 63 }; 64 65 hardware.bluetooth.enable = true; 66 67 environment.systemPackages = 68 with pkgs; 69 let 70 desktopEntries = [ 71 (pkgs.makeDesktopItem { 72 name = "feh.desktop"; 73 desktopName = "feh"; 74 exec = "feh --scale-down --auto-zoom"; 75 icon = "feh"; 76 }) 77 ]; 78 in 79 [ 80 jq 81 playerctl 82 brightnessctl 83 bluetuith 84 xdg-utils 85 yad 86 networkmanagerapplet 87 pavucontrol 88 (xfce.thunar.override { 89 thunarPlugins = with xfce; [ 90 thunar-archive-plugin 91 xfconf 92 ]; 93 }) 94 # https://discourse.nixos.org/t/sway-wm-configuration-polkit-login-manager/3857/6 95 polkit_gnome 96 glib 97 feh 98 libnotify 99 # https://nixos.wiki/wiki/PipeWire#pactl_not_found 100 pulseaudio 101 tridactyl-native 102 vlc 103 timewall 104 swaybg 105 ] 106 ++ desktopEntries; 107 108 fonts.packages = with pkgs; [ 109 noto-fonts 110 noto-fonts-emoji 111 (nerdfonts.override { 112 fonts = [ 113 "DroidSansMono" 114 "NerdFontsSymbolsOnly" 115 ]; 116 }) 117 wqy_zenhei 118 libertine 119 ]; 120 121 # thunar 122 services.gvfs.enable = true; 123 services.udisks2.enable = true; 124 # thunar thumbnail support for images 125 services.tumbler.enable = true; 126 127 # sets $WORLDLIST for `dict` 128 environment.wordlist.enable = true; 129 }; 130}