mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-25 19:35:37 +00:00
66 lines
2.0 KiB
Nix
66 lines
2.0 KiB
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
options = {
|
|
nautilus = {
|
|
enable = lib.mkEnableOption {
|
|
description = "Enable Nautilus file manager.";
|
|
default = false;
|
|
};
|
|
};
|
|
};
|
|
|
|
# Install Nautilus file manager
|
|
config = lib.mkIf (config.gui.enable && config.nautilus.enable) {
|
|
|
|
# Quick preview with spacebar
|
|
services.gnome.sushi.enable = true;
|
|
environment.systemPackages = [ pkgs.gnome.nautilus ];
|
|
|
|
home-manager.users.${config.user} = {
|
|
|
|
# Quick button for launching nautilus
|
|
xsession.windowManager.i3.config.keybindings = {
|
|
"${
|
|
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
|
}+n" = "exec --no-startup-id ${pkgs.gnome.nautilus}/bin/nautilus";
|
|
};
|
|
|
|
# Generates a QR code and previews it with sushi
|
|
programs.fish.functions = {
|
|
qr = {
|
|
body =
|
|
"${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.gnome.sushi}/bin/sushi /tmp/qr.png";
|
|
};
|
|
};
|
|
|
|
# Set Nautilus as default for opening directories
|
|
xdg.mimeApps = {
|
|
associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
|
# associations.removed = {
|
|
# "inode/directory" = [ "kitty-open.desktop" ];
|
|
# };
|
|
defaultApplications."inode/directory" =
|
|
lib.mkBefore [ "org.gnome.Nautilus.desktop" ];
|
|
};
|
|
|
|
};
|
|
|
|
# # Set default for opening directories
|
|
# xdg.mime = {
|
|
# addedAssociations."inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
|
# removedAssociations = { "inode/directory" = [ "kitty-open.desktop" ]; };
|
|
# defaultApplications."inode/directory" =
|
|
# lib.mkForce [ "org.gnome.Nautilus.desktop" ];
|
|
# };
|
|
|
|
# Delete Trash files older than 1 week
|
|
systemd.user.services.empty-trash = {
|
|
description = "Empty Trash on a regular basis";
|
|
wantedBy = [ "default.target" ];
|
|
script = "${pkgs.trash-cli}/bin/trash-empty 7";
|
|
};
|
|
|
|
};
|
|
|
|
}
|