forked from fabian/nix
		
	
		
			
				
	
	
		
			70 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  config,
 | 
						|
  pkgs,
 | 
						|
  lib,
 | 
						|
  ...
 | 
						|
}:
 | 
						|
with lib; let
 | 
						|
  cfg = config.local.gui;
 | 
						|
  monitorType = {setName}: (
 | 
						|
    types.submodule ({name ? null, ...}: {
 | 
						|
      options = {
 | 
						|
        width = mkOption {
 | 
						|
          type = types.str;
 | 
						|
          default = "1920";
 | 
						|
          example = "1920";
 | 
						|
        };
 | 
						|
        height = mkOption {
 | 
						|
          type = types.str;
 | 
						|
          default = "1080";
 | 
						|
          example = "1080";
 | 
						|
        };
 | 
						|
        rate = mkOption {
 | 
						|
          type = types.str;
 | 
						|
          description = "refresh rate";
 | 
						|
          example = "143.85";
 | 
						|
        };
 | 
						|
        posX = mkOption {
 | 
						|
          type = types.str;
 | 
						|
          description = "x axis position";
 | 
						|
          default = "0";
 | 
						|
          example = "0";
 | 
						|
        };
 | 
						|
        posY = mkOption {
 | 
						|
          type = types.str;
 | 
						|
          description = "y axis position";
 | 
						|
          default = "0";
 | 
						|
          example = "0";
 | 
						|
        };
 | 
						|
      };
 | 
						|
    })
 | 
						|
  );
 | 
						|
in {
 | 
						|
  options.local.gui = {
 | 
						|
    enable = mkEnableOption "GUI settings";
 | 
						|
    monitors = mkOption {
 | 
						|
      type = types.attrsOf (monitorType {setName = true;});
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  imports = [
 | 
						|
    ./fonts.nix
 | 
						|
    ./theme.nix
 | 
						|
    ./sway.nix
 | 
						|
    ./waybar.nix
 | 
						|
    ./mako.nix
 | 
						|
  ];
 | 
						|
 | 
						|
  config = mkIf cfg.enable {
 | 
						|
    xdg = {
 | 
						|
      enable = true;
 | 
						|
      mimeApps = {
 | 
						|
        enable = true;
 | 
						|
        defaultApplications = {
 | 
						|
          "application/pdf" = with pkgs; ["qpdfview.desktop"];
 | 
						|
          "x-scheme-handler/file" = with pkgs; ["foot.desktop"];
 | 
						|
        };
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |