Further configs for tower
This commit is contained in:
		
							
								
								
									
										140
									
								
								home-manager/modules/gui/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										140
									
								
								home-manager/modules/gui/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,140 @@
 | 
			
		||||
{ lib, pkgs, config, ... }:
 | 
			
		||||
let
 | 
			
		||||
  inherit (lib) mkIf mkDefault mkMerge mkForce;
 | 
			
		||||
  inherit (lib.my) mkBoolOpt';
 | 
			
		||||
 | 
			
		||||
  cfg = config.my.gui;
 | 
			
		||||
in
 | 
			
		||||
{
 | 
			
		||||
  options.my.gui = {
 | 
			
		||||
    enable = mkBoolOpt' true "Enable settings and packages meant for graphical systems";
 | 
			
		||||
    standalone = mkBoolOpt' false "Enable settings for fully Nix managed systems";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable (mkMerge [
 | 
			
		||||
      {
 | 
			
		||||
        home = {
 | 
			
		||||
          packages = with pkgs; [
 | 
			
		||||
            (nerdfonts.override {
 | 
			
		||||
              fonts = [ "DroidSansMono" "SourceCodePro" ];
 | 
			
		||||
            })
 | 
			
		||||
            pavucontrol
 | 
			
		||||
          ];
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        programs = {
 | 
			
		||||
          alacritty = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            settings = {
 | 
			
		||||
              font.normal.family = "SauceCodePro Nerd Font Mono";
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
      (mkIf cfg.standalone {
 | 
			
		||||
        xdg = {
 | 
			
		||||
          userDirs = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            createDirectories = true;
 | 
			
		||||
            desktop = "$HOME/desktop";
 | 
			
		||||
            documents = "$HOME/documents";
 | 
			
		||||
            download = "$HOME/downloads";
 | 
			
		||||
            music = "$HOME/music";
 | 
			
		||||
            pictures = "$HOME/pictures";
 | 
			
		||||
            publicShare = "$HOME/public";
 | 
			
		||||
            templates = "$HOME/templates";
 | 
			
		||||
            videos = "$HOME/videos";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        home = {
 | 
			
		||||
          pointerCursor = {
 | 
			
		||||
            package = pkgs.vanilla-dmz;
 | 
			
		||||
            name = "Vanilla-DMZ";
 | 
			
		||||
            gtk.enable = true;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        fonts.fontconfig.enable = true;
 | 
			
		||||
 | 
			
		||||
        wayland = {
 | 
			
		||||
          windowManager = {
 | 
			
		||||
            sway = {
 | 
			
		||||
              enable = true;
 | 
			
		||||
              xwayland = true;
 | 
			
		||||
              config = {
 | 
			
		||||
                input = {
 | 
			
		||||
                  "type:touchpad" = {
 | 
			
		||||
                    tap = "enabled";
 | 
			
		||||
                    natural_scroll = "enable";
 | 
			
		||||
                  };
 | 
			
		||||
                };
 | 
			
		||||
                output = {
 | 
			
		||||
                  "*".bg = "${./stop-nixos.png} stretch";
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                modifier = "Mod4";
 | 
			
		||||
                terminal = "alacritty";
 | 
			
		||||
                keybindings =
 | 
			
		||||
                  let
 | 
			
		||||
                    cfg = config.wayland.windowManager.sway.config;
 | 
			
		||||
                    mod = cfg.modifier;
 | 
			
		||||
                  in
 | 
			
		||||
                  lib.mkOptionDefault {
 | 
			
		||||
                    "${mod}+d" = null;
 | 
			
		||||
                    "${mod}+x" = "exec ${cfg.menu}";
 | 
			
		||||
                    "${mod}+q" = "kill";
 | 
			
		||||
                    "${mod}+Shift+q" = "exec swaynag -t warning -m 'bruh you really wanna kill sway?' -b 'ye' 'swaymsg exit'";
 | 
			
		||||
                  };
 | 
			
		||||
 | 
			
		||||
                menu = "rofi -show run";
 | 
			
		||||
                bars = mkForce [ ];
 | 
			
		||||
              };
 | 
			
		||||
 | 
			
		||||
              swaynag = {
 | 
			
		||||
                enable = true;
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        programs = {
 | 
			
		||||
          git = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            diff-so-fancy.enable = true;
 | 
			
		||||
            userEmail = "jackos1998@gmail.com";
 | 
			
		||||
            userName = "Jack O'Sullivan";
 | 
			
		||||
          };
 | 
			
		||||
 | 
			
		||||
          waybar = import ./waybar.nix { inherit lib pkgs config; };
 | 
			
		||||
          rofi = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            font = "SauceCodePro Nerd Font Mono";
 | 
			
		||||
            plugins = with pkgs; [
 | 
			
		||||
              rofi-calc
 | 
			
		||||
              rofi-emoji
 | 
			
		||||
            ];
 | 
			
		||||
            extraConfig = {
 | 
			
		||||
              modes = "window,run,ssh,filebrowser,calc,emoji";
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
 | 
			
		||||
          chromium = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            package = (pkgs.chromium.override { enableWideVine = true; }).overrideAttrs (old: {
 | 
			
		||||
              buildCommand = ''
 | 
			
		||||
                ${old.buildCommand}
 | 
			
		||||
 | 
			
		||||
                # Re-activate Google sync
 | 
			
		||||
                wrapProgram "$out"/bin/chromium \
 | 
			
		||||
                  --set NIXOS_OZONE_WL 1 \
 | 
			
		||||
                  --set GOOGLE_DEFAULT_CLIENT_ID "77185425430.apps.googleusercontent.com" \
 | 
			
		||||
                  --set GOOGLE_DEFAULT_CLIENT_SECRET "OTJgUOQcT7lO7GsGZq2G4IlT"
 | 
			
		||||
              '';
 | 
			
		||||
            });
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      })
 | 
			
		||||
    ]
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								home-manager/modules/gui/stop-nixos.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								home-manager/modules/gui/stop-nixos.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 249 KiB  | 
							
								
								
									
										215
									
								
								home-manager/modules/gui/waybar.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										215
									
								
								home-manager/modules/gui/waybar.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,215 @@
 | 
			
		||||
{ lib, pkgs, config, ... }:
 | 
			
		||||
let
 | 
			
		||||
  inherit (lib) mkIf mkDefault mkMerge mkForce;
 | 
			
		||||
 | 
			
		||||
  cfg = config.my.gui;
 | 
			
		||||
  pkg = pkgs.waybar.override { withMediaPlayer = true; };
 | 
			
		||||
in
 | 
			
		||||
{
 | 
			
		||||
  enable = true;
 | 
			
		||||
  package = pkg;
 | 
			
		||||
  systemd.enable = true;
 | 
			
		||||
  settings = {
 | 
			
		||||
    mainBar = {
 | 
			
		||||
      height = 30;
 | 
			
		||||
      spacing = 4;
 | 
			
		||||
      modules-left = [ "sway/workspaces" "sway/mode" "custom/media" ];
 | 
			
		||||
      modules-center = [ "sway/window" ];
 | 
			
		||||
      modules-right = [
 | 
			
		||||
        "idle_inhibitor" "pulseaudio" "network" "cpu" "memory" "temperature" "backlight"
 | 
			
		||||
        "keyboard-state" "sway/language" "battery" "clock" "tray"
 | 
			
		||||
      ];
 | 
			
		||||
      # Modules configuration
 | 
			
		||||
      # "sway/workspaces": {
 | 
			
		||||
      #     "disable-scroll": true,
 | 
			
		||||
      #     "all-outputs": true,
 | 
			
		||||
      #     "format": "{name}: {icon}",
 | 
			
		||||
      #     "format-icons": {
 | 
			
		||||
      #         "1": "",
 | 
			
		||||
      #         "2": "",
 | 
			
		||||
      #         "3": "",
 | 
			
		||||
      #         "4": "",
 | 
			
		||||
      #         "5": "",
 | 
			
		||||
      #         "urgent": "",
 | 
			
		||||
      #         "focused": "",
 | 
			
		||||
      #         "default": ""
 | 
			
		||||
      #     }
 | 
			
		||||
      # },
 | 
			
		||||
      keyboard-state = {
 | 
			
		||||
        numlock = true;
 | 
			
		||||
        capslock = true;
 | 
			
		||||
        format = "{name} {icon}";
 | 
			
		||||
        format-icons = {
 | 
			
		||||
          locked = "";
 | 
			
		||||
          unlocked = "";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      "sway/mode".format = "<span style=\"italic\">{}</span>";
 | 
			
		||||
      idle_inhibitor = {
 | 
			
		||||
        format = "{icon}";
 | 
			
		||||
        format-icons = {
 | 
			
		||||
          activated = "";
 | 
			
		||||
          deactivated = "";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      tray = {
 | 
			
		||||
        # "icon-size": 21,
 | 
			
		||||
        spacing = 10;
 | 
			
		||||
      };
 | 
			
		||||
      clock = {
 | 
			
		||||
        # "timezone": "America/New_York",
 | 
			
		||||
        tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
 | 
			
		||||
        format-alt = "{:%Y-%m-%d}";
 | 
			
		||||
      };
 | 
			
		||||
      cpu = {
 | 
			
		||||
        format = "{usage}% ";
 | 
			
		||||
        tooltip = false;
 | 
			
		||||
      };
 | 
			
		||||
      memory.format = "{}% ";
 | 
			
		||||
      temperature = {
 | 
			
		||||
        # "thermal-zone": 2,
 | 
			
		||||
        # "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
 | 
			
		||||
        critical-threshold = 80;
 | 
			
		||||
        # "format-critical": "{temperatureC}°C {icon}",
 | 
			
		||||
        format = "{temperatureC}°C {icon}";
 | 
			
		||||
        format-icons = [ "" "" "" ];
 | 
			
		||||
      };
 | 
			
		||||
      backlight = {
 | 
			
		||||
          # "device": "acpi_video1",
 | 
			
		||||
          format = "{percent}% {icon}";
 | 
			
		||||
          format-icons = [ "" "" "" "" "" "" "" "" "" ];
 | 
			
		||||
      };
 | 
			
		||||
      battery = {
 | 
			
		||||
        states = {
 | 
			
		||||
          # "good": 95,
 | 
			
		||||
          warning = 30;
 | 
			
		||||
          critical = 15;
 | 
			
		||||
        };
 | 
			
		||||
        format = "{capacity}% {icon}";
 | 
			
		||||
        format-charging = "{capacity}% ";
 | 
			
		||||
        format-plugged = "{capacity}% ";
 | 
			
		||||
        format-alt = "{time} {icon}";
 | 
			
		||||
        # "format-good": "", // An empty format will hide the module
 | 
			
		||||
        # "format-full": "",
 | 
			
		||||
        format-icons = [ "" "" "" "" "" ];
 | 
			
		||||
      };
 | 
			
		||||
      network = {
 | 
			
		||||
        # "interface": "wlp2*", // (Optional) To force the use of this interface
 | 
			
		||||
        format-wifi = "{essid} ({signalStrength}%) ";
 | 
			
		||||
        format-ethernet = "{ipaddr}/{cidr} ";
 | 
			
		||||
        tooltip-format = "{ifname} via {gwaddr} ";
 | 
			
		||||
        format-linked = "{ifname} (No IP) ";
 | 
			
		||||
        format-disconnected = "Disconnected ⚠";
 | 
			
		||||
        format-alt = "{ifname}: {ipaddr}/{cidr}";
 | 
			
		||||
      };
 | 
			
		||||
      pulseaudio = {
 | 
			
		||||
        # "scroll-step": 1, // %, can be a float
 | 
			
		||||
        format = "{volume}% {icon} {format_source}";
 | 
			
		||||
        format-bluetooth = "{volume}% {icon} {format_source}";
 | 
			
		||||
        format-bluetooth-muted = " {icon} {format_source}";
 | 
			
		||||
        format-muted = " {format_source}";
 | 
			
		||||
        format-source = "{volume}% ";
 | 
			
		||||
        format-source-muted = "";
 | 
			
		||||
        format-icons = {
 | 
			
		||||
          headphone = "";
 | 
			
		||||
          hands-free = "";
 | 
			
		||||
          headset = "";
 | 
			
		||||
          phone = "";
 | 
			
		||||
          portable = "";
 | 
			
		||||
          car = "";
 | 
			
		||||
          default = [ "" "" "" ];
 | 
			
		||||
        };
 | 
			
		||||
        on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
 | 
			
		||||
      };
 | 
			
		||||
      "custom/media" = {
 | 
			
		||||
        format = "{icon} {}";
 | 
			
		||||
        return-type = "json";
 | 
			
		||||
        max-length = 40;
 | 
			
		||||
        format-icons = {
 | 
			
		||||
          spotify = "";
 | 
			
		||||
          default = "🎜";
 | 
			
		||||
        };
 | 
			
		||||
        escape = true;
 | 
			
		||||
        exec = ''${pkg}/bin/waybar-mediaplayer.py 2> /dev/null'';
 | 
			
		||||
        # "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  style = ''
 | 
			
		||||
    * {
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
      font-family: SauceCodePro Nerd Font Mono;
 | 
			
		||||
      /*font-family: monospace;*/
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    window#waybar {
 | 
			
		||||
      background: #292b2e;
 | 
			
		||||
      color: #fdf6e3;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #custom-right-arrow-dark,
 | 
			
		||||
    #custom-left-arrow-dark {
 | 
			
		||||
      color: #1a1a1a;
 | 
			
		||||
    }
 | 
			
		||||
    #custom-right-arrow-light,
 | 
			
		||||
    #custom-left-arrow-light {
 | 
			
		||||
      color: #292b2e;
 | 
			
		||||
      background: #1a1a1a;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #workspaces,
 | 
			
		||||
    #clock.1,
 | 
			
		||||
    #clock.2,
 | 
			
		||||
    #clock.3,
 | 
			
		||||
    #pulseaudio,
 | 
			
		||||
    #memory,
 | 
			
		||||
    #cpu,
 | 
			
		||||
    #battery,
 | 
			
		||||
    #disk,
 | 
			
		||||
    #tray {
 | 
			
		||||
      background: #1a1a1a;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #workspaces button {
 | 
			
		||||
      padding: 0 2px;
 | 
			
		||||
      color: #fdf6e3;
 | 
			
		||||
    }
 | 
			
		||||
    #workspaces button.focused {
 | 
			
		||||
      color: #268bd2;
 | 
			
		||||
    }
 | 
			
		||||
    #workspaces button:hover {
 | 
			
		||||
      box-shadow: inherit;
 | 
			
		||||
      text-shadow: inherit;
 | 
			
		||||
    }
 | 
			
		||||
    #workspaces button:hover {
 | 
			
		||||
      background: #1a1a1a;
 | 
			
		||||
      border: #1a1a1a;
 | 
			
		||||
      padding: 0 3px;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #pulseaudio {
 | 
			
		||||
      color: #268bd2;
 | 
			
		||||
    }
 | 
			
		||||
    #memory {
 | 
			
		||||
      color: #2aa198;
 | 
			
		||||
    }
 | 
			
		||||
    #cpu {
 | 
			
		||||
      color: #6c71c4;
 | 
			
		||||
    }
 | 
			
		||||
    #battery {
 | 
			
		||||
      color: #859900;
 | 
			
		||||
    }
 | 
			
		||||
    #disk {
 | 
			
		||||
      color: #b58900;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #clock,
 | 
			
		||||
    #pulseaudio,
 | 
			
		||||
    #memory,
 | 
			
		||||
    #cpu,
 | 
			
		||||
    #battery,
 | 
			
		||||
    #disk {
 | 
			
		||||
      padding: 0 10px;
 | 
			
		||||
    }
 | 
			
		||||
  '';
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user