refactor: rename home modules/general cleanup

This commit is contained in:
ooks-io 2024-01-26 13:43:14 +13:00
parent 16dd61d968
commit 653640b484
86 changed files with 230 additions and 322 deletions

View file

@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
./firefox
#./chrome -- still needs to be implemented
#./brave -- still needs tio be implemented
];
options.homeModules.desktop.browser = {
firefox = {
enable = lib.mkEnableOption "Enable firefox browser";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set Firefox as default browser";
};
};
};
}

View file

@ -0,0 +1,304 @@
{ pkgs, lib, inputs, config, ... }:
let
addons = inputs.firefox-addons.packages.${pkgs.system};
cfg = config.homeModules.desktop.browser.firefox;
in
{
config = {
nixpkgs.config.allowUnfree = true;
home.sessionVariables = lib.mkIf cfg.default {
BROWSER = "firefox";
};
programs.firefox = lib.mkIf cfg.enable {
enable = true;
profiles.ooks = {
bookmarks = { };
extensions = with addons; [
ublock-origin
browserpass
stylus
surfingkeys
];
settings = {
#Basic Settings
"browser.disableResetPrompt" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.cache.disk.enable" = false;
"browser.cache.memory.enable" = true;
"browser.cache.memory.capacity" = 524288;
"browser.sessionstore.interval" = 15000000;
"extensions.pocket.enabled" = false;
"reader.parse-on-load.enabled" = false;
"accessibility.force_disabled" = 1;
"browser.helperApps.deleteTempFileOnExit" = true;
"browser.uitour.enabled" = false;
#Startup
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.default.sites" = "";
"browser.aboutConfig.showWarning" = false;
#Disable recommendations
"extensions.getAddons.showPane" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"browser.discovery.enabled" = false;
#Telemetry
"datareporting.policy.dataSubmissionEnabled" = false;
"datareporting.healthreport.uploadEnabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.server" = "data:,";
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.updatePing.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.coverage.opt-out" = true;
"toolkit.coverage.opt-out" = true;
"toolkit.coverage.endpoint.base" = "";
"browser.ping-centre.telemetry" = false;
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
"browser.newtabpage.activity-stream.telemetry" = false;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.shutdownPingSender.enabledFirstsession" = false;
"browser.vpn_promo.enabled" = false;
"app.shield.optoutstudies.enabled" = false;
"app.normandy.enabled" = false;
"app.normandy.api_url" = "";
#Crash Reports
"breakpad.reportURL" = "";
"browser.tabs.crashReporting.sendReport" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
#Other
"captivedetect.canonicalURL" = "";
"network.captive-portal-service.enabled" = false;
"network.connectivity-service.enabled" = false;
#Geolocation
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
"geo.provider.use_gpsd" = false;
"geo.provider.use_geoclue" = false;
#Calculator
"browser.urlbar.suggest.calculator" = true;
};
userChrome =
''
/* config */
* {
--animation-speed: 0.2s;
--button-corner-rounding: 30px;
--urlbar-container-height: 40px !important;
--urlbar-min-height: 30px !important;
--urlbar-height: 30px !important;
--urlbar-toolbar-height: 38px !important;
--moz-hidden-unscrollable: scroll !important;
--toolbarbutton-border-radius: 3px !important;
--tabs-border-color: transparent;
}
:root {
--window: -moz-Dialog !important;
--secondary: color-mix(in srgb, currentColor 5%, -moz-Dialog) !important;
--uc-border-radius: 0px;
--uc-status-panel-spacing: 0px;
--uc-page-action-margin: 7px;
}
/* animation and effect */
#nav-bar:not([customizing]) {
visibility: visible;
margin-top: -40px;
transition-delay: 0.1s;
filter: alpha(opacity=0);
opacity: 0;
transition: visibility, ease 0.1s, margin-top, ease 0.1s, opacity, ease 0.1s,
rotate, ease 0.1s !important;
}
#nav-bar:hover,
#nav-bar:focus-within,
#urlbar[focused='true'],
#identity-box[open='true'],
#titlebar:hover + #nav-bar:not([customizing]),
#toolbar-menubar:not([inactive='true']) ~ #nav-bar:not([customizing]) {
visibility: visible;
margin-top: 0px;
filter: alpha(opacity=100);
opacity: 100;
margin-bottom: -0.2px;
}
#PersonalToolbar {
margin-top: 0px;
}
#nav-bar .toolbarbutton-1[open='true'] {
visibility: visible;
opacity: 100;
}
tab:not(:active) .tab-background {
transition: background-color var(--animation-speed) !important;
}
:root:not([customizing]) :hover > .tabbrowser-tab:not(:hover) {
transition: blur, ease 0.1s !important;
}
:root:not([customizing]) :not(:hover) > .tabbrowser-tab {
transition: blur, ease 0.1s !important;
}
#tabbrowser-tabs .tab-label-container[customizing] {
color: transparent;
transition: ease 0.1s;
transition-delay: 0.2s;
}
.tabbrowser-tab:not([pinned]) .tab-icon-image ,.bookmark-item .toolbarbutton-icon{opacity: 0!important; transition: .15s !important; width: 0!important; padding-left: 16px!important}
.tabbrowser-tab:not([pinned]):hover .tab-icon-image,.bookmark-item:hover .toolbarbutton-icon{opacity: 100!important; transition: .15s !important; display: inline-block!important; width: 16px!important; padding-left: 0!important}
.tabbrowser-tab:not([hover]) .tab-icon-image,.bookmark-item:not([hover]) .toolbarbutton-icon{padding-left: 0!important}
/* Removes annoying buttons and spaces */
#firefox-view-button, .titlebar-spacer[type="pre-tabs"], .titlebar-spacer[type="post-tabs"]{display: none !important}
#tabbrowser-tabs{border-inline-start-width: 0!important}
/* Makes some buttons nicer */
#PanelUI-menu-button, #unified-extensions-button, #reload-button, #stop-button {padding: 2px !important}
#reload-button, #stop-button{margin: 1px !important;}
/* Tabs colors */
#tabbrowser-tabs:not([movingtab])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab
> .tab-stack
> .tab-background[multiselected='true'],
#tabbrowser-tabs:not([movingtab])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab
> .tab-stack
> .tab-background[selected='true'] {
background-image: none !important;
background-color: var(--toolbar-bgcolor) !important;
}
/* Inactive tabs color */
#navigator-toolbox {
background-color: var(--window) !important;
}
/* X-button */
:root {
--show-tab-close-button: none;
--show-tab-close-button-hover: -moz-inline-block;
}
.tabbrowser-tab:not([pinned]) .tab-close-button { display: var(--show-tab-close-button) !important; }
.tabbrowser-tab:not([pinned]):hover .tab-close-button { display: var(--show-tab-close-button-hover) !important }
/* Window colors */
:root {
--lwt-sidebar-background-color: var(--window) !important;
--lwt-toolbar-field-focus: var(--secondary) !important;
}
/* tabbar */
/* Hide the secondary Tab Label
* e.g. playing indicator (the text, not the icon) */
.tab-secondary-label { display: none !important; }
#nav-bar:not([tabs-hidden='true']) {
box-shadow: none;
}
:root {
--toolbarbutton-border-radius: 0 !important;
--tab-border-radius: 0 !important;
--tab-block-margin: 0 !important;
}
.tab-background {
border-right: 0px solid rgba(0, 0, 0, 0) !important;
margin-left: -4px !important;
}
.tabbrowser-tab:is([visuallyselected='true'], [multiselected])
> .tab-stack
> .tab-background {
box-shadow: none !important;
}
.tabbrowser-tab[last-visible-tab='true'] {
padding-inline-end: 0 !important;
}
#tabs-newtab-button {
padding-left: 0 !important;
}
/* remove tab shadow */
.tabbrowser-tab
>.tab-stack
> .tab-background { box-shadow: none !important; }
/* multi tab selection */
#tabbrowser-tabs:not([noshadowfortests]) .tabbrowser-tab:is([multiselected])
> .tab-stack
> .tab-background:-moz-lwtheme { outline-color: var(--toolbarseparator-color) !important; }
/* Hides the list-all-tabs button*/
#alltabs-button { display: var(--uc-show-all-tabs-button) !important; }
/* remove gap after pinned tabs */
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs])
> #tabbrowser-arrowscrollbox
> .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { margin-inline-start: 0 !important; }
/* Removes annoying border */
#navigator-toolbox{border:none !important;}
/* Removes the annoying rainbow thing from the hamburger */
#appMenu-fxa-separator{border-image:none !important;}
'';
userContent = ''
@-moz-document url-prefix(about:){
/* Removes the scrollbar on some places */
body,html{overflow-y: auto}
/* Devtools */
@-moz-document url-prefix(about:devtools){
#toolbox-container{margin-top: 10px !important}
.devtools-tabbar{background: transparent !important}
.devtools-tab-line{border-radius: 0 0 5px 5px}
.customize-animate-enter-done,.customize-menu,.top-site-outer:hover,button{background-color: transparent!important}}
/* Newtab */
@-moz-document url("about:home"), url("about:newtab"){
.search-wrapper .search-handoff-button .fake-caret {top: 13px !important; inset-inline-start: 48px !important}
.search-wrapper .logo-and-wordmark{opacity: 0.9 !important; order: 1 !important; margin-bottom: 0 !important; flex: 1 !important; flex-basis: 20% !important}
.search-wrapper .search-handoff-button .fake-caret{top: 13px !important; inset-inline-start: 48px !important}
.search-wrapper .logo-and-wordmark{opacity: 0.9 !important; order: 1 !important; margin-bottom: 0 !important; flex: 1 !important; flex-basis: 20% !important}
.outer-wrapper .search-wrapper{padding: 0px !important; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; align-content: space-around !important; gap: 20px 10px !important}
.search-wrapper .logo-and-wordmark .logo{background-size: 60px !important; height: 60px !important; width: 60px !important}
.search-wrapper .search-inner-wrapper{min-height: 42px !important; order: 2 !important; flex: 3 !important; flex-basis: 60% !important; top: 4px !important}
.search-wrapper .search-inner-wrapper{min-height: 42px !important; order: 2 !important; flex: 3 !important; flex-basis: 60% !important; top: 4px !important}
.outer-wrapper.ds-outer-wrapper-breakpoint-override.only-search.visible-logo{display: flex !important; padding-top: 0px !important;vertical-align: middle}
.customize-menu{border-radius: 10px 0 0 10px !important}
#root > div{align-items: center; display: flex}}}
'';
};
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./discord
];
options.homeModules.desktop.communication = {
discord = {
enable = lib.mkEnableOption "Enable discord module";
};
};
}

View file

@ -0,0 +1,150 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homeModules.desktop.communication.discord;
inherit (config.colorscheme) colors;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.vesktop ];
xdg.configFile."vesktop/themes/nix.css".text = /* css */ ''
/**
* @name nix-colors-minimal
* @author aoku
* @description minimal theme designed with nix colors
*/
:root {
--nix-bg1: #${colors.base00};
--nix-bg2: #${colors.base01};
--nix-bg3: #${colors.base02};
--nix-fg1: #${colors.base05};
--nix-fg2: #${colors.base07};
--nix-fg3: #${colors.base03};
--nix-link: #${colors.base0D};
--nix-accent: #${colors.base08};
--nix-hi: #${colors.base0B};
--font-mono: ${config.fontProfiles.monospace.family}, monospace;
--font-regular: ${config.fontProfiles.regular.family}, sans serif;
/* server collapse */
--sb-collapsed-width: 12px;
--sb-transition-duration: 0s;
}
.theme-dark {
--background-primary: var(--nix-bg1);
--background-secondary: var(--nix-bg1);
--background-secondary-alt: var(--nix-bg1);
--background-accent: var(--nix-accent);
--background-tertiary: var(--nix-bg1);
--background-floating: var(--nix-bg1);
--background-mentioned: var(--nix-bg1);
--background-mentioned-hover: var(--nix-bg1);
--background-mobile: var(--nix-bg1);
--background-mobile-secondary: var(--nix-bg2);
--background-modifier-selected: var(--nix-bg1);
--channeltextarea-background:var(--nix-bg1);
--background-modifier-hover:var(--nix-bg1);
--activity-card-background: var(--nix-bg2);
--header-primary: var(--nix-fg2);
--header-secondary: var(--nix-fg1);
--text-normal: var(--nix-fg1);
--text-muted: var(--nix-fg1);
--text-link: var(--nix-link);
--text-warning: var(--nix-accent);
--font-primary: var(--font-mono);
--font-headline: var(--font-mono);
--font-display: var(--font-mono);
--interactive-normal: var(--nix-fg1); /*base05*/
--interactive-hover: var(--nix-hi); /*base0B*/
--interactive-active: var(--nix-fg2);
--interactive-muted: var(--nix-fg3); /*base03*/
--channels-default: var(--nix-fg1);
--scrollbar-thin-thumb: transparent;
--scrollbar-thin-track: transparent;
--scrollbar-auto-thumb: var(--nix-fg1);
--scrollbar-auto-track:var(--nix-bg1);
--scrollbar-auto-scrollbar-color-thumb: var(--nix-accent);
}
.messagesWrapper_ea2b0b {
font-family: var(--font-regular);
}
.titleWrapper__482dc {
font-family: var(--font-mono);
}
.link__95dc0 /* text channel*/{
border-radius: 0px;
margin-left: -10px;
font-family: var(--font-mono);
}
.container_ca50b9 .avatar_f8541f { /*avatar*/
display: none;
}
.form__13a2c /* text input box resize */ {
height: 50px;
font-family: var(--font-regular);
}
.containerDefault__3187b .wrapper__7bcde:before /* text channel */{
content: "";
display:inline-block;
background: var(--nix-hi);
height: 100%;
position: absolute;
left: 0;
}
/* server collapse */
.guilds__2b93a /* servers */{
overflow: hidden !important;
width: var(--sb-collapsed-width, 75px);
transition: width var(--sb-transition-duration);
}
.guilds__2b93a:hover /* expand server bar on hover */{
width: 70px;
overflow: visible !important;
animation: server-bar-overflow 0s linear 0ms forwards
}
.guilds__2b93a ~ .base__3e6af /* friends list, chat */{
position: absolute;
left: var(--sb-collapsed-left, var(--sb-collapsed-width));
top: var(--sb-collapsed-top, 0px);
bottom: var(--sb-collapsed-bottom, 0px);
right: var(--sb-collapsed-right, 0px);
transition-property: var(--sb-transition-property, left);
transition-duration: var(--sb-transition-duration);
}
.guilds__2b93a:hover ~ .base__3e6af /* friends list, chat */{
position: absolute;
left: var(--sb-left, 70px);
top: var(--sb-top, 0px);
bottom: var(--sb-bottom, 0px);
right: var(--sb-right, 0px);
}
@keyframes server-bar-overflow{
from{
overflow: hidden;
}
to{
overflow: visible;
}
}
'';
};
}

View file

View file

@ -0,0 +1,15 @@
{
imports = [
./themeSettings # done
./browser # done -- firefox still need: chrome, brave
#./creative -- still needs to be implemented
./communication # only discord implemented
./media # done -- spotify gui still needs to be implemented
./terminal # done -- wezterm still needs to be implemented
#./wallpaper -- still needs to be implemented
#./utility -- still needs to be implemented
./wayland # -- almost done, need to implement eww
#./productivity -- still needs to be implemented
# ./gaming
];
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,7 @@
{
imports = [
./video
./image
./music
];
}

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./imv
];
options.homeModules.desktop.media.image = {
imv = {
enable = lib.mkEnableOption "Enable imv image viewer";
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.media.image.imv;
in
{
config = lib.mkIf cfg.enable {
programs = {
imv = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, ... }:
{
imports = [
#./spotify --- still needs to be implemented
./tui
];
options.homeModules.desktop.media.music = {
tui = {
enable = lib.mkEnableOption "Enable tui music";
};
spotify = {
enable = lib.mkEnableOption "Enable spotify";
};
};
}

View file

@ -0,0 +1,17 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.desktop.media.music.tui;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
termusic
spotify-player
ytui-music
alsa-utils
];
};
}

View file

@ -0,0 +1,20 @@
{ lib, ... }:
{
imports = [
./youtube
./jellyfin
./mpv
];
options.homeModules.desktop.media.video = {
mpv = {
enable = lib.mkEnableOption "Enable mpv video player";
};
youtube = {
enable = lib.mkEnableOption "Enable youtube tui player";
};
jellyfin = {
enable = lib.mkEnableOption "Enable jellyifn media player";
};
};
}

View file

@ -0,0 +1,9 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.desktop.media.video.jellyfin;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ jellyfin-media-player ];
};
}

View file

@ -0,0 +1,12 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.media.video.mpv;
in
{
config = {
programs.mpv = lib.mkIf cfg.enable {
enable = true;
};
};
}

View file

@ -0,0 +1,12 @@
{ lib, config, pkgs, ...}:
let
cfg = config.homeModules.desktop.media.video.youtube;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ youtube-tui ];
programs.yt-dlp = {
enable = true;
};
};
}

View file

@ -0,0 +1,43 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.terminal;
in
{
imports = [
./foot
./kitty
];
options.homeModules.desktop.terminal = {
foot = {
enable = lib.mkEnableOption "Enable foot terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set foot as default terminal in environment variables";
};
};
kitty = {
enable = lib.mkEnableOption "Enable kitty terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set kitty as default terminal in environment variables";
};
};
};
config = {
assertions = [
{
assertion =
(lib.length (lib.filter (x: x) [
cfg.foot.default or false
cfg.kitty.default or false
]) <= 1);
message = "Only one terminal can be default in the configuration";
}
];
};
}

View file

@ -0,0 +1,63 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.terminal.foot;
in
{
config = lib.mkIf cfg.enable {
home.sessionVariables = lib.mkIf cfg.default {
TERMINAL = "foot";
TERM = "foot";
};
programs.foot = {
enable = true;
server.enable = true;
settings = {
main = {
font = "${config.fontProfiles.monospace.family}:pixelsize=18:antialias=true";
font-bold = "${config.fontProfiles.monospace.family}:style=Bold:pixelsize=18:antialias=true";
font-italic = "${config.fontProfiles.monospace.family}:style=Italic:pixelsize=18:antialias=true";
font-bold-italic = "${config.fontProfiles.monospace.family}:style=Bold Italic:pixelsize=18:antialias=true";
dpi-aware = "yes";
letter-spacing = "-1px";
bold-text-in-bright = "palette-based";
resize-delay-ms = "80";
pad = "9x9 center";
};
cursor = {
style = "beam";
blink = "yes";
};
colors = {
alpha = 1.0;
foreground = "${colors.base05}";
background = "${colors.base00}";
regular0 = "${colors.base00}"; # black
regular1 = "${colors.base08}"; # red
regular2 = "${colors.base0B}"; # green
regular3 = "${colors.base0A}"; # yellow
regular4 = "${colors.base0D}"; # blue
regular5 = "${colors.base0E}"; # magenta
regular6 = "${colors.base0C}"; # cyan
regular7 = "${colors.base05}"; # white
bright0 = "${colors.base03}"; # bright black
bright1 = "${colors.base08}"; # bright red
bright2 = "${colors.base0B}"; # bright green
bright3 = "${colors.base0A}"; # bright yellow
bright4 = "${colors.base0D}"; # bright blue
bright5 = "${colors.base0E}"; # bright magenta
bright6 = "${colors.base0C}"; # bright cyan
bright7 = "${colors.base07}"; # bright white
"16" = "${colors.base09}";
"17" = "${colors.base0F}";
"18" = "${colors.base01}";
"19" = "${colors.base02}";
"20" = "${colors.base04}";
"21" = "${colors.base06}";
};
};
};
};
}

View file

@ -0,0 +1,64 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.terminal.kitty;
in
{
config = lib.mkIf cfg.enable {
home.sessionVariables = lib.mkIf cfg.default {
TERMINAL = "kitty -1";
TERM = "kitty -1";
};
programs.kitty = {
enable = true;
font = {
name = config.fontProfiles.monospace.family;
size = 12;
};
shellIntegration.enableFishIntegration = true;
settings = {
scrollback_lines = 4000;
scrollback_pager_history_size = 2048;
window_padding_width = 1;
foreground = "#${colors.base05}";
background = "#${colors.base00}";
background_opacity = "1.0";
selection_background = "#${colors.base05}";
selection_foreground = "#${colors.base00}";
url_color = "#${colors.base04}";
cursor = "#${colors.base05}";
active_border_color = "#${colors.base03}";
inactive_border_color = "#${colors.base01}";
active_tab_background = "#${colors.base00}";
active_tab_foreground = "#${colors.base05}";
inactive_tab_background = "#${colors.base01}";
inactive_tab_foreground = "#${colors.base04}";
tab_bar_background = "#${colors.base01}";
color0 = "#${colors.base00}";
color1 = "#${colors.base08}";
color2 = "#${colors.base0B}";
color3 = "#${colors.base0A}";
color4 = "#${colors.base0D}";
color5 = "#${colors.base0E}";
color6 = "#${colors.base0C}";
color7 = "#${colors.base05}";
color8 = "#${colors.base03}";
color9 = "#${colors.base08}";
color10 = "#${colors.base0B}";
color11 = "#${colors.base0A}";
color12 = "#${colors.base0D}";
color13 = "#${colors.base0E}";
color14 = "#${colors.base0C}";
color15 = "#${colors.base07}";
color16 = "#${colors.base09}";
color17 = "#${colors.base0F}";
color18 = "#${colors.base01}";
color19 = "#${colors.base02}";
color20 = "#${colors.base04}";
color21 = "#${colors.base06}";
};
};
};
}

View file

@ -0,0 +1,16 @@
{ pkgs, lib, config, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable {
home.pointerCursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 22;
gtk.enable = true;
x11.enable = true;
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./cursor.nix
./fonts.nix
./gtk.nix
./qt.nix
];
# settings to be expanded on in the future
options.homeModules.desktop.themeSettings = {
enable = lib.mkEnableOption "Enable theme settings";
};
}

View file

@ -0,0 +1,24 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib. mkIf cfg.enable {
fontProfiles = {
enable = true;
monospace = {
family = "JetBrainsMono Nerd Font";
package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
};
regular = {
family = "Fira Sans";
package = pkgs.fira;
};
};
home.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
];
};
}

View file

@ -0,0 +1,35 @@
{ config, pkgs, inputs, lib, ... }:
let
inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme;
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable (rec {
gtk = {
enable = true;
font = {
name = config.fontProfiles.regular.family;
size = 12;
};
theme = {
name = config.colorscheme.slug;
package = gtkThemeFromScheme { scheme = config.colorscheme; };
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
services.xsettingsd = {
enable = true;
settings = {
"Net/ThemeName" = gtk.theme.name;
"Net/IconThemeName" = gtk.iconTheme.name;
};
};
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
});
}

View file

@ -0,0 +1,12 @@
{ config, lib, ... }:
let
cfg = config.homeModules.desktop.themeSettings;
in
{
config = lib.mkIf cfg.enable {
qt = {
enable = true;
platformTheme = "gtk";
};
};
}

View file

@ -0,0 +1,21 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.utility.gammastep;
in
{
config = lib.mkIf cfg.enable {
services.gammastep = lib.mkif config.programs.desktop.windowManager.hyprland.enable {
enable = true;
provider = "geoclue2";
temperature = {
day = 6000;
night = 4600;
};
settings = {
general.adjustment-method = "wayland";
};
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
{
imports = [
#./eww
#./ags -- needs to be implemented
#./waybar -- needs to be implemented
];
options.homeModules.desktop.wayland.bar = {
eww = {
enable = lib.mkEnableOption "Enable Eww bar";
};
};
}

View file

@ -0,0 +1,17 @@
{ lib, ... }:
{
imports = [
./bar
./lockscreen
./notification
./utility
./windowManager
# ./launcher
];
options.homeModules.desktop.wayland = {
base = {
enable = lib.mkEnableOption "Enable wayland specific utilities";
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, ... }:
{
imports = [
#./gtkLock --- still needs to be implemented
./swaylock
];
options.homeModules.desktop.wayland.lockscreen = {
swaylock = {
enable = lib.mkEnableOption "Enable Swaylock screen";
};
};
}

View file

@ -0,0 +1,35 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.desktop.wayland.lockscreen.swaylock;
in
{
config = lib.mkIf cfg.enable {
programs.swaylock = {
enable = true;
settings = {
font = config.fontProfiles.monospace.family;
color = "#${colors.base01}";
ring-color = "#${colors.base02}";
inside-wrong-color = "#${colors.base08}";
ring-wrong-color = "#${colors.base08}";
key-hl-color = "#${colors.base0B}";
bs-hl-color = "#${colors.base08}";
ring-ver-color = "#${colors.base09}";
inside-ver-color = "#${colors.base09}";
inside-color = "#${colors.base01}";
text-color = "#${colors.base07}";
text-clear-color = "#${colors.base01}";
text-ver-color = "#${colors.base01}";
text-wrong-color = "#${colors.base01}";
text-caps-lock-color = "#${colors.base07}";
inside-clear-color = "#${colors.base0C}";
ring-clear-color = "#${colors.base0C}";
inside-caps-lock-color = "#${colors.base09}";
ring-caps-lock-color = "#${colors.base02}";
separator-color = "#${colors.base02}";
};
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./mako
#./dunst -- still needs to be implemented
];
options.homeModules.desktop.wayland.notification = {
mako = {
enable = lib.mkEnableOption "Enable mako notification daemon";
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors kind;
cfg = config.homeModules.desktop.wayland.notification.mako;
in {
config = lib.mkIf cfg.enable {
services.mako = {
enable = true;
iconPath =
if kind == "dark" then
"${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else
"${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${config.fontProfiles.regular.family} 12";
padding = "10,10";
anchor = "top-right";
width = 300;
height = 100;
borderSize = 2;
defaultTimeout = 3000;
backgroundColor = "#${colors.base00}dd";
borderColor = "#${colors.base05}dd";
textColor = "#${colors.base05}dd";
extraConfig = ''
[app-name="system-notify"]
padding=3,3
width=100
height=100
[app-name="bat-notify"]
padding=3,3
width=100
height=100
anchor=top-center
'';
};
};
}

View file

@ -0,0 +1,50 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.base;
in
{
config = lib.mkIf cfg.enable {
home = {
packages = with pkgs; [
grim
gtk3
libnotify
waypipe
pulseaudio
pamixer
slurp
wf-recorder
wl-clipboard
wl-mirror
xdg-utils
wlr-randr
];
sessionVariables = {
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
XDG_SESSION_TYPE = "wayland";
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = ["graphical-session-pre.target"];
};
};
# services.gammastep = {
# enable = true;
# provider = "geoclue2";
# temperature = {
# day = 6000;
# night = 4600;
# };
# settings = {
# general.adjustment-method = "wayland";
# };
# };
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./hyprland
];
options.homeModules.desktop.wayland.windowManager = {
hyprland = {
enable = lib.mkEnableOption "Enable Hyprland window-manager";
};
};
}

View file

@ -0,0 +1,65 @@
{ config, lib, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
settings = {
general = {
gaps_in = 10;
gaps_out = 10;
border_size = 2;
cursor_inactive_timeout = 4;
"col.active_border" = "0xff${config.colorscheme.colors.base05}";
"col.inactive_border" = "0xff${config.colorscheme.colors.base02}";
};
group = {
"col.border_active" = "0xff${config.colorscheme.colors.base0B}";
"col.border_inactive" = "0xff${config.colorscheme.colors.base04}";
};
dwindle.split_width_multiplier = 1.35;
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
fullscreen_opacity = 1.0;
rounding = 0;
blur = {
enabled = false;
new_optimizations = true;
ignore_opacity = true;
};
drop_shadow = true;
shadow_range = 12;
shadow_offset = "3 3";
"col.shadow" = "0x44000000";
"col.shadow_inactive" = "0x66000000";
};
animations = {
enabled = true;
bezier = [
"easein,0.11, 0, 0.5, 0"
"easeout,0.5, 1, 0.89, 1"
"easeinback,0.36, 0, 0.66, -0.56"
"easeoutback,0.34, 1.56, 0.64, 1"
];
animation = [
"windowsIn,1,3,easeoutback,slide"
"windowsOut,1,3,easeinback,slide"
"windowsMove,1,3,easeoutback"
"workspaces,1,2,easeoutback,slide"
"fadeIn,1,3,easeout"
"fadeOut,1,3,easein"
"fadeSwitch,1,3,easeout"
"fadeShadow,1,3,easeout"
"fadeDim,1,3,easeout"
"border,1,3,easeout"
];
};
};
};
};
}

View file

@ -0,0 +1,160 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
notifysend = "${pkgs.libnotify}/bin/notify-send";
#pamixer = "${pkgs.pamixer}/bin/pamixer";
brightnessScript = pkgs.writeShellScriptBin "brightness" ''
#!/bin/sh
if [ "$1" == "up" ]; then
brillo -q -u 30000 -A 5
elif [ "$1" == "down" ]; then
brillo -q -u 30000 -U 5
else
echo "Invalid argument"
exit 1
fi
BRIGHTNESS=$(brillo -G | awk -F'.' '{print$1}')
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify "󰃠 $BRIGHTNESS%"
'';
volumeScript = pkgs.writeShellScriptBin "volume" ''
#!/bin/sh
if [ "$1" == "up" ]; then
pamixer --increase 5
elif [ "$1" == "down" ]; then
pamixer --decrease 5
elif [ "$1" == "mute" ]; then
pamixer --toggle-mute
fi
VOLUME=$(pamixer --get-volume-human)
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $VOLUME"
'';
in
{
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
bind = let
terminal = config.home.sessionVariables.TERMINAL;
browser = config.home.sessionVariables.BROWSER;
editor = config.home.sessionVariables.EDITOR;
bright = "${brightnessScript}/bin/brightness";
volume = "${volumeScript}/bin/volume";
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
spotify = "${terminal} -e spotify_player";
spotifyctl = "${pkgs.spotify-player}/bin/spotify_player";
discord = "${pkgs.vesktop}/bin/vesktop";
#makoctl = "${config.services.mako.package}/bin/makoctl";
password = "${pkgs._1password-gui}/bin/1password --enable-features=UseOzonePlatform --ozone-platform=wayland";
#playerctl = "${config.services.playerctld.package}/bin/playerctl";
#playerctld = "${config.services.playerctld.package}/bin/playerctld";
#pactl = "${pkgs.pulseaudio}/bin/pactl";
in [
# Program Launch
"SUPER, b, exec, ${browser}"
"SUPER, return, exec, ${terminal}"
"SUPER, e, exec, ${editor}"
"SUPER, m, exec, ${spotify}"
"SUPERSHIFT, P, exec, ${password}"
"SUPER, d, exec, ${discord}"
# Spotify PLayer Controls
"SUPER, bracketright, exec, ${spotifyctl} playback next"
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
# Brightness
",XF86MonBrightnessUp, exec, ${bright} up"
",XF86MonBrightnessDown, exec, ${bright} down"
# Volume
",XF86AudioRaiseVolume, exec, ${volume} up"
",XF86AudioLowerVolume, exec, ${volume} down"
",XF86AudioMute, exec, ${volume} mute"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exit"
"SUPER, F, fullscreen"
"SUPER, Space, togglefloating"
"SUPER, P, pseudo" # dwindle
"SUPER, S, togglesplit" # dwindle
# Focus
"SUPER, left, movefocus,l"
"SUPER, right, movefocus,r"
"SUPER, up, movefocus,u"
"SUPER, down, movefocus,d"
# Move
"SUPERSHIFT, left, movewindow,l"
"SUPERSHIFT, right, movewindow,r"
"SUPERSHIFT, up, movewindow,u"
"SUPERSHIFT, down, movewindow,d"
#Resize
"SUPER CTRL, left, resizeactive,-20 0"
"SUPERCTRL, right, resizeactive,20 0"
"SUPER CTRL, up, resizeactive,0 -20"
"SUPERCTRL, down, resizeactive,0 20"
# Switch workspace
"SUPER, 1, workspace,1"
"SUPER, 2, workspace,2"
"SUPER, 3, workspace,3"
"SUPER, 4, workspace,4"
"SUPER, 5, workspace,5"
"SUPER, 6, workspace,6"
"SUPER, 7, workspace,7"
"SUPER, 8, workspace,8"
"SUPER, 9, workspace,9"
"SUPER, 0, workspace,10"
"SUPER, comma, workspace,e+1"
"SUPER, period, workspace,e-1"
"SUPER, tab, focusCurrentOrLast"
# Move workspace
"SUPERSHIFT, 1, movetoworkspace,1"
"SUPERSHIFT, 2, movetoworkspace,2"
"SUPERSHIFT, 3, movetoworkspace,3"
"SUPERSHIFT, 4, movetoworkspace,4"
"SUPERSHIFT, 5, movetoworkspace,5"
"SUPERSHIFT, 6, movetoworkspace,6"
"SUPERSHIFT, 7, movetoworkspace,7"
"SUPERSHIFT, 8, movetoworkspace,8"
"SUPERSHIFT, 9, movetoworkspace,9"
"SUPERSHIFT, 0, movetoworkspace,10"
# Lock Screen
"SUPER, Backspace, exec, ${swaylock}"
];
# Mouse
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
};
}

View file

@ -0,0 +1,65 @@
{ lib, config, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
imports = [
./binds.nix #hyprland keybindings
./appearance.nix
./rules.nix
./exec.nix
];
config = lib.mkIf cfg.enable {
xdg.portal = {
extraPortals = [ pkgs.inputs.hyprland.xdg-desktop-portal-hyprland ];
configPackages = [ pkgs.inputs.hyprland.hyprland ];
};
home.packages = with pkgs; [
inputs.hyprwm-contrib.grimblast
hyprpicker
light
hyprshade
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.inputs.hyprland.hyprland;
systemd = {
enable = true;
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
settings = {
input = {
kb_layout = "us";
touchpad = {
disable_while_typing = false;
};
};
misc = {
vrr = true;
disable_hyprland_logo = true;
force_default_wallpaper = 0;
};
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
monitor = lib.concatMap (m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}";
in
[ basicConfig ] ++ (if m.transform != 0 then ["${m.name},transform,${toString m.transform}"] else [])
) (config.monitors);
};
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
{
home = lib.mkIf config.homeModules.desktop.wayland.windowManager.hyprland.enable {
sessionVariables = {
# GTK_IM_MODULE = "fcitx5";
# QT_IM_MODULE = "fcitx5";
# XMODIFIERS = "@im=fcitx5";
#QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
#MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
WLR_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0";
WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
WLR_RENDERER_ALLOW_SOFTWARE = "1";
NIXOS_OZONE_WL = "1";
# GBM_BACKEND = "nvidia-drm";
CLUTTER_BACKEND = "wayland";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
WLR_RENDERER = "vulkan";
# __NV_PRIME_RENDER_OFFLOAD = "1";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
};
};
}

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
exec = [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${pkgs.swaybg}/bin/swaybg -i ${config.wallpaper} --mode fill"
];
exec-once = [
"${pkgs._1password-gui}/bin/1password --silent"
"${pkgs.live-buds-cli}/bin/earbuds -d"
"eww daemon && eww open bar"
"systemctl --user start clight"
];
};
};
}

View file

@ -0,0 +1,20 @@
{ lib, config, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
windowrulev2 = [
"float,move 191 15,size 924 396,class:(1Password)"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"rounding 0, xwayland:1"
"center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$"
"size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$"
];
};
};
}