Open2

swayでカーソルが出現しなくなった

はるきはるき

ソースコード。最初の自動生成時のコメントやハッシュ化したパスワードは変更済。このコードではカーソルがついた。

/etc/nixos/configuration.nix
{ config, pkgs, ... }:

{
  imports = [
    <home-manager/nixos>
    ./hardware-configuration.nix
  ];

  boot = {
    loader = {
      systemd-boot = {
        enable = true;
        consoleMode = "max";
        editor = false;
      };
      efi = {
        canTouchEfiVariables = true;
        efiSysMountPoint = "/boot";
      };
    };
  };

  system = {
    copySystemConfiguration = true;
    stateVersion = "22.11";
  };

  hardware = {
    opengl = {
      enable = true;
    };
    bluetooth = {
      enable = true;
      settings = {
        General = {
          Enable = "Source,Sink,Media,Socket";
        };
      };
    };
  };

  security = {
    polkit = {
      enable = true;
    };
  };

  nixpkgs = {
    overlays = [(self: super: { discord = super.discord.overrideAttrs (_: { src = builtins.fetchTarball https://discord.com/api/download?platform=linux&format=tar.gz; });})];
    config = {
      allowUnfree = true;
    };
  };

  xdg = {
    sounds = {
      enable = true;
    };
    portal = {
      enable = true;
      extraPortals = with pkgs; [
        xdg-desktop-portal-gtk
        xdg-desktop-portal-wlr
      ];
      wlr = {
        enable = true;
      };
    };
  };

  networking = {
    hostName = "dell-chan";
    networkmanager = {
      enable = true;
    };
  };

  time.timeZone = "Asia/Tokyo";

  i18n = {
    defaultLocale = "en_US.UTF-8";
    inputMethod = {
      enabled = "uim";
    };
  };

  console = {
    font = "Lat2-Terminus16";
    keyMap = "us";
  };

  users = {
    mutableUsers = true;
    users = {
      root = {
        isSystemUser = true;
        hashedPassword = "hoge";
        extraGroups = [ "root" "pipewire" ];
      };
      haruki = {
        isNormalUser = true;
        hashedPassword = "hoge";
        extraGroups = [ "wheel" "docker" "pipewire" ];
      };
      mpd = {
        extraGroups = [ "pipewire" ];
      };
    };
  };

  home-manager = {
    users = {
      root = {
        home = {
          username = "root";
          homeDirectory = "/root";
          stateVersion = "22.11";
        };
        programs = {
          home-manager = {
            enable = true;
          };
          bash = {
            enable = true;
          };
          vim = {
            enable = true;
            extraConfig = ''
              syntax on
              set number
            '';
            plugins = with pkgs.vimPlugins; [
              coc-nvim
            ];
          };
          neovim = {
            enable = true;
            extraConfig = ''
              syntax on
              set number
            '';
            withNodeJs = true;
            coc = {
              enable = true;
              settings = {
                "suggest.enablePreview" = true;
                languageserver = {
                  dockerfile = {
                    command = "coc-docker";
                    filetypes = [ "Dockerfile" ];
                  };
                };
              };
            };
          };
        };
      };
      haruki = {
        home = {
          username = "haruki";
          homeDirectory = "/home/haruki";
          stateVersion = "22.11";
          pointerCursor = {
            name = "Adwaita";
            package = pkgs.gnome.adwaita-icon-theme;
            size = 24;
          };
        };
        wayland = {
          windowManager = {
            sway = let
              cfg = config.home-manager.users.haruki.wayland.windowManager.sway.config;
            in {
              enable = true;
              wrapperFeatures = {
                gtk = true;
              };
              config = {
                modifier = "Mod4";
                terminal = "foot";
                keybindings = {
                  "${cfg.modifier}+Return" = "exec --no-startup-id ${cfg.terminal}";
                  "${cfg.modifier}+Shift+b" = "exec --no-startup-id google-chrome-stable";
                  "${cfg.modifier}+Shift+d" = "exec --no-startup-id discord";
                  "${cfg.modifier}+p" = "exec --no-startup-id grim";
                  "${cfg.modifier}+Shift+i" = "exec --no-startup-id VirtualBox";
                  "${cfg.modifier}+Shift+g" = "exec --no-startup-id godot";
                  "${cfg.modifier}+Shift+m" = "exec --no-startup-id code";
                  "${cfg.modifier}+semicolon" = "exec --no-startup-id pavucontrol";

                  "${cfg.modifier}+Shift+c" = "reload";
                  "${cfg.modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
                  "${cfg.modifier}+Shift+q" = "kill";

                  "${cfg.modifier}+Left" = "focus left";
                  "${cfg.modifier}+Down" = "focus down";
                  "${cfg.modifier}+Up" = "focus up";
                  "${cfg.modifier}+Right" = "focus right";

                  "${cfg.modifier}+Shift+Left" = "move left";
                  "${cfg.modifier}+Shift+Down" = "move down";
                  "${cfg.modifier}+Shift+Up" = "move up";
                  "${cfg.modifier}+Shift+Right" = "move right";

                  "${cfg.modifier}+h" = "splith";
                  "${cfg.modifier}+v" = "splitv";
                  "${cfg.modifier}+f" = "fullscreen toggle";
                  "${cfg.modifier}+a" = "focus parent";

                  "${cfg.modifier}+s" = "layout stacking";
                  "${cfg.modifier}+w" = "layout tabbed";
                  "${cfg.modifier}+e" = "layout toggle split";

                  "${cfg.modifier}+Shift+space" = "floating toggle";
                  "${cfg.modifier}+space" = "focus mode_toggle";

                  "${cfg.modifier}+1" = "workspace number 1";
                  "${cfg.modifier}+2" = "workspace number 2";
                  "${cfg.modifier}+3" = "workspace number 3";
                  "${cfg.modifier}+4" = "workspace number 4";
                  "${cfg.modifier}+5" = "workspace number 5";
                  "${cfg.modifier}+6" = "workspace number 6";
                  "${cfg.modifier}+7" = "workspace number 7";
                  "${cfg.modifier}+8" = "workspace number 8";
                  "${cfg.modifier}+9" = "workspace number 9";

                  "${cfg.modifier}+Shift+1" = "move container to workspace number 1";
                  "${cfg.modifier}+Shift+2" = "move container to workspace number 2";
                  "${cfg.modifier}+Shift+3" = "move container to workspace number 3";
                  "${cfg.modifier}+Shift+4" = "move container to workspace number 4";
                  "${cfg.modifier}+Shift+5" = "move container to workspace number 5";
                  "${cfg.modifier}+Shift+6" = "move container to workspace number 6";
                  "${cfg.modifier}+Shift+7" = "move container to workspace number 7";
                  "${cfg.modifier}+Shift+8" = "move container to workspace number 8";
                  "${cfg.modifier}+Shift+9" = "move container to workspace number 9";

                  "${cfg.modifier}+r" = "mode resize";
                };
                modes = {
                  resize = {
                    "Left" = "resize shrink width 10 px";
                    "Down" = "resize grow height 10 px";
                    "Up" = "resize shrink height 10 px";
                    "Right" = "resize grow width 10 px";
                    "Escape" = "mode default";
                    "Return" = "mode default";
                  };
                };
                fonts = {
                  names = [
                    "monospace"
                  ];
                  size = 8.0;
                };
                gaps = {
                  inner = 5;
                };
                output = {
                  "*" = {
                    bg = "/etc/wallpaper/nix-wallpaper-simple-dark-gray.png fill";
                  };
                };
                bars = [
                  {
                    "hiddenState" = "show";
                    "command" = "${pkgs.waybar}/bin/waybar"; # Using WayBar
                  }
                ];
              };
            };
          };
        };
        programs = {
          home-manager = {
            enable = true;
          };
          bash = {
            enable = true;
          };
          foot = {
            enable = true;
            server.enable = true;
            settings = {
              colors = {
                alpha = 0.5;
              };
            };
          };
          git = {
            enable = true;
            userName = "haruki7049";
            userEmail = "tontonkirikiri@gmail.com";
          };
          waybar = {
            enable = true;
            settings = {
              mainBar = {
                leyer = "top";
                position = "top";
                modules-left = [ "sway/workspaces" "sway/mode" ];
                modules-center = [ "clock" "mpd" ];
                modules-right = [ "network" "pulseaudio" "tray" ];
                "network" = {
                  "format" = "{ifname}";
                  "format-disconnected" = "disconnected";
                  "format-wifi" = "{essid}, {ipaddr}: ({signalStrength}%)";
                  "format-ethernet" = "{ifname}, {ipaddr}";
                };
                "pulseaudio" = {
                  format = "{desc}:{volume}% Mic:{format-source}";
                  format-bluetooth = "bluetooth: {desc} {volume}%";
                  format-muted = "Speaker muted";#Speaker
                  format-source-muted = "Mic muted";#Mic
                };
                "clock" = {
                  timezone = "Asia/Tokyo";
                  format = "{:%F %H:%M %A}";
                };
                "sway/workspaces" = {
                  disable-scroll = true;
                  all-outputs = true;
                };
              };
            };
            style = ''
              * {
                font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
                font-size: 10px;
                color: #000000;
                border: none;
                border-radius: 0;
                padding: 0;
                margin: 0;
              }
              #workspaces button {
                border-bottom: 2px solid #696969;
                background: #666666;
              }
              #workspaces button.focused {
                border-bottom: 2px solid #696969;
                background: #888888;
              }
              #clock {
                font-weight: 900;
                padding: 0 5px;
                border: 2px solid #696969;
                background: #888888;
              }
              #network {
                border: 2px solid #696969;
                padding: 0 5px;
                background: #888888;
              }
              #pulseaudio {
                border: 2px solid #696969;
                padding: 0 5px;
                background: #888888;
              }
              #mpd {
                border: 2px solid #696969;
                padding: 0 5px;
                background: #888888;
              }
              #tray {
                border: 2px solid #696969;
                padding: 0 5px;
                background: #888888;
              }
            '';
          };
          mako = {
            enable = true;
            font = "FontAwesome 10";
          };
          vim = {
            enable = true;
            extraConfig = ''
              syntax on
              set number
            '';
            plugins = with pkgs.vimPlugins; [
              coc-nvim
              molokai
              vim-hybrid
            ];
          };
          neovim = {
            enable = true;
            extraConfig = ''
              syntax on
              set number
            '';
            withNodeJs = true;
            coc = {
              enable = true;
              settings = {
                "suggest.enablePreview" = true;
                languageserver = {
                  dockerfile = {
                    command = "coc-docker";
                    filetypes = [ "Dockerfile" ];
                  };
                };
              };
            };
          };
        };
      };
    };
  };

  environment = {
    systemPackages = with pkgs; [
      vim
      wget
      alsa-utils
      pavucontrol
      wf-recorder
      mpc-cli
      w3m
      neofetch
      cmatrix
      sl
      nodejs
      rustup
      go
      clang
      clisp
      godot
      gimp
      blender
      
      google-chrome
      discord
      vscode
      chromium
      grim
      imv
    ];
    variables = {
      EDITOR = "vim";
    };
    sessionVariables = {
      GTK_THEME = "Adwaita:dark";
    };
  };

  fonts = {
    fonts = with pkgs; [
      dejavu_fonts
      ipafont
      ipaexfont
      noto-fonts
      noto-fonts-emoji
      noto-fonts-extra
      noto-fonts-cjk-sans
      noto-fonts-cjk-serif

      font-awesome
      hack-font
      roboto
      helvetica-neue-lt-std
    ];
  };

  services = {
    dbus = {
      enable = true;
    };
    postgresql = {
      package = pkgs.postgresql;
      enable = true;
    };
    #mysql = {
    #  package = pkgs.mysql80;
    #  enable = true;
    #};
    openssh = {
      enable = true;
    };
    pipewire = {
      enable = true;
      systemWide = true;
      alsa = {
        enable = true;
        support32Bit = true;
      };
      pulse.enable = true;
      config = {
        pipewire = {
          context.properties = {
            core.daemon = true;
            support.dbus = true;
          };
          context.modules = {
            name = "libpipewire-portal";
          };
        };
      };
    };
    mpd = {
      enable = true;
      extraConfig = ''
        restore_paused "yes"
        audio_output {
          type "pipewire"
          name "PipeWire"
        }
      '';
    };
  };

  virtualisation = {
    docker = {
      enable = true;
    };
    virtualbox = {
      host = {
        enable = true;
      };
    };
  };
}
はるきはるき

多分、「GTKテーマが適用できなかった」とかかなぁと思っている。