desktop/cosmic

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-04-27 21:57:57 +03:00
parent 17b2c4b55d
commit 3cf1a29d54
7 changed files with 191 additions and 14 deletions

101
flake.lock generated
View File

@ -271,6 +271,22 @@
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
@ -988,6 +1004,27 @@
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat_3",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1745752145,
"narHash": "sha256-SRvolJBy9oRUdfik/xtcsguQtcDHrkzq1yf5NbsLBhY=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "0ba6c63681ae317d122a5e76bc2bf556737a53d0",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1744633460,
@ -1037,6 +1074,22 @@
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1745487689,
"narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1744440957,
"narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=",
@ -1053,6 +1106,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1745526057,
"narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f771eb401a46846c1aebd20552521b233dd7e18b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1744932701,
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
@ -1068,7 +1137,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1743583204,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
@ -1170,9 +1239,10 @@
"mysecrets": "mysecrets",
"nix-flatpak": "nix-flatpak",
"nix-index-database": "nix-index-database",
"nixos-cosmic": "nixos-cosmic",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2",
"nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_3",
"sops-nix": "sops-nix",
"stylix": "stylix"
}
@ -1215,6 +1285,27 @@
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"nixos-cosmic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1745721366,
"narHash": "sha256-dm93104HXjKWzkrr7yAPtxpbllOSzrwFFruc+rKQHSg=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "621131c9e281d1047bf8937547ed77e97c464aba",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@ -1242,12 +1333,12 @@
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils",
"git-hooks": "git-hooks",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nur": "nur",
"systems": "systems_4",
"tinted-foot": "tinted-foot",

View File

@ -15,7 +15,7 @@
# neve.url = "git+https://gitea.linerds.us/unexplrd/Neve";
nix-flatpak.url = "github:gmodena/nix-flatpak";
nix-index-database.url = "github:nix-community/nix-index-database";
# nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
# nixvim.url = "github:nix-community/nixvim";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";

View File

@ -14,7 +14,7 @@
./minecraft.nix
];
desktop.niri.enable = true;
desktop.cosmic.enable = true;
environment.memoryAllocator.provider = "mimalloc";
locale.ukrainian.enable = true;
module.stylix = {
@ -29,6 +29,6 @@
virtual.libvirt.enable = true;
wireless = {
bluetooth.enable = true;
bluetooth.enableBlueman = true;
bluetooth.enableBlueman = false;
};
}

View File

@ -1,10 +1,12 @@
{
osConfig,
config,
pkgs,
lib,
...
}:
with lib; let
inherit (osConfig.module.stylix) theme;
cfg = config.desktop.cosmic;
in {
options = {
@ -12,8 +14,81 @@ in {
mkEnableOption "enable cosmic desktop";
};
config = mkIf cfg.enable {
stylix.targets = {
qt.enable = false;
gtk.enable = false;
};
home.packages = with pkgs; [
wl-clipboard-rs
helvum
loupe
papers
junction
celluloid
mission-center
dconf
libnotify
playerctl
wdisplays
pwvucontrol
wl-clipboard
];
gtk = {
enable = true;
iconTheme = {
name =
if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus-Light";
package =
if (removeSuffix "-light" theme) == "nord"
then pkgs.papirus-nord
else pkgs.papirus-icon-theme;
};
};
qt = {
enable = true;
platformTheme.name = "gtk3";
};
services = {
gnome-keyring = {
enable = true;
components = ["secrets"];
};
};
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
button-layout = "icon:minimize,maximize,close";
};
"org/gnome/desktop/interface" = {
icon-theme = config.gtk.iconTheme.name;
};
};
xdg = {
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = let
file_manager = ["org.gnome.Nautilus.desktop"];
image_viewer = ["org.gnome.Loupe.desktop"];
pdf_reader = ["org.gnome.Papers.desktop"];
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
web_browser = ["re.sonny.Junction.desktop"];
in {
"application/pdf" = pdf_reader;
"image/jpeg" = image_viewer;
"image/png" = image_viewer;
"inode/directory" = file_manager;
"text/html" = web_browser;
"video/mp4" = video_player;
"video/mpeg" = video_player;
"video/x-matroska" = video_player;
"video/x-mpeg" = video_player;
"x-scheme-handler/about" = web_browser;
"x-scheme-handler/http" = web_browser;
"x-scheme-handler/https" = web_browser;
"x-scheme-handler/unknown" = web_browser;
};
};
};
};
}

View File

@ -1,6 +1,7 @@
{
imports = [
./common
./cosmic
./gnome
./hyprland
./niri

View File

@ -21,18 +21,28 @@ in {
substituters = ["https://cosmic.cachix.org/"];
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
};
environment.sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1;
systemd.packages = [pkgs.observatory];
systemd.services.monitord.wantedBy = ["multi-user.target"];
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
services = {
gnome.gnome-keyring.enable = true;
dbus = {
apparmor = "enabled";
implementation = "broker";
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-cosmic
xdg-desktop-portal-gtk
];
config.common.default = [
"cosmic"
"gtk"
];
config.cosmic = {
default = ["cosmic" "gtk"];
"org.freedesktop.impl.portal.Secret" = ["gnome-keyring"];
};
};
};
}

View File

@ -1,7 +1,7 @@
{
imports = [
./common/pipewire.nix
# ./cosmic.nix
./cosmic.nix
./gnome.nix
./hyprland.nix
./niri.nix