refactor: removing needless module complexity
This commit is contained in:
17
modules/home/services/blueman-applet/default.nix
Normal file
17
modules/home/services/blueman-applet/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.blueman-applet;
|
||||
in {
|
||||
options = {
|
||||
home.services.blueman-applet.enable = mkEnableOption "Enables blueman-applet";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.blueman-applet = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
modules/home/services/copyq/default.nix
Normal file
17
modules/home/services/copyq/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.copyq;
|
||||
in {
|
||||
options = {
|
||||
home.services.copyq.enable = mkEnableOption "Enables copyq";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.copyq = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/home/services/dconf/default.nix
Normal file
24
modules/home/services/dconf/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) types mkOption;
|
||||
cfg = config.home.services.dconf;
|
||||
in {
|
||||
options = {
|
||||
home.services.dconf.settings.color-scheme = mkOption {
|
||||
type = types.str;
|
||||
default = "prefer-dark";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
dconf = {
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = cfg.settings.color-scheme;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/home/services/gpg/default.nix
Normal file
18
modules/home/services/gpg/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.gpg;
|
||||
in {
|
||||
options = {
|
||||
home.services.gpg.enable = mkEnableOption "Enables gpg";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
100
modules/home/services/gtk/default.nix
Normal file
100
modules/home/services/gtk/default.nix
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.gtk;
|
||||
in {
|
||||
options = {
|
||||
home.services.gtk.enable = mkEnableOption "Enables miscellaneous GTK elements";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = [pkgs.glib]; # gsettings
|
||||
pointerCursor = {
|
||||
# package = pkgs.catppuccin-cursors.latteDark;
|
||||
# name = "catppuccin-latte-dark-cursors";
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
size = 28;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
};
|
||||
};
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
package = pkgs.orchis-theme;
|
||||
name = "Orchis-Grey-Dark-Compact";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
};
|
||||
font = {
|
||||
name = "Input Sans Narrow Light";
|
||||
size = 10;
|
||||
};
|
||||
cursorTheme = {
|
||||
# package = pkgs.catppuccin-cursors.latteDark;
|
||||
# name = "catppuccin-latte-dark-cursors";
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
size = 28;
|
||||
};
|
||||
|
||||
gtk2 = {
|
||||
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
extraConfig = ''
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle="hintslight"
|
||||
gtk-xft-rgba="rgb"
|
||||
'';
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
# Lets be easy on the eyes. This should be easy to make dependent on
|
||||
# the "variant" of the theme, but I never use a light theme anyway.
|
||||
gtk-application-prefer-dark-theme = true;
|
||||
|
||||
# Decorations
|
||||
gtk-decoration-layout = "appmenu:none";
|
||||
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
|
||||
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
|
||||
gtk-button-images = 1;
|
||||
gtk-menu-images = 1;
|
||||
|
||||
# Silence bells and whistles, quite literally.
|
||||
gtk-error-bell = 0;
|
||||
gtk-enable-event-sounds = 0;
|
||||
gtk-enable-input-feedback-sounds = 0;
|
||||
|
||||
# Fonts
|
||||
gtk-xft-antialias = 1;
|
||||
gtk-xft-hinting = 1;
|
||||
gtk-xft-hintstyle = "hintslight";
|
||||
};
|
||||
|
||||
gtk4.extraConfig = {
|
||||
# Prefer dark theme.
|
||||
gtk-application-prefer-dark-theme = true;
|
||||
|
||||
# Decorations.
|
||||
gtk-decoration-layout = "appmenu:none";
|
||||
|
||||
# Sounds, again.
|
||||
gtk-error-bell = 0;
|
||||
gtk-enable-event-sounds = 0;
|
||||
gtk-enable-input-feedback-sounds = 0;
|
||||
|
||||
# Fonts, you know the drill.
|
||||
gtk-xft-antialias = 1;
|
||||
gtk-xft-hinting = 1;
|
||||
gtk-xft-hintstyle = "hintslight";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
140
modules/home/services/gtk/wip.nix
Normal file
140
modules/home/services/gtk/wip.nix
Normal file
@@ -0,0 +1,140 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) types mkOption mkIf;
|
||||
cfg = config.home.userd.gtk;
|
||||
in {
|
||||
options = {
|
||||
home.userd.gtk.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable GTK configuration.";
|
||||
};
|
||||
|
||||
home.userd.gtk.theme = mkOption {
|
||||
type = types.str;
|
||||
default = "Orchis-Grey-Dark-Compact";
|
||||
description = "GTK theme name.";
|
||||
};
|
||||
|
||||
home.userd.gtk.themePackage = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.orchis-theme;
|
||||
description = "GTK theme package.";
|
||||
};
|
||||
|
||||
home.userd.gtk.iconTheme = mkOption {
|
||||
type = types.str;
|
||||
default = "Adwaita";
|
||||
description = "GTK icon theme name.";
|
||||
};
|
||||
|
||||
home.userd.gtk.iconThemePackage = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.adwaita-icon-theme;
|
||||
description = "GTK icon theme package.";
|
||||
};
|
||||
|
||||
home.userd.gtk.font = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = {
|
||||
name = "Input Sans Narrow Light";
|
||||
size = 10;
|
||||
};
|
||||
description = "GTK font configuration.";
|
||||
};
|
||||
|
||||
home.userd.gtk.cursorTheme = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = {
|
||||
name = "Adwaita";
|
||||
size = 28;
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
};
|
||||
description = "Cursor theme configuration.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = [pkgs.glib];
|
||||
|
||||
pointerCursor = {
|
||||
package = cfg.cursorTheme.package;
|
||||
name = cfg.cursorTheme.name;
|
||||
size = cfg.cursorTheme.size;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
||||
theme = {
|
||||
package = cfg.themePackage;
|
||||
name = cfg.theme;
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
package = cfg.iconThemePackage;
|
||||
name = cfg.iconTheme;
|
||||
};
|
||||
|
||||
font = {
|
||||
name = cfg.font.name;
|
||||
size = cfg.font.size;
|
||||
};
|
||||
|
||||
cursorTheme = {
|
||||
package = cfg.cursorTheme.package;
|
||||
name = cfg.cursorTheme.name;
|
||||
size = cfg.cursorTheme.size;
|
||||
};
|
||||
|
||||
gtk2 = {
|
||||
extraConfig = ''
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle="hintslight"
|
||||
gtk-xft-rgba="rgb"
|
||||
'';
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
gtk-application-prefer-dark-theme = true;
|
||||
|
||||
gtk-decoration-layout = "appmenu:none";
|
||||
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
|
||||
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
|
||||
gtk-button-images = 1;
|
||||
gtk-menu-images = 1;
|
||||
|
||||
gtk-error-bell = 0;
|
||||
gtk-enable-event-sounds = 0;
|
||||
gtk-enable-input-feedback-sounds = 0;
|
||||
|
||||
gtk-xft-antialias = 1;
|
||||
gtk-xft-hinting = 1;
|
||||
gtk-xft-hintstyle = "hintslight";
|
||||
};
|
||||
|
||||
gtk4.extraConfig = {
|
||||
gtk-application-prefer-dark-theme = true;
|
||||
|
||||
gtk-decoration-layout = "appmenu:none";
|
||||
|
||||
gtk-error-bell = 0;
|
||||
gtk-enable-event-sounds = 0;
|
||||
gtk-enable-input-feedback-sounds = 0;
|
||||
|
||||
gtk-xft-antialias = 1;
|
||||
gtk-xft-hinting = 1;
|
||||
gtk-xft-hintstyle = "hintslight";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
modules/home/services/hypridle/default.nix
Normal file
42
modules/home/services/hypridle/default.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.hypridle;
|
||||
|
||||
hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle;
|
||||
# hypridlePkg = pkgs.hypridle;
|
||||
in {
|
||||
options = {
|
||||
home.services.hypridle.enable = mkEnableOption "Enables hypridle";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
package = hypridleFlake;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "hyprlock";
|
||||
before_sleep_cmd = "$lock_cmd";
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 900; # 15mins
|
||||
on-timeout = "hyprlock";
|
||||
}
|
||||
{
|
||||
timeout = 1200; # 20mins
|
||||
on-timeout = "hyprctl dispatch dpms off";
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
55
modules/home/services/hyprpaper/default.nix
Normal file
55
modules/home/services/hyprpaper/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.hyprpaper;
|
||||
|
||||
hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default;
|
||||
# hyprpaperPkg = pkgs.hyprpaper;
|
||||
in {
|
||||
options = {
|
||||
home.services.hyprpaper.enable = mkEnableOption "Enables hyprpaper";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
package = hyprpaperFlake;
|
||||
settings = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
splash_offset = 2.0;
|
||||
|
||||
preload = [
|
||||
"~/media/images/l_ash08_big.jpg"
|
||||
"~/media/images/l_ash09_big.jpg"
|
||||
"~/media/images/l_int06_big.jpg"
|
||||
"~/media/images/by_housevisit_2560.jpg"
|
||||
"~/media/images/nix.png"
|
||||
"~/media/images/stacks.png"
|
||||
"~/media/images/ship.png"
|
||||
"~/media/images/cabin.png"
|
||||
"~/media/images/dunes.png"
|
||||
"~/media/images/globe.png"
|
||||
"~/media/images/space.jpg"
|
||||
"~/media/images/galaxy.png"
|
||||
"~/media/images/deathstar.png"
|
||||
"~/media/images/trollskog.png"
|
||||
];
|
||||
|
||||
wallpaper = [
|
||||
# cnix
|
||||
"DP-3,~/media/images/l_ash08_big.jpg"
|
||||
# adampad
|
||||
"eDP-1,~/media/images/l_ash08_big.jpg"
|
||||
# toothpc
|
||||
"DVI-D-1,~/media/images/dunes.png"
|
||||
# "DP-1,/share/wallpapers/cat_pacman.png"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
39
modules/home/services/mako/default.nix
Normal file
39
modules/home/services/mako/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.mako;
|
||||
in {
|
||||
options = {
|
||||
home.services.mako.enable = mkEnableOption "Enables mako";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.mako = {
|
||||
enable = true;
|
||||
iconPath = "$HOME/.nix-profile/share/icons/Gruvbox-Plus-Dark";
|
||||
font = "FiraCode Nerd Font Medium 12";
|
||||
padding = "20";
|
||||
margin = "10";
|
||||
anchor = "top-right";
|
||||
width = 400;
|
||||
height = 150;
|
||||
borderSize = 2;
|
||||
defaultTimeout = 12000;
|
||||
backgroundColor = "#3c3836dd";
|
||||
borderColor = "#689d6add";
|
||||
textColor = "#d5c4a1dd";
|
||||
layer = "overlay";
|
||||
extraConfig = ''
|
||||
max-history=50
|
||||
max-visible=4
|
||||
outer-margin=25
|
||||
icon-location=right
|
||||
max-icon-size=48
|
||||
[mode=do-not-disturb]
|
||||
invisible=1
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
32
modules/home/services/polkit/default.nix
Normal file
32
modules/home/services/polkit/default.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.polkit;
|
||||
in {
|
||||
options = {
|
||||
home.services.polkit.enable = mkEnableOption "Enables polkit";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.polkit-gnome-authentication-agent-1 = {
|
||||
Unit.Description = "polkit-gnome-authentication-agent-1";
|
||||
|
||||
Install = {
|
||||
WantedBy = ["graphical-session.target"];
|
||||
Wants = ["graphical-session.target"];
|
||||
After = ["graphical-session.target"];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/home/services/syncthing/default.nix
Normal file
18
modules/home/services/syncthing/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.syncthing;
|
||||
in {
|
||||
options = {
|
||||
home.services.syncthing.enable = mkEnableOption "Enables syncthing";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
tray.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/home/services/udiskie/default.nix
Normal file
19
modules/home/services/udiskie/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.services.udiskie;
|
||||
in {
|
||||
options = {
|
||||
home.services.udiskie.enable = mkEnableOption "Enables udiskie";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.udiskie = {
|
||||
enable = true;
|
||||
tray = "always";
|
||||
notify = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
80
modules/home/services/xdg/default.nix
Normal file
80
modules/home/services/xdg/default.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption elem;
|
||||
browser =
|
||||
if elem osConfig.networking.hostName ["cnix" "cnixpad"]
|
||||
then "zen.desktop"
|
||||
else "firefox.desktop";
|
||||
cfg = config.home.services.xdg;
|
||||
in {
|
||||
options = {
|
||||
home.services.xdg.enable = mkEnableOption "Enables XDG settings";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
xdg = {
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
desktop = "${config.home.homeDirectory}/desktop";
|
||||
documents = "${config.home.homeDirectory}/documents";
|
||||
download = "${config.home.homeDirectory}/downloads";
|
||||
music = "${config.home.homeDirectory}/media/music";
|
||||
pictures = "${config.home.homeDirectory}/media/images";
|
||||
publicShare = "${config.home.homeDirectory}/documents/share";
|
||||
templates = "${config.home.homeDirectory}/documents/templates";
|
||||
videos = "${config.home.homeDirectory}/media/videos";
|
||||
};
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = browser;
|
||||
"text/xml" = browser;
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
"x-scheme-handler/chrome" = browser;
|
||||
"application/x-extension-htm" = browser;
|
||||
"application/x-extension-html" = browser;
|
||||
"application/x-extension-shtml" = browser;
|
||||
"application/x-extension-xhtml" = browser;
|
||||
"application/x-extension-xht" = browser;
|
||||
"application/xhtml+xml" = browser;
|
||||
"application/json" = browser;
|
||||
"application/pdf" = "org.pwmt.zathura.desktop";
|
||||
"inode/directory" = "thunar.desktop";
|
||||
|
||||
"image/apng" = "feh.desktop";
|
||||
"image/avif" = "feh.desktop";
|
||||
"image/bmp" = "feh.desktop";
|
||||
"image/gif" = "feh.desktop";
|
||||
"image/jpeg" = "feh.desktop";
|
||||
"image/png" = "feh.desktop";
|
||||
"image/svg+xml" = "feh.desktop";
|
||||
"image/tiff" = "feh.desktop";
|
||||
"image/webp" = "feh.desktop";
|
||||
|
||||
"video/H264" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/x-msvideo" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/mp4" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/mpeg" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/ogg" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/mp2t" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/webm" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/3gpp" = ["mpv.desktop" "vlc.desktop"];
|
||||
"video/3gpp2" = ["mpv.desktop" "vlc.desktop"];
|
||||
|
||||
"application/x-7z-compressed" = "org.gnome.FileRoller.desktop";
|
||||
"application/zip" = "org.gnome.FileRoller.desktop";
|
||||
"application/vnd.rar" = "org.gnome.FileRoller.desktop";
|
||||
"application/x-bzip" = "org.gnome.FileRoller.desktop";
|
||||
"application/x-bzip2" = "org.gnome.FileRoller.desktop";
|
||||
"application/x-tar" = "org.gnome.FileRoller.desktop";
|
||||
"application/gzip" = "org.gnome.FileRoller.desktop";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user