{config, lib, pkgs, ... }: let nixos-cosmic = builtins.fetchGit { url = "https://github.com/lilyinstarlight/nixos-cosmic.git"; # rev = "b61e7a0da2fa1d5f05d41e3db6386b2ac5f5079b"; }; unstablePkgs = import (builtins.fetchTarball "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"); cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs"; cosmicPkgsDirs = builtins.filter (v: cosmicPkgsMainDir."${v}" == "directory") (builtins.attrNames cosmicPkgsMainDir); cosmicPkgsOverlay = final: prev: builtins.listToAttrs ( builtins.map (v: {name = v; value = final.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs ); cosmicPkgs = unstablePkgs { inherit (config.nixpkgs) config localSystem crossSystem; overlays = [ cosmicPkgsOverlay ]; }; finalOverlay = finial: prev: lib.filterAttrs (n: v: builtins.elem n cosmicPkgsDirs) cosmicPkgs; in { imports = [ "${nixos-cosmic}/nixos/cosmic/module.nix" ]; config = { services.xserver.desktopManager.cosmic.enable = true; nixpkgs.overlays = [ finalOverlay ]; nix.settings = { substituters = [ "https://cosmic.cachix.org/" ]; trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; }; options = { cosmic-applets = lib.mkOption {default = pkgs.cosmic-applets;}; cosmic-applibrary = lib.mkOption {default = pkgs.cosmic-applibrary;}; cosmic-bg = lib.mkOption {default = pkgs.cosmic-bg;}; cosmic-comp = lib.mkOption {default = pkgs.cosmic-comp;}; cosmic-design-demo = lib.mkOption {default = pkgs.cosmic-design;}; cosmic-edit = lib.mkOption {default = pkgs.cosmic-edit;}; cosmic-files = lib.mkOption {default = pkgs.cosmic-files;}; cosmic-icons = lib.mkOption {default = pkgs.cosmic-icons;}; cosmic-launcher = lib.mkOption {default = pkgs.cosmic-launcher;}; cosmic-notifications = lib.mkOption {default = pkgs.cosmic-notifications;}; cosmic-osd = lib.mkOption {default = pkgs.cosmic-osd;}; cosmic-panel = lib.mkOption {default = pkgs.cosmic-panel;}; cosmic-protocols = lib.mkOption {default = pkgs.cosmic-protocols;}; cosmic-randr = lib.mkOption {default = pkgs.cosmic-randr;}; cosmic-screenshot = lib.mkOption {default = pkgs.cosmic-screenshot;}; cosmic-session = lib.mkOption {default = pkgs.cosmic-session;}; cosmic-settings = lib.mkOption {default = pkgs.cosmic-settings;}; cosmic-settings-daemon = lib.mkOption {default = pkgs.cosmic-settings;}; cosmic-term = lib.mkOption {default = pkgs.cosmic-term;}; cosmic-workspaces-epoch = lib.mkOption {default = pkgs.cosmic-workspaces;}; wrapCosmicAppsHook = lib.mkOption {default = pkgs.wrapCosmicAppsHook;}; xdg-desktop-portal-cosmic = lib.mkOption {default = pkgs.xdg-desktop-portal-cosmic;}; }; }