This commit is contained in:
LordGrimmauld 2024-04-27 14:20:48 +02:00
parent 9656e48df5
commit 070df903b5
9 changed files with 99 additions and 10 deletions

View File

@ -19,6 +19,7 @@ in
xcb-util-cursor
qt6ct
kdePackages.dolphin
qtwayland
];
environment.pathsToLink = [

View File

@ -52,6 +52,11 @@ in
nomacs
gparted
zathura
imhex
libreoffice-qt
filezilla
obsidian
thunderbird
];
programs.git = {
@ -118,6 +123,7 @@ in
matplotlib
numpy
scipy
pygobject3
];
};
};

View File

@ -18,6 +18,10 @@ in
nix-search-cli
];
environment.sessionVariables = {
NIXPKGS_ALLOW_UNFREE = "1";
};
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [
vim-nix
];

6
common/xdg/default.nix Normal file
View File

@ -0,0 +1,6 @@
{
imports = [
./portals.nix
./mime.nix
];
}

76
common/xdg/mime.nix Normal file
View File

@ -0,0 +1,76 @@
{ pkgs, config, lib, ... }:
let
cfg = config.grimmShared;
browsers = [
"firefox-beta.desktop"
"firefox.desktop"
];
text_editors = [
"nvim.desktop"
"geany.desktop"
"imhex.desktop"
];
image_viewers = [
"org.nomacs.ImageLounge.desktop"
"org.kde.krita.desktop"
"draw.desktop"
];
audio_players = [
"vlc.desktop"
];
video_viewers = [
"vlc.desktop"
];
document_viewers = [
"org.pwmt.zathura-pdf-mupdf.desktop"
"com.github.jeromerobert.pdfarranger.desktop"
] ++ browsers;
cad = [
"org.freecadweb.FreeCAD.desktop"
"PrusaSlicer.desktop"
"openscad.desktop"
];
tex_editors = [ ] ++ text_editors;
in
{
config = with cfg; lib.mkIf (enable && portals && graphical) {
xdg.mime.enable = true;
xdg.mime.addedAssociations = {
"application/java-vm" = [
"idea-community.desktop"
"imhex.desktop"
];
"application/json" = text_editors ++ [
"firefox-beta.desktop"
];
"application/mp4" = video_viewers;
"application/ogg" = audio_players;
"application/octet-stream" = "imhex.desktop";
"application/pdf" = document_viewers;
"application/rss+xml" = text_editors;
"application/x-chess-pgn" = [ ] ++ text_editors; # fixme
"application/x-krita" = "org.kde.krita.desktop";
"application/x-latex" = tex_editors;
"application/x-tex" = tex_editors;
"application/x-texinfo" = tex_editors;
"application/xml" = text_editors;
"image/svg+xml" = image_viewers ++ browsers ++ text_editors;
"image/*" = image_viewers;
"image/vnd.dwg" = cad;
"model/*" = cad;
"gcode" = [
"PrusaSlicer.desktop"
];
"audio/*" = audio_players;
"text/*" = text_editors;
"text/plain" = text_editors;
"text/markdown" = [ "obsidian.desktop" ] ++ text_editors;
"text/csv" = [ "calc.desktop" ] ++ text_editors;
"text/html" = browsers ++ text_editors;
"text/x-python" = [ "pycharm-community.desktop" ] ++ text_editors;
"text/x-c" = [ "clion.desktop" ] ++ text_editors;
"text/x-java-source" = [ "idea-community.desktop" ] ++ text_editors;
"video/*" = video_viewers;
};
};
}

View File

@ -5,9 +5,11 @@ in
{
config = with cfg; lib.mkIf (enable && portals) {
xdg.icons.enable = true;
xdg.sounds.enable = lib.mkIf sound.enable true;
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-kde

View File

@ -15,7 +15,7 @@
};
# Enable flatpaks
services.flatpak.enable = true;
# services.flatpak.enable = true;
grimmShared = {
enable = true;
@ -25,6 +25,7 @@
network = true;
tooling = {
enable = true;
pass = true;
lilypond = true;
};
sound = {
@ -60,14 +61,6 @@
mode = "777";
};
environment.sessionVariables = {
NIXPKGS_ALLOW_UNFREE = "1";
MOZ_ENABLE_WAYLAND = "1";
# QT_QPA_PLATFORM="wayland-egl";
OCI_CLI_RC_FILE = "/home/grimmauld/.oci/config";
};
boot.tmp.cleanOnBoot = true;
programs.dconf.enable = true;
}

View File

@ -8,7 +8,7 @@ with lib;
imports = [
./common/localisation.nix
./common/printing.nix
./common/portals.nix
./common/xdg
./common/network
./common/tooling
./common/sound

View File

@ -43,6 +43,7 @@
freecad
openscad
vlc
arena
stable.jetbrains.clion
jetbrains.idea-community
jetbrains.pycharm-community