3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services/x11/window-managers/i3.nix
AndersonTorres 2955b2fcf4 Getting rid of mkOption in NixOS window manager modules
Now the default way to define NixOS window manager modules is to use
mkEnableOption to describe the module itself.
In this commit, all files on nixos/modules/services/x11/window-managers
are changed.
2015-12-04 07:38:23 -02:00

40 lines
815 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.windowManager.i3;
in
{
options = {
services.xserver.windowManager.i3 = {
enable = mkEnableOption "i3";
configFile = mkOption {
default = null;
type = types.nullOr types.path;
description = ''
Path to the i3 configuration file.
If left at the default value, $HOME/.i3/config will be used.
'';
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [{
name = "i3";
start = ''
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
"-c \"${cfg.configFile}\""
} &
waitPID=$!
'';
}];
};
environment.systemPackages = [ pkgs.i3 ];
};
}