mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
refactor: format nix code with alejandra & rename nix files for clarity
This commit is contained in:
parent
bb86ea12ca
commit
df492dab6b
6 changed files with 298 additions and 311 deletions
67
nix/nixos-module.nix
Normal file
67
nix/nixos-module.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
self: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.mango;
|
||||
in {
|
||||
options = {
|
||||
programs.mango = {
|
||||
enable = lib.mkEnableOption "mango, a wayland compositor based on dwl";
|
||||
addLoginEntry = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to add a login entry to the display manager for mango. Only has effect if a display manager is configured (e.g. SDDM, GDM via `services.displayManager`).";
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = self.packages.${pkgs.stdenv.hostPlatform.system}.mango;
|
||||
description = "The mango package to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
];
|
||||
|
||||
xdg.portal = {
|
||||
enable = lib.mkDefault true;
|
||||
|
||||
config = {
|
||||
mango = {
|
||||
default = [
|
||||
"gtk"
|
||||
];
|
||||
# except those
|
||||
"org.freedesktop.impl.portal.Secret" = ["gnome-keyring"];
|
||||
"org.freedesktop.impl.portal.ScreenCast" = ["wlr"];
|
||||
"org.freedesktop.impl.portal.ScreenShot" = ["wlr"];
|
||||
|
||||
# wlr does not have this interface
|
||||
"org.freedesktop.impl.portal.Inhibit" = [];
|
||||
};
|
||||
};
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
|
||||
wlr.enable = lib.mkDefault true;
|
||||
|
||||
configPackages = [cfg.package];
|
||||
};
|
||||
|
||||
security.polkit.enable = lib.mkDefault true;
|
||||
|
||||
programs.xwayland.enable = lib.mkDefault true;
|
||||
|
||||
services = {
|
||||
displayManager.sessionPackages = lib.mkIf cfg.addLoginEntry [cfg.package];
|
||||
|
||||
graphical-desktop.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue