feat(config): add userDirs & mimeApp modules

This commit is contained in:
ooks-io 2024-04-01 18:04:00 +13:00
parent 0db15b3748
commit ed8bad82e2
5 changed files with 59 additions and 18 deletions

View file

@ -9,6 +9,7 @@
./userDirs
./home
./nixColors
./mimeApps
];
options.homeModules.config = {
@ -16,5 +17,6 @@
nixColors.enable = lib.mkEnableOption "enable nixColors configuration module";
home.enable = lib.mkEnableOption "enable home configuration module";
userDirs.enable = lib.mkEnableOption "enable userDirs configuration module";
mimeApps.enable = lib.mkEnableOption "enable mimeApps configuration module";
};
}

View file

@ -0,0 +1,40 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.config.mimeApps;
browser = ["${config.home.sessionVariables.BROWSER}.desktop"];
zathura = ["org.pwmt.zethura.desktop.desktop"];
associations = {
"text/html" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/xhtml+xml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
"application/json" = browser;
"application/pdf" = zathura;
"x-scheme-handler/discord" = ["vesktop.desktop"];
};
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.xdg-utils ];
xdg.mimeApps = {
enable = true;
associations.added = associations;
defaultApplications = associations;
};
};
}

View file

@ -6,9 +6,22 @@ in
{
config = lib.mkIf cfg.enable {
xdg.userDirs = {
xdg = {
enable = true;
configHome = "${config.home.homeDirectory}/.config";
cacheHome = "${config.home.homeDirectory}/.cache";
dataHome = "${config.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state";
userDirs = {
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/Desktop";
documents = "${config.home.homeDirectory}/Documents";
music = "${config.home.homeDirectory}/Media/Music";
videos = "${config.home.homeDirectory}/Media/Videos";
pictures = "${config.home.homeDirectory}/Media/Pictures";
};
};
};
}

View file

@ -7,21 +7,5 @@ in
{
config = lib.mkIf cfg.enable {
hardware.brillo.enable = true;
services.clight = {
enable = true;
temperature = {
night = 3000;
day = 6000;
};
settings = {
verbose = true;
backlight.disabled = true;
dpms.timeouts = [900 300];
dimmer.timeouts = [870 270];
screen.disabled = true;
sunrise = "9:00";
sunset = "20:00";
};
};
};
}

View file

@ -17,6 +17,8 @@ let
mangohud
winetricks
protontricks
gtk3
gtk3-x11
];
};
in