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,4 +1,18 @@
{
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 = ''
{
@ -16,4 +30,5 @@
}
'';
};
};
}

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, ... }:
{
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,6 +1,9 @@
{ lib, ... }:
{ config, lib, ... }:
{
options.features.desktop.espanso.enable = lib.mkEnableOption "Enable espanso";
config = lib.mkIf config.features.desktop.espanso.enable {
services.espanso = {
enable = true;
@ -15,4 +18,5 @@
base = import ./espanso/matches/base.nix { inherit lib; };
};
};
};
}

View file

@ -1,5 +1,14 @@
{ username, ... }:
{
config,
lib,
username,
...
}:
{
options.features.desktop.flameshot.enable = lib.mkEnableOption "Enable flameshot";
config = lib.mkIf config.features.desktop.flameshot.enable {
services.flameshot = {
enable = true;
@ -13,4 +22,5 @@
};
};
};
};
}

View file

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