dotfiles/nix/home/desktop.nix
2022-03-15 23:23:57 -07:00

81 lines
2.1 KiB
Nix

{ pkgs, ... }:
let
defaultPkgs = with pkgs; [
calibre
dmenu
firefox
multilockscreen
mullvad-vpn
obsidian
signal-desktop
spotify
slack
# Do NOT use qbittorrent unless you have set up interface binding with your
# VPN: https://web.archive.org/web/20210426203102/https://mullvad.net/en/help/bittorrent/
qbittorrent
vlc
zathura
zoom-us
];
gnomePkgs = with pkgs; [
gnomecast
gnome.gnome-tweaks
# TODO: enable after experimenting with multi-monitor support and workspaces:
# https://github.com/paperwm/PaperWM#recommended-gnome-shell-settings
# gnomeExtensions.paperwm
gnomeExtensions.worksets
];
in
{
imports = [ (import ./commandline.nix) ] ++ [ (import ./programs/rofi) ];
nixpkgs.overlays = [ (import .././overlays/paperwm.nix) ];
home = {
packages = defaultPkgs ++ gnomePkgs;
};
dconf.settings =
let
inherit (builtins) length head tail listToAttrs genList;
range = a: b: if a < b then [ a ] ++ range (a + 1) b else [ ];
# TODO: something similar for org/gnome/desktop/wm/keybindings
globalPath = "org/gnome/settings-daemon/plugins/media-keys";
path = "${globalPath}/custom-keybindings";
mkPath = id: "${globalPath}/custom${toString id}";
isEmpty = list: length list == 0;
mkSettings = settings:
let
checkSettings = { name, command, binding }@this: this;
aux = i: list:
if isEmpty list then [ ] else
let
hd = head list;
tl = tail list;
name = mkPath i;
in
aux (i + 1) tl ++ [{
name = mkPath i;
value = checkSettings hd;
}];
settingsList = (aux 0 settings);
in
listToAttrs (settingsList ++ [
{
name = globalPath;
value = {
custom-keybindings = genList (i: "/${mkPath i}/") (length settingsList);
};
}
]);
in
mkSettings [
{
name = "rofi-run";
command = "rofi -show run -normal-window";
binding = "<Primary>d";
}
];
}