Desktop: restructure folder structure

This commit is contained in:
Toast 2023-07-04 08:06:17 +02:00
parent bb6c9ea5d1
commit ade2927e8b
7 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./discord.nix
./firefox.nix
./micro.nix
./keepassxc.nix
];
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
let
discordOverlay = self: super: {
discord = super.discord.override {
withOpenASAR = true;
withVencord = true;
};
};
in
{
nixpkgs.overlays = [ discordOverlay ];
users.users.toast.packages = with pkgs; [
discord
];
}

View file

@ -0,0 +1,65 @@
{ config, pkgs, ... }:
{
# System wide firefox settings
programs.firefox = {
enable = true;
policies = {
"DisablePocket" = true;
"DisableTelemetry" = true;
# You need these for Spotify
"EncryptedMediaExtensions" = { "Enabled" = true; };
"ExtensionSettings" = {
# TODO: Install extensions the NUR instead of from AMO
"uBlock0@raymondhill.net" = {
"installation_mode" = "force_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
};
# Decentraleyes
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
};
"jid1-MnnxcxisBPnSXQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
};
};
"Preferences" = {
# Enable video hardware acceleration
"media.ffmpeg.vaapi.enabled" = {
"Value" = true;
"Status" = "default";
};
"dom.security.https_only_mode" = {
"Value" = true;
"Status" = "locked";
};
# Make firefox use the kde file picker
"widget.use-xdg-desktop-portal.file-picker" = {
"Value" = 1;
"Status" = "default";
};
/*
https://wiki.archlinux.org/title/Firefox#KDE_integration tells me to enable this,
but strangely enough doing so makes firefox ask to be set as the default browser
every time you start it up, so I'll disable it
*/
"widget.use-xdg-desktop-portal.mime-handler" = {
"Value" = 0;
"Status" = "default";
};
};
"PromptForDownloadLocation" = true;
# I use an external password manager, so the built in one just bothers me
"PasswordManagerEnabled" = false;
"Permissions" = {
"Autoplay" = {
"Allow" = [ "https://www.youtube.com" ];
"Default" = "block-audio-video";
};
};
"FirefoxHome" = { "SponsoredTopSites" = false; };
};
};
}

View file

@ -0,0 +1,68 @@
{ config, pkgs, lib, ... }:
let
kpxcSettings = lib.generators.toINI {} {
# Not sure what changing this does, I'll leave it alone
General = {
ConfigVersion = 2;
MinimizeAfterUnlock = true;
};
GUI = {
ApplicationTheme = "classic";
MinimizeOnStartup = false;
MinimizeOnClose = true;
MinimizeToTray = true;
ShowTrayIcon = true;
# 0 is icons, 1 is text, 2 is text next to icons, 3 is text under icons, and 4 is follow style
ToolButtonStyle = 0; # Would choose 4 but it's too big for a small window
# monochrome-light, monochrome-dark or colorful
TrayIconAppearance = "monochrome-light";
};
};
in
{
# I'm only using keepass on my user, so I'm installing it with home-manager
home-manager = {
/*
TODO: move home-manager settings into the common role
They are not keepass specific, so they really should
not be here. I'm too lazy to do it now tho :P
*/
backupFileExtension = "backup";
useGlobalPkgs = true;
extraSpecialArgs = { kpxcSettings = kpxcSettings; };
users.toast = { config, pkgs, kpxcSettings, ... }: {
home = {
stateVersion = "23.05";
packages = [ pkgs.keepassxc ];
# No module for KeePassXC config :(
file = {
".config/keepassxc/keepassxc.ini".text = kpxcSettings;
# For some reason the autostart .desktop is not the same as the regular one
".config/autostart/org.keepassxc.KeePassXC.desktop".text = ''
[Desktop Entry]
Name=KeePassXC
GenericName=Password Manager
Exec=keepassxc
TryExec=keepassxc
Icon=keepassxc
StartupWMClass=keepassxc
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Categories=Utility;Security;Qt;
MimeType=application/x-keepass2;
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=2
X-KDE-autostart-after=panel
X-LXQt-Need-Tray=true
'';
};
};
};
};
}

View file

@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
{
home-manager = {
users.toast = { config, pkgs, ... }:
{
programs.micro = {
enable = true;
settings = {
# Use xclip/wl-clipboard for copying and pasting
clipboard = lib.mkForce "external";
};
};
/*
On a kde wayland session micro uses xsel or xclip instead of wl-clipboard
which doesn't work, so I only install wl-clipboard here to make micro use it
*/
home.packages = with pkgs; [ wl-clipboard ];
};
};
}