nixos/cardboard: init

Copy-inspired from river.
This commit is contained in:
Anderson Torres 2023-10-20 22:26:04 -03:00
parent 347ed6dca8
commit 6b2f0db256
2 changed files with 32 additions and 0 deletions

View File

@ -268,6 +268,7 @@
./programs/usbtop.nix
./programs/vim.nix
./programs/wavemon.nix
./programs/wayland/cardboard.nix
./programs/wayland/river.nix
./programs/wayland/sway.nix
./programs/wayland/waybar.nix

View File

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
let
cfg = config.programs.cardboard;
in
{
meta.maintainers = with lib.maintainers; [ AndersonTorres ];
options.programs.cardboard = {
enable = lib.mkEnableOption (lib.mdDoc "cardboard");
package = lib.mkOption {
type = with lib.types; nullOr package;
default = pkgs.cardboard;
defaultText = lib.literalExpression "pkgs.cardboard";
description = lib.mdDoc ''
cardboard package to use.
'';
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
environment.systemPackages = [ cfg.package ];
# To make a cardboard session available for certain DMs like SDDM
services.xserver.displayManager.sessionPackages = [ cfg.package ];
}
(import ./wayland-session.nix { inherit lib pkgs; })
]);
}