Skip to content

Commit

Permalink
nixos/cosmic: init
Browse files Browse the repository at this point in the history
  • Loading branch information
nyabinary committed Sep 3, 2024
1 parent d77093f commit 0247294
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
87 changes: 87 additions & 0 deletions nixos/modules/services/x11/desktop-managers/cosmic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{ config, pkgs, lib, ... }:

let
cfg = config.services.xserver.desktopManager.cosmic;
in
{
meta.maintainers = with lib.maintainers; [ nyanbinary lilyinstarlight ];

options.services.xserver.desktopManager.cosmic = {
enable = lib.mkEnableOption (lib.mdDoc "COSMIC desktop environment");
};

config = lib.mkIf cfg.enable {
# seed configuration in nixos-generate-config
system.nixos-generate-config.desktopConfiguration = [
''
# Enable the COSMIC Desktop Environment.
services.xserver.displayManager.cosmic-greeter.enable = true;
services.xserver.desktopManager.cosmic.enable = true;
''
];

# environment packages
environment.etc."cosmic-comp/config.ron".source = lib.mkDefault "${pkgs.cosmic-comp}/etc/cosmic-comp/config.ron";
environment.pathsToLink = [ "/share/cosmic" ];
environment.systemPackages = with pkgs; [
gnome.adwaita-icon-theme
cosmic-applibrary
cosmic-applets
cosmic-bg
cosmic-comp
cosmic-edit
cosmic-files
cosmic-greeter
cosmic-icons
cosmic-launcher
cosmic-notifications
cosmic-osd
cosmic-panel
cosmic-randr
cosmic-screenshot
cosmic-session
cosmic-settings
cosmic-settings-daemon
cosmic-term
cosmic-workspaces-epoch
hicolor-icon-theme
pop-icon-theme
pop-launcher
];

# xdg portal packages and config
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-cosmic
xdg-desktop-portal-gtk
];
configPackages = with pkgs; [
xdg-desktop-portal-cosmic
];
};

# fonts
fonts.packages = with pkgs; [
fira-mono
];

# required features
hardware.opengl.enable = true;
services.xserver.libinput.enable = true;

# optional features
hardware.pulseaudio.enable = lib.mkDefault true;

# required dbus services
services.upower.enable = true;
security.polkit.enable = true;

# session packages
services.xserver.displayManager.sessionPackages = with pkgs; [ cosmic-session ];
systemd.packages = with pkgs; [ cosmic-session ];

# required for screen locker
security.pam.services.cosmic-greeter = { };
};
}
2 changes: 1 addition & 1 deletion nixos/modules/services/x11/desktop-managers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ in
./none.nix ./xterm.nix ./phosh.nix ./xfce.nix ./plasma5.nix ../../desktop-managers/plasma6.nix ./lumina.nix
./lxqt.nix ./enlightenment.nix ./gnome.nix ./retroarch.nix ./kodi.nix
./mate.nix ./pantheon.nix ./surf-display.nix ./cde.nix
./cinnamon.nix ./budgie.nix ./deepin.nix ../../desktop-managers/lomiri.nix
./cinnamon.nix ./budgie.nix ./cosmic.nix ./deepin.nix ../../desktop-managers/lomiri.nix
];

options = {
Expand Down

0 comments on commit 0247294

Please sign in to comment.