From da960bb8992fa051f2c40a60d2bbf5d3b85cf0cd Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Tue, 23 Oct 2018 15:17:51 -0700 Subject: [PATCH] sway-beta: module init --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/sway-beta.nix | 54 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 nixos/modules/programs/sway-beta.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ae7a3a783d3f..eab3639d582e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -120,6 +120,7 @@ ./programs/sysdig.nix ./programs/systemtap.nix ./programs/sway.nix + ./programs/sway-beta.nix ./programs/thefuck.nix ./programs/tmux.nix ./programs/udevil.nix diff --git a/nixos/modules/programs/sway-beta.nix b/nixos/modules/programs/sway-beta.nix new file mode 100644 index 000000000000..04f2e0662b86 --- /dev/null +++ b/nixos/modules/programs/sway-beta.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.programs.sway-beta; + swayPackage = cfg.package; +in { + options.programs.sway-beta = { + enable = mkEnableOption '' + Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 + ''; + + package = mkOption { + type = types.package; + default = pkgs.sway-beta; + defaultText = "pkgs.sway-beta"; + description = '' + The package to be used for `sway`. + ''; + }; + + extraPackages = mkOption { + type = with types; listOf package; + default = with pkgs; [ + xwayland dmenu + ]; + defaultText = literalExample '' + with pkgs; [ xwayland dmenu ]; + ''; + example = literalExample '' + with pkgs; [ + xwayland + i3status i3status-rust + termite rofi light + ] + ''; + description = '' + Extra packages to be installed system wide. + ''; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ swayPackage ] ++ cfg.extraPackages; + security.pam.services.swaylock = {}; + hardware.opengl.enable = mkDefault true; + fonts.enableDefaultFonts = mkDefault true; + programs.dconf.enable = mkDefault true; + }; + + meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ]; +} +