1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 14:50:40 +02:00

chore: update flake, add uwsm

This commit is contained in:
oddlama 2024-10-27 11:51:53 +01:00
parent 080e8b7f52
commit cde4da7e51
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
16 changed files with 397 additions and 74 deletions

172
config/graphical/cosmic.nix Normal file
View file

@ -0,0 +1,172 @@
{
lib,
pkgs,
config,
utils,
...
}: let
excludePackages = with pkgs; [fira];
in {
environment.pathsToLink = [
"/share/backgrounds"
"/share/cosmic"
];
environment.systemPackages =
utils.removePackagesByName (
with pkgs;
[
adwaita-icon-theme
alsa-utils
cosmic-applets
cosmic-applibrary
cosmic-bg
(cosmic-comp.override {
# avoid PATH pollution of system action keybinds (Xwayland handled below)
useXWayland = false;
})
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-wallpapers
cosmic-workspaces-epoch
hicolor-icon-theme
playerctl
pop-icon-theme
pop-launcher
xdg-user-dirs
xwayland
]
++ lib.optionals config.services.flatpak.enable [
cosmic-store
]
)
excludePackages;
# xdg portal packages and config
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-cosmic
xdg-desktop-portal-gtk
];
configPackages = lib.mkDefault (
with pkgs; [
xdg-desktop-portal-cosmic
]
);
};
# fonts
fonts.packages =
utils.removePackagesByName (with pkgs; [
fira
])
excludePackages;
# required features
# hardware.${
# if lib.versionAtLeast lib.version "24.11"
# then "graphics"
# else "opengl"
# }.enable =
# true;
# services.libinput.enable = true;
# xdg.mime.enable = true;
# xdg.icons.enable = true;
# optional features
# hardware.bluetooth.enable = lib.mkDefault true;
services.acpid.enable = lib.mkDefault true;
# services.pipewire = {
# enable = lib.mkDefault true;
# alsa.enable = lib.mkDefault true;
# pulse.enable = lib.mkDefault true;
# };
services.gvfs.enable = lib.mkDefault true;
# networking.networkmanager.enable = lib.mkDefault true;
services.gnome.gnome-keyring.enable = lib.mkDefault true;
# general graphical session features
# programs.dconf.enable = lib.mkDefault true;
#
# required dbus services
services.accounts-daemon.enable = true;
services.upower.enable = true;
services.power-profiles-daemon.enable = lib.mkDefault (!config.hardware.system76.power-daemon.enable);
security.polkit.enable = true;
security.rtkit.enable = true;
# session packages
services.displayManager.sessionPackages = with pkgs; [cosmic-session];
systemd.packages = with pkgs; [cosmic-session];
# TODO: remove when upstream has XDG autostart support
systemd.user.targets.cosmic-session = {
wants = ["xdg-desktop-autostart.target"];
before = ["xdg-desktop-autostart.target"];
};
# required for screen locker
security.pam.services.cosmic-greeter = {};
nix.settings.substituters = [
"https://cosmic.cachix.org/"
];
nix.settings.trusted-public-keys = [
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
];
# module diagnostics
warnings =
lib.optional
(
lib.elem pkgs.cosmic-files excludePackages
&& !(lib.elem pkgs.cosmic-session excludePackages)
)
''
The COSMIC session may fail to initialise with the `cosmic-files` package excluded via
`excludePackages`.
Please do one of the following:
1. Remove `cosmic-files` from `excludePackages`.
2. Add `cosmic-session` (in addition to `cosmic-files`) to
`excludePackages` and ensure whatever session starter/manager you are
using is appropriately set up.
'';
assertions = [
{
assertion = lib.elem "libcosmic-app-hook" (
lib.map (
drv: lib.optionalString (lib.isDerivation drv) (lib.getName drv)
)
pkgs.cosmic-comp.nativeBuildInputs
);
message = ''
It looks like the provided `pkgs` to the NixOS COSMIC module is not usable for a working COSMIC
desktop environment.
If you are erroneously passing in `pkgs` to `specialArgs` somewhere in your system configuration,
this is is often unnecessary and has unintended consequences for all NixOS modules. Please either
remove that in favor of configuring the NixOS `pkgs` instance via `nixpkgs.config` and
`nixpkgs.overlays`.
If you must instantiate your own `pkgs`, then please include the overlay from the NixOS COSMIC flake
when instantiating `pkgs` and be aware that the `nixpkgs.config` and `nixpkgs.overlays` options will
not function for any NixOS modules.
Note that the COSMIC packages in Nixpkgs are still largely broken as of 2024-10-16 and will not be
usable for having a fully functional COSMIC desktop environment. The overlay is therefore necessary.
'';
}
];
}

View file

@ -4,6 +4,7 @@
lib,
minimal,
pkgs,
globals,
...
}: let
inherit
@ -29,6 +30,7 @@ in
./fonts.nix
./steam.nix
./xserver.nix
# ./cosmic.nix
];
config = {
@ -59,6 +61,22 @@ in
];
};
services.displayManager.enable = true;
programs.uwsm = {
enable = true;
waylandCompositors.sway = {
prettyName = "Sway";
comment = "Sway";
binPath = lib.getExe config.home-manager.users.${globals.myuser.name}.wayland.windowManager.sway.package;
};
waylandCompositors.hyprland = {
prettyName = "Hyprland";
comment = "Hyprland";
binPath = lib.getExe config.home-manager.users.${globals.myuser.name}.wayland.windowManager.hyprland.package;
};
};
stylix = {
enable = true;
# I want to choose what to style myself.

View file

@ -2,7 +2,7 @@
systemd.network.wait-online.anyInterface = true;
services = {
tlp.enable = true;
# tlp.enable = true;
physlock.enable = true;
logind = {
lidSwitch = "ignore";

View file

@ -1,8 +1,9 @@
{pkgs, ...}: {
documentation.nixos.enable = false;
# Disable sudo which is entierly unnecessary.
# Disable sudo which is entirely unnecessary.
security.sudo.enable = false;
services.dbus.implementation = "broker";
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "C.UTF-8";