1{ 2 pkgs, 3 config, 4 lib, 5 ... 6}: 7 8let 9 cfg = config.custom.gui; 10in 11{ 12 imports = [ 13 ./i3.nix 14 ./sway.nix 15 ]; 16 17 options.custom.gui.enable = lib.mkEnableOption "gui"; 18 19 config = lib.mkIf cfg.enable { 20 gtk = { 21 enable = true; 22 font = { 23 name = "Noto Sans 11"; 24 package = pkgs.noto-fonts; 25 }; 26 iconTheme = { 27 package = pkgs.gruvbox-gtk-theme; 28 name = "Gruvbox-Dark"; 29 }; 30 theme = { 31 package = pkgs.gruvbox-gtk-theme; 32 name = "Gruvbox-Dark"; 33 }; 34 }; 35 36 home = { 37 packages = 38 let 39 status = pkgs.stdenv.mkDerivation { 40 name = "status"; 41 42 src = ../status; 43 44 installPhase = '' 45 mkdir -p $out 46 cp -r * $out 47 ''; 48 }; 49 in 50 [ status ]; 51 sessionVariables = { 52 # evince workaround 53 GTK_THEME = "Gruvbox-Dark"; 54 WALLPAPER = 55 let 56 wallpaper = ./wallpaper.jpg; 57 in 58 pkgs.runCommand (builtins.baseNameOf wallpaper) { } "cp ${wallpaper} $out"; 59 TERMINAL = "alacritty"; 60 }; 61 pointerCursor = { 62 name = "Adwaita"; 63 package = pkgs.adwaita-icon-theme; 64 size = 32; 65 }; 66 file = { 67 ".profile".text = '' 68 source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" 69 ''; 70 ".config/gtk-3.0/bookmarks" = { 71 force = true; 72 text = '' 73 file:///${config.home.homeDirectory}/archive 74 file:///${config.home.homeDirectory}/documents 75 file:///${config.home.homeDirectory}/downloads 76 file:///${config.home.homeDirectory}/pictures 77 file:///${config.home.homeDirectory}/videos 78 file:///${config.home.homeDirectory}/projects 79 ''; 80 }; 81 ".config/mimeapps.list" = { 82 force = true; 83 source = ./mimeapps.list; 84 }; 85 }; 86 }; 87 88 programs.firefox = 89 let 90 settings = { 91 "browser.ctrlTab.recentlyUsedOrder" = false; 92 "browser.tabs.warnOnClose" = false; 93 "browser.toolbars.bookmarks.visibility" = "never"; 94 95 # Only hide UI elements on F11 (i.e. don't go fullscreen, leave that to WM) 96 "full-screen-api.ignore-widgets" = true; 97 # Right click issue fix 98 "ui.context_menus.after_mouseup" = true; 99 100 # Use userChrome.css 101 "toolkit.legacyUserProfileCustomizations.stylesheets" = true; 102 103 "browser.shell.checkDefaultBrowser" = false; 104 105 # sync toolbar 106 "services.sync.prefs.sync.browser.uiCustomization.state" = true; 107 108 "extensions.pocket.enabled" = false; 109 110 "extensions.autoDisableScopes" = 0; 111 }; 112 userChrome = '' 113 #webrtcIndicator { 114 display: none; 115 } 116 117 /* Move find bar to top */ 118 .browserContainer > findbar { 119 -moz-box-ordinal-group: 0; 120 } 121 122 #TabsToolbar 123 { 124 visibility: collapse; 125 } 126 ''; 127 extensions = with pkgs.nur.repos.rycee.firefox-addons; [ 128 auto-tab-discard 129 bitwarden 130 multi-account-containers 131 news-feed-eradicator 132 istilldontcareaboutcookies 133 leechblock-ng 134 search-by-image 135 simple-translate 136 tree-style-tab 137 tridactyl 138 ublock-origin 139 zotero-connector 140 ]; 141 in 142 { 143 enable = true; 144 profiles.default = { 145 inherit settings userChrome extensions; 146 }; 147 profiles.secondary = { 148 inherit settings userChrome extensions; 149 id = 1; 150 isDefault = false; 151 }; 152 package = ( 153 pkgs.firefox.override { 154 nativeMessagingHosts = with pkgs; [ tridactyl-native ]; 155 } 156 ); 157 }; 158 159 xdg = { 160 configFile = { 161 "Thunar/uca.xml".source = ./thunar.xml; 162 "fontconfig/fonts.conf".source = ./fonts.conf; 163 "alacritty.toml".source = ./alacritty.toml; 164 "Element/config.json".source = ./element.json; 165 "swappy/config".text = '' 166 [Default] 167 save_dir=~/capture/capture/ 168 save_filename_format=screenshot_%Y-%m-%dT%H:%M:%S%z.png 169 ''; 170 "tridactyl/tridactylrc".source = ./tridactylrc; 171 }; 172 userDirs = { 173 enable = true; 174 createDirectories = true; 175 download = "$HOME/downloads"; 176 pictures = "$HOME/pictures"; 177 videos = "$HOME/videos"; 178 documents = "$HOME/documents/"; 179 music = "$HOME/"; 180 # https://bugzilla.mozilla.org/show_bug.cgi?id=1082717 181 desktop = "$HOME/"; 182 templates = "$HOME/"; 183 publicShare = "$HOME/"; 184 }; 185 }; 186 }; 187}