mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
refactor: format nix code with alejandra and optimize src path
This commit is contained in:
parent
f202a16abe
commit
6c99eeaeb3
4 changed files with 109 additions and 109 deletions
|
|
@ -18,51 +18,53 @@
|
|||
ninja,
|
||||
wlroots,
|
||||
mmsg,
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
pname = "maomaowm";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit pname;
|
||||
version = "nightly";
|
||||
stdenv.mkDerivation {
|
||||
inherit pname;
|
||||
version = "nightly";
|
||||
|
||||
src = ../.;
|
||||
src = builtins.path {
|
||||
path = ../.;
|
||||
name = "source";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
libinput
|
||||
libxcb
|
||||
libxkbcommon
|
||||
pcre2
|
||||
pixman
|
||||
wayland
|
||||
wayland-protocols
|
||||
wlroots
|
||||
]
|
||||
++ lib.optionals enableXWayland [
|
||||
libX11
|
||||
xcbutilwm
|
||||
xwayland
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
];
|
||||
|
||||
passthru = {
|
||||
providedSessions = [ "maomao" ];
|
||||
inherit mmsg;
|
||||
};
|
||||
buildInputs =
|
||||
[
|
||||
libinput
|
||||
libxcb
|
||||
libxkbcommon
|
||||
pcre2
|
||||
pixman
|
||||
wayland
|
||||
wayland-protocols
|
||||
wlroots
|
||||
]
|
||||
++ lib.optionals enableXWayland [
|
||||
libX11
|
||||
xcbutilwm
|
||||
xwayland
|
||||
];
|
||||
|
||||
meta = {
|
||||
mainProgram = "maomao";
|
||||
description = "A streamlined but feature-rich Wayland compositor";
|
||||
homepage = "https://github.com/DreamMaoMao/maomaowm";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
passthru = {
|
||||
providedSessions = ["maomao"];
|
||||
inherit mmsg;
|
||||
};
|
||||
|
||||
meta = {
|
||||
mainProgram = "maomao";
|
||||
description = "A streamlined but feature-rich Wayland compositor";
|
||||
homepage = "https://github.com/DreamMaoMao/maomaowm";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
self:
|
||||
{
|
||||
self: {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
inherit (self.packages.${pkgs.system}) maomaowm;
|
||||
cfg = config.wayland.windowManager.maomaowm;
|
||||
variables = lib.concatStringsSep " " cfg.systemd.variables;
|
||||
|
|
@ -15,8 +13,7 @@ let
|
|||
${lib.optionalString cfg.systemd.enable systemdActivation}
|
||||
${cfg.autostart_sh}
|
||||
'';
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
wayland.windowManager.maomaowm = with lib; {
|
||||
enable = mkOption {
|
||||
|
|
@ -53,7 +50,7 @@ in
|
|||
"XCURSOR_THEME"
|
||||
"XCURSOR_SIZE"
|
||||
];
|
||||
example = [ "--all" ];
|
||||
example = ["--all"];
|
||||
description = ''
|
||||
Environment variables imported into the systemd and D-Bus user environment.
|
||||
'';
|
||||
|
|
@ -95,23 +92,23 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ maomaowm ];
|
||||
home.packages = [maomaowm];
|
||||
home.activation =
|
||||
lib.optionalAttrs (cfg.autostart_sh != "") {
|
||||
createMaomaoScript = lib.hm.dag.entryAfter [ "clearMaomaoConfig" ] ''
|
||||
createMaomaoScript = lib.hm.dag.entryAfter ["clearMaomaoConfig"] ''
|
||||
cat ${autostart_sh} > $HOME/.config/maomao/autostart.sh
|
||||
chmod +x $HOME/.config/maomao/autostart.sh
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs (cfg.settings != "") {
|
||||
createMaomaoConfig = lib.hm.dag.entryAfter [ "clearMaomaoConfig" ] ''
|
||||
createMaomaoConfig = lib.hm.dag.entryAfter ["clearMaomaoConfig"] ''
|
||||
cat > $HOME/.config/maomao/config.conf <<EOF
|
||||
${cfg.settings}
|
||||
EOF
|
||||
'';
|
||||
}
|
||||
// {
|
||||
clearMaomaoConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
clearMaomaoConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
rm -rf $HOME/.config/maomao
|
||||
mkdir -p $HOME/.config/maomao
|
||||
'';
|
||||
|
|
@ -119,12 +116,14 @@ in
|
|||
systemd.user.targets.maomao-session = lib.mkIf cfg.systemd.enable {
|
||||
Unit = {
|
||||
Description = "maomao compositor session";
|
||||
Documentation = [ "man:systemd.special(7)" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
Wants = [
|
||||
"graphical-session-pre.target"
|
||||
] ++ lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
Documentation = ["man:systemd.special(7)"];
|
||||
BindsTo = ["graphical-session.target"];
|
||||
Wants =
|
||||
[
|
||||
"graphical-session-pre.target"
|
||||
]
|
||||
++ lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
|
||||
After = ["graphical-session-pre.target"];
|
||||
Before = lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
self:
|
||||
{
|
||||
self: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
cfg = config.programs.maomaowm;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
programs.maomaowm = {
|
||||
enable = lib.mkEnableOption "maomaowm, a wayland compositor based on dwl";
|
||||
|
|
@ -21,16 +18,22 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
] ++ (if (builtins.hasAttr "mmsg" cfg.package) then [ cfg.package.mmsg ] else [ ]);
|
||||
environment.systemPackages =
|
||||
[
|
||||
cfg.package
|
||||
]
|
||||
++ (
|
||||
if (builtins.hasAttr "mmsg" cfg.package)
|
||||
then [cfg.package.mmsg]
|
||||
else []
|
||||
);
|
||||
|
||||
xdg.portal = {
|
||||
enable = lib.mkDefault true;
|
||||
|
||||
wlr.enable = lib.mkDefault true;
|
||||
|
||||
configPackages = [ cfg.package ];
|
||||
configPackages = [cfg.package];
|
||||
};
|
||||
|
||||
security.polkit.enable = lib.mkDefault true;
|
||||
|
|
@ -38,10 +41,9 @@ in
|
|||
programs.xwayland.enable = lib.mkDefault true;
|
||||
|
||||
services = {
|
||||
displayManager.sessionPackages = [ cfg.package ];
|
||||
displayManager.sessionPackages = [cfg.package];
|
||||
|
||||
graphical-desktop.enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue