diff --git a/modules/apps/alacritty/default.nix b/modules/apps/alacritty/default.nix new file mode 100644 index 0000000..e457613 --- /dev/null +++ b/modules/apps/alacritty/default.nix @@ -0,0 +1,13 @@ +{...}: { + home-manager.users.joy.programs.alacritty = { + enable = true; + settings = { + window = { + padding = { + x = 5; + y = 5; + }; + }; + }; + }; +} diff --git a/modules/apps/appimage/default.nix b/modules/apps/appimage/default.nix new file mode 100644 index 0000000..2704021 --- /dev/null +++ b/modules/apps/appimage/default.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; +} diff --git a/modules/apps/default.nix b/modules/apps/default.nix new file mode 100644 index 0000000..80d064e --- /dev/null +++ b/modules/apps/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ./alacritty + ./appimage + ./firefox + ./helix + ./newsboat + ./packages + ./rofi + ./vm + ./zsh + ]; +} diff --git a/modules/apps/firefox/default.nix b/modules/apps/firefox/default.nix new file mode 100644 index 0000000..29f1a26 --- /dev/null +++ b/modules/apps/firefox/default.nix @@ -0,0 +1,170 @@ +{inputs, ...}: { + imports = [ + ./user.nix + ]; + + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + search.engines = { + "4get" = { + urls = [ + { + template = "https://4get.joygnu.org/web"; + params = [ + { + name = "s"; + value = "{searchTerms}"; + } + ]; + } + ]; + definedAliases = ["@4get"]; + }; + }; + search.force = true; + search.default = "4get"; + + bookmarks = [ + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "Packages"; + url = "https://search.nixos.org/packages?channel=unstable"; + } + { + name = "Homemanager"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "Stylix"; + url = "https://stylix.danth.me/options/nixos.html"; + } + { + name = "Git"; + url = "https://git.joygnu.org/"; + } + { + name = "Mail"; + url = "https://mail.joygnu.org/"; + } + { + name = "Photos"; + url = "https://immich.joygnu.org/"; + } + { + name = "Server"; + url = "https://avoro.eu/cp/clientarea.php?action=productdetails&id=27920"; + } + { + name = "Domain"; + url = "https://ap.www.namecheap.com/domains/list/"; + } + { + name = "Translate"; + url = "https://simplytranslate.org/"; + } + { + name = "Syncthing"; + url = "http://localhost:8384/"; + } + { + name = "GitHub"; + url = "https://github.com/"; + } + { + name = "Codeberg"; + url = "https://codeberg.org/"; + } + { + name = "Zophar's Domain"; + url = "https://www.zophar.net/music"; + } + { + name = "Hyprland"; + url = "https://wiki.hyprland.org/"; + } + { + name = "Monkeytype"; + url = "https://monkeytype.com/"; + } + { + name = "invidious"; + url = "https://invidious.reallyaweso.me"; + } + ]; + } + ]; + + extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ + ublock-origin + darkreader + libredirect + search-by-image + terms-of-service-didnt-read + decentraleyes + stylus + istilldontcareaboutcookies + ]; + + settings = { + "dom.security.https_only_mode" = true; + "browser.download.panel.shown" = true; + "identity.fxaccounts.enabled" = false; + "signon.rememberSignons" = false; + "browser.urlbar.pocket.featureGate" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "privacy.trackingprotection.enabled" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.uiCustomization.state" = '' + { + "placements": { + "widget-overflow-fixed-list": [], + "nav-bar": [ + "back-button", + "forward-button", + "stop-reload-button", + "urlbar-container", + "downloads-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "toolbar-menubar": [ + "menubar-items" + ], + "TabsToolbar": [ + "tabbrowser-tabs", + "new-tab-button", + "alltabs-button" + ], + "PersonalToolbar": [ + "personal-bookmarks" + ] + }, + "seen": [ + "save-to-pocket-button", + "developer-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "dirtyAreaCache": [ + "nav-bar", + "PersonalToolbar", + "toolbar-menubar", + "TabsToolbar", + "widget-overflow-fixed-list" + ], + "currentVersion": 18, + "newElementCount": 4 + } + ''; + }; + }; + }; +} diff --git a/modules/apps/firefox/user.nix b/modules/apps/firefox/user.nix new file mode 100644 index 0000000..8820e87 --- /dev/null +++ b/modules/apps/firefox/user.nix @@ -0,0 +1,380 @@ +{...}: { + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + userChrome = '' + + /*================== Gruvbox Theme for Firefox ================== + Author: kmason + Based on the color scheme of calvinchd's Gruvbox Dark Firefox Theme - https://gitlab.com/calvinchd/gruvbox-dark-firefox-theme + */ + @namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + + :root { + --background: #1d2021; + --secondary: #282828; + --foreground: #EBDBB2; + + --orange-highlight: #fe8019; + --sound-border: #68217A; + + --separator: #665e54; + + --toolbar-bgcolor: var(--secondary) !important; + + --tab: var(--background); + --tab-btn: var(--tab-inactive); + --tab-inactive: var(--secondary); + --tab-btn-inactive: var(--tab-inactive); + --tab-hover: #32302f; + --tab-btn-hover: #3C3836; + --toolbar-btn-hover: #49463f; + + --url-bar: #3C3836; + --url-focus: #504945; + --url-bar-item-hover: #6a6257; + + --sidebar: #3C3836; + --sidebar-button-hover: #5A544B; + --sidebar-highlight: #458588; + } + + /* + SEARCH AND POPUPS/MENUS + */ + + .panel-arrowcontainer { + background-color: var(--secondary) !important; + } + + #PopupAutoComplete, + #PopupSearchAutoComplete + { + background-color: var(--url-focus) !important; + color: var(--foreground) !important; + } + + panelview { + background-color: var(--sidebar) !important; + color: var(--foreground) !important; + } + + panelview toolbarbutton.subviewbutton:hover { + background-color: var(--sidebar-button-hover) !important; + } + + panel[type="autocomplete-richlistbox"] { + --panel-background: none !important; + border-radius: 4px !important; + color: var(--foreground) !important; + } + + /* + _____ ___ ___ _ ___ _ ___ + |_ _/ _ \ / _ \| | | _ ) / \ | _ \ + | || (_) | (_) | |__| _ \/ = \| / + |_| \___/ \___/|____|___/_/ \_\_|\_\ + + */ + + toolbarseparator, + menuseparator + { + border-color: var(--separator) !important; + border-image: none !important; + } + + toolbar { + background-color: var(--secondary); + } + + toolbar#TabsToolbar { + background-color: var(--background); + } + toolbar#TabsToolbar:-moz-window-inactive { + background-color: var(--toolbar-bgcolor) !important; + } + + #titlebar, + #titlebar-spacer, + #titlebar-buttonbox-container + { + background-color: var(--background) !important; + border: none !important; + } + + #navigator-toolbox { + --tabs-border-color: var(--orange-highlight) !important; + } + + /* Remove border under navbar */ + #navigator-toolbox::after { + border-bottom: 0px !important; + } + + /* remove some borders */ + #navigator-toolbox { + border: none !important; + } + + /* + _ _ ___ _ ___ _ ___ + | | | | _ \| | | _ ) / \ | _ \ + | |_| | /| |__| _ \/ = \| / + \___/|_|\_\____|___/_/ \_\_|\_\ + + */ + + #urlbar, + #searchbar + { + box-shadow: none !important; + border: none !important; + border-radius: 4px; + color : var(--foreground) !important; + background-color: var(--url-bar) !important; + --autocomplete-popup-separator-color: var(--separator) !important; + } + + #urlbar-input, + #urlbar-input-container + { + color: var(--foreground) !important; + background-color: var(--url-bar) !important; + } + + #urlbar:not([open]) #urlbar-input-container:focus-within, + #searchbar:focus-within + { + border: 2px solid var(--orange-highlight) !important; + } + + #urlbar:focus-within, + #urlbar[open], + #urlbar[open] #urlbar-input-container, + #urlbar[open] #urlbar-input, + #urlbar-input-container:focus-within, + #urlbar-input:focus, + #urlbar-background, + .urlbarView, + #searchbar:focus-within, + menupop + { + background-color: var(--url-focus) !important; + } + #searchbar:focus-within { + outline: none !important; + } + + :is(panel, menupopup)::part(content) { + background: none !important; + } + + .urlbarView button:hover, + #searchbar button:hover, + .urlbarView-row:hover .urlbarView-row-inner, + .search-autocomplete-richlistbox-popup .autocomplete-richlistitem:hover + { + background-color: var(--url-bar-item-hover) !important; + } + + .urlbarView-row[type="switchtab"] > span{ + color: var(--orange-highlight) !important; + } + + #PopupSearchAutoComplete .autocomplete-richlistitem[selected], + .searchbar-engine-one-off-item[selected], + .urlbarView-row[selected], + .urlbarView-row[aria-selected="true"], + .urlbarView-row:not([type="tip"], [type="dynamic"])[selected] > .urlbarView-row-inner, + .urlbarView-row-inner[selected] + { + color: var(--foreground) !important; + background-color: var(--sidebar-highlight) !important; + border-radius: 4px !important; + } + + /* + BOOKMARKS BAR + */ + + #PersonalToolbar { + background-color: var(--secondary) !important; + } + + /* + _____ _ ___ ___ + |_ _/ \ | _ ) __| + | |/ = \| _ \__ \ + |_/_/ \_\___/___/ + + */ + .tab-background[selected="true"] { + background-color: transparent !important; + background-image: none !important; + } + .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected="true"]):not([multiselected]){ + background-color: transparent !important; + } + + .tabbrowser-tab[soundplaying="true"] { + --lwt-tab-line-color: var(--sound-border) !important; + } + .tab-content[selected="true"] { + border-color: var(--orange-highlight) !important; + --sound-border: var(--orange-highlight) !important; + } + .tab-text { + color: var(--foreground); + } + + tab, + #tabbrowser-tabs + { + background-color: var(--background) !important; + color : var(--foreground) !important; + } + tab:-moz-window-inactive, + #tabbrowser-tabs:-moz-window-inactive, + #nav-bar-customization-target + { + background-color: var(--secondary) !important; + } + + .tabbrowser-tab[selected]{ + opacity: 1; + } + + .tab-loading-burst { + background-color: inherit; + } + + .tab-content + { + border-radius: 4px; + margin: 5px 0px 5px 0px !important; + border: 1px solid transparent !important; + } + .tab-content[selected="true"] + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + border: 1px solid var(--orange-highlight) !important; + } + .tab-content:not([selected="true"]):hover { + background-color: var(--tab-hover) !important; + } + + /* + ___ _____ ___ _ ___ + | _ )_ _| \| |/ __| + | _ \ | | | |\ | |\__ \ + |___/ |_| |_| \__|/___/ + + */ + + /* + Toolbar buttons + */ + + toolbarbutton { + fill: var(--foreground) !important; + background-color: transparent !important; + } + + /* + TAB BAR BUTTONS + */ + + #TabsToolbar toolbarbutton { + border-radius: 4px; + border: 1px solid transparent !important; + } + #TabsToolbar toolbarbutton:-moz-window-inactive { + opacity: 0.7 !important; + } + + #alltabs-button > .toolbarbutton-badge-stack, + #tabs-newtab-button > .toolbarbutton-icon { + background-image: none; + border-radius: 6px; + } + #alltabs-button:hover > .toolbarbutton-badge-stack, + #tabs-newtab-button:hover > .toolbarbutton-icon { + background-color: var(--tab-btn-hover) !important; + } + + /* Firefox View button */ + #TabsToolbar #firefox-view-button > .toolbarbutton-icon + { + background-image: none !important; + border-radius: 4px; + } + #TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + padding: 9px !important; + border: 1px solid var(--orange-highlight) !important; + } + #TabsToolbar #firefox-view-button:not([open]):hover > .toolbarbutton-icon { + background-color: var(--tab-hover) !important; + } + + /* + MIDDLE BAR (url bar) BUTTONS + */ + + #nav-bar toolbarbutton > .toolbarbutton-icon, + #nav-bar toolbarbutton > .toolbarbutton-badge-stack { + border-radius: 6px; + } + #nav-bar toolbarbutton:hover > .toolbarbutton-icon, + #nav-bar toolbarbutton:hover > .toolbarbutton-badge-stack { + background-color: var(--toolbar-btn-hover) !important; + } + + #back-button { + padding-right: 2px !important; + padding-left: 2px !important; + margin-left: 6px !important; + } + + /* Hamburger Menu */ + #PanelUI-menu-button { + background-color: var(--secondary) !important; + padding-right: 2px !important; + margin-right: 6px !important; + } + + /* + BOOKMARK BUTTONS + */ + #PersonalToolbar toolbarbutton { + margin: 3px 0px 3px 3px !important; + border-radius: 4px; + } + #PersonalToolbar toolbarbutton:hover { + background-color: var(--toolbar-btn-hover) !important; + } + ''; + + userContent = '' + + :root { + --background: #1d2021; + --secondary: #282828; + --newtab-body: #32302f; + --foreground: #EBDBB2; + } + + @-moz-document url-prefix("about:"), url-prefix("about:newtab"), url-prefix("about:home") { + html, body { + color: var(--foreground) !important; + background-color: var(--newtab-body) !important; + } + } + ''; + }; + }; +} diff --git a/modules/apps/helix/default.nix b/modules/apps/helix/default.nix new file mode 100644 index 0000000..a9274fb --- /dev/null +++ b/modules/apps/helix/default.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + home-manager.users.joy.programs.helix = { + enable = true; + defaultEditor = true; + settings = { + keys.normal = { + space.space = "file_picker"; + Z.Z = ":wq"; + Z.Q = ":q!"; + }; + }; + }; + + home-manager.users.joy.home.packages = with pkgs; [ + nil + clang-tools + javascript-typescript-langserver + vscode-langservers-extracted + rust-analyzer + lldb_18 + lua-language-server + jdt-language-server + gopls + dockerfile-language-server-nodejs + python312Packages.python-lsp-server + omnisharp-roslyn + netcoredbg + dotnetCorePackages.sdk_9_0 + texlab + ]; +} diff --git a/modules/apps/newsboat/default.nix b/modules/apps/newsboat/default.nix new file mode 100644 index 0000000..179f3a6 --- /dev/null +++ b/modules/apps/newsboat/default.nix @@ -0,0 +1,132 @@ +{...}: { + home-manager.users.joy.programs.newsboat = { + enable = true; + browser = "firefox"; + urls = [ + { + url = "https://invidious.reallyaweso.me/feed/channel/UCg6gPGh8HU2U01vaFCAsvmQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCYAg4bYdyqENxEyHUX7t1FA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCVls1GmFKf6WlTraIb_IaJg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC5KDiSAFxrDWhmysBcNqtMA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCcBhwZNKqmPaw3Zk7mh6eBg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCwnqDLYzLGPbghL9uIOwMnQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCRSxdcWjoye7ohD_ibxzYhg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChIs72whgZI9w6d6FhwGGHA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCE_K_gW6ReBi4H3Gp0gi-hg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCWRHrWUsjdF86dt7NKK2Ixw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFzUEe9XUlkDLp6AmtNzmOA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxBfQGaMuiMyw1dgW-tpZbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCpes6DXY4XCSA8s9Q1G9ocg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCR42P1Uub9py2H5RkdcTnWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtwjD3551TskyUxnfaUw7Rg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCZpKTYOk5WAdCyMal3J1KHg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCl2mFZoRqjw_ELax4Yisf6w"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC2eYFnH61tmytImy1mTYvhA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC7YOGHUfC1Tb6E4pudI9STA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC0sUzmZ0CHvVCVrpRfGKZfw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFFfGA991VRR4U8FNNs72Qg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCIS-e4W5wK2xG6NbI5Tdm_g"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCKmEAsezQ0kUQ6EC-BtBNbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCgj6MvuVmp0JVanAZkFQM5A"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCohllq0Pk5lQuuNANabHKcg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCUKU3fl8z2rcK7GBdocd7Ww"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCO57urWt8_T63SPFCA_QmNw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtMVHI3AJD4Qk4hcbZnI9ZQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC8ENHE5xdFSwx71u3fDH5Xw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCMXLdjrQi4JzY0NNvCdUEUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCEKtvLc3EIS0T7shmgPbVrw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC_zBdZ0_H_jn41FDRG7q4Tw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChuDUAo3Hfr_0dn54GpwdUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UClonyx8pReBvkjropmrS6jQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCOSqzSTg4QZXdi7jvV-9rUg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxdZ7XCQVMRMipj3gGemQfw"; + } + ]; + extraConfig = '' + bind-key j down + bind-key k up + bind-key j next articlelist + bind-key k prev articlelist + bind-key ge end + bind-key gg home + bind-key l open + bind-key h quit + macro c set browser "setsid -f mpv --no-terminal %u &" ; open-in-browser ; set browser "elinks %u" ''; + }; +} diff --git a/modules/apps/packages/default.nix b/modules/apps/packages/default.nix new file mode 100644 index 0000000..d1b1b89 --- /dev/null +++ b/modules/apps/packages/default.nix @@ -0,0 +1,72 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + #hackerman + fastfetch + cmatrix + cava + nitch + gotop + sl + cbonsai + pipes + #image/video/music/recording + imv + mpv + cmus + obs-studio + pulseaudioFull + #gui stuff + uget + element-desktop + keepassxc + vesktop + signal-desktop + upscayl + nemo + bottles + boxbuddy + waydroid + transmission_4-gtk + #gnome + gnome-calculator + gnome-disk-utility + gnome-clocks + #random shit + htop + alejandra + bat + screen + tree + zip + unzip + scrcpy + appimage-run + yt-dlp + distrobox + font-awesome + lm_sensors + brightnessctl + networkmanagerapplet + ncdu + git + ffmpeg + libnotify + #mutt + mutt-wizard + neomutt + msmtp + curl + isync + pass + lynx + notmuch + abook + mpop + urlscan + vim + #office + sent + texliveFull + ]; +} + diff --git a/modules/apps/rofi/default.nix b/modules/apps/rofi/default.nix new file mode 100644 index 0000000..6b3e78f --- /dev/null +++ b/modules/apps/rofi/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + lib, + ... +}: { + home-manager.users.joy.programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + theme = lib.mkForce "~/nix/modules/rofi/gruvbox-material.rasi"; + extraConfig = { + display-ssh = ""; + display-run = ""; + display-drun = ""; + display-window = ""; + display-combi = ""; + show-icons = true; + terminal = "alacritty"; + }; + }; +} diff --git a/modules/apps/rofi/gruvbox-material.rasi b/modules/apps/rofi/gruvbox-material.rasi new file mode 100644 index 0000000..f75bc2c --- /dev/null +++ b/modules/apps/rofi/gruvbox-material.rasi @@ -0,0 +1,149 @@ +/** + * Gruvbox rofi theme + * + * Color palette imported from https://github.com/sainnhe/gruvbox-material + * + */ + +* { + gruv0: #282828; + gruv1: #32302f; + gruv2: #45403d; + gruv3: #5a524c; + + gruv4: #fbf1c7; + gruv5: #f4e8be; + gruv6: #eee0b7; + + gruv7: #a89984; + gruv8: #928374; + gruv9: #7c6f64; + gruv10: #504945; + red: #ea6962; + + orange: #e78a4e; + yellow: #d8a657; + aqua: #89b482; + purple: #d3869b; + + reddark: #c14a4a; + yellowdark: #b47109; + + foreground: @gruv9; + background-color: transparent; + + highlight: underline bold #eee0b7; + + transparent: rgba(46,52,64,0); + +} + +window { + location: center; + anchor: center; + border-radius: 10px; + height: 560px; + width: 600px; + + background-color: @transparent; + spacing: 0; + children: [mainbox]; + orientation: horizontal; +} + +mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +message { + padding: 10px; + border: 0px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv7; +} + +inputbar { + color: @gruv6; + padding: 14px; + background-color: @gruv0; + border-color: @gruv0; + + border: 1px; + border-radius: 10px 10px 0px 0px; +} + +entry, prompt, case-indicator { + text-font: inherit; + text-color: inherit; +} + +prompt { + margin: 0px 1em 0em 0em ; +} + +listview { + padding: 8px; + border-radius: 0px 0px 10px 10px; + border: 2px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv0; + dynamic: false; +} + +element { + padding: 5px; + vertical-align: 0.5; + border-radius: 10px; + color: @foreground; + text-color: @gruv6; + background-color: @gruv1; +} + +element.normal.active { + background-color: @yellow; +} + +element.normal.urgent { + background-color: @reddark; +} + +element.selected.normal { + background-color: @gruv7; + text-color: @gruv0; +} + +element.selected.active { + background-color: @yellowdark; +} + +element.selected.urgent { + background-color: @red; +} + +element.alternate.normal { + background-color: @transparent; +} + +element-text, element-icon { + size: 3ch; + margin: 0 10 0 0; + vertical-align: 0.5; + background-color: inherit; + text-color: @gruv6; +} + +button { + padding: 6px; + color: @foreground; + horizontal-align: 0.5; + + border: 2px 0px 2px 2px; + border-radius: 10px; + border-color: @foreground; +} + +button.selected.normal { + border: 2px 0px 2px 2px; + border-color: @foreground; +} diff --git a/modules/apps/vm/default.nix b/modules/apps/vm/default.nix new file mode 100644 index 0000000..20b7c77 --- /dev/null +++ b/modules/apps/vm/default.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: { + programs.dconf.enable = true; + + users.users.joy.extraGroups = ["libvirtd"]; + + environment.systemPackages = with pkgs; [ + virt-manager + virt-viewer + spice + spice-gtk + spice-protocol + win-virtio + win-spice + virtiofsd + freerdp + ]; + + virtualisation = { + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + ovmf.enable = true; + ovmf.packages = [pkgs.OVMFFull.fd]; + }; + }; + spiceUSBRedirection.enable = true; + }; + services.spice-vdagentd.enable = true; +} diff --git a/modules/apps/zsh/default.nix b/modules/apps/zsh/default.nix new file mode 100644 index 0000000..b492bc9 --- /dev/null +++ b/modules/apps/zsh/default.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + home-manager.users.joy.programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + enableCompletion = true; + autosuggestion.enable = true; + historySubstringSearch.enable = true; + dotDir = ".config/zsh"; + initExtra = "PROMPT='%F{green}%~%f '"; + + shellAliases = { + v = "hx"; + cat = "bat"; + cn = "cd ~/nix"; + ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first"; + pu = "sh ~/nix/modules/zsh/scripts/push.sh"; + ip = "sh ~/nix/modules/zsh/scripts/ip.sh"; + fr = "sudo systemctl reboot --firmware"; + ser = "ssh root@joygnu.org"; + rb = "sh ~/nix/modules/zsh/scripts/rebuild.sh"; + up = "sudo nix flake update ~/nix"; + del = "sudo nix-collect-garbage -d"; + }; + + history.size = 1000000; + history.path = ".config/zsh/history"; + }; +} diff --git a/modules/apps/zsh/scripts/ip.sh b/modules/apps/zsh/scripts/ip.sh new file mode 100755 index 0000000..42c0432 --- /dev/null +++ b/modules/apps/zsh/scripts/ip.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +local_ip=$(ip -4 addr show scope global | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1) + +public_ip=$(curl -s ifconfig.me) + +echo "Local IP Address: $local_ip" +echo "Public IP Address: $public_ip" diff --git a/modules/apps/zsh/scripts/push.sh b/modules/apps/zsh/scripts/push.sh new file mode 100755 index 0000000..769c35d --- /dev/null +++ b/modules/apps/zsh/scripts/push.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Function to push to all remotes +push_to_all_remotes() { + # Get a list of all remotes + remotes=$(git remote) + + # Check if there are no remotes + if [ -z "$remotes" ]; then + echo "No remotes found." + exit 1 + fi + + # Loop through each remote and push + for remote in $remotes; do + echo "Pushing to remote '$remote'..." + git push "$remote" --all + git push "$remote" --tags + echo "Push to remote '$remote' completed." + done +} + +# Execute the function +push_to_all_remotes + diff --git a/modules/apps/zsh/scripts/rebuild.sh b/modules/apps/zsh/scripts/rebuild.sh new file mode 100755 index 0000000..77032a9 --- /dev/null +++ b/modules/apps/zsh/scripts/rebuild.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +hostname=$(hostname) + +git add . + +if [[ $hostname == *"desktop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#desktop +elif [[ $hostname == *"laptop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#laptop +fi diff --git a/modules/desktop/ags/bar/config.js b/modules/desktop/ags/bar/config.js new file mode 100644 index 0000000..2a12735 --- /dev/null +++ b/modules/desktop/ags/bar/config.js @@ -0,0 +1,201 @@ +const hyprland = await Service.import("hyprland") +const mpris = await Service.import("mpris") +const audio = await Service.import("audio") +const battery = await Service.import("battery") +const systemtray = await Service.import("systemtray") + +const date = Variable("", { + poll: [1000, 'date "+%H:%M:%S %b %e."'], +}) + +function Workspaces() { + const activeId = hyprland.active.workspace.bind("id"); + const workspaces = hyprland.bind("workspaces").as((ws) => + ws + .filter(({ id }) => id > 0) + .sort((a, b) => a.id - b.id) + .map(({ id }) => + Widget.Button({ + on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), + child: Widget.Label(`${id}`), + class_name: activeId.as(i => `${i === id ? "focused" : ""}`), + }))) + + return Widget.Box({ + class_name: "workspaces", + children: workspaces, + }) +} + + +function ClientTitle() { + return Widget.Label({ + class_name: "client-title", + label: hyprland.active.client.bind("title"), + }) +} + + +function Clock() { + return Widget.Label({ + class_name: "clock", + label: date.bind(), + }) +} + + + + +function Media() { + const label = Utils.watch("", mpris, "player-changed", () => { + if (mpris.players[0]) { + const { track_artists, track_title } = mpris.players[0] + return `${track_artists.join(", ")} - ${track_title}` + } else { + return "Nothing is playing" + } + }) + + return Widget.Button({ + class_name: "media", + on_primary_click: () => mpris.getPlayer("")?.playPause(), + on_scroll_up: () => mpris.getPlayer("")?.next(), + on_scroll_down: () => mpris.getPlayer("")?.previous(), + child: Widget.Label({ label }), + }) +} + + +function Volume() { + const icons = { + 101: "overamplified", + 67: "high", + 34: "medium", + 1: "low", + 0: "muted", + } + + function getIcon() { + const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( + threshold => threshold <= audio.speaker.volume * 100) + + return `audio-volume-${icons[icon]}-symbolic` + } + + const icon = Widget.Icon({ + icon: Utils.watch(getIcon(), audio.speaker, getIcon), + }) + + const slider = Widget.Slider({ + hexpand: true, + draw_value: false, + on_change: ({ value }) => audio.speaker.volume = value, + setup: self => self.hook(audio.speaker, () => { + self.value = audio.speaker.volume || 0 + }), + }) + + return Widget.Box({ + class_name: "volume", + css: "min-width: 180px", + children: [icon, slider], + }) +} + + +function BatteryLabel() { + const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) + const icon = battery.bind("percent").as(p => + `battery-level-${Math.floor(p / 10) * 10}-symbolic`) + + return Widget.Box({ + class_name: "battery", + visible: battery.bind("available"), + children: [ + Widget.Icon({ icon }), + Widget.LevelBar({ + widthRequest: 140, + vpack: "center", + value, + }), + ], + }) +} + + +function SysTray() { + const items = systemtray.bind("items") + .as(items => items.map(item => Widget.Button({ + child: Widget.Icon({ icon: item.bind("icon") }), + on_primary_click: (_, event) => item.activate(event), + on_secondary_click: (_, event) => item.openMenu(event), + tooltip_markup: item.bind("tooltip_markup"), + }))) + + return Widget.Box({ + children: items, + }) +} + + +// layout of the bar +function Left() { + return Widget.Box({ + spacing: 8, + children: [ + Workspaces(), + ClientTitle(), + ], + }) +} + +function Center() { + return Widget.Box({ + spacing: 8, + children: [ + Media(), + ], + }) +} + +function Right() { + return Widget.Box({ + hpack: "end", + spacing: 8, + children: [ + Volume(), + BatteryLabel(), + Clock(), + SysTray(), + ], + }) +} + +function Bar(monitor = 0) { + return Widget.Window({ + name: `bar-${monitor}`, // name has to be unique + class_name: "bar", + monitor, + anchor: ["top", "left", "right"], + exclusivity: "exclusive", + child: Widget.CenterBox({ + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), + }) +} + +App.config({ + style: "./style.css", + windows: [ + Bar(), + + // you can call it, for each monitor + // Bar(0), + // Bar(1) + ], +}) + +export { } + diff --git a/modules/desktop/ags/bar/style.css b/modules/desktop/ags/bar/style.css new file mode 100644 index 0000000..29f8fdd --- /dev/null +++ b/modules/desktop/ags/bar/style.css @@ -0,0 +1,40 @@ +window.bar { + background-color: @theme_bg_color; + color: @theme_fg_color; +} + +button { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + background-color: transparent; +} + +button:active { + background-color: @theme_selected_bg_color; +} + +button:hover { + border-bottom: 3px solid @theme_fg_color; +} + +label { + font-weight: bold; +} + +.workspaces button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + +.client-title { + color: @theme_selected_bg_color; +} + +.notification { + color: yellow; +} + +levelbar block, +highlight { + min-height: 10px; +} diff --git a/modules/desktop/ags/default.nix b/modules/desktop/ags/default.nix new file mode 100644 index 0000000..dd4c841 --- /dev/null +++ b/modules/desktop/ags/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + home-manager.users.joy.imports = [inputs.ags.homeManagerModules.default]; + home-manager.users.joy.programs.ags = { + enable = true; + configDir = ./bar; + }; +} diff --git a/modules/desktop/ags/tsconfig.json b/modules/desktop/ags/tsconfig.json new file mode 100644 index 0000000..bdd7690 --- /dev/null +++ b/modules/desktop/ags/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "lib": [ + "ES2022" + ], + "allowJs": true, + "checkJs": true, + "strict": true, + "noImplicitAny": false, + "baseUrl": ".", + "typeRoots": [ + "./types" + ], + "skipLibCheck": true + } + // "include": [ + // "*/*.ts" + // ] +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..6f87207 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./ags + ./hypridle + ./hyprland + ]; +} diff --git a/modules/desktop/hypridle/default.nix b/modules/desktop/hypridle/default.nix new file mode 100644 index 0000000..c4f0e87 --- /dev/null +++ b/modules/desktop/hypridle/default.nix @@ -0,0 +1,19 @@ +{...}: { + home-manager.users.joy.services.hypridle = { + # enable = true; + settings = { + listener = [ + { + timeout = 300; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 600; + on-timeout = "systemctl suspend"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix new file mode 100644 index 0000000..d374f25 --- /dev/null +++ b/modules/desktop/hyprland/default.nix @@ -0,0 +1,195 @@ +{pkgs, ...}: { + home-manager.users.joy.home.packages = with pkgs; [ + rofi-wayland + pwvucontrol + swww + wl-clipboard + cliphist + grim + slurp + hyprpicker + swappy + hypridle + playerctl + ]; + + home-manager.users.joy.services.cliphist.enable = true; + + home-manager.users.joy.wayland.windowManager.hyprland = { + enable = true; + + settings = { + "$mod" = "SUPER"; + "$scrPath" = "~/nix/modules/desktop/hyprland/scirpts"; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + cursor = { + inactive_timeout = "3"; + }; + + env = [ + "HYPRCURSOR_THEME = Bibata-Modern-Ice" + "HYPRCURSOR_SIZE = 24" + "NIXOS_OZONE_WL = 1" + ]; + + xwayland = { + force_zero_scaling = true; + }; + + monitor = [ + "DP-1,2560x1440@165.00Hz,auto,1,bitdepth,10" + "eDP-1,prefrered,auto,1" + "HDMI-A-1,prefrered,auto,1,mirror,eDP-1" + ]; + + exec-once = [ + "ags" + "sh ~/nix/modules/desktop/hyprland/scripts/hypridle.sh" + ]; + + windowrule = [ + "float,title:^(Pipewire)(.*)$" + "float,title:^(Disks)(.*)$" + "float,title:^(Calculator)(.*)$" + "float,title:^(Bluetooth)(.*)$" + "float,title:^(Clocks)(.*)$" + "float,title:^(Network Connections)(.*)$" + "opacity 0.9,^(Alacritty)(.*)$" + ]; + + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + workspace_swipe_distance = 200; + }; + + bind = [ + # launch Apps + "$mod,TAB, exec, alacritty" + "$mod, E, exec, nemo" + "$mod, S, exec, firefox" + "$mod, X, exec, keepassxc" + "$mod, M, exec, mw -Y && alacritty -e neomutt" + "$mod, N, exec, alacritty -e newsboat" + "$mod, A, exec, rofi -show drun" + "$mod, F, exec, freetube" + "$mod, C, exec, hyprpicker -a" + "$mod+Shift, W, exec, sh ~/nix/modules/desktop/hyprland/scripts/vm.sh" + "$mod+Shift, Z, exec, grim - | swappy -f -" + "$mod, Z, exec, sh ~/nix/modules/desktop/hyprland/scripts/screen.sh" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + "$mod, O, exec, sh ~/nix/modules/desktop/hyprland/scripts/mpv.sh" + + # controles + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, R, togglesplit" + "$mod+shift, S, exec, systemctl suspend" + "$mod+shift, M, exit, hyprland" + "$mod, G, exec, sh ~/nix/modules/desktop/hyprland/scripts/gamemode.sh" + "$mod+shift, B, exec, sh ~/nix/modules/desktop/hyprland/scripts/ags.sh" + "$mod, up, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -i" + "$mod, down, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -d" + "$mod, P, exec, hyprctl dispatch togglefloating && hyprctl dispatch pin" + + # cmus + "$mod, D, exec, sh ~/nix/modules/desktop/hyprland/scripts/cmus.sh" + "$mod, space, exec, playerctl play-pause" + "$mod, comma, exec, playerctl previous" + "$mod, period, exec, playerctl next" + "$mod, equal, exec, cmus-remote -v +10%" + "$mod, minus, exec, cmus-remote -v -10%" + + # Move focus + "$mod, Return, fullscreen" + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + + # Window resizing X Y + "CTRL+SHIFT, H, resizeactive, -60 0" + "CTRL+SHIFT, L, resizeactive, 60 0" + "CTRL+SHIFT, K, resizeactive, 0 -60" + "CTRL+SHIFT, J, resizeactive, 0 60" + + # Moving windows + "$mod SHIFT, H, swapwindow, l" + "$mod SHIFT, L, swapwindow, r" + "$mod SHIFT, K, swapwindow, u" + "$mod SHIFT, J, swapwindow, d" + + # Switch workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + # Move active window to a workspace + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + bindl = [ + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" + ", XF86AudioRaiseVolume, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -i" + ", XF86AudioLowerVolume, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -d" + ", XF86AudioMute, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -m" + ", XF86AudioMicMute, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -t" + ]; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 4; + allow_tearing = false; + layout = "master"; + }; + + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + decoration = { + rounding = 5; + }; + + input = { + kb_layout = "us,de"; + kb_variant = ",qwerty"; + kb_options = "grp:alt_shift_toggle,caps:swapescape"; + }; + + device = { + name = "at-translated-set-2-keyboard"; + repeat_rate = "50"; + }; + }; + }; +} diff --git a/modules/desktop/hyprland/scripts/ags.sh b/modules/desktop/hyprland/scripts/ags.sh new file mode 100755 index 0000000..60709fa --- /dev/null +++ b/modules/desktop/hyprland/scripts/ags.sh @@ -0,0 +1,4 @@ +#/bin/sh + +pkill ags +ags diff --git a/modules/desktop/hyprland/scripts/cmus.sh b/modules/desktop/hyprland/scripts/cmus.sh new file mode 100755 index 0000000..375e67f --- /dev/null +++ b/modules/desktop/hyprland/scripts/cmus.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if screen -list | grep -q '\.cmus'; then + alacritty -e screen -r cmus +else + screen -dmS cmus cmus & + alacritty -e screen -r cmus +fi + diff --git a/modules/desktop/hyprland/scripts/gamemode.sh b/modules/desktop/hyprland/scripts/gamemode.sh new file mode 100755 index 0000000..b89b5c4 --- /dev/null +++ b/modules/desktop/hyprland/scripts/gamemode.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') +if [ "$HYPRGAMEMODE" = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:drop_shadow 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + exit +fi +hyprctl reload diff --git a/modules/desktop/hyprland/scripts/hypridle.sh b/modules/desktop/hyprland/scripts/hypridle.sh new file mode 100755 index 0000000..cf4ef17 --- /dev/null +++ b/modules/desktop/hyprland/scripts/hypridle.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +hostname=$(hostname) + +if [ "$hostname" = "laptop" ]; then + hyprilde +fi diff --git a/modules/desktop/hyprland/scripts/mpv.sh b/modules/desktop/hyprland/scripts/mpv.sh new file mode 100755 index 0000000..2eccf05 --- /dev/null +++ b/modules/desktop/hyprland/scripts/mpv.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Get the link from the clipboard using wl-paste +link=$(wl-paste) + +# Check if a link was provided +if [ -n "$link" ]; then + # Open the link in mpv + mpv "$link" +else + echo "No URL provided." +fi diff --git a/modules/desktop/hyprland/scripts/screen.sh b/modules/desktop/hyprland/scripts/screen.sh new file mode 100755 index 0000000..d705daf --- /dev/null +++ b/modules/desktop/hyprland/scripts/screen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +grim -g "$(slurp)" - | swappy -f - + diff --git a/modules/desktop/hyprland/scripts/vm.sh b/modules/desktop/hyprland/scripts/vm.sh new file mode 100755 index 0000000..e1a6e71 --- /dev/null +++ b/modules/desktop/hyprland/scripts/vm.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +VM_NAME="Windows" + +vm_state=$(virsh --connect qemu:///system domstate "$VM_NAME") + +if [ "$vm_state" != "running" ]; then + virsh --connect qemu:///system start "$VM_NAME" + sleep 20 +fi + +# Get the IP address of the VM +VM_IP=$(virsh --connect qemu:///system domifaddr "$VM_NAME" | grep -oP '(\d+\.){3}\d+' | head -1) + +if [ -z "$VM_IP" ]; then + echo "Failed to retrieve IP address for VM: $VM_NAME" + exit 1 +fi + +xfreerdp -grab-keyboard /v:"$VM_IP" /u:joy /p:1 /size:100% /dynamic-resolution /gfx-h264:avc444 +gfx-progressive /sec:nla /bpp:32 /rfx /rfx-mode:video -bitmap-cache -offscreen-cache -glyph-cache diff --git a/modules/desktop/hyprland/scripts/volume.sh b/modules/desktop/hyprland/scripts/volume.sh new file mode 100755 index 0000000..550e28a --- /dev/null +++ b/modules/desktop/hyprland/scripts/volume.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +usage() { + echo "Usage: $0 [-d|-i|-m|-t]" + echo " -d Decrease volume by 10%" + echo " -i Increase volume by 10%" + echo " -m Toggle mute/unmute for the sink" + echo " -t Toggle mute/unmute for the microphone" + exit 1 +} + +get_default_sink() { + pactl info | grep "Default Sink" | awk '{print $3}' +} + +get_default_source() { + pactl info | grep "Default Source" | awk '{print $3}' +} + +while getopts "dimt" opt; do + case $opt in + d) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" -10% + else + echo "No default sink found." + fi + ;; + i) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" +10% + else + echo "No default sink found." + fi + ;; + m) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + current_mute=$(pactl get-sink-mute "$sink" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-sink-mute "$sink" 0 + echo "Unmuted sink" + else + pactl set-sink-mute "$sink" 1 + echo "Muted sink" + fi + else + echo "No default sink found." + fi + ;; + t) + source=$(get_default_source) + if [ -n "$source" ]; then + current_mute=$(pactl get-source-mute "$source" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-source-mute "$source" 0 + echo "Unmuted microphone" + else + pactl set-source-mute "$source" 1 + echo "Muted microphone" + fi + else + echo "No default source found." + fi + ;; + *) + usage + ;; + esac +done + +sink=$(get_default_sink) +if [ -n "$sink" ]; then + echo "Current volume for sink:" + pactl list sinks | grep -A 15 "$sink" | grep "Volume:" +fi diff --git a/modules/hardware/bluetooth/default.nix b/modules/hardware/bluetooth/default.nix new file mode 100644 index 0000000..5c3033a --- /dev/null +++ b/modules/hardware/bluetooth/default.nix @@ -0,0 +1,4 @@ +{...}: { + services.blueman.enable = true; + hardware.bluetooth.enable = true; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix new file mode 100644 index 0000000..0346b38 --- /dev/null +++ b/modules/hardware/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./bluetooth + ./sound + ]; +} diff --git a/modules/hardware/sound/default.nix b/modules/hardware/sound/default.nix new file mode 100644 index 0000000..4bb78e4 --- /dev/null +++ b/modules/hardware/sound/default.nix @@ -0,0 +1,10 @@ +{...}: { + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/modules/modules/apps/alacritty/default.nix b/modules/modules/apps/alacritty/default.nix new file mode 100644 index 0000000..e457613 --- /dev/null +++ b/modules/modules/apps/alacritty/default.nix @@ -0,0 +1,13 @@ +{...}: { + home-manager.users.joy.programs.alacritty = { + enable = true; + settings = { + window = { + padding = { + x = 5; + y = 5; + }; + }; + }; + }; +} diff --git a/modules/modules/apps/appimage/default.nix b/modules/modules/apps/appimage/default.nix new file mode 100644 index 0000000..2704021 --- /dev/null +++ b/modules/modules/apps/appimage/default.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; +} diff --git a/modules/modules/apps/default.nix b/modules/modules/apps/default.nix new file mode 100644 index 0000000..80d064e --- /dev/null +++ b/modules/modules/apps/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ./alacritty + ./appimage + ./firefox + ./helix + ./newsboat + ./packages + ./rofi + ./vm + ./zsh + ]; +} diff --git a/modules/modules/apps/firefox/default.nix b/modules/modules/apps/firefox/default.nix new file mode 100644 index 0000000..29f1a26 --- /dev/null +++ b/modules/modules/apps/firefox/default.nix @@ -0,0 +1,170 @@ +{inputs, ...}: { + imports = [ + ./user.nix + ]; + + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + search.engines = { + "4get" = { + urls = [ + { + template = "https://4get.joygnu.org/web"; + params = [ + { + name = "s"; + value = "{searchTerms}"; + } + ]; + } + ]; + definedAliases = ["@4get"]; + }; + }; + search.force = true; + search.default = "4get"; + + bookmarks = [ + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "Packages"; + url = "https://search.nixos.org/packages?channel=unstable"; + } + { + name = "Homemanager"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "Stylix"; + url = "https://stylix.danth.me/options/nixos.html"; + } + { + name = "Git"; + url = "https://git.joygnu.org/"; + } + { + name = "Mail"; + url = "https://mail.joygnu.org/"; + } + { + name = "Photos"; + url = "https://immich.joygnu.org/"; + } + { + name = "Server"; + url = "https://avoro.eu/cp/clientarea.php?action=productdetails&id=27920"; + } + { + name = "Domain"; + url = "https://ap.www.namecheap.com/domains/list/"; + } + { + name = "Translate"; + url = "https://simplytranslate.org/"; + } + { + name = "Syncthing"; + url = "http://localhost:8384/"; + } + { + name = "GitHub"; + url = "https://github.com/"; + } + { + name = "Codeberg"; + url = "https://codeberg.org/"; + } + { + name = "Zophar's Domain"; + url = "https://www.zophar.net/music"; + } + { + name = "Hyprland"; + url = "https://wiki.hyprland.org/"; + } + { + name = "Monkeytype"; + url = "https://monkeytype.com/"; + } + { + name = "invidious"; + url = "https://invidious.reallyaweso.me"; + } + ]; + } + ]; + + extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ + ublock-origin + darkreader + libredirect + search-by-image + terms-of-service-didnt-read + decentraleyes + stylus + istilldontcareaboutcookies + ]; + + settings = { + "dom.security.https_only_mode" = true; + "browser.download.panel.shown" = true; + "identity.fxaccounts.enabled" = false; + "signon.rememberSignons" = false; + "browser.urlbar.pocket.featureGate" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "privacy.trackingprotection.enabled" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.uiCustomization.state" = '' + { + "placements": { + "widget-overflow-fixed-list": [], + "nav-bar": [ + "back-button", + "forward-button", + "stop-reload-button", + "urlbar-container", + "downloads-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "toolbar-menubar": [ + "menubar-items" + ], + "TabsToolbar": [ + "tabbrowser-tabs", + "new-tab-button", + "alltabs-button" + ], + "PersonalToolbar": [ + "personal-bookmarks" + ] + }, + "seen": [ + "save-to-pocket-button", + "developer-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "dirtyAreaCache": [ + "nav-bar", + "PersonalToolbar", + "toolbar-menubar", + "TabsToolbar", + "widget-overflow-fixed-list" + ], + "currentVersion": 18, + "newElementCount": 4 + } + ''; + }; + }; + }; +} diff --git a/modules/modules/apps/firefox/user.nix b/modules/modules/apps/firefox/user.nix new file mode 100644 index 0000000..8820e87 --- /dev/null +++ b/modules/modules/apps/firefox/user.nix @@ -0,0 +1,380 @@ +{...}: { + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + userChrome = '' + + /*================== Gruvbox Theme for Firefox ================== + Author: kmason + Based on the color scheme of calvinchd's Gruvbox Dark Firefox Theme - https://gitlab.com/calvinchd/gruvbox-dark-firefox-theme + */ + @namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + + :root { + --background: #1d2021; + --secondary: #282828; + --foreground: #EBDBB2; + + --orange-highlight: #fe8019; + --sound-border: #68217A; + + --separator: #665e54; + + --toolbar-bgcolor: var(--secondary) !important; + + --tab: var(--background); + --tab-btn: var(--tab-inactive); + --tab-inactive: var(--secondary); + --tab-btn-inactive: var(--tab-inactive); + --tab-hover: #32302f; + --tab-btn-hover: #3C3836; + --toolbar-btn-hover: #49463f; + + --url-bar: #3C3836; + --url-focus: #504945; + --url-bar-item-hover: #6a6257; + + --sidebar: #3C3836; + --sidebar-button-hover: #5A544B; + --sidebar-highlight: #458588; + } + + /* + SEARCH AND POPUPS/MENUS + */ + + .panel-arrowcontainer { + background-color: var(--secondary) !important; + } + + #PopupAutoComplete, + #PopupSearchAutoComplete + { + background-color: var(--url-focus) !important; + color: var(--foreground) !important; + } + + panelview { + background-color: var(--sidebar) !important; + color: var(--foreground) !important; + } + + panelview toolbarbutton.subviewbutton:hover { + background-color: var(--sidebar-button-hover) !important; + } + + panel[type="autocomplete-richlistbox"] { + --panel-background: none !important; + border-radius: 4px !important; + color: var(--foreground) !important; + } + + /* + _____ ___ ___ _ ___ _ ___ + |_ _/ _ \ / _ \| | | _ ) / \ | _ \ + | || (_) | (_) | |__| _ \/ = \| / + |_| \___/ \___/|____|___/_/ \_\_|\_\ + + */ + + toolbarseparator, + menuseparator + { + border-color: var(--separator) !important; + border-image: none !important; + } + + toolbar { + background-color: var(--secondary); + } + + toolbar#TabsToolbar { + background-color: var(--background); + } + toolbar#TabsToolbar:-moz-window-inactive { + background-color: var(--toolbar-bgcolor) !important; + } + + #titlebar, + #titlebar-spacer, + #titlebar-buttonbox-container + { + background-color: var(--background) !important; + border: none !important; + } + + #navigator-toolbox { + --tabs-border-color: var(--orange-highlight) !important; + } + + /* Remove border under navbar */ + #navigator-toolbox::after { + border-bottom: 0px !important; + } + + /* remove some borders */ + #navigator-toolbox { + border: none !important; + } + + /* + _ _ ___ _ ___ _ ___ + | | | | _ \| | | _ ) / \ | _ \ + | |_| | /| |__| _ \/ = \| / + \___/|_|\_\____|___/_/ \_\_|\_\ + + */ + + #urlbar, + #searchbar + { + box-shadow: none !important; + border: none !important; + border-radius: 4px; + color : var(--foreground) !important; + background-color: var(--url-bar) !important; + --autocomplete-popup-separator-color: var(--separator) !important; + } + + #urlbar-input, + #urlbar-input-container + { + color: var(--foreground) !important; + background-color: var(--url-bar) !important; + } + + #urlbar:not([open]) #urlbar-input-container:focus-within, + #searchbar:focus-within + { + border: 2px solid var(--orange-highlight) !important; + } + + #urlbar:focus-within, + #urlbar[open], + #urlbar[open] #urlbar-input-container, + #urlbar[open] #urlbar-input, + #urlbar-input-container:focus-within, + #urlbar-input:focus, + #urlbar-background, + .urlbarView, + #searchbar:focus-within, + menupop + { + background-color: var(--url-focus) !important; + } + #searchbar:focus-within { + outline: none !important; + } + + :is(panel, menupopup)::part(content) { + background: none !important; + } + + .urlbarView button:hover, + #searchbar button:hover, + .urlbarView-row:hover .urlbarView-row-inner, + .search-autocomplete-richlistbox-popup .autocomplete-richlistitem:hover + { + background-color: var(--url-bar-item-hover) !important; + } + + .urlbarView-row[type="switchtab"] > span{ + color: var(--orange-highlight) !important; + } + + #PopupSearchAutoComplete .autocomplete-richlistitem[selected], + .searchbar-engine-one-off-item[selected], + .urlbarView-row[selected], + .urlbarView-row[aria-selected="true"], + .urlbarView-row:not([type="tip"], [type="dynamic"])[selected] > .urlbarView-row-inner, + .urlbarView-row-inner[selected] + { + color: var(--foreground) !important; + background-color: var(--sidebar-highlight) !important; + border-radius: 4px !important; + } + + /* + BOOKMARKS BAR + */ + + #PersonalToolbar { + background-color: var(--secondary) !important; + } + + /* + _____ _ ___ ___ + |_ _/ \ | _ ) __| + | |/ = \| _ \__ \ + |_/_/ \_\___/___/ + + */ + .tab-background[selected="true"] { + background-color: transparent !important; + background-image: none !important; + } + .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected="true"]):not([multiselected]){ + background-color: transparent !important; + } + + .tabbrowser-tab[soundplaying="true"] { + --lwt-tab-line-color: var(--sound-border) !important; + } + .tab-content[selected="true"] { + border-color: var(--orange-highlight) !important; + --sound-border: var(--orange-highlight) !important; + } + .tab-text { + color: var(--foreground); + } + + tab, + #tabbrowser-tabs + { + background-color: var(--background) !important; + color : var(--foreground) !important; + } + tab:-moz-window-inactive, + #tabbrowser-tabs:-moz-window-inactive, + #nav-bar-customization-target + { + background-color: var(--secondary) !important; + } + + .tabbrowser-tab[selected]{ + opacity: 1; + } + + .tab-loading-burst { + background-color: inherit; + } + + .tab-content + { + border-radius: 4px; + margin: 5px 0px 5px 0px !important; + border: 1px solid transparent !important; + } + .tab-content[selected="true"] + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + border: 1px solid var(--orange-highlight) !important; + } + .tab-content:not([selected="true"]):hover { + background-color: var(--tab-hover) !important; + } + + /* + ___ _____ ___ _ ___ + | _ )_ _| \| |/ __| + | _ \ | | | |\ | |\__ \ + |___/ |_| |_| \__|/___/ + + */ + + /* + Toolbar buttons + */ + + toolbarbutton { + fill: var(--foreground) !important; + background-color: transparent !important; + } + + /* + TAB BAR BUTTONS + */ + + #TabsToolbar toolbarbutton { + border-radius: 4px; + border: 1px solid transparent !important; + } + #TabsToolbar toolbarbutton:-moz-window-inactive { + opacity: 0.7 !important; + } + + #alltabs-button > .toolbarbutton-badge-stack, + #tabs-newtab-button > .toolbarbutton-icon { + background-image: none; + border-radius: 6px; + } + #alltabs-button:hover > .toolbarbutton-badge-stack, + #tabs-newtab-button:hover > .toolbarbutton-icon { + background-color: var(--tab-btn-hover) !important; + } + + /* Firefox View button */ + #TabsToolbar #firefox-view-button > .toolbarbutton-icon + { + background-image: none !important; + border-radius: 4px; + } + #TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + padding: 9px !important; + border: 1px solid var(--orange-highlight) !important; + } + #TabsToolbar #firefox-view-button:not([open]):hover > .toolbarbutton-icon { + background-color: var(--tab-hover) !important; + } + + /* + MIDDLE BAR (url bar) BUTTONS + */ + + #nav-bar toolbarbutton > .toolbarbutton-icon, + #nav-bar toolbarbutton > .toolbarbutton-badge-stack { + border-radius: 6px; + } + #nav-bar toolbarbutton:hover > .toolbarbutton-icon, + #nav-bar toolbarbutton:hover > .toolbarbutton-badge-stack { + background-color: var(--toolbar-btn-hover) !important; + } + + #back-button { + padding-right: 2px !important; + padding-left: 2px !important; + margin-left: 6px !important; + } + + /* Hamburger Menu */ + #PanelUI-menu-button { + background-color: var(--secondary) !important; + padding-right: 2px !important; + margin-right: 6px !important; + } + + /* + BOOKMARK BUTTONS + */ + #PersonalToolbar toolbarbutton { + margin: 3px 0px 3px 3px !important; + border-radius: 4px; + } + #PersonalToolbar toolbarbutton:hover { + background-color: var(--toolbar-btn-hover) !important; + } + ''; + + userContent = '' + + :root { + --background: #1d2021; + --secondary: #282828; + --newtab-body: #32302f; + --foreground: #EBDBB2; + } + + @-moz-document url-prefix("about:"), url-prefix("about:newtab"), url-prefix("about:home") { + html, body { + color: var(--foreground) !important; + background-color: var(--newtab-body) !important; + } + } + ''; + }; + }; +} diff --git a/modules/modules/apps/helix/default.nix b/modules/modules/apps/helix/default.nix new file mode 100644 index 0000000..a9274fb --- /dev/null +++ b/modules/modules/apps/helix/default.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + home-manager.users.joy.programs.helix = { + enable = true; + defaultEditor = true; + settings = { + keys.normal = { + space.space = "file_picker"; + Z.Z = ":wq"; + Z.Q = ":q!"; + }; + }; + }; + + home-manager.users.joy.home.packages = with pkgs; [ + nil + clang-tools + javascript-typescript-langserver + vscode-langservers-extracted + rust-analyzer + lldb_18 + lua-language-server + jdt-language-server + gopls + dockerfile-language-server-nodejs + python312Packages.python-lsp-server + omnisharp-roslyn + netcoredbg + dotnetCorePackages.sdk_9_0 + texlab + ]; +} diff --git a/modules/modules/apps/newsboat/default.nix b/modules/modules/apps/newsboat/default.nix new file mode 100644 index 0000000..179f3a6 --- /dev/null +++ b/modules/modules/apps/newsboat/default.nix @@ -0,0 +1,132 @@ +{...}: { + home-manager.users.joy.programs.newsboat = { + enable = true; + browser = "firefox"; + urls = [ + { + url = "https://invidious.reallyaweso.me/feed/channel/UCg6gPGh8HU2U01vaFCAsvmQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCYAg4bYdyqENxEyHUX7t1FA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCVls1GmFKf6WlTraIb_IaJg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC5KDiSAFxrDWhmysBcNqtMA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCcBhwZNKqmPaw3Zk7mh6eBg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCwnqDLYzLGPbghL9uIOwMnQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCRSxdcWjoye7ohD_ibxzYhg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChIs72whgZI9w6d6FhwGGHA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCE_K_gW6ReBi4H3Gp0gi-hg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCWRHrWUsjdF86dt7NKK2Ixw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFzUEe9XUlkDLp6AmtNzmOA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxBfQGaMuiMyw1dgW-tpZbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCpes6DXY4XCSA8s9Q1G9ocg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCR42P1Uub9py2H5RkdcTnWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtwjD3551TskyUxnfaUw7Rg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCZpKTYOk5WAdCyMal3J1KHg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCl2mFZoRqjw_ELax4Yisf6w"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC2eYFnH61tmytImy1mTYvhA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC7YOGHUfC1Tb6E4pudI9STA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC0sUzmZ0CHvVCVrpRfGKZfw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFFfGA991VRR4U8FNNs72Qg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCIS-e4W5wK2xG6NbI5Tdm_g"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCKmEAsezQ0kUQ6EC-BtBNbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCgj6MvuVmp0JVanAZkFQM5A"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCohllq0Pk5lQuuNANabHKcg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCUKU3fl8z2rcK7GBdocd7Ww"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCO57urWt8_T63SPFCA_QmNw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtMVHI3AJD4Qk4hcbZnI9ZQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC8ENHE5xdFSwx71u3fDH5Xw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCMXLdjrQi4JzY0NNvCdUEUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCEKtvLc3EIS0T7shmgPbVrw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC_zBdZ0_H_jn41FDRG7q4Tw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChuDUAo3Hfr_0dn54GpwdUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UClonyx8pReBvkjropmrS6jQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCOSqzSTg4QZXdi7jvV-9rUg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxdZ7XCQVMRMipj3gGemQfw"; + } + ]; + extraConfig = '' + bind-key j down + bind-key k up + bind-key j next articlelist + bind-key k prev articlelist + bind-key ge end + bind-key gg home + bind-key l open + bind-key h quit + macro c set browser "setsid -f mpv --no-terminal %u &" ; open-in-browser ; set browser "elinks %u" ''; + }; +} diff --git a/modules/modules/apps/packages/default.nix b/modules/modules/apps/packages/default.nix new file mode 100644 index 0000000..d1b1b89 --- /dev/null +++ b/modules/modules/apps/packages/default.nix @@ -0,0 +1,72 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + #hackerman + fastfetch + cmatrix + cava + nitch + gotop + sl + cbonsai + pipes + #image/video/music/recording + imv + mpv + cmus + obs-studio + pulseaudioFull + #gui stuff + uget + element-desktop + keepassxc + vesktop + signal-desktop + upscayl + nemo + bottles + boxbuddy + waydroid + transmission_4-gtk + #gnome + gnome-calculator + gnome-disk-utility + gnome-clocks + #random shit + htop + alejandra + bat + screen + tree + zip + unzip + scrcpy + appimage-run + yt-dlp + distrobox + font-awesome + lm_sensors + brightnessctl + networkmanagerapplet + ncdu + git + ffmpeg + libnotify + #mutt + mutt-wizard + neomutt + msmtp + curl + isync + pass + lynx + notmuch + abook + mpop + urlscan + vim + #office + sent + texliveFull + ]; +} + diff --git a/modules/modules/apps/rofi/default.nix b/modules/modules/apps/rofi/default.nix new file mode 100644 index 0000000..6b3e78f --- /dev/null +++ b/modules/modules/apps/rofi/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + lib, + ... +}: { + home-manager.users.joy.programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + theme = lib.mkForce "~/nix/modules/rofi/gruvbox-material.rasi"; + extraConfig = { + display-ssh = ""; + display-run = ""; + display-drun = ""; + display-window = ""; + display-combi = ""; + show-icons = true; + terminal = "alacritty"; + }; + }; +} diff --git a/modules/modules/apps/rofi/gruvbox-material.rasi b/modules/modules/apps/rofi/gruvbox-material.rasi new file mode 100644 index 0000000..f75bc2c --- /dev/null +++ b/modules/modules/apps/rofi/gruvbox-material.rasi @@ -0,0 +1,149 @@ +/** + * Gruvbox rofi theme + * + * Color palette imported from https://github.com/sainnhe/gruvbox-material + * + */ + +* { + gruv0: #282828; + gruv1: #32302f; + gruv2: #45403d; + gruv3: #5a524c; + + gruv4: #fbf1c7; + gruv5: #f4e8be; + gruv6: #eee0b7; + + gruv7: #a89984; + gruv8: #928374; + gruv9: #7c6f64; + gruv10: #504945; + red: #ea6962; + + orange: #e78a4e; + yellow: #d8a657; + aqua: #89b482; + purple: #d3869b; + + reddark: #c14a4a; + yellowdark: #b47109; + + foreground: @gruv9; + background-color: transparent; + + highlight: underline bold #eee0b7; + + transparent: rgba(46,52,64,0); + +} + +window { + location: center; + anchor: center; + border-radius: 10px; + height: 560px; + width: 600px; + + background-color: @transparent; + spacing: 0; + children: [mainbox]; + orientation: horizontal; +} + +mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +message { + padding: 10px; + border: 0px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv7; +} + +inputbar { + color: @gruv6; + padding: 14px; + background-color: @gruv0; + border-color: @gruv0; + + border: 1px; + border-radius: 10px 10px 0px 0px; +} + +entry, prompt, case-indicator { + text-font: inherit; + text-color: inherit; +} + +prompt { + margin: 0px 1em 0em 0em ; +} + +listview { + padding: 8px; + border-radius: 0px 0px 10px 10px; + border: 2px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv0; + dynamic: false; +} + +element { + padding: 5px; + vertical-align: 0.5; + border-radius: 10px; + color: @foreground; + text-color: @gruv6; + background-color: @gruv1; +} + +element.normal.active { + background-color: @yellow; +} + +element.normal.urgent { + background-color: @reddark; +} + +element.selected.normal { + background-color: @gruv7; + text-color: @gruv0; +} + +element.selected.active { + background-color: @yellowdark; +} + +element.selected.urgent { + background-color: @red; +} + +element.alternate.normal { + background-color: @transparent; +} + +element-text, element-icon { + size: 3ch; + margin: 0 10 0 0; + vertical-align: 0.5; + background-color: inherit; + text-color: @gruv6; +} + +button { + padding: 6px; + color: @foreground; + horizontal-align: 0.5; + + border: 2px 0px 2px 2px; + border-radius: 10px; + border-color: @foreground; +} + +button.selected.normal { + border: 2px 0px 2px 2px; + border-color: @foreground; +} diff --git a/modules/modules/apps/vm/default.nix b/modules/modules/apps/vm/default.nix new file mode 100644 index 0000000..20b7c77 --- /dev/null +++ b/modules/modules/apps/vm/default.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: { + programs.dconf.enable = true; + + users.users.joy.extraGroups = ["libvirtd"]; + + environment.systemPackages = with pkgs; [ + virt-manager + virt-viewer + spice + spice-gtk + spice-protocol + win-virtio + win-spice + virtiofsd + freerdp + ]; + + virtualisation = { + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + ovmf.enable = true; + ovmf.packages = [pkgs.OVMFFull.fd]; + }; + }; + spiceUSBRedirection.enable = true; + }; + services.spice-vdagentd.enable = true; +} diff --git a/modules/modules/apps/zsh/default.nix b/modules/modules/apps/zsh/default.nix new file mode 100644 index 0000000..b492bc9 --- /dev/null +++ b/modules/modules/apps/zsh/default.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + home-manager.users.joy.programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + enableCompletion = true; + autosuggestion.enable = true; + historySubstringSearch.enable = true; + dotDir = ".config/zsh"; + initExtra = "PROMPT='%F{green}%~%f '"; + + shellAliases = { + v = "hx"; + cat = "bat"; + cn = "cd ~/nix"; + ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first"; + pu = "sh ~/nix/modules/zsh/scripts/push.sh"; + ip = "sh ~/nix/modules/zsh/scripts/ip.sh"; + fr = "sudo systemctl reboot --firmware"; + ser = "ssh root@joygnu.org"; + rb = "sh ~/nix/modules/zsh/scripts/rebuild.sh"; + up = "sudo nix flake update ~/nix"; + del = "sudo nix-collect-garbage -d"; + }; + + history.size = 1000000; + history.path = ".config/zsh/history"; + }; +} diff --git a/modules/modules/apps/zsh/scripts/ip.sh b/modules/modules/apps/zsh/scripts/ip.sh new file mode 100755 index 0000000..42c0432 --- /dev/null +++ b/modules/modules/apps/zsh/scripts/ip.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +local_ip=$(ip -4 addr show scope global | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1) + +public_ip=$(curl -s ifconfig.me) + +echo "Local IP Address: $local_ip" +echo "Public IP Address: $public_ip" diff --git a/modules/modules/apps/zsh/scripts/push.sh b/modules/modules/apps/zsh/scripts/push.sh new file mode 100755 index 0000000..769c35d --- /dev/null +++ b/modules/modules/apps/zsh/scripts/push.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Function to push to all remotes +push_to_all_remotes() { + # Get a list of all remotes + remotes=$(git remote) + + # Check if there are no remotes + if [ -z "$remotes" ]; then + echo "No remotes found." + exit 1 + fi + + # Loop through each remote and push + for remote in $remotes; do + echo "Pushing to remote '$remote'..." + git push "$remote" --all + git push "$remote" --tags + echo "Push to remote '$remote' completed." + done +} + +# Execute the function +push_to_all_remotes + diff --git a/modules/modules/apps/zsh/scripts/rebuild.sh b/modules/modules/apps/zsh/scripts/rebuild.sh new file mode 100755 index 0000000..77032a9 --- /dev/null +++ b/modules/modules/apps/zsh/scripts/rebuild.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +hostname=$(hostname) + +git add . + +if [[ $hostname == *"desktop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#desktop +elif [[ $hostname == *"laptop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#laptop +fi diff --git a/modules/modules/default.nix b/modules/modules/default.nix new file mode 100644 index 0000000..c9c4e02 --- /dev/null +++ b/modules/modules/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./apps + ./default.nix + ./desktop + ./hardware + ./services + ./styling + ./system + ./tools + ]; +} diff --git a/modules/modules/desktop/ags/bar/config.js b/modules/modules/desktop/ags/bar/config.js new file mode 100644 index 0000000..2a12735 --- /dev/null +++ b/modules/modules/desktop/ags/bar/config.js @@ -0,0 +1,201 @@ +const hyprland = await Service.import("hyprland") +const mpris = await Service.import("mpris") +const audio = await Service.import("audio") +const battery = await Service.import("battery") +const systemtray = await Service.import("systemtray") + +const date = Variable("", { + poll: [1000, 'date "+%H:%M:%S %b %e."'], +}) + +function Workspaces() { + const activeId = hyprland.active.workspace.bind("id"); + const workspaces = hyprland.bind("workspaces").as((ws) => + ws + .filter(({ id }) => id > 0) + .sort((a, b) => a.id - b.id) + .map(({ id }) => + Widget.Button({ + on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), + child: Widget.Label(`${id}`), + class_name: activeId.as(i => `${i === id ? "focused" : ""}`), + }))) + + return Widget.Box({ + class_name: "workspaces", + children: workspaces, + }) +} + + +function ClientTitle() { + return Widget.Label({ + class_name: "client-title", + label: hyprland.active.client.bind("title"), + }) +} + + +function Clock() { + return Widget.Label({ + class_name: "clock", + label: date.bind(), + }) +} + + + + +function Media() { + const label = Utils.watch("", mpris, "player-changed", () => { + if (mpris.players[0]) { + const { track_artists, track_title } = mpris.players[0] + return `${track_artists.join(", ")} - ${track_title}` + } else { + return "Nothing is playing" + } + }) + + return Widget.Button({ + class_name: "media", + on_primary_click: () => mpris.getPlayer("")?.playPause(), + on_scroll_up: () => mpris.getPlayer("")?.next(), + on_scroll_down: () => mpris.getPlayer("")?.previous(), + child: Widget.Label({ label }), + }) +} + + +function Volume() { + const icons = { + 101: "overamplified", + 67: "high", + 34: "medium", + 1: "low", + 0: "muted", + } + + function getIcon() { + const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( + threshold => threshold <= audio.speaker.volume * 100) + + return `audio-volume-${icons[icon]}-symbolic` + } + + const icon = Widget.Icon({ + icon: Utils.watch(getIcon(), audio.speaker, getIcon), + }) + + const slider = Widget.Slider({ + hexpand: true, + draw_value: false, + on_change: ({ value }) => audio.speaker.volume = value, + setup: self => self.hook(audio.speaker, () => { + self.value = audio.speaker.volume || 0 + }), + }) + + return Widget.Box({ + class_name: "volume", + css: "min-width: 180px", + children: [icon, slider], + }) +} + + +function BatteryLabel() { + const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) + const icon = battery.bind("percent").as(p => + `battery-level-${Math.floor(p / 10) * 10}-symbolic`) + + return Widget.Box({ + class_name: "battery", + visible: battery.bind("available"), + children: [ + Widget.Icon({ icon }), + Widget.LevelBar({ + widthRequest: 140, + vpack: "center", + value, + }), + ], + }) +} + + +function SysTray() { + const items = systemtray.bind("items") + .as(items => items.map(item => Widget.Button({ + child: Widget.Icon({ icon: item.bind("icon") }), + on_primary_click: (_, event) => item.activate(event), + on_secondary_click: (_, event) => item.openMenu(event), + tooltip_markup: item.bind("tooltip_markup"), + }))) + + return Widget.Box({ + children: items, + }) +} + + +// layout of the bar +function Left() { + return Widget.Box({ + spacing: 8, + children: [ + Workspaces(), + ClientTitle(), + ], + }) +} + +function Center() { + return Widget.Box({ + spacing: 8, + children: [ + Media(), + ], + }) +} + +function Right() { + return Widget.Box({ + hpack: "end", + spacing: 8, + children: [ + Volume(), + BatteryLabel(), + Clock(), + SysTray(), + ], + }) +} + +function Bar(monitor = 0) { + return Widget.Window({ + name: `bar-${monitor}`, // name has to be unique + class_name: "bar", + monitor, + anchor: ["top", "left", "right"], + exclusivity: "exclusive", + child: Widget.CenterBox({ + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), + }) +} + +App.config({ + style: "./style.css", + windows: [ + Bar(), + + // you can call it, for each monitor + // Bar(0), + // Bar(1) + ], +}) + +export { } + diff --git a/modules/modules/desktop/ags/bar/style.css b/modules/modules/desktop/ags/bar/style.css new file mode 100644 index 0000000..29f8fdd --- /dev/null +++ b/modules/modules/desktop/ags/bar/style.css @@ -0,0 +1,40 @@ +window.bar { + background-color: @theme_bg_color; + color: @theme_fg_color; +} + +button { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + background-color: transparent; +} + +button:active { + background-color: @theme_selected_bg_color; +} + +button:hover { + border-bottom: 3px solid @theme_fg_color; +} + +label { + font-weight: bold; +} + +.workspaces button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + +.client-title { + color: @theme_selected_bg_color; +} + +.notification { + color: yellow; +} + +levelbar block, +highlight { + min-height: 10px; +} diff --git a/modules/modules/desktop/ags/default.nix b/modules/modules/desktop/ags/default.nix new file mode 100644 index 0000000..dd4c841 --- /dev/null +++ b/modules/modules/desktop/ags/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + home-manager.users.joy.imports = [inputs.ags.homeManagerModules.default]; + home-manager.users.joy.programs.ags = { + enable = true; + configDir = ./bar; + }; +} diff --git a/modules/modules/desktop/ags/tsconfig.json b/modules/modules/desktop/ags/tsconfig.json new file mode 100644 index 0000000..bdd7690 --- /dev/null +++ b/modules/modules/desktop/ags/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "lib": [ + "ES2022" + ], + "allowJs": true, + "checkJs": true, + "strict": true, + "noImplicitAny": false, + "baseUrl": ".", + "typeRoots": [ + "./types" + ], + "skipLibCheck": true + } + // "include": [ + // "*/*.ts" + // ] +} diff --git a/modules/modules/desktop/default.nix b/modules/modules/desktop/default.nix new file mode 100644 index 0000000..6f87207 --- /dev/null +++ b/modules/modules/desktop/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./ags + ./hypridle + ./hyprland + ]; +} diff --git a/modules/modules/desktop/hypridle/default.nix b/modules/modules/desktop/hypridle/default.nix new file mode 100644 index 0000000..c4f0e87 --- /dev/null +++ b/modules/modules/desktop/hypridle/default.nix @@ -0,0 +1,19 @@ +{...}: { + home-manager.users.joy.services.hypridle = { + # enable = true; + settings = { + listener = [ + { + timeout = 300; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 600; + on-timeout = "systemctl suspend"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/modules/modules/desktop/hyprland/default.nix b/modules/modules/desktop/hyprland/default.nix new file mode 100644 index 0000000..d374f25 --- /dev/null +++ b/modules/modules/desktop/hyprland/default.nix @@ -0,0 +1,195 @@ +{pkgs, ...}: { + home-manager.users.joy.home.packages = with pkgs; [ + rofi-wayland + pwvucontrol + swww + wl-clipboard + cliphist + grim + slurp + hyprpicker + swappy + hypridle + playerctl + ]; + + home-manager.users.joy.services.cliphist.enable = true; + + home-manager.users.joy.wayland.windowManager.hyprland = { + enable = true; + + settings = { + "$mod" = "SUPER"; + "$scrPath" = "~/nix/modules/desktop/hyprland/scirpts"; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + cursor = { + inactive_timeout = "3"; + }; + + env = [ + "HYPRCURSOR_THEME = Bibata-Modern-Ice" + "HYPRCURSOR_SIZE = 24" + "NIXOS_OZONE_WL = 1" + ]; + + xwayland = { + force_zero_scaling = true; + }; + + monitor = [ + "DP-1,2560x1440@165.00Hz,auto,1,bitdepth,10" + "eDP-1,prefrered,auto,1" + "HDMI-A-1,prefrered,auto,1,mirror,eDP-1" + ]; + + exec-once = [ + "ags" + "sh ~/nix/modules/desktop/hyprland/scripts/hypridle.sh" + ]; + + windowrule = [ + "float,title:^(Pipewire)(.*)$" + "float,title:^(Disks)(.*)$" + "float,title:^(Calculator)(.*)$" + "float,title:^(Bluetooth)(.*)$" + "float,title:^(Clocks)(.*)$" + "float,title:^(Network Connections)(.*)$" + "opacity 0.9,^(Alacritty)(.*)$" + ]; + + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + workspace_swipe_distance = 200; + }; + + bind = [ + # launch Apps + "$mod,TAB, exec, alacritty" + "$mod, E, exec, nemo" + "$mod, S, exec, firefox" + "$mod, X, exec, keepassxc" + "$mod, M, exec, mw -Y && alacritty -e neomutt" + "$mod, N, exec, alacritty -e newsboat" + "$mod, A, exec, rofi -show drun" + "$mod, F, exec, freetube" + "$mod, C, exec, hyprpicker -a" + "$mod+Shift, W, exec, sh ~/nix/modules/desktop/hyprland/scripts/vm.sh" + "$mod+Shift, Z, exec, grim - | swappy -f -" + "$mod, Z, exec, sh ~/nix/modules/desktop/hyprland/scripts/screen.sh" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + "$mod, O, exec, sh ~/nix/modules/desktop/hyprland/scripts/mpv.sh" + + # controles + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, R, togglesplit" + "$mod+shift, S, exec, systemctl suspend" + "$mod+shift, M, exit, hyprland" + "$mod, G, exec, sh ~/nix/modules/desktop/hyprland/scripts/gamemode.sh" + "$mod+shift, B, exec, sh ~/nix/modules/desktop/hyprland/scripts/ags.sh" + "$mod, up, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -i" + "$mod, down, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -d" + "$mod, P, exec, hyprctl dispatch togglefloating && hyprctl dispatch pin" + + # cmus + "$mod, D, exec, sh ~/nix/modules/desktop/hyprland/scripts/cmus.sh" + "$mod, space, exec, playerctl play-pause" + "$mod, comma, exec, playerctl previous" + "$mod, period, exec, playerctl next" + "$mod, equal, exec, cmus-remote -v +10%" + "$mod, minus, exec, cmus-remote -v -10%" + + # Move focus + "$mod, Return, fullscreen" + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + + # Window resizing X Y + "CTRL+SHIFT, H, resizeactive, -60 0" + "CTRL+SHIFT, L, resizeactive, 60 0" + "CTRL+SHIFT, K, resizeactive, 0 -60" + "CTRL+SHIFT, J, resizeactive, 0 60" + + # Moving windows + "$mod SHIFT, H, swapwindow, l" + "$mod SHIFT, L, swapwindow, r" + "$mod SHIFT, K, swapwindow, u" + "$mod SHIFT, J, swapwindow, d" + + # Switch workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + # Move active window to a workspace + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + bindl = [ + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" + ", XF86AudioRaiseVolume, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -i" + ", XF86AudioLowerVolume, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -d" + ", XF86AudioMute, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -m" + ", XF86AudioMicMute, exec, sh ~/nix/modules/desktop/hyprland/scripts/volume.sh -t" + ]; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 4; + allow_tearing = false; + layout = "master"; + }; + + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + decoration = { + rounding = 5; + }; + + input = { + kb_layout = "us,de"; + kb_variant = ",qwerty"; + kb_options = "grp:alt_shift_toggle,caps:swapescape"; + }; + + device = { + name = "at-translated-set-2-keyboard"; + repeat_rate = "50"; + }; + }; + }; +} diff --git a/modules/modules/desktop/hyprland/scripts/ags.sh b/modules/modules/desktop/hyprland/scripts/ags.sh new file mode 100755 index 0000000..60709fa --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/ags.sh @@ -0,0 +1,4 @@ +#/bin/sh + +pkill ags +ags diff --git a/modules/modules/desktop/hyprland/scripts/cmus.sh b/modules/modules/desktop/hyprland/scripts/cmus.sh new file mode 100755 index 0000000..375e67f --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/cmus.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if screen -list | grep -q '\.cmus'; then + alacritty -e screen -r cmus +else + screen -dmS cmus cmus & + alacritty -e screen -r cmus +fi + diff --git a/modules/modules/desktop/hyprland/scripts/gamemode.sh b/modules/modules/desktop/hyprland/scripts/gamemode.sh new file mode 100755 index 0000000..b89b5c4 --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/gamemode.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') +if [ "$HYPRGAMEMODE" = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:drop_shadow 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + exit +fi +hyprctl reload diff --git a/modules/modules/desktop/hyprland/scripts/hypridle.sh b/modules/modules/desktop/hyprland/scripts/hypridle.sh new file mode 100755 index 0000000..cf4ef17 --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/hypridle.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +hostname=$(hostname) + +if [ "$hostname" = "laptop" ]; then + hyprilde +fi diff --git a/modules/modules/desktop/hyprland/scripts/mpv.sh b/modules/modules/desktop/hyprland/scripts/mpv.sh new file mode 100755 index 0000000..2eccf05 --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/mpv.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Get the link from the clipboard using wl-paste +link=$(wl-paste) + +# Check if a link was provided +if [ -n "$link" ]; then + # Open the link in mpv + mpv "$link" +else + echo "No URL provided." +fi diff --git a/modules/modules/desktop/hyprland/scripts/screen.sh b/modules/modules/desktop/hyprland/scripts/screen.sh new file mode 100755 index 0000000..d705daf --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/screen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +grim -g "$(slurp)" - | swappy -f - + diff --git a/modules/modules/desktop/hyprland/scripts/vm.sh b/modules/modules/desktop/hyprland/scripts/vm.sh new file mode 100755 index 0000000..e1a6e71 --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/vm.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +VM_NAME="Windows" + +vm_state=$(virsh --connect qemu:///system domstate "$VM_NAME") + +if [ "$vm_state" != "running" ]; then + virsh --connect qemu:///system start "$VM_NAME" + sleep 20 +fi + +# Get the IP address of the VM +VM_IP=$(virsh --connect qemu:///system domifaddr "$VM_NAME" | grep -oP '(\d+\.){3}\d+' | head -1) + +if [ -z "$VM_IP" ]; then + echo "Failed to retrieve IP address for VM: $VM_NAME" + exit 1 +fi + +xfreerdp -grab-keyboard /v:"$VM_IP" /u:joy /p:1 /size:100% /dynamic-resolution /gfx-h264:avc444 +gfx-progressive /sec:nla /bpp:32 /rfx /rfx-mode:video -bitmap-cache -offscreen-cache -glyph-cache diff --git a/modules/modules/desktop/hyprland/scripts/volume.sh b/modules/modules/desktop/hyprland/scripts/volume.sh new file mode 100755 index 0000000..550e28a --- /dev/null +++ b/modules/modules/desktop/hyprland/scripts/volume.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +usage() { + echo "Usage: $0 [-d|-i|-m|-t]" + echo " -d Decrease volume by 10%" + echo " -i Increase volume by 10%" + echo " -m Toggle mute/unmute for the sink" + echo " -t Toggle mute/unmute for the microphone" + exit 1 +} + +get_default_sink() { + pactl info | grep "Default Sink" | awk '{print $3}' +} + +get_default_source() { + pactl info | grep "Default Source" | awk '{print $3}' +} + +while getopts "dimt" opt; do + case $opt in + d) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" -10% + else + echo "No default sink found." + fi + ;; + i) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" +10% + else + echo "No default sink found." + fi + ;; + m) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + current_mute=$(pactl get-sink-mute "$sink" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-sink-mute "$sink" 0 + echo "Unmuted sink" + else + pactl set-sink-mute "$sink" 1 + echo "Muted sink" + fi + else + echo "No default sink found." + fi + ;; + t) + source=$(get_default_source) + if [ -n "$source" ]; then + current_mute=$(pactl get-source-mute "$source" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-source-mute "$source" 0 + echo "Unmuted microphone" + else + pactl set-source-mute "$source" 1 + echo "Muted microphone" + fi + else + echo "No default source found." + fi + ;; + *) + usage + ;; + esac +done + +sink=$(get_default_sink) +if [ -n "$sink" ]; then + echo "Current volume for sink:" + pactl list sinks | grep -A 15 "$sink" | grep "Volume:" +fi diff --git a/modules/modules/hardware/bluetooth/default.nix b/modules/modules/hardware/bluetooth/default.nix new file mode 100644 index 0000000..5c3033a --- /dev/null +++ b/modules/modules/hardware/bluetooth/default.nix @@ -0,0 +1,4 @@ +{...}: { + services.blueman.enable = true; + hardware.bluetooth.enable = true; +} diff --git a/modules/modules/hardware/default.nix b/modules/modules/hardware/default.nix new file mode 100644 index 0000000..0346b38 --- /dev/null +++ b/modules/modules/hardware/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./bluetooth + ./sound + ]; +} diff --git a/modules/modules/hardware/sound/default.nix b/modules/modules/hardware/sound/default.nix new file mode 100644 index 0000000..4bb78e4 --- /dev/null +++ b/modules/modules/hardware/sound/default.nix @@ -0,0 +1,10 @@ +{...}: { + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/modules/modules/services/default.nix b/modules/modules/services/default.nix new file mode 100644 index 0000000..35fdce9 --- /dev/null +++ b/modules/modules/services/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./dunst + ./gdm + ./polkit + ./syncthing + ]; +} diff --git a/modules/modules/services/dunst/default.nix b/modules/modules/services/dunst/default.nix new file mode 100644 index 0000000..2c2e575 --- /dev/null +++ b/modules/modules/services/dunst/default.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + home-manager.users.joy.services.dunst = { + enable = true; + # settings = { + # global = { + # frame_color = "#89b4fa"; + # separator_color = "frame"; + # }; + + # urgency_low = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_normal = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_critical = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # frame_color = "#fab387"; + # }; + # }; + }; +} diff --git a/modules/modules/services/gdm/default.nix b/modules/modules/services/gdm/default.nix new file mode 100644 index 0000000..69e11f2 --- /dev/null +++ b/modules/modules/services/gdm/default.nix @@ -0,0 +1,10 @@ +{...}: { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "joy"; + + systemd.services."getty@tty1".enable = false; + systemd.services."autovt@tty1".enable = false; +} diff --git a/modules/modules/services/polkit/default.nix b/modules/modules/services/polkit/default.nix new file mode 100644 index 0000000..25aaa8e --- /dev/null +++ b/modules/modules/services/polkit/default.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + systemd = { + user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = ["graphical-session.target"]; + wants = ["graphical-session.target"]; + after = ["graphical-session.target"]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; +} diff --git a/modules/modules/services/syncthing/default.nix b/modules/modules/services/syncthing/default.nix new file mode 100644 index 0000000..cb6b713 --- /dev/null +++ b/modules/modules/services/syncthing/default.nix @@ -0,0 +1,9 @@ +{...}: { + services = { + syncthing = { + enable = true; + user = "joy"; + configDir = "/home/joy/.config/syncthing"; + }; + }; +} diff --git a/modules/modules/services/syncthing/services/default.nix b/modules/modules/services/syncthing/services/default.nix new file mode 100644 index 0000000..fdebb3f --- /dev/null +++ b/modules/modules/services/syncthing/services/default.nix @@ -0,0 +1,5 @@ +{...}: { + services.devmon.enable = true; + services.udisks2.enable = true; + services.gvfs.enable = true; +} diff --git a/modules/modules/styling/default.nix b/modules/modules/styling/default.nix new file mode 100644 index 0000000..de46e7b --- /dev/null +++ b/modules/modules/styling/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./qt + ./gkt + ./stylix + ]; +} diff --git a/modules/modules/styling/gtk/default.nix b/modules/modules/styling/gtk/default.nix new file mode 100644 index 0000000..44bc138 --- /dev/null +++ b/modules/modules/styling/gtk/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + gruvboxPlus = import ./gruvbox-plus.nix {inherit pkgs;}; +in { + home-manager.users.joy.home.file = { + ".local/share/icons/GruvboxPlus".source = "${gruvboxPlus}"; + }; + + home-manager.users.joy.gtk = { + enable = true; + iconTheme.package = gruvboxPlus; + iconTheme.name = "GruvboxPlus"; + }; + + # qt.enable = true; + # qt.style.name = "adwaita-dark"; + # qt.style.package = pkgs.adwaita-qt; + # qt.platformTheme.name = "adwaita"; +} diff --git a/modules/modules/styling/gtk/gruvbox-plus.nix b/modules/modules/styling/gtk/gruvbox-plus.nix new file mode 100644 index 0000000..92992cc --- /dev/null +++ b/modules/modules/styling/gtk/gruvbox-plus.nix @@ -0,0 +1,19 @@ +{pkgs}: let + link = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v3.1/gruvbox-plus-icon-pack-3.1.zip"; +in + pkgs.stdenv.mkDerivation + { + name = "gruvbox-plus"; + + src = pkgs.fetchurl { + url = link; + sha256 = "sha256-i/AzhYz/ACeXsG5j0kDVfvfA4TwxA3KZJTPwCO4BKmc="; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out + ${pkgs.unzip}/bin/unzip $src -d $out/ + ''; + } diff --git a/modules/modules/styling/qt/default.nix b/modules/modules/styling/qt/default.nix new file mode 100644 index 0000000..0fa5491 --- /dev/null +++ b/modules/modules/styling/qt/default.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: +{ + home-manager.users.joy.qt = { + enable = true; + style.name = "adwaita-dark"; + style.package = pkgs.adwaita-qt; + platformTheme.name = "adwaita"; + }; +} diff --git a/modules/modules/styling/stylix/default.nix b/modules/modules/styling/stylix/default.nix new file mode 100644 index 0000000..570ad78 --- /dev/null +++ b/modules/modules/styling/stylix/default.nix @@ -0,0 +1,41 @@ +{pkgs, ...}: { + stylix = { + enable = true; + + base16Scheme = { + base00 = "282828"; # ---- + base01 = "3c3836"; # --- + base02 = "504945"; # -- + base03 = "665c54"; # - + base04 = "bdae93"; # + + base05 = "d5c4a1"; # ++ + base06 = "ebdbb2"; # +++ + base07 = "fbf1c7"; # ++++ + base08 = "cc241d"; # red + base09 = "fe0819"; # orange + base0A = "d79921"; # yellow + base0B = "98971a"; # green + base0C = "689d6a"; # aqua/cyan + base0D = "458588"; # blue + base0E = "b16286"; # purple + base0F = "a89984"; # brown + }; + + image = ./wallpaper.png; + + cursor = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 24; + }; + + fonts = { + sizes = { + applications = 12; + terminal = 14; + desktop = 12; + popups = 12; + }; + }; + }; +} diff --git a/modules/modules/styling/stylix/wallpaper.png b/modules/modules/styling/stylix/wallpaper.png new file mode 100644 index 0000000..9964649 Binary files /dev/null and b/modules/modules/styling/stylix/wallpaper.png differ diff --git a/modules/modules/system/default.nix b/modules/modules/system/default.nix new file mode 100644 index 0000000..86a8ad4 --- /dev/null +++ b/modules/modules/system/default.nix @@ -0,0 +1,53 @@ + +{ + inputs, + pkgs, + ... +}: { + + users.users.joy = { + isNormalUser = true; + description = "joy"; + extraGroups = ["wheel" "docker"]; + }; + + fonts.packages = with pkgs; [ + font-awesome + (nerdfonts.override {fonts = ["FiraCode"];}) + ]; + + virtualisation.docker.rootless.enable = true; + virtualisation.docker.enable = true; + virtualisation.waydroid.enable = true; + programs.hyprland.enable = true; + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + nix.settings.experimental-features = ["nix-command" "flakes"]; + programs.nix-ld.enable = true; + services.printing.enable = true; + time.timeZone = "Europe/Zurich"; + system.stateVersion = "23.11"; + home-manager.backupFileExtension = "backup"; + home-manager.users.joy.home = { + username = "joy"; + homeDirectory = "/home/joy"; + stateVersion = "23.11"; + sessionVariables = { + }; + }; + + services.devmon.enable = true; + services.udisks2.enable = true; + services.gvfs.enable = true; + + + home-manager.users.joy.programs.home-manager.enable = true; + + home-manager.users.joy.xdg.mimeApps.defaultApplications = { + "text/plain" = ["helix.desktop"]; + "image/*" = ["imv.desktop"]; + "video/png" = ["mpv.desktop"]; + "video/jpg" = ["mpv.desktop"]; + "video/*" = ["mpv.desktop"]; + }; +} diff --git a/modules/modules/tools/default.nix b/modules/modules/tools/default.nix new file mode 100644 index 0000000..43e2ca7 --- /dev/null +++ b/modules/modules/tools/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./git + ./ssh + ./gpg + ]; +} diff --git a/modules/modules/tools/git/default.nix b/modules/modules/tools/git/default.nix new file mode 100644 index 0000000..154f162 --- /dev/null +++ b/modules/modules/tools/git/default.nix @@ -0,0 +1,7 @@ +{...}: { + home-manager.users.joy.programs.git = { + enable = true; + userEmail = "mail@joygnu.org"; + userName = "joygnu"; + }; +} diff --git a/modules/modules/tools/gpg/default.nix b/modules/modules/tools/gpg/default.nix new file mode 100644 index 0000000..95e24d2 --- /dev/null +++ b/modules/modules/tools/gpg/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + pinentryPackage = pkgs.pinentry-curses; + enableSSHSupport = true; + }; +} diff --git a/modules/modules/tools/ssh/default.nix b/modules/modules/tools/ssh/default.nix new file mode 100644 index 0000000..9bd17c0 --- /dev/null +++ b/modules/modules/tools/ssh/default.nix @@ -0,0 +1,16 @@ +{...}: { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + AllowUsers = null; + }; + }; + + users.users.joy = { + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8FnfVKPbbzPmZ3L0KuSMc8GD42rkIoIMay3c/r9zGkMBwRyluwP7OBR7SaTlp/w7iPHom3YwhGYa37HOXp/icSEMvFlYsCQOXWPkf7cNqyhEnycRsMojpKP2a6qxvcnuuCLY+xMwtlsX1h4nJFpsWHb2A62qBgdaOVrBlbVGd2ZuVCgiB+eenVagW3EFAO9jK5r6rSFciND7EMxBKfi6DbRma6UCejwGjpU0AHCZDikw5XKFhLUDbhdb9e02gyQxD5cs4Q2CuZ1PVt+Jb1GwHVnfh3wdEz5v7TWF+RUv85JXlRLrIYd2SEDpA6yvQIIT4YR2Bb1Tc/aC+zTdUdP+HMiBI32GGyplMfrE1dbj3quTfGN6cJ0TfPFOx7K+0N108fM7mehPtGT/uyB9nnMyYeLO45cgA1wMZZcT4egSvnnqe+6NO7j+zR0whl8+SbIru7HUK2Oa67SzxotQ7D8F27rx02Ie4UJqwbPsZGrxL7TlvNKUXQ4mOINkyE79tIshWncO71O6vJWzaoeYiye0mxc0AP3vYozdV3MgN34+5zscb/o4pwOQtthin8Nf1Y6o6H0poUz5YXYBdEKK/O0Wz3kxT6i/oZWZG7a18xCCKYnF1Jgdr7mfxkizLMkRqYsgM9CS0e0KoVJhu78TmMz8Eip9za1ncvGg3w1ZW6VG/6w==" + ]; + }; +} diff --git a/modules/services/default.nix b/modules/services/default.nix index fdebb3f..35fdce9 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,5 +1,8 @@ -{...}: { - services.devmon.enable = true; - services.udisks2.enable = true; - services.gvfs.enable = true; +{ + imports = [ + ./dunst + ./gdm + ./polkit + ./syncthing + ]; } diff --git a/modules/services/dunst/default.nix b/modules/services/dunst/default.nix new file mode 100644 index 0000000..2c2e575 --- /dev/null +++ b/modules/services/dunst/default.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + home-manager.users.joy.services.dunst = { + enable = true; + # settings = { + # global = { + # frame_color = "#89b4fa"; + # separator_color = "frame"; + # }; + + # urgency_low = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_normal = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_critical = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # frame_color = "#fab387"; + # }; + # }; + }; +} diff --git a/modules/services/gdm/default.nix b/modules/services/gdm/default.nix new file mode 100644 index 0000000..69e11f2 --- /dev/null +++ b/modules/services/gdm/default.nix @@ -0,0 +1,10 @@ +{...}: { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "joy"; + + systemd.services."getty@tty1".enable = false; + systemd.services."autovt@tty1".enable = false; +} diff --git a/modules/services/polkit/default.nix b/modules/services/polkit/default.nix new file mode 100644 index 0000000..25aaa8e --- /dev/null +++ b/modules/services/polkit/default.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + systemd = { + user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = ["graphical-session.target"]; + wants = ["graphical-session.target"]; + after = ["graphical-session.target"]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; +} diff --git a/modules/services/syncthing/default.nix b/modules/services/syncthing/default.nix new file mode 100644 index 0000000..cb6b713 --- /dev/null +++ b/modules/services/syncthing/default.nix @@ -0,0 +1,9 @@ +{...}: { + services = { + syncthing = { + enable = true; + user = "joy"; + configDir = "/home/joy/.config/syncthing"; + }; + }; +} diff --git a/modules/services/syncthing/services/default.nix b/modules/services/syncthing/services/default.nix new file mode 100644 index 0000000..fdebb3f --- /dev/null +++ b/modules/services/syncthing/services/default.nix @@ -0,0 +1,5 @@ +{...}: { + services.devmon.enable = true; + services.udisks2.enable = true; + services.gvfs.enable = true; +} diff --git a/modules/styling/default.nix b/modules/styling/default.nix new file mode 100644 index 0000000..de46e7b --- /dev/null +++ b/modules/styling/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./qt + ./gkt + ./stylix + ]; +} diff --git a/modules/styling/gtk/default.nix b/modules/styling/gtk/default.nix new file mode 100644 index 0000000..44bc138 --- /dev/null +++ b/modules/styling/gtk/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + gruvboxPlus = import ./gruvbox-plus.nix {inherit pkgs;}; +in { + home-manager.users.joy.home.file = { + ".local/share/icons/GruvboxPlus".source = "${gruvboxPlus}"; + }; + + home-manager.users.joy.gtk = { + enable = true; + iconTheme.package = gruvboxPlus; + iconTheme.name = "GruvboxPlus"; + }; + + # qt.enable = true; + # qt.style.name = "adwaita-dark"; + # qt.style.package = pkgs.adwaita-qt; + # qt.platformTheme.name = "adwaita"; +} diff --git a/modules/styling/gtk/gruvbox-plus.nix b/modules/styling/gtk/gruvbox-plus.nix new file mode 100644 index 0000000..92992cc --- /dev/null +++ b/modules/styling/gtk/gruvbox-plus.nix @@ -0,0 +1,19 @@ +{pkgs}: let + link = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v3.1/gruvbox-plus-icon-pack-3.1.zip"; +in + pkgs.stdenv.mkDerivation + { + name = "gruvbox-plus"; + + src = pkgs.fetchurl { + url = link; + sha256 = "sha256-i/AzhYz/ACeXsG5j0kDVfvfA4TwxA3KZJTPwCO4BKmc="; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out + ${pkgs.unzip}/bin/unzip $src -d $out/ + ''; + } diff --git a/modules/styling/qt/default.nix b/modules/styling/qt/default.nix new file mode 100644 index 0000000..0fa5491 --- /dev/null +++ b/modules/styling/qt/default.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: +{ + home-manager.users.joy.qt = { + enable = true; + style.name = "adwaita-dark"; + style.package = pkgs.adwaita-qt; + platformTheme.name = "adwaita"; + }; +} diff --git a/modules/styling/stylix/default.nix b/modules/styling/stylix/default.nix new file mode 100644 index 0000000..570ad78 --- /dev/null +++ b/modules/styling/stylix/default.nix @@ -0,0 +1,41 @@ +{pkgs, ...}: { + stylix = { + enable = true; + + base16Scheme = { + base00 = "282828"; # ---- + base01 = "3c3836"; # --- + base02 = "504945"; # -- + base03 = "665c54"; # - + base04 = "bdae93"; # + + base05 = "d5c4a1"; # ++ + base06 = "ebdbb2"; # +++ + base07 = "fbf1c7"; # ++++ + base08 = "cc241d"; # red + base09 = "fe0819"; # orange + base0A = "d79921"; # yellow + base0B = "98971a"; # green + base0C = "689d6a"; # aqua/cyan + base0D = "458588"; # blue + base0E = "b16286"; # purple + base0F = "a89984"; # brown + }; + + image = ./wallpaper.png; + + cursor = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 24; + }; + + fonts = { + sizes = { + applications = 12; + terminal = 14; + desktop = 12; + popups = 12; + }; + }; + }; +} diff --git a/modules/styling/stylix/wallpaper.png b/modules/styling/stylix/wallpaper.png new file mode 100644 index 0000000..9964649 Binary files /dev/null and b/modules/styling/stylix/wallpaper.png differ diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..86a8ad4 --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,53 @@ + +{ + inputs, + pkgs, + ... +}: { + + users.users.joy = { + isNormalUser = true; + description = "joy"; + extraGroups = ["wheel" "docker"]; + }; + + fonts.packages = with pkgs; [ + font-awesome + (nerdfonts.override {fonts = ["FiraCode"];}) + ]; + + virtualisation.docker.rootless.enable = true; + virtualisation.docker.enable = true; + virtualisation.waydroid.enable = true; + programs.hyprland.enable = true; + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + nix.settings.experimental-features = ["nix-command" "flakes"]; + programs.nix-ld.enable = true; + services.printing.enable = true; + time.timeZone = "Europe/Zurich"; + system.stateVersion = "23.11"; + home-manager.backupFileExtension = "backup"; + home-manager.users.joy.home = { + username = "joy"; + homeDirectory = "/home/joy"; + stateVersion = "23.11"; + sessionVariables = { + }; + }; + + services.devmon.enable = true; + services.udisks2.enable = true; + services.gvfs.enable = true; + + + home-manager.users.joy.programs.home-manager.enable = true; + + home-manager.users.joy.xdg.mimeApps.defaultApplications = { + "text/plain" = ["helix.desktop"]; + "image/*" = ["imv.desktop"]; + "video/png" = ["mpv.desktop"]; + "video/jpg" = ["mpv.desktop"]; + "video/*" = ["mpv.desktop"]; + }; +} diff --git a/modules/tools/default.nix b/modules/tools/default.nix new file mode 100644 index 0000000..43e2ca7 --- /dev/null +++ b/modules/tools/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./git + ./ssh + ./gpg + ]; +} diff --git a/modules/tools/git/default.nix b/modules/tools/git/default.nix new file mode 100644 index 0000000..154f162 --- /dev/null +++ b/modules/tools/git/default.nix @@ -0,0 +1,7 @@ +{...}: { + home-manager.users.joy.programs.git = { + enable = true; + userEmail = "mail@joygnu.org"; + userName = "joygnu"; + }; +} diff --git a/modules/tools/gpg/default.nix b/modules/tools/gpg/default.nix new file mode 100644 index 0000000..95e24d2 --- /dev/null +++ b/modules/tools/gpg/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + pinentryPackage = pkgs.pinentry-curses; + enableSSHSupport = true; + }; +} diff --git a/modules/tools/ssh/default.nix b/modules/tools/ssh/default.nix new file mode 100644 index 0000000..9bd17c0 --- /dev/null +++ b/modules/tools/ssh/default.nix @@ -0,0 +1,16 @@ +{...}: { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + AllowUsers = null; + }; + }; + + users.users.joy = { + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8FnfVKPbbzPmZ3L0KuSMc8GD42rkIoIMay3c/r9zGkMBwRyluwP7OBR7SaTlp/w7iPHom3YwhGYa37HOXp/icSEMvFlYsCQOXWPkf7cNqyhEnycRsMojpKP2a6qxvcnuuCLY+xMwtlsX1h4nJFpsWHb2A62qBgdaOVrBlbVGd2ZuVCgiB+eenVagW3EFAO9jK5r6rSFciND7EMxBKfi6DbRma6UCejwGjpU0AHCZDikw5XKFhLUDbhdb9e02gyQxD5cs4Q2CuZ1PVt+Jb1GwHVnfh3wdEz5v7TWF+RUv85JXlRLrIYd2SEDpA6yvQIIT4YR2Bb1Tc/aC+zTdUdP+HMiBI32GGyplMfrE1dbj3quTfGN6cJ0TfPFOx7K+0N108fM7mehPtGT/uyB9nnMyYeLO45cgA1wMZZcT4egSvnnqe+6NO7j+zR0whl8+SbIru7HUK2Oa67SzxotQ7D8F27rx02Ie4UJqwbPsZGrxL7TlvNKUXQ4mOINkyE79tIshWncO71O6vJWzaoeYiye0mxc0AP3vYozdV3MgN34+5zscb/o4pwOQtthin8Nf1Y6o6H0poUz5YXYBdEKK/O0Wz3kxT6i/oZWZG7a18xCCKYnF1Jgdr7mfxkizLMkRqYsgM9CS0e0KoVJhu78TmMz8Eip9za1ncvGg3w1ZW6VG/6w==" + ]; + }; +}