Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windowmaker: rework #335961

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
45 changes: 37 additions & 8 deletions nixos/modules/services/x11/window-managers/windowmaker.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
{ config, lib, pkgs, ... }:

with lib;
{
config,
lib,
pkgs,
...
}:

let
inherit (lib)
mkEnableOption
mkPackageOption
mkOption
literalExpression
mkIf
singleton
;
inherit (lib.types) functionTo listOf package;
cfg = config.services.xserver.windowManager.windowmaker;
in
{
###### interface
options = {
services.xserver.windowManager.windowmaker.enable = mkEnableOption "windowmaker";
services.xserver.windowManager.windowmaker = {
enable = mkEnableOption "windowmaker";
package = mkPackageOption pkgs "windowmaker" { };
dockapps = mkOption {
type = functionTo (listOf package);
default = _: [ ];
defaultText = literalExpression ''
windowmaker: with windowmaker.dockapps; [ ];
'';
description = ''
Extra dockapps available to WindowMaker.
'';
example = literalExpression ''
windowmaker: with windowmaker.dockapps; [
cputnik
wmcube
];
'';
};
};
};

###### implementation
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ] ++ cfg.dockapps cfg.package;
services.xserver.windowManager.session = singleton {
name = "windowmaker";
start = ''
${pkgs.windowmaker}/bin/wmaker &
${lib.getExe cfg.package} &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.windowmaker ];
};
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{ lib
, stdenv
, alsa-lib
, dockapps-sources
, libX11
, libXext
, libXpm
, pkg-config
{
lib,
alsa-lib,
libX11,
libXext,
libXpm,
pkg-config,
stdenv,
windowmaker,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "AlsaMixer.app";
inherit (windowmaker.dockapps.dockapps-sources) version;

inherit (dockapps-sources) version src;
src = windowmaker.dockapps.dockapps-sources;

sourceRoot = "${finalAttrs.src.name}/AlsaMixer.app";

nativeBuildInputs = [
pkg-config
];
nativeBuildInputs = [ pkg-config ];

buildInputs = [
alsa-lib
Expand All @@ -28,20 +28,24 @@ stdenv.mkDerivation (finalAttrs: {

hardeningDisable = [ "fortify" ];

dontConfigure = true;
strictDeps = true;

installPhase = ''
runHook preInstall

install -D -t ${placeholder "out"}/bin/ AlsaMixer.app
pushd ${placeholder "out"}/bin
ln -vs AlsaMixer.app AlsaMixer
ln -s AlsaMixer.app AlsaMixer
popd

runHook postInstall
'';

meta = {
description = "Alsa mixer application for Windowmaker";
homepage = "https://www.dockapps.net/alsamixerapp";
description = "Alsa mixer application for Windowmaker";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
mainProgram = "AlsaMixer";
inherit (windowmaker.meta) maintainers platforms;
};
})
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
{ lib
, stdenv
, dockapps-sources
, libX11
, libXext
, libXpm
{
lib,
libX11,
libXext,
libXpm,
stdenv,
windowmaker,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "cputnik";
inherit (finalAttrs.src) version;

inherit (dockapps-sources) version src;
src = windowmaker.dockapps.dockapps-sources;

sourceRoot = "${finalAttrs.src.name}/cputnik/src";

buildInputs = [
libX11
libXpm
libXext
libXpm
];

hardeningDisable = [ "format" ];

strictDeps = true;

# TODO: convert to __structuredAttrs
preBuild = ''
makeFlagsArray+=(
INCS="-I${libX11.dev}/include -I${libXext.dev}/include -I${libXpm.dev}/include"
LIBS="-L${libX11}/lib -L${libXext}/lib -L${libXpm}/lib -lX11 -lXpm -lXext"
)
'';

hardeningDisable = [ "format" ];

installPhase = ''
runHook preInstall

Expand All @@ -37,10 +42,10 @@ stdenv.mkDerivation (finalAttrs: {
'';

meta = {
description = "Calendar clock with antialiased text";
homepage = "https://www.dockapps.net/wmcalclock";
homepage = "https://www.dockapps.net/cputnik";
description = "CPU and memory monitor";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
mainProgram = "cputnik";
inherit (windowmaker.meta) maintainers platforms;
};
})
29 changes: 0 additions & 29 deletions pkgs/by-name/wi/windowmaker/dockapps/default.nix

This file was deleted.

12 changes: 12 additions & 0 deletions pkgs/by-name/wi/windowmaker/dockapps/dockapps-sources.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ fetchFromRepoOrCz }:

# We are interested in the pristine sources; installation phases are not needed
# here
fetchFromRepoOrCz {
pname = "dockapps-sources";
version = "0-unstable-2023-10-11"; # Shall correspond to rev below
repo = "dockapps";
rev = "1bbb32008ecb58acaec9ea70e00b4ea1735408fc";
hash = "sha256-BLUDe/cIIuh9mCtafbcBSDatUXSRD83FeyYhcbem5FU=";
}
# TODO: update script
36 changes: 0 additions & 36 deletions pkgs/by-name/wi/windowmaker/dockapps/libdockapp.nix

This file was deleted.

54 changes: 54 additions & 0 deletions pkgs/by-name/wi/windowmaker/dockapps/libdockapp/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
lib,
autoreconfHook,
fontutil,
libX11,
libXext,
libXpm,
mkfontdir,
pkg-config,
stdenv,
windowmaker,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "libdockapp";
inherit (finalAttrs.src) version;

src = windowmaker.dockapps.dockapps-sources;

sourceRoot = "${finalAttrs.src.name}/libdockapp";

nativeBuildInputs = [
autoreconfHook
fontutil
mkfontdir
pkg-config
];

buildInputs = [
libX11
libXext
libXpm
];

outputs = [
"out"
"dev"
];

strictDeps = true;

configureFlags = [
(lib.withFeature false "examples")
# There is a bug on --with-font
(lib.withFeature false "font")
];

meta = {
description = "Library providing a framework for dockapps";
homepage = "https://www.dockapps.net/libdockapp";
license = lib.licenses.gpl2Plus;
inherit (windowmaker.meta) maintainers platforms;
};
})
44 changes: 0 additions & 44 deletions pkgs/by-name/wi/windowmaker/dockapps/wmCalClock.nix

This file was deleted.

Loading