First step in migrating sway to nixos
This commit is contained in:
		
							parent
							
								
									b4125a0bcb
								
							
						
					
					
						commit
						65959bee44
					
				| 
						 | 
					@ -2,23 +2,92 @@
 | 
				
			||||||
let
 | 
					let
 | 
				
			||||||
  cfg = config.this.application.sway;
 | 
					  cfg = config.this.application.sway;
 | 
				
			||||||
  graphical = config.this.graphical;
 | 
					  graphical = config.this.graphical;
 | 
				
			||||||
 | 
					  wallpaper = pkgs.fetchurl {
 | 
				
			||||||
 | 
					    url =
 | 
				
			||||||
 | 
					      "https://raw.githubusercontent.com/catppuccin/wallpapers/main/landscapes/evening-sky.png";
 | 
				
			||||||
 | 
					    sha256 = "sha256-fYMzoY3un4qGOSR4DMqVUAFmGGil+wUze31rLLrjcAc=";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
in with lib; {
 | 
					in with lib; {
 | 
				
			||||||
  options = {
 | 
					  options = {
 | 
				
			||||||
    this.application.sway = {
 | 
					    this.application.sway = {
 | 
				
			||||||
      enable = mkOption {
 | 
					      enable = mkOption {
 | 
				
			||||||
        # TODO base on graphical
 | 
					 | 
				
			||||||
        default = graphical.enable;
 | 
					        default = graphical.enable;
 | 
				
			||||||
        type = with types; bool;
 | 
					        type = with types; bool;
 | 
				
			||||||
        description = "testing one two three";
 | 
					 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  config = mkIf cfg.enable {
 | 
					  config = mkIf cfg.enable {
 | 
				
			||||||
    home-manager.users.james = {
 | 
					    home-manager.users.james = {
 | 
				
			||||||
      home.sessionVariables = {
 | 
					      home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; };
 | 
				
			||||||
        MOZ_ENABLE_WAYLAND = 1;
 | 
					      wayland.windowManager.sway = {
 | 
				
			||||||
        XDG_CURRENT_DESKTOP = "sway";
 | 
					        enable = true;
 | 
				
			||||||
 | 
					        wrapperFeatures.gtk = true;
 | 
				
			||||||
 | 
					        config = {
 | 
				
			||||||
 | 
					          bars = [ ];
 | 
				
			||||||
 | 
					          colors = {
 | 
				
			||||||
 | 
					            focusedInactive = {
 | 
				
			||||||
 | 
					              background = "#1E1E2E";
 | 
				
			||||||
 | 
					              border = "#1E1E2E";
 | 
				
			||||||
 | 
					              childBorder = "#1E1E2E";
 | 
				
			||||||
 | 
					              indicator = "#1E1E2E";
 | 
				
			||||||
 | 
					              text = "#C9CBFF";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            unfocused = {
 | 
				
			||||||
 | 
					              background = "#1E1E2E";
 | 
				
			||||||
 | 
					              border = "#1E1E2E";
 | 
				
			||||||
 | 
					              childBorder = "#1E1E2E";
 | 
				
			||||||
 | 
					              indicator = "#1E1E2E";
 | 
				
			||||||
 | 
					              text = "#C9CBFF";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            focused = {
 | 
				
			||||||
 | 
					              background = "#131020";
 | 
				
			||||||
 | 
					              border = "#131020";
 | 
				
			||||||
 | 
					              childBorder = "#131020";
 | 
				
			||||||
 | 
					              indicator = "#131020";
 | 
				
			||||||
 | 
					              text = "#ABE9B3";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            urgent = {
 | 
				
			||||||
 | 
					              background = "#F28FAD";
 | 
				
			||||||
 | 
					              border = "#F28FAD";
 | 
				
			||||||
 | 
					              childBorder = "#F28FAD";
 | 
				
			||||||
 | 
					              indicator = "#F28FAD";
 | 
				
			||||||
 | 
					              text = "#ABE9B3";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					          fonts = {
 | 
				
			||||||
 | 
					            names = [ "Alegreya" "FontAwesome" ];
 | 
				
			||||||
 | 
					            size = 9.0;
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					          input = {
 | 
				
			||||||
 | 
					            "1133:45079:MX_Master_Mouse" = {
 | 
				
			||||||
 | 
					              natural_scroll = "enable";
 | 
				
			||||||
 | 
					              accel_profile = "adaptive";
 | 
				
			||||||
 | 
					              pointer_accel = "-0.3";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            "1:1:AT_Translated_Set_2_keyboard" = {
 | 
				
			||||||
 | 
					              xkb_options = "ctrl:nocaps";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            "2:7:SynPS/2_Synaptics_TouchPad" = {
 | 
				
			||||||
 | 
					              dwt = "enabled";
 | 
				
			||||||
 | 
					              click_method = "clickfinger";
 | 
				
			||||||
 | 
					              natural_scroll = "enabled";
 | 
				
			||||||
 | 
					              middle_emulation = "enabled";
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					          gaps = {
 | 
				
			||||||
 | 
					            inner = 5;
 | 
				
			||||||
 | 
					            outer = 2;
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					          # And import and scripts as scene here would be good.
 | 
				
			||||||
 | 
					          # https://github.com/gytis-ivaskevicius/nixfiles/blob/master/home-manager/i3-sway.nix
 | 
				
			||||||
 | 
					          keybindings = mkOptionDefault { "Mod4+d" = ""; };
 | 
				
			||||||
 | 
					          modifier = "Mod4";
 | 
				
			||||||
 | 
					          output = { "eDP-1" = { bg = "${wallpaper} fill"; }; };
 | 
				
			||||||
 | 
					          terminal = "${pkgs.kitty}/bin/kitty";
 | 
				
			||||||
 | 
					          # https://rycee.gitlab.io/home-manager/options.html#opt-wayland.windowManager.sway.config.window.commands
 | 
				
			||||||
 | 
					          window = { };
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      home.packages = with pkgs; [
 | 
					      home.packages = with pkgs; [
 | 
				
			||||||
| 
						 | 
					@ -53,11 +122,6 @@ in with lib; {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    programs.light.enable = true;
 | 
					    programs.light.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    programs.sway = {
 | 
					 | 
				
			||||||
      enable = true;
 | 
					 | 
				
			||||||
      wrapperFeatures.gtk = true; # so that gtk works properly
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    systemd.user.targets.sway-session = {
 | 
					    systemd.user.targets.sway-session = {
 | 
				
			||||||
      description = "Sway compositor session";
 | 
					      description = "Sway compositor session";
 | 
				
			||||||
      documentation = [ "man:systemd.special(7)" ];
 | 
					      documentation = [ "man:systemd.special(7)" ];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,6 +8,7 @@ in {
 | 
				
			||||||
        alegreya
 | 
					        alegreya
 | 
				
			||||||
        fira-code
 | 
					        fira-code
 | 
				
			||||||
        fira-code-symbols
 | 
					        fira-code-symbols
 | 
				
			||||||
 | 
					        font-awesome
 | 
				
			||||||
        hasklig
 | 
					        hasklig
 | 
				
			||||||
        inter
 | 
					        inter
 | 
				
			||||||
        liberation_ttf
 | 
					        liberation_ttf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue
	
	Block a user