Skip to content

About

A Nix Flake to use the in development singularity desktop

Resources

Stars

15 stars

Watchers

0 watching

Forks

Latest commit

 

History

120 Commits

Folders and files

Repository files navigation

singularity-flake

A Nix Flake to use the in development singularity desktop.

Usage

# Run the packaged Singularity Desktop binary directly without installing.
# This is useful for quick experiments, but it is not a full display-manager
# session.
nix run github:mateoalfaro/singularity-flake

# Build the package
nix build github:mateoalfaro/singularity-flake

NixOS module

For a real desktop session, use the NixOS module. Add the flake to your inputs and enable it with a single option. This registers the session with an existing display manager; enable the optional Singularity greeter below if the machine does not already have one:

{
  inputs.singularity-desktop.url = "github:mateoalfaro/singularity-flake";

  outputs = { self, nixpkgs, singularity-desktop, ... }: {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        singularity-desktop.nixosModules.default
      ];
    };
  };
}

Configuration

{
  programs.singularity-desktop = {
    enable = true;

    # Optional: you can also exclude bundled applications from the system profile.
    excludePackages = with pkgs; [
      singularity-calculator
      singularity-music
      singularity-store
    ];

    # Or remove every optional bundled app at once without listing them.
    core-apps.enable = false;

    greeter = {
      enable = true;   # enables the Singularity greeter via greetd (disabled by default)
      #You can also customize greetd by replacing the default background image
      #background = "/path/to/image.jpg";
    };

  };

  # The Singularity Cachix binary cache is enabled by default. Set this to
  # false if you do not want to use or trust it.
  # singularity-flake.cache.enable = false;
}

programs.singularity-desktop.excludePackages accepts package values, like environment.gnome.excludePackages. Importing the Singularity NixOS module adds an overlay that exposes these default applications under pkgs:

  • singularity-files
  • singularity-calculator
  • singularity-calendar
  • singularity-edit
  • singularity-git
  • singularity-leafs
  • singularity-monitor
  • singularity-music
  • singularity-photos
  • singularity-store
  • singularity-videos
  • singularity-write

singularity-files cannot be excluded: the Singularity portal advertises the FileChooser interface and delegates it to Files. Setting core-apps.enable to false therefore leaves Files installed while removing the other applications.

When programs.singularity-desktop.greeter.enable = true, your desktop session is started by greetd on tty1. If you later switch to another display manager such as GDM with nixos-rebuild switch while still logged into that session, the existing greetd session will still be present in tty1/tty2. Reboot for the old session to disappear. This appears to be intended greetd behavior and cannot be fixed by this flake.

For display manager changes such as greetd <-> gdm, prefer one of these:

  • use nixos-rebuild boot and reboot
  • run nixos-rebuild switch from another TTY or over SSH
  • after switching, move to the VT where the new display manager started (commonly Ctrl+Alt+F2 or Ctrl+Alt+F3)

Custom package requirements

programs.singularity-desktop.package can be overridden, but the replacement package must provide the same runtime interface as the default package:

  • bin/singularity-labwc-session
  • bin/singularity-desktop-session
  • bin/labwc
  • the greeter executables used by the module
  • Wayland session metadata under share/wayland-sessions
  • xdg-desktop-portal metadata and services, including a desktop-specific config at share/xdg-desktop-portal/<desktop>-portals.conf
  • passthru.providedSessions

The portal configuration must be scoped to the package's desktop name. The module installs the package as an additional portal implementation and uses a low-priority xdg.portal.configPackages entry, so GNOME, KDE, Hyprland, Niri, and other desktop modules can retain their own portal configuration when they are used instead of Singularity. A replacement package must not provide a generic share/xdg-desktop-portal/portals.conf that changes portal selection for every desktop.

Inputs

  • nixpkgs — pinned to nixos-unstable.
  • singularity-desktop-src — tracks the latest commit of singularityos-lab/singularity-desktop with submodules. The package builds the labwc revision pinned by that source tree, so the compositor and desktop cannot drift independently.

For local development against the singularity-desktop checkout in this repository (including its checked-out labwc submodule), override the source:

nix build .#singularity-desktop-core \
  --override-input singularity-desktop-src path:./singularity-desktop

Updating inputs

To update inputs manually:

nix flake update

About

A Nix Flake to use the in development singularity desktop

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages