Jump to content

COSMIC: Difference between revisions

From NixOS Wiki
imported>Ahoneybun
fix code blocks
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
COSMIC is a desktop environment developed in the Rust programming language, using the iced cross platform GUI library for Rust, and Smithay as building blocks for its compositor, cosmic-comp. Cosmic-comp is comparable to smithay's own anvil compositor demonstration, just like the Wayland project uses Weston as demo compositor.
COSMIC is a [[:Category:Desktop environment|desktop environment]] developed in the [[Rust]] programming language, using the iced cross platform GUI library for Rust, and Smithay as building blocks for its compositor, cosmic-comp. Cosmic-comp is comparable to smithay's own anvil compositor demonstration, just like the Wayland project uses Weston as demo compositor.


== Installation ==
COSMIC was primarily developed for use in the [https://pop.system76.com/ Pop!_OS] distribution.


Currently packaged in nixpkgs master/unstable are below, one way to install them is to use a configuration file like this:
== NixOS module (starting with NixOS 25.05) ==


<code>
COSMIC support in nixpkgs is still in development. You can follow progress via [https://github.com/NixOS/nixpkgs/issues/259641 the tracking issue].  
{ config, pkgs, ...}:


let
You can enable COSMIC on your NixOS system by setting the following configuration options: <syntaxhighlight lang="nix">{
   unstable = import
   # Enable the COSMIC login manager
    (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/master)
  services.displayManager.cosmic-greeter.enable = true;
    # reuse the current configuration
    { config = config.nixpkgs.config; };
in


  # Enable the COSMIC desktop environment
  services.desktopManager.cosmic.enable = true;
}</syntaxhighlight>Support for automatic logins is present when using the `cosmic-greeter` login manager. All you need is the following configuration: <syntaxhighlight lang="nix">
{
{
   environment.systemPackages = with pkgs; [
   services.displayManager.autoLogin = {
     unstable.rustc
     enable = true;
     unstable.just
     # Replace `yourUserName` with the actual username of user who should be automatically logged in
     unstable.cosmic-icons
     user = "yourUserName";
    unstable.cosmic-settings
   };
   ];
}
}
</code>
</syntaxhighlight>Alternatively, there is a [https://github.com/lilyinstarlight/nixos-cosmic flake] to setup COSMIC on NixOS.


You would add it to your main configuration.nix file in /etc/nixos/ like this:
== COSMIC packages ==


<code>
While the whole desktop is not configured many packages are available in nixpkgs already. You can search for packages with a query similar to this one https://search.nixos.org/packages?query=cosmic&from=0&size=1000&sort=relevance&channel=unstable. Note that not all of the results will be part of the COSMIC desktop.
  imports =
      [
          ./hardware-configuration.nix
          ./unstable.nix
      ];
</code>


then rebuild:
[[Category:Desktop environment]]
 
<code>
sudo nixos-rebuild switch
</code>
 
=== COSMIC Comp ===
 
https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/applications/window-managers/cosmic/comp
 
=== COSMIC Panel ===
 
This also includes the Dock:
 
https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/applications/window-managers/cosmic/panel
 
=== COSMIC Applet ===
 
https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/applications/window-managers/cosmic/applets
 
=== COSMIC Settings ===
 
https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/window-managers/cosmic/settings
 
=== COSMIC Icons ===
 
https://github.com/NixOS/nixpkgs/tree/a10c1225467f721dedbaaa260c006d6d15c8c40b/pkgs/by-name/co/cosmic-icons

Revision as of 21:07, 8 April 2025

COSMIC is a desktop environment developed in the Rust programming language, using the iced cross platform GUI library for Rust, and Smithay as building blocks for its compositor, cosmic-comp. Cosmic-comp is comparable to smithay's own anvil compositor demonstration, just like the Wayland project uses Weston as demo compositor.

COSMIC was primarily developed for use in the Pop!_OS distribution.

NixOS module (starting with NixOS 25.05)

COSMIC support in nixpkgs is still in development. You can follow progress via the tracking issue.

You can enable COSMIC on your NixOS system by setting the following configuration options:

{
  # Enable the COSMIC login manager
  services.displayManager.cosmic-greeter.enable = true;

  # Enable the COSMIC desktop environment
  services.desktopManager.cosmic.enable = true;
}

Support for automatic logins is present when using the `cosmic-greeter` login manager. All you need is the following configuration:

{
  services.displayManager.autoLogin = {
    enable = true;
    # Replace `yourUserName` with the actual username of user who should be automatically logged in
    user = "yourUserName";
  };
}

Alternatively, there is a flake to setup COSMIC on NixOS.

COSMIC packages

While the whole desktop is not configured many packages are available in nixpkgs already. You can search for packages with a query similar to this one https://search.nixos.org/packages?query=cosmic&from=0&size=1000&sort=relevance&channel=unstable. Note that not all of the results will be part of the COSMIC desktop.