Skip to content

Commit

Permalink
home-manager/desktop: convert it to module
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Sep 28, 2023
1 parent b070bac commit 71eb43c
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 126 deletions.
14 changes: 0 additions & 14 deletions home-manager/chromium.nix

This file was deleted.

2 changes: 1 addition & 1 deletion home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
imports = [
./cli
./desktop.nix
./desktop
./emacs
./i3
./kitty.nix
Expand Down
75 changes: 0 additions & 75 deletions home-manager/desktop.nix

This file was deleted.

20 changes: 20 additions & 0 deletions home-manager/desktop/chromium.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:

{
options.home-manager.desktop.chromium.enable = lib.mkEnableOption "Chromium config" // {
default = config.home-manager.desktop.enable;
};

config = lib.mkIf config.home-manager.desktop.chromium.enable {
programs.chromium = {
enable = true;
package = pkgs.chromium.override {
enableWideVine = true;
};
extensions = [
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
{ id = "hfjbmagddngcpeloejdejnfgbamkjaeg"; } # vimium-c
];
};
};
}
79 changes: 79 additions & 0 deletions home-manager/desktop/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{ config, pkgs, lib, ... }:

{
imports = [
./chromium.nix
./firefox.nix
];

options.home-manager.desktop.enable = lib.mkDefaultOption "desktop config";

config = lib.mkIf config.home-manager.desktop.enable {
home.packages = with pkgs; [
android-file-transfer
audacious
(calibre.override { unrarSupport = true; })
(cinnamon.nemo-with-extensions.override { extensions = with cinnamon; [ nemo-fileroller ]; })
desktop-file-utils
ffmpeg
gammastep
gimp
gnome.evince
gnome.file-roller
gnome.gnome-disk-utility
gthumb
inkscape
libreoffice-fresh
open-browser
(mcomix.override { unrarSupport = true; })
pavucontrol
pinta
qalculate-gtk
vlc
xclip
xdotool
xdragon
xorg.xdpyinfo
xorg.xhost
xorg.xkill
xorg.xset
zoom-us
];

services = {
easyeffects.enable = true;
udiskie = {
enable = true;
tray = "always";
};
};

xdg = {
# Some applications like to overwrite this file, so let's just force it
configFile."mimeapps.list".force = true;

mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = "org.gnome.Evince.desktop";
"image/gif" = "org.gnome.gThumb.desktop";
"image/jpeg" = "org.gnome.gThumb.desktop";
"image/png" = "org.gnome.gThumb.desktop";
"inode/directory" = "nemo.desktop";
"text/html" = "open-browser.desktop";
"text/plain" = "emacs.desktop";
"text/x-makefile" = "emacs.desktop";
"x-scheme-handler/about" = "open-browser.desktop";
"x-scheme-handler/http" = "open-browser.desktop";
"x-scheme-handler/https" = "open-browser.desktop";
"x-scheme-handler/unknown" = "open-browser.desktop";
};
};

userDirs = {
enable = true;
createDirectories = true;
};
};
};
}
42 changes: 42 additions & 0 deletions home-manager/desktop/firefox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ config, lib, osConfig, ... }:

let
inherit (config.home) username;
subpixelRender = (osConfig.fonts.fontconfig.antialias or false) &&
(osConfig.fonts.fontconfig.subpixel.rgba != "none");
in
{
options.home-manager.desktop.firefox.enable = lib.mkEnableOption "Firefox config" // {
default = config.home-manager.desktop.enable;
};

config = lib.mkIf config.home-manager.desktop.firefox.enable {
programs.firefox = {
enable = true;
profiles.${username} = {
settings = {
# disable annoyinh Ctrl+Q shortcut
"browser.quitShortcut.disabled" = true;
# enable hw video acceleration, if supported
"media.ffmpeg.vaapi.enabled" = true;
# handpicked settings from: https://github.com/arkenfox/user.js/blob/master/user.js
# ads
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
# telemetry
"datareporting.policy.dataSubmissionEnable" = false;
"datareporting.healthreport.uploadEnabled" = false;
"app.shield.optoutstudies.enabled" = false;
"app.normandy.enabled" = false;
"browser.tabs.crashReporting.sendReport" = false;
} // lib.optionalAttrs subpixelRender {
# https://pandasauce.org/get-fonts-done/
"gfx.text.subpixel-position.force-enabled" = true;
"gfx.webrender.quality.force-subpixel-aa-where-possible" = true;
};
};
};
};
}
36 changes: 0 additions & 36 deletions home-manager/firefox.nix

This file was deleted.

0 comments on commit 71eb43c

Please sign in to comment.