nixos-configs/nixosModules/desktop/environment/modules/packages.nix

208 lines
6 KiB
Nix
Raw Normal View History

self: {
config,
lib,
pkgs,
...
}: let
inherit (self.inputs) jellyfin-flake;
in {
imports = [./dolphin.nix];
config = let
inherit (lib) getExe optionals;
inherit (pkgs.writers) writeTOML;
flakeDir = config.environment.variables.FLAKE;
cfg = config.roles.desktop;
isNvidia = config.nvidia.enable;
restartTailscale = pkgs.writeShellScriptBin "restartTailscale" ''
sudo ${pkgs.systemd}/bin/systemctl restart tailscaled.service
'';
in {
programs.kdeconnect.enable = true;
security.sudo.extraRules = [
{
users = [cfg.user];
groups = [100];
commands = [
{
command = "${pkgs.systemd}/bin/systemctl restart tailscaled.service";
options = ["SETENV" "NOPASSWD"];
}
];
}
];
home-manager.users.${cfg.user} = {
imports = [
../home/foot.nix
(import ../home/mpv.nix self)
(import ../home/obs.nix self)
({config, ...}: let
inherit (config.lib.file) mkOutOfStoreSymlink;
configDir = "${flakeDir}/nixosModules/desktop/environment/config";
in {
xdg.configFile = {
"dolphinrc".source = mkOutOfStoreSymlink "${configDir}/dolphinrc";
"kdeglobals".source = mkOutOfStoreSymlink "${configDir}/kdeglobals";
"kiorc".source = mkOutOfStoreSymlink "${configDir}/kiorc";
"mimeapps.list".source = mkOutOfStoreSymlink "${configDir}/mimeapps.list";
"satty/config.toml".source = writeTOML "satty.toml" {
general = {
early-exit = true;
copy-command = "wl-copy";
initial-tool = "crop";
output-filename = "${config.home.homeDirectory}/Pictures/Screenshots/screen-%d-%m-%Y_%H:%M:%S.png";
};
font.family = "Ubuntu Mono";
};
};
})
];
programs.sioyek = {
enable = true;
config = {
startup_commands = "toggle_custom_color";
ui_font = "JetBrainsMono Nerd Font Mono Regular";
font_size = "24";
source = toString self.legacyPackages.${pkgs.system}.dracula.sioyek;
};
};
home.packages =
(builtins.attrValues {
# School
inherit (pkgs.hunspellDicts) en_CA;
inherit
(pkgs)
xournalpp
virt-manager
libreoffice-fresh # TODO: declarative conf?
hunspell
;
# Apps
inherit
(pkgs)
protonmail-desktop
protonmail-bridge
spotifywm
photoqt
nextcloud-client
prismlauncher
;
# tools
inherit
(pkgs)
chore: update flake.lock Flake Inputs: • Updated input 'astal': 'github:Aylur/astal/cb6fd7b' (2024-09-30) → 'github:Aylur/astal/9c2f6ab' (2024-10-02) • Updated input 'gpu-screen-recorder-src': 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=0eb9ce0' (2024-09-29) → 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=793d483' (2024-10-03) • Updated input 'grim-hyprland': 'github:eriedaberrie/grim-hyprland/e09bff0' (2024-05-10) → 'github:eriedaberrie/grim-hyprland/db5b1cc' (2024-10-02) • Updated input 'home-manager': 'github:nix-community/home-manager/ffe2d07' (2024-09-26) → 'github:nix-community/home-manager/437ec62' (2024-10-01) • Updated input 'hyprland': 'github:hyprwm/Hyprland/5c6c300' (2024-09-30) → 'github:hyprwm/Hyprland/de68e06' (2024-10-02) • Updated input 'jovian': 'github:Jovian-Experiments/Jovian-NixOS/3390ff2' (2024-09-27) → 'github:Jovian-Experiments/Jovian-NixOS/703c0ac' (2024-10-02) • Updated input 'nix-gaming': 'github:fufexan/nix-gaming/6401744' (2024-09-29) → 'github:fufexan/nix-gaming/24d805b' (2024-10-02) • Updated input 'nixd': 'github:nix-community/nixd/e5e144f' (2024-09-28) → 'github:nix-community/nixd/c38702b' (2024-10-01) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/06cf0e1' (2024-09-29) → 'github:NixOS/nixpkgs/27e30d1' (2024-10-01) • Updated input 'nixpkgs-wayland': 'github:nix-community/nixpkgs-wayland/50e4446' (2024-09-30) → 'github:nix-community/nixpkgs-wayland/a40e6b0' (2024-10-01) • Updated input 'pcsd': 'github:matt1432/nixos-pcsd/a2ef219' (2024-09-30) → 'github:matt1432/nixos-pcsd/d85a2d4' (2024-10-03) • Updated input 'tuya-local-src': 'github:make-all/tuya-local/f6245ff' (2024-09-30) → 'github:make-all/tuya-local/694579b' (2024-10-03) Docker Images: • vegardit/gitea-act-runner dind-latest: sha256:c265e8cc15e287ca7bef81a1f31e400c6b7c69e787e12d050b8556286a9b6c2e → sha256:5686ce9464839df7333098a61a802d16645d92fa4175b02684a536656d17a28f • ghcr.io/immich-app/immich-machine-learning release: sha256:60d6d3b7090c664b76adabd00c06674e25c5a91419e374bff4e7cf2ee5dd920a → sha256:1221bc54568a0779227baeaa4282bb0e0db50831b66f9ac9afa9d78513df36ad • ghcr.io/immich-app/immich-server release: sha256:effd3d44202964c5f53af85e0fd0f2ca5287c989a43c4d55ba71133eb148bed3 → sha256:ac9fb82f2be3cc60d4e0c7f1ceb371d401d52573e387834d7a82776116458242 • nginx latest: sha256:b5d3f3e104699f0768e5ca8626914c16e52647943c65274d8a9e63072bd015bb → sha256:d2eb56950b84efe34f966a2b92efb1a1a2ea53e7e93b94cdf45a27cf3cd47fc0 • ghcr.io/linuxserver/bazarr latest: sha256:68efaf4f9a6ea072b68e1a8a2925fdc00f931fb1c699d969cae9c16f394b1411 → sha256:137f55b12859e7f6905c513d403ba80dfe3b2afe7fa892c891c1982996a114ba • ghcr.io/linuxserver/prowlarr latest: sha256:a6fc8ab9ff34d82327d29f8b5bfb7a672c0e54a274e5e5b023db01c335d05dfd → sha256:806916104582ff18024b1234a0c82e113c160037f0bf0e6c076e14528bbab331 • ghcr.io/linuxserver/sabnzbd latest: sha256:51df466fb66b6a18d89597a3608bb2ab69ff8aff3131b5bec80e4ed7534b2b9f → sha256:a33738b946bee3bd2a754b2e576643d069ac2913d88290ef13d8e00f0c0e1224 Firefox Addons: darkreader: 4.9.92 -> 4.9.94 ublock-origin: 1.59.0 -> 1.60.0
2024-10-03 09:11:53 -04:00
grim-hyprland
wl-color-picker
wl-clipboard
cliphist
slurp
satty
;
})
++ [
(jellyfin-flake
.packages
.${pkgs.system}
.jellyfin-media-player
.override {isNvidiaWayland = isNvidia;})
/*
Discord themes for Vencord
https://markchan0225.github.io/RoundedDiscord/RoundedDiscord.theme.css
https://raw.githubusercontent.com/dracula/BetterDiscord/master/Dracula_Official.theme.css
*/
(pkgs.discord.override {withVencord = true;})
# GParted
(let
inherit (pkgs) writeShellScriptBin libsForQt5 gparted makeWrapper symlinkJoin;
newWrapper = writeShellScriptBin "Gparted" ''
(
sleep 1.5
while killall -r -0 ksshaskpass > /dev/null 2>&1
do
sleep 0.1
if [[ $(hyprctl activewindow | grep Ksshaskpass) == "" ]]; then
killall -r ksshaskpass
fi
done
) &
exec env SUDO_ASKPASS="${libsForQt5.ksshaskpass}/bin/ksshaskpass" sudo -k -EA "${getExe gparted}" "$@"
'';
in
symlinkJoin {
name = "gparted";
paths = [gparted];
buildInputs = [makeWrapper];
postBuild = let
in ''
mkdir $out/.wrapped
mv $out/bin/gparted $out/.wrapped
cp ${getExe newWrapper} $out/bin/gparted
sed -i "s#Exec.*#Exec=$out/bin/gparted %f#" $out/share/applications/gparted.desktop
'';
})
];
wayland.windowManager.hyprland = {
settings = {
exec-once =
[
"${config.programs.kdeconnect.package}/libexec/kdeconnectd"
"kdeconnect-indicator"
"wl-paste --watch cliphist store"
"sleep 3; nextcloud --background"
2024-08-10 21:53:54 -04:00
"sleep 10; tmux new-session -s protonmail-bridge -d 'bash -c protonmail-bridge -c'"
2024-08-03 21:15:32 -04:00
"[workspace special:protonmail silent] sleep 10; proton-mail"
"[workspace special:spot silent] spotify"
]
++ optionals config.services.tailscale.enable [
"sleep 3; ${getExe restartTailscale}"
];
windowrule = [
"tile,^(libreoffice)$"
"float,^(org.gnome.Calculator)$"
"float,^(com.gabm.satty)$"
"size 1000 700,^(com.gabm.satty)$"
"float,^(com.nextcloud.desktopclient.nextcloud)$"
"move cursor -15 -10,^(com.nextcloud.desktopclient.nextcloud)$"
"size 400 581,^(com.nextcloud.desktopclient.nextcloud)$"
"workspace special:protonmail silent,^(Proton Mail)$"
"workspace special:spot silent,^(Spotify)$"
];
bind = [
"$mainMod, Q, exec, foot"
"$mainMod SHIFT, C, exec, wl-color-picker"
"$mainMod, P, togglespecialworkspace, protonmail"
"$mainMod, S, togglespecialworkspace, spot"
];
};
};
};
};
# For accurate stack trace
_file = ./packages.nix;
}