diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix index b815c5f16a1e..51096d804981 100644 --- a/nixos/modules/services/x11/window-managers/default.nix +++ b/nixos/modules/services/x11/window-managers/default.nix @@ -28,6 +28,7 @@ in ./notion.nix ./ratpoison.nix ./sawfish.nix + ./smallwm.nix ./stumpwm.nix ./spectrwm.nix ./tinywm.nix diff --git a/nixos/modules/services/x11/window-managers/smallwm.nix b/nixos/modules/services/x11/window-managers/smallwm.nix new file mode 100644 index 000000000000..091ba4f92b94 --- /dev/null +++ b/nixos/modules/services/x11/window-managers/smallwm.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.xserver.windowManager.smallwm; +in +{ + ###### interface + options = { + services.xserver.windowManager.smallwm.enable = mkEnableOption "smallwm"; + }; + + ###### implementation + config = mkIf cfg.enable { + services.xserver.windowManager.session = singleton { + name = "smallwm"; + start = '' + ${pkgs.smallwm}/bin/smallwm & + waitPID=$! + ''; + }; + environment.systemPackages = [ pkgs.smallwm ]; + }; +} diff --git a/pkgs/applications/window-managers/smallwm/default.nix b/pkgs/applications/window-managers/smallwm/default.nix new file mode 100644 index 000000000000..b6d3821e8d06 --- /dev/null +++ b/pkgs/applications/window-managers/smallwm/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub +, doxygen, graphviz, libX11, libXrandr }: + +stdenv.mkDerivation rec { + + pname = "smallwm"; + version = "2020-02-28"; + + src = fetchFromGitHub { + owner = "adamnew123456"; + repo = "SmallWM"; + rev = "c2dc72afa87241bcf7e646630f4aae216ce78613"; + sha256 = "0cqhy81ymdcdyvgi55a401rr96h2akskcxi9ddzjbln4a71yjlz8"; + }; + + nativeBuildInputs = [ doxygen graphviz ]; + buildInputs = [ libX11 libXrandr ]; + + dontConfigure = true; + + makeFlags = [ "CC=${stdenv.cc}/bin/cc" "CXX=${stdenv.cc}/bin/c++" ]; + + buildFlags = [ "all" "doc" ]; + + installPhase = '' + install -dm755 $out/bin $out/share/doc/${pname}-${version} + install -m755 bin/smallwm -t $out/bin + cp -r README.markdown doc/html doc/latex $out/share/doc/${pname}-${version} + ''; + + meta = with stdenv.lib;{ + description = "A small X window manager, extended from tinywm"; + homepage = "https://github.com/adamnew123456/SmallWM"; + license = licenses.bsd2; + maintainers = [ maintainers.AndersonTorres ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f21ed5b6dce..6e394097bd6b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19997,6 +19997,8 @@ in spectmorph = callPackage ../applications/audio/spectmorph { }; + smallwm = callPackage ../applications/window-managers/smallwm { }; + spectrwm = callPackage ../applications/window-managers/spectrwm { }; spectral = qt5.callPackage ../applications/networking/instant-messengers/spectral { };