Compare commits

..

3 Commits

Author SHA1 Message Date
ff5bd34efd
Add home-manager options arg to an option
good for repl stuff
2024-03-04 21:13:29 -05:00
373d32f5c9
nullbox: auto_cache /ntfs 2024-03-04 21:11:16 -05:00
3aece4f65b
wm: Enable XDG MIME and set some defaults 2024-03-04 21:09:08 -05:00
4 changed files with 46 additions and 0 deletions

View File

@ -2,6 +2,7 @@
let
cfg = config.nixfiles.common.wm;
inherit (lib) mkDefault;
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
in
{
options.nixfiles.common.wm = {
@ -47,6 +48,25 @@ in
package = pkgs.swaylock-effects;
};
};
# File associations
xdg.mimeApps = {
enable = true;
defaultApplications = let
defaultBrowser = [ "firefox.desktop" ];
in mkOverrideEach 50 {
"x-scheme-handler/https" = defaultBrowser;
"x-scheme-handler/http" = defaultBrowser;
"text/html" = defaultBrowser;
"application/xhtml+xml" = defaultBrowser;
"application/pdf" = defaultBrowser;
};
};
# this solves some inconsistent behavior with xdg-open
xdg.portal.xdgOpenUsePortal = true;
services = {
udiskie = {
enable = mkDefault true;

View File

@ -13,6 +13,11 @@ in
];
config = {};
options.nixfiles = {
options = lib.mkOption {
description = "home-manager options attrset for repl";
default = options;
readOnly = true;
};
meta.standalone = lib.mkOption {
default = isStandalone;
description = "Whether or not the home-manager installation is standalone (standalone installations don't have access to osConfig).";

View File

@ -3,6 +3,7 @@ let
cfg = config.nixfiles.packageSets.multimedia;
inherit (lib) optionals mkEnableOption mkIf;
default = osConfig ? nixfiles && osConfig.nixfiles.packageSets.multimedia.enable;
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
in
{
options.nixfiles.packageSets.multimedia = {
@ -21,10 +22,29 @@ in
krita
inkscape
obs-studio
nomacs
audacity
] ++ [
yt-dlp
imagemagick
ffmpeg
];
xdg.mimeApps.defaultApplications = lib.mkMerge [
# project files
(mkOverrideEach 100 {
"image/x-xcf" = [ "gimp.desktop" ];
"image/x-compressed-xcf" = [ "gimp.desktop" ];
"image/x-krita" = [ "krita.desktop" ];
"application/x-audacity-project" = [ "audacity.desktop" ];
"application/x-audacity-project+sqlite3" = [ "audacity.desktop" ];
"image/svg+xml" = [ "org.inkscape.Inkscape.desktop" ];
"image/svg+xml-compressed" = [ "org.inkscape.Inkscape.desktop" ];
})
# general files
(with pkgs; mkOverrideEach 150 (config.lib.xdg.mimeAssociations [ nomacs mpv ]))
# rest of the files
(with pkgs; mkOverrideEach 200 (config.lib.xdg.mimeAssociations [ inkscape gimp audacity ]))
];
};
}

View File

@ -21,6 +21,7 @@
"/ntfs" = {
fsType = "ntfs-3g";
device = "/dev/disk/by-uuid/6AC23F0FC23EDF4F";
options = [ "auto_cache" ];
};
"/.btrfsroot" = {
options = [ "subvol=/" ];