dotfiles/nix/home/desktop.nix

77 lines
1.9 KiB
Nix
Raw Normal View History

2021-10-05 23:42:21 -07:00
{ pkgs, ... }:
let
defaultPkgs = with pkgs; [
calibre
dmenu
firefox
multilockscreen
2022-01-08 18:12:02 -08:00
mullvad-vpn
obsidian
2021-10-05 23:42:21 -07:00
signal-desktop
spotify
2021-10-05 23:42:21 -07:00
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/
2022-01-08 18:12:02 -08:00
qbittorrent
2021-10-05 23:42:21 -07:00
vlc
zathura
zoom-us
];
gnomePkgs = with pkgs; [
gnomecast
gnome.gnome-tweaks
gnomeExtensions.worksets
2021-10-05 23:42:21 -07:00
];
in
{
imports = [ (import ./commandline.nix) ] ++ [ (import ./programs/rofi) ];
2021-10-05 23:42:21 -07:00
home = {
packages = defaultPkgs ++ gnomePkgs;
2021-10-05 23:42:21 -07:00
};
2022-03-15 22:48:27 -07:00
dconf.settings =
let
inherit (builtins) length head tail listToAttrs genList;
range = a: b: if a < b then [ a ] ++ range (a + 1) b else [ ];
2022-03-15 23:00:07 -07:00
# TODO: something similar for org/gnome/desktop/wm/keybindings
2022-03-15 22:48:27 -07:00
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";
}
];
2021-10-05 23:42:21 -07:00
}