Make other desktop Home Manager modules togglable

This commit is contained in:
Oliver Davies 2024-11-26 08:27:14 +00:00
parent af9edbfe1a
commit 0baed7e6f6
12 changed files with 124 additions and 77 deletions

View file

@ -30,15 +30,6 @@ let
inherit (pkgs) lib;
desktop-config = import ./desktop.nix {
inherit
config
inputs
pkgs
username
;
};
shared-config = import "${self}/nix/lib/shared/home-manager.nix" {
inherit
config
@ -61,14 +52,7 @@ let
};
in
{
imports =
if desktop then
[
desktop-config
shared-config
]
else
[ shared-config ];
imports = [ shared-config ];
home.packages =
shared-packages

View file

@ -1,12 +0,0 @@
{ ... }:
{
imports = [
../../modules/home-manager/copyq.nix
../../modules/home-manager/bluetuith.nix
../../modules/home-manager/espanso.nix
../../modules/home-manager/gtk.nix
../../modules/home-manager/flameshot.nix
../../modules/home-manager/gtk.nix
];
}

View file

@ -1,5 +1,9 @@
{
features = {
cli = {
direnv.enable = true;
};
desktop = {
alacritty.enable = false;
};

View file

@ -2,7 +2,16 @@
{
features = {
cli = {
bluetuith.enable = true;
direnv.enable = true;
};
desktop = {
copyq.enable = true;
espanso.enable = true;
flameshot.enable = true;
gtk.enable = true;
mpv.enable = true;
};
};

View file

@ -185,7 +185,6 @@
++ pkgs.lib.optionals desktop [
acpi
arandr
bluetuith
brightnessctl
cpufrequtils
libnotify

View file

@ -1,19 +1,34 @@
{
xdg.configFile."bluetuith/bluetuith.conf" = {
text = ''
{
adapter: ""
adapter-states: ""
connect-bdaddr: ""
gsm-apn: ""
gsm-number: ""
keybindings: {
NavigateDown: j
NavigateUp: k
config,
lib,
pkgs,
...
}:
{
options.features.cli.bluetuith.enable = lib.mkEnableOption "Enable bluetuith";
config = lib.mkIf config.features.cli.bluetuith.enable {
home.packages = with pkgs; [
bluetuith
];
xdg.configFile."bluetuith/bluetuith.conf" = {
text = ''
{
adapter: ""
adapter-states: ""
connect-bdaddr: ""
gsm-apn: ""
gsm-number: ""
keybindings: {
NavigateDown: j
NavigateUp: k
}
receive-dir: ""
theme: {}
}
receive-dir: ""
theme: {}
}
'';
'';
};
};
}

View file

@ -1 +1,9 @@
{ services.copyq.enable = true; }
{ config, lib, ... }:
{
options.features.desktop.copyq.enable = lib.mkEnableOption "Enable copyq";
config = lib.mkIf config.features.desktop.copyq.enable {
services.copyq.enable = true;
};
}

View file

@ -20,9 +20,14 @@
./alacritty.nix
./bat.nix
./bin.nix
./bluetuith.nix
./copyq.nix
./direnv.nix
./espanso.nix
./flameshot.nix
./fzf.nix
./git.nix
./gtk.nix
./htop.nix
./lsd.nix
./mpv.nix

View file

@ -1,7 +1,13 @@
{ config, lib, ... }:
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
options.features.cli.direnv.enable = lib.mkEnableOption "Enable direnv";
config = lib.mkIf config.features.cli.direnv.enable {
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
};
}

View file

@ -1,18 +1,22 @@
{ lib, ... }:
{ config, lib, ... }:
{
services.espanso = {
enable = true;
options.features.desktop.espanso.enable = lib.mkEnableOption "Enable espanso";
configs = {
default = {
show_notifications = false;
toggle_key = "LEFT_ALT";
config = lib.mkIf config.features.desktop.espanso.enable {
services.espanso = {
enable = true;
configs = {
default = {
show_notifications = false;
toggle_key = "LEFT_ALT";
};
};
};
matches = {
base = import ./espanso/matches/base.nix { inherit lib; };
matches = {
base = import ./espanso/matches/base.nix { inherit lib; };
};
};
};
}

View file

@ -1,15 +1,25 @@
{ username, ... }:
{
services.flameshot = {
enable = true;
config,
lib,
username,
...
}:
settings = {
General = {
disabledTrayIcon = false;
saveAfterCopy = true;
savePath = "/home/${username}/Pictures/Screenshots";
showHelp = false;
uiColor = "#60a5fa";
{
options.features.desktop.flameshot.enable = lib.mkEnableOption "Enable flameshot";
config = lib.mkIf config.features.desktop.flameshot.enable {
services.flameshot = {
enable = true;
settings = {
General = {
disabledTrayIcon = false;
saveAfterCopy = true;
savePath = "/home/${username}/Pictures/Screenshots";
showHelp = false;
uiColor = "#60a5fa";
};
};
};
};

View file

@ -1,11 +1,26 @@
{ pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
gtk = {
enable = true;
theme.package = pkgs.arc-theme;
theme.name = "Arc-Dark";
iconTheme.package = pkgs.arc-icon-theme;
iconTheme.name = "Arc";
options.features.desktop.gtk.enable = lib.mkEnableOption "Enable gtk";
config = lib.mkIf config.features.desktop.gtk.enable {
gtk = {
enable = true;
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Arc";
package = pkgs.arc-icon-theme;
};
};
};
}