forked from fabian/nix
		
	improve firefox module
This commit is contained in:
		
							parent
							
								
									d7f1c06f40
								
							
						
					
					
						commit
						48d230a108
					
				
					 5 changed files with 35 additions and 28 deletions
				
			
		|  | @ -1,26 +0,0 @@ | ||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; let |  | ||||||
|   cfg = config.local.apps.browsers; |  | ||||||
| in { |  | ||||||
|   options.local.apps.browsers = { |  | ||||||
|     enable = mkEnableOption "Browser home settings"; |  | ||||||
|   }; |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       chromium |  | ||||||
|       firefox |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # create an option for this |  | ||||||
|     xsession.windowManager.i3.config.startup = [ |  | ||||||
|       { |  | ||||||
|         command = "${lib.getExe pkgs.i3-gaps} 'workspace 1; exec ${lib.getExe pkgs.firefox}'"; |  | ||||||
|       } |  | ||||||
|     ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|     ./baseline.nix |     ./baseline.nix | ||||||
|     ./gaming.nix |     ./gaming.nix | ||||||
|     ./yubikey.nix |     ./yubikey.nix | ||||||
|     ./browsers.nix |     ./firefox.nix | ||||||
|     ./gui |     ./gui | ||||||
|     ./zsh |     ./zsh | ||||||
|     ./gpg.nix |     ./gpg.nix | ||||||
|  |  | ||||||
|  | @ -13,6 +13,7 @@ in { | ||||||
|   config = mkIf cfg.enable { |   config = mkIf cfg.enable { | ||||||
|     home.packages = with pkgs; [ |     home.packages = with pkgs; [ | ||||||
|       calibre |       calibre | ||||||
|  |       chromium | ||||||
|       discord |       discord | ||||||
|       gwenview |       gwenview | ||||||
|       libreoffice-fresh |       libreoffice-fresh | ||||||
|  |  | ||||||
							
								
								
									
										29
									
								
								home/modules/firefox.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								home/modules/firefox.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | ||||||
|  | { | ||||||
|  |   config, | ||||||
|  |   lib, | ||||||
|  |   pkgs, | ||||||
|  |   ... | ||||||
|  | }: | ||||||
|  | with lib; let | ||||||
|  |   cfg = config.local.apps.browsers; | ||||||
|  | in { | ||||||
|  |   options.local.apps.browsers = { | ||||||
|  |     enable = mkEnableOption "firefox settings"; | ||||||
|  |      | ||||||
|  |     workspace = mkOption { | ||||||
|  |       type = types.nullOr types.str; | ||||||
|  |       default = null; | ||||||
|  |       description = '' | ||||||
|  |         Workspace in which Firefox should open. If not set, Firefox will not open at startup. | ||||||
|  |       ''; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   config = mkIf cfg.enable { | ||||||
|  |     programs.firefox.enable = true; | ||||||
|  | 
 | ||||||
|  |     xsession.windowManager.i3.config.startup = optional (cfg.workspace != null) { | ||||||
|  |       command = "${lib.getExe pkgs.i3-gaps} 'workspace ${cfg.workspace}; exec ${lib.getExe pkgs.firefox}'"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -40,8 +40,11 @@ | ||||||
|       neovim.enable = true; |       neovim.enable = true; | ||||||
|       gaming.enable = true; |       gaming.enable = true; | ||||||
|       yubikey.enable = true; |       yubikey.enable = true; | ||||||
|       browsers.enable = true; |  | ||||||
|       defaultDesktopPack.enable = true; |       defaultDesktopPack.enable = true; | ||||||
|  |       firefox = { | ||||||
|  |         enable = true; | ||||||
|  |         workspace = 1; | ||||||
|  |       }; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     gui = { |     gui = { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue