Improve MIME defaults and Home Manager backups
This commit is contained in:
@@ -1,4 +1,11 @@
|
|||||||
{ inputs, config, pkgs, lib, makeEnable, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
makeEnable,
|
||||||
|
...
|
||||||
|
}:
|
||||||
makeEnable config "myModules.desktop" true {
|
makeEnable config "myModules.desktop" true {
|
||||||
services.greenclip.enable = true;
|
services.greenclip.enable = true;
|
||||||
imports = [
|
imports = [
|
||||||
@@ -42,7 +49,7 @@ makeEnable config "myModules.desktop" true {
|
|||||||
|
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
{
|
{
|
||||||
imports = [ ./dunst.nix ];
|
imports = [./dunst.nix];
|
||||||
|
|
||||||
xdg.desktopEntries."com.mitchellh.ghostty" = {
|
xdg.desktopEntries."com.mitchellh.ghostty" = {
|
||||||
name = "Ghostty";
|
name = "Ghostty";
|
||||||
@@ -50,7 +57,7 @@ makeEnable config "myModules.desktop" true {
|
|||||||
icon = "com.mitchellh.ghostty";
|
icon = "com.mitchellh.ghostty";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
type = "Application";
|
type = "Application";
|
||||||
categories = [ "System" "TerminalEmulator" ];
|
categories = ["System" "TerminalEmulator"];
|
||||||
startupNotify = true;
|
startupNotify = true;
|
||||||
exec = "${pkgs.ghostty}/bin/ghostty --gtk-single-instance=false";
|
exec = "${pkgs.ghostty}/bin/ghostty --gtk-single-instance=false";
|
||||||
settings = {
|
settings = {
|
||||||
@@ -72,79 +79,88 @@ makeEnable config "myModules.desktop" true {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs;
|
||||||
# Appearance
|
[
|
||||||
adwaita-icon-theme
|
# Appearance
|
||||||
hicolor-icon-theme
|
adwaita-icon-theme
|
||||||
# libsForQt5.breeze-gtk
|
hicolor-icon-theme
|
||||||
# materia-theme
|
# libsForQt5.breeze-gtk
|
||||||
numix-icon-theme-circle
|
# materia-theme
|
||||||
papirus-icon-theme
|
numix-icon-theme-circle
|
||||||
|
papirus-icon-theme
|
||||||
|
|
||||||
# XOrg
|
# XOrg
|
||||||
autorandr
|
autorandr
|
||||||
keyd
|
keyd
|
||||||
wmctrl
|
wmctrl
|
||||||
xclip
|
xclip
|
||||||
xdotool
|
xdotool
|
||||||
xev
|
xev
|
||||||
xwininfo
|
xwininfo
|
||||||
xsettingsd
|
xsettingsd
|
||||||
|
|
||||||
# Desktop
|
# Desktop
|
||||||
alacritty
|
alacritty
|
||||||
ghostty
|
ghostty
|
||||||
blueman
|
blueman
|
||||||
# clipit
|
# clipit
|
||||||
d-spy
|
d-spy
|
||||||
kdePackages.dolphin
|
kdePackages.dolphin
|
||||||
|
|
||||||
feh
|
feh
|
||||||
gthumb
|
file-roller
|
||||||
firefox
|
gthumb
|
||||||
cheese
|
firefox
|
||||||
kdePackages.kleopatra
|
cheese
|
||||||
libnotify
|
kdePackages.kleopatra
|
||||||
libreoffice
|
libnotify
|
||||||
lxappearance
|
libreoffice
|
||||||
lxqt.lxqt-powermanagement
|
loupe
|
||||||
networkmanagerapplet
|
lxappearance
|
||||||
kdePackages.okular
|
lxqt.lxqt-powermanagement
|
||||||
pinentry-gnome3
|
networkmanagerapplet
|
||||||
# mission-center
|
kdePackages.okular
|
||||||
quassel
|
pinentry-gnome3
|
||||||
remmina
|
# mission-center
|
||||||
rofi
|
quassel
|
||||||
wofi
|
remmina
|
||||||
rofi-pass
|
rofi
|
||||||
rofi-systemd
|
wofi
|
||||||
simplescreenrecorder
|
rofi-pass
|
||||||
skippy-xd
|
rofi-systemd
|
||||||
transmission_4-gtk
|
simplescreenrecorder
|
||||||
vlc
|
skippy-xd
|
||||||
thunar
|
transmission_4-gtk
|
||||||
|
vlc
|
||||||
|
thunar
|
||||||
|
|
||||||
# Audio
|
# Audio
|
||||||
picard
|
picard
|
||||||
pavucontrol
|
pavucontrol
|
||||||
playerctl
|
playerctl
|
||||||
pulsemixer
|
pulsemixer
|
||||||
espeak
|
espeak
|
||||||
|
|
||||||
#
|
#
|
||||||
brightnessctl
|
brightnessctl
|
||||||
|
|
||||||
# Visualization
|
# Visualization
|
||||||
graphviz
|
graphviz
|
||||||
mermaid-cli
|
mermaid-cli
|
||||||
] ++ (if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then with pkgs; [
|
]
|
||||||
google-chrome
|
++ (
|
||||||
pommed_light
|
if pkgs.stdenv.hostPlatform.system == "x86_64-linux"
|
||||||
slack
|
then
|
||||||
spicetify-cli
|
with pkgs; [
|
||||||
spotify
|
google-chrome
|
||||||
tor-browser
|
pommed_light
|
||||||
vscode
|
slack
|
||||||
zulip
|
spicetify-cli
|
||||||
] else []);
|
spotify
|
||||||
|
tor-browser
|
||||||
|
vscode
|
||||||
|
zulip
|
||||||
|
]
|
||||||
|
else []
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
{ config, pkgs, lib, nixos, ... }:
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
nixos,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
mimeMap = desktopId: mimeTypes: lib.genAttrs mimeTypes (_: [desktopId]);
|
||||||
|
in {
|
||||||
# Automatic garbage collection of old home-manager generations
|
# Automatic garbage collection of old home-manager generations
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
@@ -20,42 +27,152 @@
|
|||||||
static_history = []
|
static_history = []
|
||||||
'';
|
'';
|
||||||
|
|
||||||
xdg.mimeApps = lib.mkIf nixos.config.myModules.desktop.enable {
|
xdg.mimeApps = lib.mkIf nixos.config.myModules.desktop.enable (
|
||||||
enable = true;
|
let
|
||||||
|
browser = "google-chrome.desktop";
|
||||||
|
imageViewer = "org.gnome.Loupe.desktop";
|
||||||
|
fallbackImageViewer = "okularApplication_kimgio.desktop";
|
||||||
|
pdfViewer = "okularApplication_pdf.desktop";
|
||||||
|
comicViewer = "okularApplication_comicbook.desktop";
|
||||||
|
djvuViewer = "okularApplication_djvu.desktop";
|
||||||
|
ebookViewer = "okularApplication_epub.desktop";
|
||||||
|
mobiViewer = "okularApplication_mobi.desktop";
|
||||||
|
xpsViewer = "okularApplication_xps.desktop";
|
||||||
|
mediaPlayer = "vlc.desktop";
|
||||||
|
archiveManager = "org.gnome.FileRoller.desktop";
|
||||||
|
fileManager = "thunar.desktop";
|
||||||
|
wordProcessor = "writer.desktop";
|
||||||
|
spreadsheet = "calc.desktop";
|
||||||
|
presentation = "impress.desktop";
|
||||||
|
|
||||||
associations.added = {
|
defaultApplications =
|
||||||
"video/x-matroska" = "vlc.desktop";
|
(mimeMap imageViewer [
|
||||||
"audio/flac" = "vlc.desktop";
|
"image/avif"
|
||||||
"image/jpeg" = "feh.desktop";
|
"image/bmp"
|
||||||
"video/x-msvideo" = "vlc.desktop";
|
"image/gif"
|
||||||
"text/vnd.trolltech.linguist" = "vlc.desktop";
|
"image/heic"
|
||||||
"audio/mpeg" = "vlc.desktop";
|
"image/jpeg"
|
||||||
"application/pdf" = "okularApplication_pdf.desktop";
|
"image/jxl"
|
||||||
"image/png" = "okularApplication_kimgio.desktop";
|
"image/png"
|
||||||
"video/mp4" = [ "vlc.desktop" "org.gnome.Totem.desktop" ];
|
"image/svg+xml"
|
||||||
"x-scheme-handler/magnet" = "userapp-transmission-gtk-24GQLZ.desktop";
|
"image/svg+xml-compressed"
|
||||||
"element" = "element-desktop.desktop";
|
"image/tiff"
|
||||||
};
|
"image/vnd.microsoft.icon"
|
||||||
|
"image/webp"
|
||||||
defaultApplications = {
|
])
|
||||||
"text/html" = "google-chrome.desktop";
|
// (mimeMap fallbackImageViewer [
|
||||||
"x-scheme-handler/http" = "google-chrome.desktop";
|
"image/heif"
|
||||||
"x-scheme-handler/https" = "google-chrome.desktop";
|
])
|
||||||
"x-scheme-handler/about" = "google-chrome.desktop";
|
// (mimeMap pdfViewer [
|
||||||
"x-scheme-handler/unknown" = "google-chrome.desktop";
|
"application/pdf"
|
||||||
"x-scheme-handler/magnet" = "userapp-transmission-gtk-24GQLZ.desktop";
|
"application/x-bzpdf"
|
||||||
"x-scheme-handler/element" = "element-desktop.desktop";
|
"application/x-gzpdf"
|
||||||
};
|
])
|
||||||
|
// (mimeMap comicViewer [
|
||||||
defaultApplicationPackages = [
|
"application/x-cb7"
|
||||||
pkgs.gthumb
|
"application/x-cbr"
|
||||||
];
|
"application/x-cbt"
|
||||||
};
|
"application/x-cbz"
|
||||||
|
])
|
||||||
|
// (mimeMap djvuViewer [
|
||||||
|
"image/vnd.djvu"
|
||||||
|
])
|
||||||
|
// (mimeMap ebookViewer [
|
||||||
|
"application/epub+zip"
|
||||||
|
])
|
||||||
|
// (mimeMap mobiViewer [
|
||||||
|
"application/x-mobipocket-ebook"
|
||||||
|
])
|
||||||
|
// (mimeMap xpsViewer [
|
||||||
|
"application/oxps"
|
||||||
|
"application/vnd.ms-xpsdocument"
|
||||||
|
])
|
||||||
|
// (mimeMap mediaPlayer [
|
||||||
|
"application/ogg"
|
||||||
|
"audio/flac"
|
||||||
|
"audio/mp4"
|
||||||
|
"audio/mpeg"
|
||||||
|
"audio/ogg"
|
||||||
|
"audio/opus"
|
||||||
|
"audio/webm"
|
||||||
|
"audio/wav"
|
||||||
|
"audio/x-flac"
|
||||||
|
"audio/x-wav"
|
||||||
|
"video/mp4"
|
||||||
|
"video/ogg"
|
||||||
|
"video/quicktime"
|
||||||
|
"video/webm"
|
||||||
|
"video/x-matroska"
|
||||||
|
"video/x-msvideo"
|
||||||
|
])
|
||||||
|
// (mimeMap archiveManager [
|
||||||
|
"application/bzip2"
|
||||||
|
"application/gzip"
|
||||||
|
"application/vnd.rar"
|
||||||
|
"application/x-7z-compressed"
|
||||||
|
"application/x-bzip"
|
||||||
|
"application/x-compressed-tar"
|
||||||
|
"application/x-gzip"
|
||||||
|
"application/x-rar"
|
||||||
|
"application/x-rar-compressed"
|
||||||
|
"application/x-tar"
|
||||||
|
"application/x-xz"
|
||||||
|
"application/x-zip-compressed"
|
||||||
|
"application/zip"
|
||||||
|
"application/zstd"
|
||||||
|
])
|
||||||
|
// (mimeMap wordProcessor [
|
||||||
|
"application/msword"
|
||||||
|
"application/rtf"
|
||||||
|
"application/vnd.ms-word"
|
||||||
|
"application/vnd.oasis.opendocument.text"
|
||||||
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||||
|
])
|
||||||
|
// (mimeMap spreadsheet [
|
||||||
|
"application/vnd.ms-excel"
|
||||||
|
"application/vnd.oasis.opendocument.spreadsheet"
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
|
"text/csv"
|
||||||
|
"text/tab-separated-values"
|
||||||
|
])
|
||||||
|
// (mimeMap presentation [
|
||||||
|
"application/mspowerpoint"
|
||||||
|
"application/vnd.ms-powerpoint"
|
||||||
|
"application/vnd.oasis.opendocument.presentation"
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.slideshow"
|
||||||
|
])
|
||||||
|
// (mimeMap fileManager [
|
||||||
|
"inode/directory"
|
||||||
|
])
|
||||||
|
// (mimeMap browser [
|
||||||
|
"application/rdf+xml"
|
||||||
|
"application/rss+xml"
|
||||||
|
"application/xhtml+xml"
|
||||||
|
"application/xhtml_xml"
|
||||||
|
"application/xml"
|
||||||
|
"text/html"
|
||||||
|
"text/xml"
|
||||||
|
"x-scheme-handler/about"
|
||||||
|
"x-scheme-handler/http"
|
||||||
|
"x-scheme-handler/https"
|
||||||
|
"x-scheme-handler/unknown"
|
||||||
|
])
|
||||||
|
// {
|
||||||
|
"x-scheme-handler/element" = ["element-desktop.desktop"];
|
||||||
|
"x-scheme-handler/magnet" = ["transmission-gtk.desktop"];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
associations.added = defaultApplications;
|
||||||
|
inherit defaultApplications;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
xsession = {
|
xsession = {
|
||||||
enable = true;
|
enable = true;
|
||||||
preferStatusNotifierItems = true;
|
preferStatusNotifierItems = true;
|
||||||
importedVariables = [ "GDK_PIXBUF_ICON_LOADER" ];
|
importedVariables = ["GDK_PIXBUF_ICON_LOADER"];
|
||||||
profileExtra = ''
|
profileExtra = ''
|
||||||
systemctl --user set-environment IMALISON_SESSION_TYPE=x11
|
systemctl --user set-environment IMALISON_SESSION_TYPE=x11
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
{ inputs, specialArgs, config, lib, realUsers, ... }:
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
specialArgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
realUsers,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
@@ -19,8 +26,31 @@
|
|||||||
};
|
};
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.backupCommand = pkgs.writeShellScript "home-manager-backup-command" ''
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
target_path="$1"
|
||||||
|
backup_ext="''${HOME_MANAGER_BACKUP_EXT:-hm-backup}"
|
||||||
|
backup_path="''${target_path}.''${backup_ext}"
|
||||||
|
|
||||||
|
if [[ ! -e "$backup_path" ]]; then
|
||||||
|
mv -- "$target_path" "$backup_path"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
timestamp="$(date +%Y%m%d-%H%M%S)"
|
||||||
|
candidate="''${backup_path}.''${timestamp}"
|
||||||
|
counter=0
|
||||||
|
|
||||||
|
while [[ -e "$candidate" ]]; do
|
||||||
|
counter=$((counter + 1))
|
||||||
|
candidate="''${backup_path}.''${timestamp}-''${counter}"
|
||||||
|
done
|
||||||
|
|
||||||
|
mv -- "$target_path" "$candidate"
|
||||||
|
'';
|
||||||
home-manager.backupFileExtension = "hm-backup";
|
home-manager.backupFileExtension = "hm-backup";
|
||||||
home-manager.sharedModules = [ ./home-manager.nix ];
|
home-manager.sharedModules = [./home-manager.nix];
|
||||||
|
|
||||||
nix = rec {
|
nix = rec {
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
@@ -55,27 +85,34 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays =
|
||||||
# (import ./nvidia-container-toolkit-overlay.nix)
|
[
|
||||||
(import ./runc-overlay.nix)
|
# (import ./nvidia-container-toolkit-overlay.nix)
|
||||||
(import ./emacs-overlay.nix)
|
(import ./runc-overlay.nix)
|
||||||
(import ./overlay.nix)
|
(import ./emacs-overlay.nix)
|
||||||
# Use codex and claude-code from dedicated flakes with cachix
|
(import ./overlay.nix)
|
||||||
(final: prev: {
|
# Use codex and claude-code from dedicated flakes with cachix
|
||||||
codex = inputs.codex-cli-nix.packages.${prev.stdenv.hostPlatform.system}.default;
|
(final: prev: {
|
||||||
claude-code = inputs.claude-code-nix.packages.${prev.stdenv.hostPlatform.system}.default;
|
codex = inputs.codex-cli-nix.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
git-sync-rs = let
|
claude-code = inputs.claude-code-nix.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
base = inputs.git-sync-rs.packages.${prev.stdenv.hostPlatform.system}.default;
|
git-sync-rs = let
|
||||||
in prev.symlinkJoin {
|
base = inputs.git-sync-rs.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
name = "${base.name}-wrapped";
|
in
|
||||||
paths = [ base ];
|
prev.symlinkJoin {
|
||||||
postBuild = ''
|
name = "${base.name}-wrapped";
|
||||||
ln -s $out/bin/git-sync-rs $out/bin/git-sync-on-inotify
|
paths = [base];
|
||||||
ln -s $out/bin/git-sync-rs $out/bin/git-sync
|
postBuild = ''
|
||||||
'';
|
ln -s $out/bin/git-sync-rs $out/bin/git-sync-on-inotify
|
||||||
};
|
ln -s $out/bin/git-sync-rs $out/bin/git-sync
|
||||||
})
|
'';
|
||||||
] ++ (if config.imalison.nixOverlay.enable then [ inputs.nix.overlays.default ] else []);
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
if config.imalison.nixOverlay.enable
|
||||||
|
then [inputs.nix.overlays.default]
|
||||||
|
else []
|
||||||
|
);
|
||||||
|
|
||||||
# Allow all the things
|
# Allow all the things
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user