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; inherit (pkgs) lib;
desktop-config = import ./desktop.nix {
inherit
config
inputs
pkgs
username
;
};
shared-config = import "${self}/nix/lib/shared/home-manager.nix" { shared-config = import "${self}/nix/lib/shared/home-manager.nix" {
inherit inherit
config config
@ -61,14 +52,7 @@ let
}; };
in in
{ {
imports = imports = [ shared-config ];
if desktop then
[
desktop-config
shared-config
]
else
[ shared-config ];
home.packages = home.packages =
shared-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 = { features = {
cli = {
direnv.enable = true;
};
desktop = { desktop = {
alacritty.enable = false; alacritty.enable = false;
}; };

View file

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

View file

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

View file

@ -1,19 +1,34 @@
{ {
xdg.configFile."bluetuith/bluetuith.conf" = { config,
text = '' lib,
{ pkgs,
adapter: "" ...
adapter-states: "" }:
connect-bdaddr: ""
gsm-apn: "" {
gsm-number: "" options.features.cli.bluetuith.enable = lib.mkEnableOption "Enable bluetuith";
keybindings: {
NavigateDown: j config = lib.mkIf config.features.cli.bluetuith.enable {
NavigateUp: k 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 ./alacritty.nix
./bat.nix ./bat.nix
./bin.nix ./bin.nix
./bluetuith.nix
./copyq.nix
./direnv.nix ./direnv.nix
./espanso.nix
./flameshot.nix
./fzf.nix ./fzf.nix
./git.nix ./git.nix
./gtk.nix
./htop.nix ./htop.nix
./lsd.nix ./lsd.nix
./mpv.nix ./mpv.nix

View file

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

View file

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

View file

@ -1,15 +1,25 @@
{ username, ... }:
{ {
services.flameshot = { config,
enable = true; lib,
username,
...
}:
settings = { {
General = { options.features.desktop.flameshot.enable = lib.mkEnableOption "Enable flameshot";
disabledTrayIcon = false;
saveAfterCopy = true; config = lib.mkIf config.features.desktop.flameshot.enable {
savePath = "/home/${username}/Pictures/Screenshots"; services.flameshot = {
showHelp = false; enable = true;
uiColor = "#60a5fa";
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 = { options.features.desktop.gtk.enable = lib.mkEnableOption "Enable gtk";
enable = true;
theme.package = pkgs.arc-theme; config = lib.mkIf config.features.desktop.gtk.enable {
theme.name = "Arc-Dark"; gtk = {
iconTheme.package = pkgs.arc-icon-theme; enable = true;
iconTheme.name = "Arc";
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Arc";
package = pkgs.arc-icon-theme;
};
};
}; };
} }