From f57cfda76773d7d6031a8f5ad5b430cdd0db7830 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 2 Apr 2021 19:03:29 +0000 Subject: [PATCH] home: wm: add i3 This is only the basic default configuration. The full configuration will come later. I am not a fan of `wm.windowManager`, I might rename that option at some point. --- home/default.nix | 1 + home/wm/default.nix | 15 +++++++++++++++ home/wm/i3.nix | 15 +++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 home/wm/default.nix create mode 100644 home/wm/i3.nix diff --git a/home/default.nix b/home/default.nix index 7a51a02..fd59171 100644 --- a/home/default.nix +++ b/home/default.nix @@ -14,6 +14,7 @@ ./ssh.nix ./tmux.nix ./vim + ./wm ./x ./xdg.nix ./zsh diff --git a/home/wm/default.nix b/home/wm/default.nix new file mode 100644 index 0000000..10f86a4 --- /dev/null +++ b/home/wm/default.nix @@ -0,0 +1,15 @@ +{ lib, ... }: +{ + imports = [ + ./i3.nix + ]; + + options.my.home.wm = with lib; { + windowManager = mkOption { + type = with types; nullOr (enum [ "i3" ]); + default = null; + example = "i3"; + description = "Which window manager to use for home session"; + }; + }; +} diff --git a/home/wm/i3.nix b/home/wm/i3.nix new file mode 100644 index 0000000..3039cd6 --- /dev/null +++ b/home/wm/i3.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +let + isEnabled = config.my.home.wm.windowManager == "i3"; +in +{ + config = lib.mkIf isEnabled { + xsession.windowManager.i3 = { + enable = true; + + config = { + modifier = "Mod4"; # `Super` key + }; + }; + }; +}