Commit acc4e7ea authored by Felix Buehler's avatar Felix Buehler
Browse files

nixos/services.xserver.windowManager.bspwm: remove `with lib;`

parent f8531604
Loading
Loading
Loading
Loading
+16 −19
Original line number Diff line number Diff line
@@ -4,9 +4,6 @@
  pkgs,
  ...
}:

with lib;

let
  cfg = config.services.xserver.windowManager.bspwm;
in
@@ -14,14 +11,14 @@ in
{
  options = {
    services.xserver.windowManager.bspwm = {
      enable = mkEnableOption "bspwm";
      enable = lib.mkEnableOption "bspwm";

      package = mkPackageOption pkgs "bspwm" {
      package = lib.mkPackageOption pkgs "bspwm" {
        example = "bspwm-unstable";
      };
      configFile = mkOption {
        type = with types; nullOr path;
        example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
      configFile = lib.mkOption {
        type = with lib.types; nullOr path;
        example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
        default = null;
        description = ''
          Path to the bspwm configuration file.
@@ -30,12 +27,12 @@ in
      };

      sxhkd = {
        package = mkPackageOption pkgs "sxhkd" {
        package = lib.mkPackageOption pkgs "sxhkd" {
          example = "sxhkd-unstable";
        };
        configFile = mkOption {
          type = with types; nullOr path;
          example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
        configFile = lib.mkOption {
          type = with lib.types; nullOr path;
          example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
          default = null;
          description = ''
            Path to the sxhkd configuration file.
@@ -46,15 +43,15 @@ in
    };
  };

  config = mkIf cfg.enable {
    services.xserver.windowManager.session = singleton {
  config = lib.mkIf cfg.enable {
    services.xserver.windowManager.session = lib.singleton {
      name = "bspwm";
      start = ''
        export _JAVA_AWT_WM_NONREPARENTING=1
        SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${
          optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""
          lib.optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""
        } &
        ${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
        ${cfg.package}/bin/bspwm ${lib.optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
        waitPID=$!
      '';
    };
@@ -62,17 +59,17 @@ in
  };

  imports = [
    (mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
    (lib.mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
      "Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm."
    )
    (mkRemovedOptionModule [
    (lib.mkRemovedOptionModule [
      "services"
      "xserver"
      "windowManager"
      "bspwm"
      "startThroughSession"
    ] "bspwm package does not provide bspwm-session anymore.")
    (mkRemovedOptionModule [
    (lib.mkRemovedOptionModule [
      "services"
      "xserver"
      "windowManager"