Skip to content

NixOS flake for scroll, a fork of Sway with a scrolling tiling layout

License

Notifications You must be signed in to change notification settings

AsahiRocks/scroll-flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scroll-flake

GitHub Repo stars GitHub last commit (branch)

This flake contains NixOS packages & modules for scroll, which is a fork of Sway (an i3-compatible Wayland compositor) with a scrolling tiling layout.

This concept should be already familiar to users of PaperWM, Karousel, niri and other projects. If not, however, you can watch this great video by Brodie Robertson explaining it here.

Installation

To get started, just simply add the repository to your flake inputs:

{
  inputs = {
    # ... other inputs

    scroll-flake = {
      url = "github:AsahiRocks/scroll-flake";
      inputs.nixpkgs.follows = "nixpkgs"; # this assumes nixos unstable
    };
  };
  
  # ... rest of your flake
}

NixOS Module

A NixOS module is available that provides an easy way to enable scroll, and additionally configure some basic options.

If you wish to use it, you need to first import the scroll-flake module in your NixOS configuration's flake:

{
  # ... rest of your flake

  outputs = inputs @ { self, nixpkgs, ... }: {
    # example host, replace with your own!
    nixosConfigurations.example = nixpkgs.lib.nixosSystem {
      modules = [
        inputs.scroll-flake.nixosModules.default

        # ... other modules
      ];
    };
  };
}

Now, you can use the scroll module anywhere in your configuration! Here's an example config that enables the git version of scroll alongside some other options:

{
  pkgs,
  inputs,
  ...
}:
{
  programs.scroll = {
    enable = true;
    package = inputs.scroll-flake.packages.${pkgs.stdenv.hostPlatform.system}.scroll-git;

    # Commands executed before scroll gets launched, see more examples here:
    # https://github.com/dawsers/scroll#environment-variables
    extraSessionCommands = ''
      # Tell QT, GDK and others to use the Wayland backend by default, X11 if not available
      export QT_QPA_PLATFORM="wayland;xcb"
      export GDK_BACKEND="wayland,x11"
      export SDL_VIDEODRIVER=wayland
      export CLUTTER_BACKEND=wayland

      # XDG desktop variables to set scroll as the desktop
      export XDG_CURRENT_DESKTOP=scroll
      export XDG_SESSION_TYPE=wayland
      export XDG_SESSION_DESKTOP=scroll

      # Configure Electron to use Wayland instead of X11
      export ELECTRON_OZONE_PLATFORM_HINT=wayland
    '';
  };

  # Enable Pipewire for screencasting and audio server
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    pulse.enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
  };
}

Note

To see all the available options, you can reference the Sway NixOS module from Nixpkgs, as they are both very similar.

Warning

Upon enabling the scroll module, some applications may take longer to start or fail entirely, most notably Waybar. This is not an issue exclusive to scroll, as it also seems to be happening to other Sway users on NixOS. To address this, you will need to manually add this line to the top of your configuration:

include /etc/scroll/config.d/*

If you wanna read more, refer to this comment on a GitHub issue.

Package

The input also exposes 3 package names, if you wish to install them manually:

  • 📦 default — same as using "scroll-stable"
  • 📦 scroll-stable — the latest tagged release of scroll (currently "1.12.4")
  • 📦 scroll-git — the git (master branch) version of scroll, which gets automatically rebased daily

Using them is as simple as adding a normal package:

{
  pkgs,
  inputs,
  ...
}:
let
  system = pkgs.stdenv.hostPlatform.system;
in
{
  environment.systemPackages = [
    # scroll package (replace `default` with whatever package name above)
    inputs.scroll-flake.packages.${system}.default
  ];
}

TODO

  • Generate documentation from the NixOS module
  • Create a Home Manager module

License

This project is licensed under the MIT License

About

NixOS flake for scroll, a fork of Sway with a scrolling tiling layout

Resources

License

Stars

Watchers

Forks

Languages