Make discord parts of default associations
This commit is contained in:
parent
1804a8e4a9
commit
14fc51fe18
4 changed files with 25 additions and 38 deletions
|
@ -25,7 +25,6 @@ in
|
|||
./modules/monitors.nix
|
||||
./modules/linux/graphical
|
||||
./modules/X11/xfce4-notifyd.nix
|
||||
./modules/programs/discord.nix
|
||||
kwallet
|
||||
];
|
||||
config = (mkIf pkgs.stdenv.isLinux {
|
||||
|
|
|
@ -3,7 +3,6 @@ with lib;
|
|||
let
|
||||
cfg = config.linux.graphical;
|
||||
|
||||
thunderbird = pkgs.thunderbird-128;
|
||||
vscode = with pkgs; if stdenv.isAarch64 then unstable.vscode else unstable.vscode-fhs;
|
||||
|
||||
wifi-indicator = pkgs.writeScriptBin "wifi-indicator" ''
|
||||
|
@ -52,15 +51,16 @@ in
|
|||
startup = mkOption {
|
||||
type = types.listOf types.package;
|
||||
description = "List of packages to include in ~/.config/autostart";
|
||||
default = with pkgs; [
|
||||
default = [
|
||||
cfg.defaults.webBrowser.package
|
||||
thunderbird
|
||||
vesktop
|
||||
pkgs.thunderbird
|
||||
cfg.defaults.discord.package
|
||||
];
|
||||
};
|
||||
defaults = {
|
||||
webBrowser = mkPackageWithDesktopOption { description = "default web browser"; };
|
||||
terminal = mkPackageWithDesktopOption { description = "default terminal"; default.package = pkgs.kitty; };
|
||||
discord = mkPackageWithDesktopOption { description = "Discord client"; default.package = pkgs.vesktop; };
|
||||
};
|
||||
};
|
||||
config = mkIf (cfg.type != null) {
|
||||
|
@ -106,9 +106,6 @@ in
|
|||
wifi-indicator
|
||||
] ++ cfg.startup);
|
||||
|
||||
nki.programs.discord.enable = pkgs.stdenv.isx86_64;
|
||||
nki.programs.discord.package = pkgs.vesktop;
|
||||
|
||||
# OBS
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
|
@ -146,6 +143,14 @@ in
|
|||
"application/x-extension-rss" = [ "thunderbird.desktop" ];
|
||||
"x-scheme-handler/tg2" = [ "org.telegram.desktop.desktop" ];
|
||||
"x-scheme-handler/tonsite2" = [ "org.telegram.desktop.desktop" ];
|
||||
|
||||
# Other browser stuff
|
||||
"application/x-extension-htm" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-html" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-shtml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/xhtml+xml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-xhtml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-xht" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
# Email
|
||||
|
@ -164,6 +169,7 @@ in
|
|||
|
||||
# Default web browser stuff
|
||||
"text/html" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/chrome" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/about" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/unknown" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/http" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
|
@ -171,6 +177,12 @@ in
|
|||
"x-scheme-handler/ftp" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/ftps" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"x-scheme-handler/file" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-htm" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-html" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-shtml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/xhtml+xml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-xhtml" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
"application/x-extension-xht" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||
|
||||
# Torrent
|
||||
"application/x-bittorrent" = [ "deluge.desktop" ];
|
||||
|
@ -186,13 +198,16 @@ in
|
|||
# Telegram
|
||||
"x-scheme-handler/tg2" = "org.telegram.desktop.desktop";
|
||||
"x-scheme-handler/tonsite2" = "org.telegram.desktop.desktop";
|
||||
|
||||
# Discord
|
||||
"x-scheme-handler/discord" = [ (desktopFileOf cfg.defaults.discord) ];
|
||||
};
|
||||
|
||||
# Add one for kakoune
|
||||
xdg.desktopEntries."kakoune" = {
|
||||
name = "Kakoune";
|
||||
genericName = "Text Editor";
|
||||
exec = ''kitty --class kitty-float -o initial_window_width=150c -o initial_window_height=40c ${pkgs.writeShellScript "editor.sh" ''
|
||||
exec = ''${lib.getExe pkgs.kitty} --class kitty-float -o initial_window_width=150c -o initial_window_height=40c ${pkgs.writeShellScript "editor.sh" ''
|
||||
$EDITOR "$@"
|
||||
''} %U'';
|
||||
# exec = "kakoune %U";
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nki.programs.discord;
|
||||
in
|
||||
{
|
||||
options.nki.programs.discord = {
|
||||
enable = mkEnableOption "Enable discord";
|
||||
|
||||
basePackage = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.discord;
|
||||
description = "The base Discord package that will get patched";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = cfg.basePackage.override { nss = pkgs.nss_latest; };
|
||||
description = "The actual package to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, options, config, lib, ... }:
|
||||
|
||||
let
|
||||
iio-sway = pkgs.stdenv.mkDerivation {
|
||||
|
@ -44,7 +44,7 @@ in
|
|||
# Graphical set up
|
||||
linux.graphical.type = "wayland";
|
||||
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
||||
linux.graphical.startup = with pkgs; [ zen-browser-bin thunderbird vesktop slack ];
|
||||
linux.graphical.startup = options.linux.graphical.startup.default ++ [ pkgs.slack ];
|
||||
linux.graphical.defaults.webBrowser.package = pkgs.zen-browser-bin;
|
||||
linux.graphical.defaults.webBrowser.desktopFile = "zen.desktop";
|
||||
# Enable sway
|
||||
|
|
Loading…
Add table
Reference in a new issue