1
0
Fork 0
forked from Bun/nixos-config

Move more things to xdg paths

This commit is contained in:
Bun 2025-05-14 14:57:32 -04:00
parent 04560dfbc5
commit c41543edcf
23 changed files with 491 additions and 566 deletions

View file

@ -4,37 +4,24 @@
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.librewolf; package = pkgs.librewolf;
profiles = let profiles.default = {
# FireFox css, based on https://github.com/Dook97/firefox-qutebrowser-userchrome isDefault = true;
themeFont = '' containersForce = true;
--tab-font: '${config.look.fonts.main}';
--urlbar-font: '${config.look.fonts.main}';
'';
themeMain = ''
:root {
--tab-active-bg-color: #${config.look.colors.prime};
--tab-hover-bg-color: #${config.look.colors.accent};
--tab-inactive-bg-color: #${config.look.colors.dark};
--tab-active-fg-fallback-color: #FFFFFF;
--tab-inactive-fg-fallback-color: #${config.look.colors.text};
--urlbar-focused-bg-color: #${config.look.colors.dark};
--urlbar-not-focused-bg-color: #${config.look.colors.dark};
--toolbar-bgcolor: #${config.look.colors.dark} !important;
'';
themeAlt = ''
:root {
--tab-active-bg-color: #${config.look.colors.dark};
--tab-hover-bg-color: #${config.look.colors.accent};
--tab-inactive-bg-color: #${config.look.colors.prime};
--tab-active-fg-fallback-color: #${config.look.colors.text};
--tab-inactive-fg-fallback-color: #FFFFFF;
--urlbar-focused-bg-color: #${config.look.colors.prime};
--urlbar-not-focused-bg-color: #${config.look.colors.prime};
--toolbar-bgcolor: #${config.look.colors.prime} !important;
'';
# Profile settings containers = {
commonExtensions = with pkgs.nur.repos.rycee.firefox-addons; [ home = {
color = "purple";
icon = "fruit";
id = 0;
};
school = {
color = "red";
icon = "briefcase";
id = 1;
};
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden bitwarden
darkreader darkreader
return-youtube-dislikes return-youtube-dislikes
@ -43,7 +30,8 @@
ublock-origin ublock-origin
violentmonkey violentmonkey
]; ];
commonSearch = {
search = {
force = true; force = true;
default = "Ecosia"; default = "Ecosia";
order = [ order = [
@ -64,6 +52,7 @@
}]; }];
definedAliases = [ "@e" ]; definedAliases = [ "@e" ];
}; };
"NixPKGs" = { "NixPKGs" = {
urls = [{ urls = [{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
@ -80,6 +69,7 @@
}]; }];
definedAliases = [ "@p" ]; definedAliases = [ "@p" ];
}; };
"MyNixOS" = { "MyNixOS" = {
urls = [{ urls = [{
template = "https://mynixos.com/search"; template = "https://mynixos.com/search";
@ -90,6 +80,7 @@
}]; }];
definedAliases = [ "@my" ]; definedAliases = [ "@my" ];
}; };
"YouTube" = { "YouTube" = {
urls = [{ urls = [{
template = "https://www.youtube.com/results"; template = "https://www.youtube.com/results";
@ -100,13 +91,17 @@
}]; }];
definedAliases = [ "@y" ]; definedAliases = [ "@y" ];
}; };
"Spotify" = { "Spotify" = {
urls = [{ template = "https://open.spotify.com/search/{searchTerms}"; }]; urls = [{ template = "https://open.spotify.com/search/{searchTerms}"; }];
definedAliases = [ "@s" ]; definedAliases = [ "@s" ];
}; };
}; };
}; };
commonSettings = {
settings = {
force = true;
# Generic # Generic
"browser.download.useDownloadDir" = true; "browser.download.useDownloadDir" = true;
"browser.shell.checkDefaultBrowser" = false; "browser.shell.checkDefaultBrowser" = false;
@ -121,9 +116,9 @@
"webgl.disabled" = false; "webgl.disabled" = false;
# Fonts # Fonts
"font.name.serif.x-western" = config.look.fonts.main;
"font.name.sans-serif.x-western" = config.look.fonts.main;
"font.name.monospace.x-western" = config.look.fonts.mono; "font.name.monospace.x-western" = config.look.fonts.mono;
"font.name.sans-serif.x-western" = config.look.fonts.main;
"font.name.serif.x-western" = config.look.fonts.main;
# Theming and visibility # Theming and visibility
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;
@ -143,47 +138,46 @@
"browser.newtabpage.enabled" = false; "browser.newtabpage.enabled" = false;
# Safe browsing # Safe browsing
"browser.safebrowsing.blockedURIs.enabled" = false;
"browser.safebrowsing.downloads.enabled" = false; "browser.safebrowsing.downloads.enabled" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.malware.enabled" = false; "browser.safebrowsing.malware.enabled" = false;
"browser.safebrowsing.phishing.enabled" = false; "browser.safebrowsing.phishing.enabled" = false;
"browser.safebrowsing.blockedURIs.enabled" = false;
"browser.safebrowsing.provider.google4.gethashURL" = false;
"browser.safebrowsing.provider.google4.updateURL" = false;
"browser.safebrowsing.provider.google.gethashURL" = false; "browser.safebrowsing.provider.google.gethashURL" = false;
"browser.safebrowsing.provider.google.updateURL" = false; "browser.safebrowsing.provider.google.updateURL" = false;
"browser.safebrowsing.provider.google4.gethashURL" = false;
"browser.safebrowsing.provider.google4.updateURL" = false;
# Extensions # Extensions
"extensions.pocket.enabled" = false;
"extensions.formautofill.addresses.enabled" = false; "extensions.formautofill.addresses.enabled" = false;
"extensions.formautofill.creditCards.enabled" = false; "extensions.formautofill.creditCards.enabled" = false;
"extensions.getAddons.showPane" = false; "extensions.getAddons.showPane" = false;
"extensions.htmlaboutaddons.discover.enabled" = false; "extensions.htmlaboutaddons.discover.enabled" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false; "extensions.htmlaboutaddons.recommendations.enabled" = false;
"extensions.pocket.enabled" = false;
# Force extensions to work # Force extensions to work
"extensions.autoDisableScopes" = 0; "extensions.autoDisableScopes" = 0;
"extensions.enabledScopes" = 15; "extensions.enabledScopes" = 15;
# Privacy # Privacy
"privacy.resistFingerprinting" = true;
"privacy.firstparty.isolate" = true;
"privacy.fingerprintingProtection" = true;
"privacy.globalprivacycontrol.enabled" = true;
"privacy.globalprivacycontrol.functionality.enabled" = true;
"privacy.clearOnShutdown.cookies" = false; "privacy.clearOnShutdown.cookies" = false;
"privacy.clearOnShutdown_v2.cookiesAndStorage" = false; "privacy.clearOnShutdown_v2.cookiesAndStorage" = false;
"privacy.fingerprintingProtection" = true;
"privacy.firstparty.isolate" = true;
"privacy.globalprivacycontrol.enabled" = true;
"privacy.globalprivacycontrol.functionality.enabled" = true;
"privacy.resistFingerprinting" = true;
# Tracking URL blocking # Tracking URL blocking
"urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com";
"urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com"; "urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com";
"urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com";
# Network tracking # Network tracking
"browser.contentblocking.category" = "strict"; "browser.contentblocking.category" = "strict";
"network.cookie.cookieBehavior" = 1; "network.cookie.cookieBehavior" = 1;
"network.cookie.sameSite.noneRequiresSecure" = true;
"network.http.referer.XOriginPolicy" = 2; "network.http.referer.XOriginPolicy" = 2;
"network.http.referer.XOriginTrimmingPolicy" = 2; "network.http.referer.XOriginTrimmingPolicy" = 2;
"network.http.referer.trimmingPolicy" = 2; "network.http.referer.trimmingPolicy" = 2;
@ -209,40 +203,28 @@
"services.sync.engine.addresses.available" = false; "services.sync.engine.addresses.available" = false;
"svg.context-properties.content.enabled" = true; "svg.context-properties.content.enabled" = true;
}; };
in {
Main = {
id = 0;
isDefault = true;
extensions = commonExtensions;
search = commonSearch;
settings = commonSettings;
userChrome = '' userChrome = ''
${themeMain} :root {
${themeFont} --tab-active-bg-color: #${config.look.colors.prime};
--tab-hover-bg-color: #${config.look.colors.accent};
--tab-inactive-bg-color: #${config.look.colors.dark};
--tab-active-fg-fallback-color: #FFFFFF;
--tab-inactive-fg-fallback-color: #${config.look.colors.text};
--urlbar-focused-bg-color: #${config.look.colors.dark};
--urlbar-not-focused-bg-color: #${config.look.colors.dark};
--toolbar-bgcolor: #${config.look.colors.dark} !important;
--tab-font: '${config.look.fonts.main}';
--urlbar-font: '${config.look.fonts.main}';
${builtins.readFile ./quteFox.css} ${builtins.readFile ./quteFox.css}
''; '';
}; };
Alt = {
id = 1;
extensions = commonExtensions;
search = commonSearch;
settings = commonSettings;
userChrome = ''
${themeAlt}
${themeFont}
${builtins.readFile ./quteFox.css}
'';
};
};
}; };
# Symlinks to Librewolf # Symlinks to Librewolf
home = { home = {
file = { file.".librewolf".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.mozilla/firefox";
".librewolf".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.mozilla/firefox"; persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "browser/.mozilla/firefox/default" ];
".mozilla/librewolf".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.mozilla/firefox";
};
persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "browser/.mozilla" ];
}; };
}; };
} }

View file

@ -8,10 +8,10 @@
steam steam
steam-run-free steam-run-free
]; ];
persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = with lib; with config.home; with config.xdg; [
"games/.config/heroic" "games/${removePrefix "${homeDirectory}/" configHome}/heroic"
"games/.local/share/PrismLauncher" "games/${removePrefix "${homeDirectory}/" dataHome}/PrismLauncher"
"games/.local/share/Steam" "games/${removePrefix "${homeDirectory}/" dataHome}/Steam"
]; ];
}; };

View file

@ -6,9 +6,9 @@
qbittorrent qbittorrent
vesktop vesktop
]; ];
persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = with lib; with config.home; with config.xdg; [
"data/.config/qBittorrent" "data/${removePrefix "${homeDirectory}/" configHome}/qBittorrent"
"data/.config/vesktop" "data/${removePrefix "${homeDirectory}/" configHome}/vesktop"
]; ];
}; };
} }

View file

@ -8,10 +8,10 @@
blender_4_4 blender_4_4
krita krita
]; ];
persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = with lib; with config.home; with config.xdg; [
"data/.config/audacity" "data/${removePrefix "${homeDirectory}/" configHome}/audacity"
"data/.config/blender" "data/${removePrefix "${homeDirectory}/" configHome}/blender"
"data/.local/share/krita" "data/${removePrefix "${homeDirectory}/" dataHome}/krita"
]; ];
}; };
} }

View file

@ -11,13 +11,12 @@
shellAliases.seneca = "ssh jhampton1@matrix.senecapolytechnic.ca"; shellAliases.seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = with lib; with config.home; with config.xdg; [
"school/.cache/gpclient" "school/${removePrefix "${homeDirectory}/" cacheHome}/gpclient"
"school/.config/com.yuezk.qt" "school/${removePrefix "${homeDirectory}/" configHome}/com.yuezk.qt"
"school/.config/remmina" "school/${removePrefix "${homeDirectory}/" configHome}/remmina"
"school/.config/teams-for-linux" "school/${removePrefix "${homeDirectory}/" configHome}/teams-for-linux"
"school/.vmware" "school/.vmware"
"school/vmware"
]; ];
}; };
} }

View file

@ -1,97 +0,0 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": "xenia",
"color": {
"1": "1;97",
"2": "red",
"3": "yellow"
}
},
"display": {
"separator": " \u001b[33m ",
"color": "red"
},
"modules": [
{
"type": "custom",
"format": "\u001b[1m—————————————————————————————————————"
},
{
"type": "host",
"key": "󰌢 "
},
{
"type": "cpu",
"key": " "
},
{
"type": "gpu",
"key": "󰢮 "
},
{
"type": "disk",
"folders": "/",
"key": " "
},
{
"type": "memory",
"format": "{/1}{-}{/}{/2}{-}{/}{} / {}",
"key": " "
},
{
"type": "display",
"compactType": "original",
"key": "󰍹 "
},
{
"type": "custom",
"format": "\u001b[1m—————————————————————————————————————"
},
{
"type": "os",
"format": "{3} {12}",
"key": "󰍛 "
},
{
"type": "kernel",
"format": "{1} {2}",
"key": " "
},
{
"type": "wm",
"key": " "
},
{
"type": "shell",
"key": " "
},
{
"type": "terminal",
"key": " "
},
{
"type": "packages",
"key": "󰆧 "
},
{
"type": "uptime",
"key": "󰅐 "
},
{
"type": "command",
"text": "date -d @$(stat -c %W /persist) '+%a %b %d %r %Y'",
"key": "󰶡 "
},
{
"type": "custom",
"format": "\u001b[1m—————————————————————————————————————"
},
{
"type": "custom",
"format": "\u001b[90m󰮯 \u001b[31m󰊠 \u001b[32m󰊠 \u001b[33m󰊠 \u001b[34m󰊠 \u001b[35m󰊠 \u001b[36m󰊠 \u001b[37m󰊠"
}
]
}

View file

@ -1,11 +1,108 @@
{ pkgs, ... }: { ... }:
{ {
programs.fastfetch.enable = true; imports = [ ./smallfetch ];
home = { programs.fastfetch = {
shellAliases.ff = "clear && fastfetch"; enable = true;
packages = with pkgs; [ (writeScriptBin "smallfetch" "fastfetch --config ~/.config/fastfetch/small.jsonc") ]; settings = {
logo = {
source = "xenia";
color = {
"1" = "1;97";
"2" = "red";
"3" = "yellow";
};
}; };
xdg.configFile."fastfetch".source = ./configs; display = {
separator = '' \u001b[33m '';
color = "red";
};
modules = [
{
type = "custom";
format = ''\u001b[1m'';
}
{
type = "host";
key = "󰌢 ";
}
{
type = "cpu";
key = " ";
}
{
type = "gpu";
key = "󰢮 ";
}
{
type = "disk";
folders = "/";
key = " ";
}
{
type = "memory";
format = "{/1};-}{/}{/2}{-}{/}{} / {}";
key = " ";
}
{
type = "display";
compactType = "original";
key = "󰍹 ";
}
{
type = "custom";
format = ''\u001b[1m'';
}
{
type = "os";
format = "{3} {12}";
key = "󰍛 ";
}
{
type = "kernel";
format = "{1} {2}";
key = " ";
}
{
type = "wm";
key = " ";
}
{
type = "shell";
key = " ";
}
{
type = "terminal";
key = " ";
}
{
type = "packages";
key = "󰆧 ";
}
{
type = "uptime";
key = "󰅐 ";
}
{
type = "command";
text = "date -d @$(stat -c %W /persist) '+%a %b %d %r %Y'";
key = "󰶡 ";
}
{
type = "custom";
format = ''\u001b[1m'';
}
{
type = "custom";
format = ''\u001b[90m󰮯 \u001b[31m󰊠 \u001b[32m󰊠 \u001b[33m󰊠 \u001b[34m󰊠 \u001b[35m󰊠 \u001b[36m󰊠 \u001b[37m󰊠'';
}
];
};
};
home.shellAliases.ff = "clear && fastfetch";
} }

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeScriptBin "smallfetch" ''
#!/bin/sh
fastfetch --config ${builtins.toString ./config.jsonc}
'')
];
}

View file

@ -2,5 +2,5 @@
{ {
programs.nix-index.enable = true; programs.nix-index.enable = true;
home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "nix/.cache/nix-index" ]; home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "state/.cache/nix-index" ];
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -16,6 +16,7 @@
}; };
history = { history = {
append = true; append = true;
expireDuplicatesFirst = true;
ignoreAllDups = true; ignoreAllDups = true;
ignoreSpace = true; ignoreSpace = true;
path = "$ZDOTDIR/.zsh_history"; path = "$ZDOTDIR/.zsh_history";
@ -26,5 +27,6 @@
''; '';
}; };
home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "state/.config/zsh" ]; home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = with lib; with config.home; with config.xdg;
[ "state/${removePrefix "${homeDirectory}/" configHome}/zsh" ];
} }

View file

@ -5,5 +5,7 @@
enableSshSupport = true; enableSshSupport = true;
}; };
programs.gpg.enable = true;
home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "secure/.gnupg" ]; home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}".directories = [ "secure/.gnupg" ];
} }

View file

@ -3,22 +3,23 @@
imports = [ impermanence.homeManagerModules.default ]; imports = [ impermanence.homeManagerModules.default ];
home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}" = { home.persistence."${config.xdg.userDirs.extraConfig.XDG_PERSIST_DIR}" = {
enable = true;
allowOther = false; allowOther = false;
removePrefixDirectory = true; removePrefixDirectory = true;
directories = [ directories = let
"dirs/Keepers" home = config.home.homeDirectory;
"dirs/Projects" strip = path: lib.removePrefix "${home}/" path;
in with config.xdg.userDirs; [
"nix/.local/state/nix/profiles" "dirs/${strip extraConfig.XDG_KEEPERS_DIR}"
"dirs/${strip extraConfig.XDG_PROJECTS_DIR}"
"secure/.ssh" "secure/.ssh"
] ++ (if config.home.desktop.enable then [ ] ++ (if config.home.desktop.enable then [
"dirs/Documents" "dirs/${strip documents}"
"dirs/Games" "dirs/${strip extraConfig.XDG_GAMES_DIR}"
"dirs/Photos" "dirs/${strip pictures}"
"dirs/Videos" "dirs/${strip videos}"
"secure/.pki" "state/${strip config.xdg.stateHome}/wireplumber"
"state/.local/state/wireplumber"
] else []); ] else []);
}; };
} }

View file

@ -1,9 +1,11 @@
{ ... }: { config, ... }:
{ {
imports = [ imports = [
./defaults ./defaults
./folders ./folders
]; ];
xdg.enable = config.home.desktop.enable;
home.preferXdgDirectories = true; home.preferXdgDirectories = true;
} }

View file

@ -1,6 +1,8 @@
{ ... }: { config, ... }:
{ {
xdg.mimeApps.defaultApplications = { xdg.mimeApps = {
enable = config.xdg.enable;
defaultApplications = {
# Media # Media
"image/*" = [ "imv.desktop" ]; "image/*" = [ "imv.desktop" ];
"image/gif" = [ "mpv.desktop" ]; "image/gif" = [ "mpv.desktop" ];
@ -15,4 +17,5 @@
"x-scheme-handler/http" = [ "librewolf.desktop" ]; "x-scheme-handler/http" = [ "librewolf.desktop" ];
"x-scheme-handler/https" = [ "librewolf.desktop" ]; "x-scheme-handler/https" = [ "librewolf.desktop" ];
}; };
};
} }

View file

@ -1,17 +1,20 @@
{ config, ... }: { config, ... }:
{ {
xdg.userDirs = { xdg.userDirs = with config.home; {
enable = config.home.desktop.enable; enable = config.xdg.enable;
createDirectories = true; createDirectories = true;
desktop = null; desktop = null;
pictures = "${config.home.homeDirectory}/Photos";
music = null; music = null;
pictures = "${homeDirectory}/Photos";
publicShare = null; publicShare = null;
templates = null; templates = null;
extraConfig = { extraConfig = {
XDG_PERSIST_DIR = if !config.targets.genericLinux.enable then "/persist${config.home.homeDirectory}" else "${config.home.homeDirectory}/.stow"; XDG_GAMES_DIR = "${homeDirectory}/Games";
XDG_KEEPERS_DIR = "${homeDirectory}/Keepers";
XDG_PERSIST_DIR = if !config.targets.genericLinux.enable then "/persist${homeDirectory}" else "${homeDirectory}/.stow";
XDG_PROJECTS_DIR = "${homeDirectory}/Projects";
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
}; };
}; };

View file

@ -1,10 +1,6 @@
{ config, lib, ... }: { ... }:
{ {
options.look.border = lib.mkOption { look.border = rec {
type = lib.types.attrs;
};
config.look.border = rec {
int = 3; int = 3;
string = toString int; string = toString int;
}; };

View file

@ -1,10 +1,6 @@
{ config, lib, ... }: { ... }:
{ {
options.look.colors = lib.mkOption { look.colors = {
type = lib.types.attrs;
};
config.look.colors = {
prime = "3823C4"; #3823C4 prime = "3823C4"; #3823C4
accent = "1B1F59"; #1B1F59 accent = "1B1F59"; #1B1F59
split = "555B9E"; #555B9E split = "555B9E"; #555B9E

View file

@ -1,8 +1,12 @@
{ ... }: { config, lib, ... }:
{ {
imports = [ imports = [
./border ./border
./colors ./colors
./fonts ./fonts
]; ];
options.look = lib.mkOption {
type = lib.types.attrs;
};
} }

View file

@ -1,10 +1,6 @@
{ config, lib, ... }: { ... }:
{ {
options.look.fonts = lib.mkOption { look.fonts = {
type = lib.types.attrs;
};
config.look.fonts = {
main = "Ubuntu"; main = "Ubuntu";
mono = "UbuntuMono Nerd Font"; mono = "UbuntuMono Nerd Font";
}; };

View file

@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
programs.waybar = let programs.waybar = let
workspaceModule = { commonModules = {
"sway/workspaces" = {
format = "{name}"; format = "{name}";
enable-bar-scroll = true; enable-bar-scroll = true;
disable-scroll-wraparound = true; disable-scroll-wraparound = true;
@ -9,19 +10,14 @@
warp-on-scroll = false; warp-on-scroll = false;
}; };
windowModule = { "sway/window" = {
icon = true; icon = true;
icon-size = 15; icon-size = 15;
all-outputs = true; all-outputs = true;
tooltip = false; tooltip = false;
rewrite = {
"(.*) LibreWolf" = " $1";
"LibreWolf" = " Firefox";
"(.*) - LibreWolf Firefox" = "󰗃 $1";
};
}; };
pulseModule = with pkgs; { "pulseaudio" = with pkgs; {
format = "{icon} {volume}%"; format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%"; format-bluetooth = "{icon} {volume}%";
format-muted = " muted"; format-muted = " muted";
@ -39,19 +35,72 @@
ignored-sinks = [ "Easy Effects Sink" ]; ignored-sinks = [ "Easy Effects Sink" ];
}; };
# Monitoring "mpris" = {
cpuModule = { player = "mpd";
format = " {title}";
format-paused = " {artist}";
format-stopped = "";
tooltip-format = lib.concatStrings [
"{title} - {artist} - {album}\n"
"{position}/{length}"
];
interval = 2;
max-length = 30;
};
"custom/notifs" = with pkgs; {
exec = pkgs.writeScript "notificationScript.sh" ''
#!/bin/sh
SED="${gnused}/bin/sed"
MAKOCTL="${mako}/bin/makoctl"
# Extract the second line after "default"
mode=$(echo "$($MAKOCTL mode)" | $SED -n '/default/{n;p}')
# Print the notification status with the tooltip
if [[ "$mode" == "do-not-disturb" ]]; then
printf '{"text":"󱆥 Off","class":"disabled","tooltip":"Notifications Disabled."}'
else
printf '{"text":" On","tooltip":"Notifications Enabled."}';
fi
'';
format = "{}";
return-type = "json";
interval = 2;
on-click = "${mako}/bin/makoctl mode -t do-not-disturb";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = " On";
deactivated = "󰾫 Off";
tooltip-format-activated = "Sleep inhibited.";
tooltip-format-deactivated = "Sleep uninhibited.";
};
};
"custom/weather" = {
exec = "${pkgs.wttrbar}/bin/wttrbar --ampm";
format = "{}°";
tooltip = true;
return-type = "json";
interval = 3600;
};
"cpu" = {
format = " {usage}%"; format = " {usage}%";
interval = 3; interval = 3;
}; };
ramModule = { "memory" = {
format = " {used}G"; format = " {used}G";
tooltip = false; tooltip = false;
interval = 3; interval = 3;
}; };
vramModule = { "custom/vram" = {
exec = with pkgs; pkgs.writeScript "vramScript.sh" '' exec = with pkgs; pkgs.writeScript "vramScript.sh" ''
#!/bin/sh #!/bin/sh
@ -95,123 +144,7 @@
interval = 3; interval = 3;
}; };
# Clocks "backlight" = {
clockModule = {
interval = 1;
format = "{:%a %b %d %I:%M:%S%p}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
};
# Misc
trayModule.spacing = 5;
# Wireless
networkModule = {
format-ethernet = "󰈀";
format-wifi = "";
format-disconnected = "󰖪";
format-linked = "";
tooltip-format-ethernet = lib.concatStrings [
"{ipaddr}\n"
"{ifname} "
];
tooltip-format-wifi = lib.concatStrings [
"{ipaddr}\n"
"{essid} ({signalStrength}%)"
];
tooltip-format-disconnected = "Disconnected";
};
bluetoothModule = {
format = "";
format-disabled = "";
format-no-controller = "";
tooltip-format-on = "No devices connected.";
tooltip-format-connected = lib.concatStrings [
"{num_connections} connected\n"
"{device_enumerate}"
];
tooltip-format-enumerate-connected = "{device_alias}";
tooltip-format-enumerate-connected-battery = "{device_alias} {device_battery_percentage}%";
};
scratchpadModule = {
format = " {count}";
show-empty = false;
tooltip = true;
tooltip-format = "{title}";
};
gamemodeModule = {
format = "{glyph}";
hide-not-running = true;
use-icon = true;
icon-size = 19;
icon-spacing = 0;
tooltip = true;
};
privacyModule = {
icon-spacing = 5;
icon-size = 15;
};
mprisModule = {
player = "mpd";
format = " {title}";
format-paused = " {artist}";
format-stopped = "";
tooltip-format = lib.concatStrings [
"{title} - {artist} - {album}\n"
"{position}/{length}"
];
interval = 2;
max-length = 30;
};
notificationModule = with pkgs; {
exec = pkgs.writeScript "notificationScript.sh" ''
#!/bin/sh
SED="${gnused}/bin/sed"
MAKOCTL="${mako}/bin/makoctl"
# Extract the second line after "default"
mode=$(echo "$($MAKOCTL mode)" | $SED -n '/default/{n;p}')
# Print the notification status with the tooltip
if [[ "$mode" == "do-not-disturb" ]]; then
printf '{"text":"󱆥 Off","class":"disabled","tooltip":"Notifications Disabled."}'
else
printf '{"text":" On","tooltip":"Notifications Enabled."}';
fi
'';
format = "{}";
return-type = "json";
interval = 2;
on-click = "${mako}/bin/makoctl mode -t do-not-disturb";
};
idleModule = {
format = "{icon}";
format-icons = {
activated = " On";
deactivated = "󰾫 Off";
tooltip-format-activated = "Sleep inhibited.";
tooltip-format-deactivated = "Sleep uninhibited.";
};
};
weatherModule = {
exec = "${pkgs.wttrbar}/bin/wttrbar --ampm";
format = "{}°";
tooltip = true;
return-type = "json";
interval = 3600;
};
# Laptop modules
backlightModule = {
format = "{icon} {percent}%"; format = "{icon} {percent}%";
format-icons = [ format-icons = [
"" ""
@ -220,7 +153,7 @@
tooltip = false; tooltip = false;
}; };
batteryModule = { "battery" = {
interval = 60; interval = 60;
states = { states = {
warning = 30; warning = 30;
@ -235,11 +168,70 @@
"" ""
]; ];
}; };
"clock" = {
interval = 1;
format = "{:%a %b %d %I:%M:%S%p}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
};
"sway/scratchpad" = {
format = " {count}";
show-empty = false;
tooltip = true;
tooltip-format = "{title}";
};
"privacy" = {
icon-spacing = 5;
icon-size = 15;
};
"gamemode" = {
format = "{glyph}";
hide-not-running = true;
use-icon = true;
icon-size = 19;
icon-spacing = 0;
tooltip = true;
};
"tray".spacing = 5;
"bluetooth" = {
format = "";
format-disabled = "";
format-no-controller = "";
tooltip-format-on = "No devices connected.";
tooltip-format-connected = lib.concatStrings [
"{num_connections} connected\n"
"{device_enumerate}"
];
tooltip-format-enumerate-connected = "{device_alias}";
tooltip-format-enumerate-connected-battery = "{device_alias} {device_battery_percentage}%";
};
"network" = {
format-ethernet = "󰈀";
format-wifi = "";
format-disconnected = "󰖪";
format-linked = "";
tooltip-format-ethernet = lib.concatStrings [
"{ipaddr}\n"
"{ifname} "
];
tooltip-format-wifi = lib.concatStrings [
"{ipaddr}\n"
"{essid} ({signalStrength}%)"
];
tooltip-format-disconnected = "Disconnected";
};
};
in { in {
enable = config.home.desktop.enable; enable = config.home.desktop.enable;
systemd.enable = true; systemd.enable = true;
settings = { settings = {
displayPrimary = { displayPrimary = commonModules // {
name = "bar1"; name = "bar1";
position = "top"; position = "top";
layer = "top"; layer = "top";
@ -272,27 +264,9 @@
"bluetooth" "bluetooth"
"network" "network"
]; ];
"sway/workspaces" = workspaceModule;
"sway/window" = windowModule;
"pulseaudio" = pulseModule;
"mpris" = mprisModule;
"custom/notifs" = notificationModule;
"idle_inhibitor" = idleModule;
"custom/weather" = weatherModule;
"cpu" = cpuModule;
"memory" = ramModule;
"custom/vram" = vramModule;
"backlight" = backlightModule;
"battery" = batteryModule;
"clock" = clockModule;
"sway/scratchpad" = scratchpadModule;
"privacy" = privacyModule;
"tray" = trayModule;
"bluetooth" = bluetoothModule;
"network" = networkModule;
}; };
displaySecondary = { displaySecondary = commonModules // {
name = "bar2"; name = "bar2";
position = "top"; position = "top";
layer = "top"; layer = "top";
@ -312,13 +286,6 @@
"custom/vram" "custom/vram"
"clock" "clock"
]; ];
"sway/workspaces" = workspaceModule;
"sway/window" = windowModule;
"pulseaudio" = pulseModule;
"cpu" = cpuModule;
"memory" = ramModule;
"custom/vram" = vramModule;
"clock" = clockModule;
}; };
}; };
@ -331,38 +298,21 @@
font-size: 15.5px; font-size: 15.5px;
color: #${config.look.colors.text}; color: #${config.look.colors.text};
} }
#waybar {
background: #${config.look.colors.dark}; #waybar { background: #${config.look.colors.dark}; }
} #tray { padding: 0 2px 0 5px; }
#workspaces { #network { padding: 0 10px 0 4px; }
padding: 0 6px 0 0; #scratchpad, #privacy { margin-left: 4px; }
} #pulseaudio { margin-right: 5px; }
#tray { #mpris, #custom-notifs, #idle_inhibitor, #custom-weather, #cpu, #memory, #custom-vram, #backlight, #battery { margin: 0 5px 0 2px; }
padding: 0 2px 0 5px;
} #workspaces { padding: 0 6px; }
#network {
padding: 0 10px 0 4px;
}
#bluetooth {
margin: 0 6px 0 4px;
font-size: 13.4px;
}
#workspaces button { #workspaces button {
padding: 0 3px; padding: 0 3px;
color: white; color: white;
border-bottom: 3px solid transparent; border-bottom: 3px solid transparent;
min-width: 20px; min-width: 20px;
} }
#scratchpad, #privacy {
margin-left: 4px;
}
#mpris, #custom-notifs, #idle_inhibitor, #custom-weather, #cpu, #memory, #custom-vram, #backlight, #battery {
margin: 0 5px 0 2px;
}
#pulseaudio {
margin-right: 5px;
}
#workspaces button.visible, #workspaces button.active { #workspaces button.visible, #workspaces button.active {
border-bottom: 3px solid #${config.look.colors.prime}; border-bottom: 3px solid #${config.look.colors.prime};
background: #${config.look.colors.mid}; background: #${config.look.colors.mid};
@ -374,44 +324,25 @@
box-shadow: none; box-shadow: none;
background: #${config.look.colors.light}; background: #${config.look.colors.light};
} }
#mpris {
border-bottom: 3px solid #ffb066; #bluetooth {
} margin: 0 6px 0 4px;
#custom-notifs { font-size: 13.4px;
border-bottom: 3px solid #3823C4;
}
#idle_inhibitor {
border-bottom: 3px solid #941efc;
}
#custom-weather {
border-bottom: 3px solid #ea60e3;
}
#cpu {
border-bottom: 3px solid #f90000;
}
#memory {
border-bottom: 3px solid #4bffdc;
}
#custom-vram {
border-bottom: 3px solid #33FF00;
}
#backlight {
border-bottom: 3px solid #5ffca3;
}
#battery {
border-bottom: 3px solid #fcfc16;
}
#clock {
border-bottom: 3px solid #0a6cf5;
margin: 0 2px 0 2px;
} }
#mpris.paused, #custom-notifs.disabled, #idle_inhibitor.deactivated { #mpris { border-bottom: 3px solid #ffb066; }
color: #888; #custom-notifs { border-bottom: 3px solid #3823C4; }
} #idle_inhibitor { border-bottom: 3px solid #941efc; }
#pulseaudio.muted, #network.disconnected, #bluetooth.off { #custom-weather { border-bottom: 3px solid #ea60e3; }
color: #424242; #cpu { border-bottom: 3px solid #f90000; }
} #memory { border-bottom: 3px solid #4bffdc; }
#custom-vram { border-bottom: 3px solid #33FF00; }
#backlight { border-bottom: 3px solid #5ffca3; }
#battery { border-bottom: 3px solid #fcfc16; }
#clock { border-bottom: 3px solid #0a6cf5; }
#mpris.paused, #custom-notifs.disabled, #idle_inhibitor.deactivated { color: #888; }
#pulseaudio.muted, #network.disconnected, #bluetooth.off { color: #424242; }
''; '';
}; };
} }

View file

@ -11,9 +11,8 @@
keybindings = { keybindings = {
## Launchers ## Launchers
# Browser profiles # Browser
"${primeMod}+F1" = ''exec librewolf -p Main --name MainBrowser | notify-send "Main Browser"''; "${primeMod}+F1" = ''exec librewolf | notify-send "Browser"'';
"${primeMod}+F2" = ''exec librewolf -p Alt --name AltBrowser | notify-send "Alternate Browser"'';
# Virtual machines # Virtual machines
"${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"''; "${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"'';
@ -148,6 +147,7 @@
# Change layout # Change layout
"${primeMod}+f" = ''fullscreen toggle''; "${primeMod}+f" = ''fullscreen toggle'';
"${primeMod}+${secMod}+f" = ''fullscreen toggle global'';
"${primeMod}+w" = ''layout toggle split''; "${primeMod}+w" = ''layout toggle split'';
"${primeMod}+v" = ''split v''; "${primeMod}+v" = ''split v'';
"${primeMod}+e" = ''layout toggle tabbed stacking''; "${primeMod}+e" = ''layout toggle tabbed stacking'';

View file

@ -55,9 +55,8 @@
]; ];
}; };
assigns = { assigns = {
# Browsers # Browser
"1:${config.ws.w1}" = [{ app_id = "MainBrowser"; }]; "1:${config.ws.w1}" = [{ app_id = "librewolf"; }];
"11:${config.ws.w1a}" = [{ app_id = "AltBrowser"; }];
# Communication # Communication
"7:${config.ws.w7}" = [ "7:${config.ws.w7}" = [