From 61f614fb9cdda4d965e5652a77700b03be850a7f Mon Sep 17 00:00:00 2001 From: genofire Date: Sat, 13 Nov 2021 23:14:42 +0100 Subject: [PATCH] home/sway: make startup (and xwayland) optional --- home/sway.nix | 56 +++++++++++++++++++++++++++++++++++++++-------- nixos/default.nix | 1 + 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/home/sway.nix b/home/sway.nix index 0300f19..dece204 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -1,6 +1,37 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ...}: +let + cfg = config.my.sway; +in { + options.my.sway = with pkgs.lib; { + KDEConnect = mkOption { + default = true; + type = types.bool; + description = "enable foo"; + }; + xwayland = mkOption { + default = false; + type = types.bool; + description = "enable foo"; + }; + mail = mkOption { + default = true; + type = types.bool; + description = "enable foo"; + }; + nextcloud = mkOption { + default = true; + type = types.bool; + description = "enable foo"; + }; + XMPP = mkOption { + default = true; + type = types.bool; + description = "enable foo"; + }; + }; + config = { home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; MOZ_ENABLE_WAYLAND = "1"; @@ -59,7 +90,7 @@ # config.wayland.windowManager.sway.config.modifier; in { enable = true; - xwayland = false; + xwayland = cfg.xwayland; config = { input = { "*" = { @@ -299,19 +330,23 @@ { command = "mako"; } #{ command = "kanshi"; } # indicator - { command = "/usr/lib/kdeconnectd"; } - { command = "/home/genofire/.nix-profile/libexec/kdeconnectd"; } - { command = "kdeconnect-indicator"; } { command = "networkd-notify"; } # needs x11 #{ command = "udiskie -t"; } #{ command = "modem-manager-gui -i"; } #{ command = "nm-applet"; } # apps - { command = "thunderbird"; } { command = "firefox"; } #{ command = "firefoxdeveloperedition"; } + ] ++ lib.optionals (cfg.KDEConnect) [ + { command = "/usr/lib/kdeconnectd"; } + { command = "/home/genofire/.nix-profile/libexec/kdeconnectd"; } + { command = "kdeconnect-indicator"; } + ] ++ lib.optionals (cfg.mail) [ + { command = "thunderbird"; } + ] ++ lib.optionals (cfg.nextcloud) [ { command = "nextcloud"; } + ] ++ lib.optionals (cfg.XMPP) [ { command = "dino"; } #{ command = "gajim"; } ]; @@ -331,12 +366,15 @@ }; programs.alacritty = { - enable = false; + # enable = true; settings = { background_opacity = 0.95; font.size = 8; - schemes.base16.primary.background = "0x0a0a0a"; - colors = "*base16"; + colors.primary = { + background = "0x0a0a0a"; + foreground = "0xffffff"; + }; }; }; + }; } diff --git a/nixos/default.nix b/nixos/default.nix index 022db53..bd74922 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -8,6 +8,7 @@ system.autoUpgrade.enable = true; nix.optimise.automatic = true; nix.gc.automatic = true; + nixpkgs.config.allowUnfree = true; networking.useDHCP = false; networking.firewall.enable = true; # is already enabled ...