-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/uwsm: init module, temporarily import the package derivation here
- Loading branch information
1 parent
a81caa3
commit 642754a
Showing
4 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchFromGitHub, | ||
meson, | ||
ninja, | ||
scdoc, | ||
pkg-config, | ||
nix-update-script, | ||
dmenu, | ||
libnotify, | ||
python3Packages, | ||
util-linux, | ||
fumonSupport ? true, | ||
uuctlSupport ? true, | ||
uwsmAppSupport ? true, | ||
}: | ||
let | ||
python = python3Packages.python.withPackages (ps: [ | ||
ps.pydbus | ||
ps.dbus-python | ||
ps.pyxdg | ||
]); | ||
in | ||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "uwsm"; | ||
version = "0.17.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "Vladimir-csp"; | ||
repo = "uwsm"; | ||
rev = "refs/tags/v${finalAttrs.version}"; | ||
hash = "sha256-M2j7l5XTSS2IzaJofAHct1tuAO2A9Ps9mCgAWKEvzoE="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
meson | ||
ninja | ||
pkg-config | ||
scdoc | ||
]; | ||
|
||
buildInputs = [ | ||
libnotify | ||
util-linux | ||
] ++ (lib.optionals uuctlSupport [ dmenu ]); | ||
|
||
propagatedBuildInputs = [ python ]; | ||
|
||
mesonFlags = [ | ||
"--prefix=${placeholder "out"}" | ||
(lib.mapAttrsToList lib.mesonEnable { | ||
"uwsm-app" = uwsmAppSupport; | ||
"fumon" = fumonSupport; | ||
"uuctl" = uuctlSupport; | ||
"man-pages" = true; | ||
}) | ||
]; | ||
|
||
passthru = { | ||
updateScript = nix-update-script { }; | ||
}; | ||
|
||
meta = { | ||
description = "Universal wayland session manager"; | ||
homepage = "https://github.com/Vladimir-csp/uwsm"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ johnrtitor ]; | ||
platforms = lib.platforms.linux; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
let | ||
cfg = config.programs.uwsm; | ||
hyprlandCfg = config.programs.hyprland; | ||
swayCfg = config.programs.sway; | ||
in | ||
{ | ||
options = { | ||
programs.uwsm = { | ||
enable = lib.mkEnableOption ''uwsm, which wraps standalone | ||
Wayland compositors into a set of Systemd units on the fly | ||
''; | ||
package = lib.mkPackageOption pkgs "uwsm" {}; | ||
withHyprland = lib.mkEnableOption null // { | ||
default = cfg.enable && hyprlandCfg.enable; | ||
}; | ||
withSway = lib.mkEnableOption null // { | ||
default = cfg.enable && swayCfg.enable; | ||
}; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = [ cfg.package ]; | ||
systemd.packages = [ cfg.package ]; | ||
services.dbus.implementation = "broker"; | ||
|
||
services.displayManager.sessionPackages = lib.optionals cfg.withHyprland [ | ||
(pkgs.callPackage ./uwsm-wm-wrapper.nix { | ||
uwsm = cfg.package; | ||
wmName = "Hyprland"; | ||
wmCmd = "hyprland"; | ||
}) | ||
] ++ lib.optionals cfg.withSway [ | ||
(pkgs.callPackage ./uwsm-wm-wrapper.nix { | ||
uwsm = cfg.package; | ||
wmName = "Sway"; | ||
wmCmd = "sway"; | ||
}) | ||
]; | ||
}; | ||
|
||
meta.maintainers = with lib.maintainers; [ johnrtitor ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
writeText, | ||
uwsm, | ||
wmName ? "Example", | ||
wmCmd ? "example", | ||
}: | ||
let | ||
wm-desktop-entry = writeText "${wmName}_uwsm.desktop" '' | ||
[Desktop Entry] | ||
Name=${wmName} (with UWSM) | ||
Comment=${wmName} compositor managed by UWSM | ||
Exec=${lib.getExe uwsm} start -S -- ${wmCmd} | ||
Type=Application | ||
''; | ||
in stdenvNoCC.mkDerivation { | ||
pname = "${wmName}_uwsm"; | ||
version = "1.0.0"; | ||
dontUnpack = true; | ||
dontBuild = true; | ||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/share/wayland-sessions | ||
cp ${wm-desktop-entry} $out/share/wayland-sessions/${wmName}_uwsm.desktop | ||
runHook postInstall | ||
''; | ||
passthru.providedSessions = ["${wmName}_uwsm"]; | ||
} |