Flake for my NixOS devices

MORE

bwc9876.dev 2a4aa27c 51743186

verified
+3737 -663
+4 -3
homeModules/cat.nix
··· 3 3 lib, 4 4 inputs, 5 5 ... 6 - }: 7 - { 8 - imports = [ inputs.catppuccin.homeModules.catppuccin ]; 6 + }: { 7 + imports = [inputs.catppuccin.homeModules.catppuccin]; 9 8 10 9 options.cow.cat.enable = lib.mkEnableOption "Catppuccin Home Customizations"; 11 10 12 11 config = lib.mkIf config.cow.cat.enable { 13 12 catppuccin = { 14 13 enable = true; 14 + flavor = "mocha"; 15 + accent = "green"; 15 16 mako.enable = false; 16 17 }; 17 18 };
+2 -3
homeModules/comma.nix
··· 4 4 inputs, 5 5 pkgs, 6 6 ... 7 - }: 8 - { 9 - imports = [ inputs.nix-index-db.homeModules.nix-index ]; 7 + }: { 8 + imports = [inputs.nix-index-db.homeModules.nix-index]; 10 9 11 10 options.cow.comma.enable = lib.mkEnableOption "Command With DB"; 12 11
+98
homeModules/dev.nix
··· 1 + { 2 + config, 3 + inputs, 4 + lib, 5 + pkgs, 6 + ... 7 + }: { 8 + options.cow.dev = let 9 + mkLangOpt = d: (lib.mkEnableOption d // {default = true;}); 10 + in { 11 + enable = lib.mkEnableOption "Dev stuff (all on by default)"; 12 + rust = mkLangOpt "Rust dev stuff"; 13 + haskell = mkLangOpt "Haskell dev stuff"; 14 + js = mkLangOpt "JavaScript dev stuff"; 15 + nix = mkLangOpt "Nix dev stuff"; 16 + python = mkLangOpt "Python dev stuff"; 17 + dotnet = mkLangOpt ".NET dev stuff"; 18 + }; 19 + 20 + config = let 21 + conf = config.cow.dev; 22 + in 23 + lib.mkIf conf.enable { 24 + nixpkgs.overlays = lib.optional conf.rust [inputs.fenix.overlays.default]; 25 + 26 + xdg.configFile = { 27 + "astro/config.json" = lib.mkIf conf.js { 28 + text = builtins.toJSON { 29 + telemetry = { 30 + enabled = false; 31 + anonymousId = ""; 32 + notifiedAt = "0"; 33 + }; 34 + }; 35 + }; 36 + "ghc/ghci.conf" = lib.mkIf conf.haskell { 37 + text = '' 38 + :set prompt "\ESC[1;35m\x03BB> \ESC[m" 39 + :set prompt-cont "\ESC[1;35m > \ESC[m" 40 + ''; 41 + }; 42 + }; 43 + 44 + cow.imperm.keepCache = 45 + (lib.optional conf.rust [".cargo"]) 46 + ++ (lib.optional conf.js [ 47 + ".npm" 48 + ".pnpm" 49 + ]); 50 + 51 + programs.git = { 52 + enable = true; 53 + config = { 54 + init.defaultBranch = "main"; 55 + advice.addIgnoredFiles = false; 56 + }; 57 + }; 58 + 59 + home.packages = with pkgs; 60 + [gh] 61 + ++ (lib.optional conf.rust [ 62 + (pkgs.fenix.complete.withComponents [ 63 + "cargo" 64 + "clippy" 65 + "rust-src" 66 + "rustc" 67 + "rustfmt" 68 + ]) 69 + rust-analyzer-nightly 70 + cargo-tauri 71 + mprocs 72 + evcxr 73 + ]) 74 + ++ (lib.optional conf.js [ 75 + nodejs_latest 76 + nodePackages.pnpm 77 + yarn 78 + deno 79 + ]) 80 + ++ (lib.optional conf.haskell [ 81 + haskell.compiler.ghc912 82 + ]) 83 + ++ (lib.optional conf.python [ 84 + python3 85 + poetry 86 + pipenv 87 + uv 88 + ruff 89 + black 90 + ]) 91 + ++ (lib.optional conf.dotnet [ 92 + dotnet-sdk 93 + dotnet-runtime 94 + mono 95 + dotnetPackages.Nuget 96 + ]); 97 + }; 98 + }
+321
homeModules/firefox.nix
··· 1 + { 2 + lib, 3 + pkgs, 4 + config, 5 + ... 6 + }: let 7 + package = pkgs.firefox-devedition; 8 + in { 9 + options.cow.firefox.enable = lib.mkEnableOption "enable Firefox with customizations"; 10 + 11 + config = lib.mkIf config.cow.firefox.enable { 12 + cow.imperm.keep = [".mozilla"]; 13 + 14 + home.packages = [ 15 + package 16 + ]; 17 + 18 + programs.firefox = { 19 + inherit package; 20 + enable = true; 21 + 22 + policies = { 23 + DisableTelemetry = true; 24 + DisableFirefoxStudies = true; 25 + DisableSetDesktopBackground = true; 26 + DontCheckDefaultBrowser = true; 27 + AppAutoUpdate = false; 28 + DNSOverHTTPS.Enabled = true; 29 + ShowHomeButton = true; 30 + DisplayBookmarksToolbar = "always"; 31 + DisableProfileImport = true; 32 + DisablePocket = true; 33 + DisableFirefoxAccounts = true; 34 + OfferToSaveLoginsDefault = false; 35 + OverrideFirstRunPage = ""; 36 + NoDefaultBookmarks = true; 37 + PasswordManagerEnabled = false; 38 + SearchBar = "unified"; 39 + EncryptedMediaExtensions = true; 40 + 41 + EnableTrackingProtection = { 42 + Value = true; 43 + Locked = true; 44 + Cryptomining = true; 45 + Fingerprinting = true; 46 + EmailTracking = true; 47 + }; 48 + 49 + Preferences = let 50 + lock = val: { 51 + Value = val; 52 + Status = "locked"; 53 + }; 54 + in { 55 + # General 56 + "browser.aboutConfig.showWarning" = lock false; 57 + "media.eme.enabled" = lock true; # Encrypted Media Extensions (DRM) 58 + "layout.css.prefers-color-scheme.content-override" = lock 0; 59 + "browser.startup.page" = 3; # Restore previous session 60 + "toolkit.telemetry.server" = lock ""; 61 + 62 + # New Tab 63 + "browser.newtabpage.activity-stream.showSponsored" = lock false; 64 + "browser.newtabpage.activity-stream.system.showSponsored" = lock false; 65 + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock false; 66 + "browser.newtabpage.activity-stream.feeds.topsites" = lock false; 67 + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock false; 68 + "browser.newtabpage.activity-stream.showWeather" = lock false; 69 + "browser.newtabpage.activity-stream.system.showWeather" = lock false; 70 + "browser.newtabpage.activity-stream.feeds.weatherfeed" = lock false; 71 + "browser.newtabpage.activity-stream.feeds.telemetry" = lock false; 72 + "browser.newtabpage.activity-stream.telemetry" = lock false; 73 + "browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint" = lock ""; 74 + "browser.newtabpage.pinned" = lock []; 75 + "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = lock ""; 76 + "browser.urlbar.suggest.weather" = lock false; 77 + "browser.urlbar.quicksuggest.scenario" = lock "offline"; 78 + "browser.urlbar.suggest.quicksuggest.nonsponsored" = lock false; 79 + "browser.urlbar.suggest.quicksuggest.sponsored" = lock false; 80 + 81 + # Devtools 82 + "devtools.theme" = lock "dark"; 83 + "devtools.dom.enabled" = lock true; 84 + "devtools.command-button-rulers.enabled" = lock true; 85 + "devtools.command-button-measure.enabled" = lock true; 86 + "devtools.command-button-screenshot.enabled" = lock true; 87 + "devtools.toolbox.host" = lock "right"; 88 + "devtools.webconsole.persistlog" = lock true; 89 + "devtools.webconsole.timestampMessages" = lock true; 90 + 91 + # Privacy 92 + "dom.private-attribution.submission.enabled" = lock false; 93 + "privacy.globalprivacycontrol.enabled" = lock true; 94 + 95 + # ML 96 + "browser.ml.enable" = lock false; 97 + "browser.ml.linkPreview.enabled" = lock false; 98 + "browser.ml.pageAssist.enabled" = lock false; 99 + "browser.ml.chat.enabled" = lock false; 100 + "browser.ml.chat.menu" = lock false; 101 + "browser.ml.chat.page" = lock false; 102 + "browser.ml.chat.shortcuts" = lock false; 103 + "browser.ml.chat.sidebar" = lock false; 104 + }; 105 + 106 + Extensions.Install = 107 + map (x: "https://addons.mozilla.org/firefox/downloads/latest/${x}/latest.xpi") 108 + [ 109 + # Appearance 110 + "firefox-color" 111 + "material-icons-for-github" 112 + 113 + # Security / Privacy 114 + "facebook-container" 115 + 116 + ## Ads / Youtube 117 + "ublock-origin" 118 + "consent-o-matic" 119 + "sponsorblock" 120 + 121 + # Information 122 + "flagfox" 123 + "awesome-rss" 124 + "identfavicon-quantum" 125 + 126 + # Devtools 127 + "react-devtools" 128 + "open-graph-preview-and-debug" 129 + "wave-accessibility-tool" 130 + "styl-us" 131 + 132 + # Misc 133 + "keepassxc-browser" # integration with KeepassXC 134 + ]; 135 + 136 + ExtensionSettings."*" = { 137 + default_area = "menupanel"; 138 + }; 139 + }; 140 + profiles.dev-edition-default = { 141 + extensions = { 142 + force = true; 143 + settings = { 144 + "sponsorBlocker@ajay.app".settings.alreadyInstalled = true; 145 + "uBlock0@raymondhill.net".settings.selectedFilterLists = [ 146 + "ublock-filters" 147 + "ublock-badware" 148 + "ublock-privacy" 149 + "ublock-unbreak" 150 + "ublock-quick-fixes" 151 + ]; 152 + # Stylus 153 + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".settings = { 154 + dbInChromeStorage = true; # required se DB is stored in state.js 155 + updateOnlyEnabled = true; 156 + patchCsp = true; 157 + instantInject = true; 158 + }; 159 + }; 160 + }; 161 + search = { 162 + force = true; 163 + default = "ddg"; 164 + privateDefault = "ddg"; 165 + engines = let 166 + mkEngineForceFavicon = aliases: queryUrl: iconUrl: { 167 + definedAliases = aliases; 168 + icon = iconUrl; 169 + urls = [{template = queryUrl;}]; 170 + }; 171 + mkEngine = aliases: queryUrl: iconExt: (mkEngineForceFavicon aliases queryUrl ( 172 + let 173 + noPath = lib.strings.concatStrings ( 174 + lib.strings.intersperse "/" (lib.lists.take 3 (lib.strings.splitString "/" queryUrl)) 175 + ); 176 + in "${noPath}/favicon.${iconExt}" 177 + )); 178 + in { 179 + # Dev 180 + "GitHub Repos" = 181 + mkEngineForceFavicon ["@gh" "@github"] 182 + "https://github.com/search?type=repositories&q={searchTerms}" 183 + "https://github.githubassets.com/favicons/favicon-dark.svg"; 184 + "SourceGraph" = mkEngine [ 185 + "@sg" 186 + "@sourcegraph" 187 + ] "https://sourcegraph.com/search?q={searchTerms}" "png"; 188 + 189 + ## Web 190 + "MDN Web Docs" = mkEngine [ 191 + "@mdn" 192 + ] "https://developer.mozilla.org/en-US/search?q={searchTerms}" "ico"; 193 + "Web.Dev" = 194 + mkEngineForceFavicon ["@webdev" "@lighthouse"] "https://web.dev/s/results?q={searchTerms}" 195 + "https://www.gstatic.com/devrel-devsite/prod/vc7080045e84cd2ce1faf7f7a3876037748d52d088e5100df2e949d051a784791/web/images/favicon.png"; 196 + "Can I Use" = mkEngineForceFavicon [ 197 + "@ciu" 198 + "@baseline" 199 + ] "https://caniuse.com/?search={searchTerms}" "https://caniuse.com/img/favicon-128.png"; 200 + "NPM" = 201 + mkEngineForceFavicon ["@npm"] "https://www.npmjs.com/search?q={searchTerms}" 202 + "https://static-production.npmjs.com/3dc95981de4241b35cd55fe126ab6b2c.png"; 203 + "Iconify" = mkEngine [ 204 + "@iconify" 205 + "@icons" 206 + ] "https://icon-sets.iconify.design/?query={searchTerms}" "ico"; 207 + "Astro" = mkEngineForceFavicon [ 208 + "@astro" 209 + ] "https://a.stro.cc/{searchTerms}" "https://docs.astro.build/favicon.svg"; 210 + "Porkbun" = mkEngine ["@porkbun"] "https://porkbun.com/checkout/search?q={searchTerms}" "ico"; 211 + "Http.Cat" = mkEngine ["@cat" "@hcat" "@httpcat"] "https://http.cat/{searchTerms}" "ico"; 212 + 213 + ## Rust 214 + "Crates.io" = mkEngine [ 215 + "@crates" 216 + "@cratesio" 217 + "@cargo" 218 + ] "https://crates.io/search?q={searchTerms}" "ico"; 219 + "Rust Docs" = 220 + mkEngineForceFavicon ["@rust" "@rustdocs" "@ruststd"] 221 + "https://doc.rust-lang.org/std/index.html?search={searchTerms}" 222 + "https://doc.rust-lang.org/static.files/favicon-2c020d218678b618.svg"; 223 + "Docsrs" = mkEngine ["@docsrs"] "https://docs.rs/releases/search?query={searchTerms}" "ico"; 224 + 225 + ## Python 226 + "PyPI" = mkEngineForceFavicon [ 227 + "@pypi" 228 + "@pip" 229 + ] "https://pypi.org/search/?q={searchTerms}" "https://pypi.org/static/images/favicon.35549fe8.ico"; 230 + 231 + ## .NET 232 + "NuGet" = mkEngine ["@nuget"] "https://www.nuget.org/packages?q={searchTerms}" "ico"; 233 + 234 + ## Linux Stuff 235 + "Kernel Docs" = mkEngine [ 236 + "@lnx" 237 + "@linux" 238 + "@kernel" 239 + ] "https://www.kernel.org/doc/html/latest/search.html?q={searchTerms}" "ico"; 240 + "Arch Wiki" = mkEngine [ 241 + "@aw" 242 + "@arch" 243 + ] "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search={searchTerms}" "ico"; 244 + "Nerd Fonts" = 245 + mkEngineForceFavicon ["@nf" "@nerdfonts"] "https://www.nerdfonts.com/cheat-sheet?q={searchTerms}" 246 + "https://www.nerdfonts.com/assets/img/favicon.ico"; 247 + 248 + ### Haskell 249 + "Hoogle Base" = mkEngine [ 250 + "@h" 251 + "@hoogle" 252 + ] "https://hoogle.haskell.org/?scope=package%3Abase&hoogle={searchTerms}" "png"; 253 + "Hoogle All" = mkEngine [ 254 + "@ha" 255 + "@hoogall" 256 + ] "https://hoogle.haskell.org/?hoogle={searchTerms}" "png"; 257 + 258 + ### Nix 259 + "Nix Packages" = mkEngine [ 260 + "@nixpkgs" 261 + ] "https://search.nixos.org/packages?channel=unstable&size=500&query={searchTerms}" "png"; 262 + "NixOS Options" = mkEngine [ 263 + "@nixos" 264 + ] "https://search.nixos.org/options?channel=unstable&size=500&query={searchTerms}" "png"; 265 + "NixOS Wiki" = mkEngine ["@nixwiki"] "https://nixos.wiki/index.php?search={searchTerms}" "png"; 266 + "Home Manager Options" = 267 + mkEngineForceFavicon ["@hm"] 268 + "https://home-manager-options.extranix.com/?release=master&query={searchTerms}" 269 + "https://home-manager-options.extranix.com/images/favicon.png"; 270 + "Noogle" = mkEngine [ 271 + "@noogle" 272 + "@nixlib" 273 + ] "https://noogle.dev/q?limit=100&term={searchTerms}" "png"; 274 + "SourceGraph Nix" = 275 + mkEngine ["@sgn" "@yoink"] 276 + "https://sourcegraph.com/search?q=lang:Nix+-repo:NixOS/*+-repo:nix-community/*+{searchTerms}" 277 + "png"; 278 + "Nixpkgs Issues" = 279 + mkEngineForceFavicon ["@nixissues"] 280 + "https://github.com/NixOS/nixpkgs/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+{searchTerms}" 281 + "https://github.githubassets.com/favicons/favicon-dark.svg"; 282 + "NixVim Options" = 283 + mkEngineForceFavicon ["@nixvim"] 284 + "https://nix-community.github.io/nixvim/search/?option_scope=0&query={searchTerms}" 285 + "https://nix-community.github.io/nixvim/search/favicon.ico"; 286 + 287 + # Media 288 + "youtube" = mkEngine ["@yt"] "https://www.youtube.com/results?search_query={searchTerms}" "ico"; 289 + "Spotify" = 290 + mkEngineForceFavicon ["@sp" "@spotify"] "https://open.spotify.com/search/{searchTerms}" 291 + "https://open.spotifycdn.com/cdn/images/favicon16.1c487bff.png"; 292 + "Netflix" = mkEngine ["@nfx"] "https://www.netflix.com/search?q={searchTerms}" "ico"; 293 + "IMDb" = mkEngine ["@imdb"] "https://www.imdb.com/find?q={searchTerms}" "ico"; 294 + 295 + # Misc 296 + "Firefox Add-ons" = mkEngine [ 297 + "@addons" 298 + ] "https://addons.mozilla.org/en-US/firefox/search/?q={searchTerms}" "ico"; 299 + "Urban Dictionary" = mkEngine [ 300 + "@ud" 301 + "@urban" 302 + ] "https://www.urbandictionary.com/define.php?term={searchTerms}" "ico"; 303 + "Google Translate" = mkEngine [ 304 + "@translate" 305 + ] "https://translate.google.com/?sl=auto&tl=en&text={searchTerms}&op=translate" "ico"; 306 + 307 + # Overrides 308 + "History".metaData.alias = "@h"; 309 + "Bookmarks".metaData.alias = "@b"; 310 + "Tabs".metaData.alias = "@t"; 311 + "bing".metaData.hidden = true; 312 + "amazondotcom-us".metaData.alias = "@amz"; 313 + "google".metaData.alias = "@g"; 314 + "wikipedia".metaData.alias = "@w"; 315 + "ddg".metaData.alias = "@ddg"; 316 + }; 317 + }; 318 + }; 319 + }; 320 + }; 321 + }
+6
homeModules/firewall.nix
··· 1 + {lib}: { 2 + options.cow.firewall = { 3 + tcp = { type = lib.types.listOf lib.types.int; }; 4 + udp = { type = lib.types.listOf lib.types.int; }; 5 + }; 6 + }
+669
homeModules/gdi.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + inputs', 6 + ... 7 + }: { 8 + options.cow.gdi = { 9 + enable = lib.mkEnableOption "Cow GDI, a 'DE' by ur favorite polish cow"; 10 + doIdle = lib.mkEnableOption "Screen locking and suspend with Hypridle"; 11 + useUWSM = lib.mkEnableOption "Use UWSM to launch apps"; 12 + }; 13 + 14 + config = let 15 + runCmd = cmd: 16 + if config.cow.gdi.useUWSM 17 + then "uwsm app -- ${cmd}" 18 + else cmd; 19 + launchDesktopApp = deskFile: 20 + if config.cow.gdi.useUWSM 21 + then "uwsm app -- ${deskFile}" 22 + else "${pkgs.gtk3}/bin/gtk-launch ${deskFile}"; 23 + screenOffCmd = "hyprctl dispatch dpms off; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-add \"timeout\""; 24 + screenOnCmd = "hyprctl dispatch dpms on; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-remove \"timeout\""; 25 + iconTheme = { 26 + name = "Tela-green"; 27 + package = pkgs.tela-icon-theme; 28 + }; 29 + cursorTheme = { 30 + name = "catppuccin-mocha-dark-cursors"; 31 + package = pkgs.catppuccin-cursors.mochaDark; 32 + size = 24; 33 + }; 34 + hyprThemeName = "${cursorTheme.name}-hypr"; 35 + hyprCursorTheme = let 36 + utils = "${pkgs.hyprcursor}/bin/hyprcursor-util"; 37 + in 38 + pkgs.runCommand hyprThemeName {} '' 39 + export PATH="$PATH:${pkgs.xcur2png}/bin" 40 + ${utils} -x ${cursorTheme.package}/share/icons/${cursorTheme.name} --output . 41 + mkdir -p $out/share/icons 42 + ${utils} -c ./extracted_${cursorTheme.name} --output . 43 + cp -r "./theme_Extracted Theme" $out/share/icons/${hyprThemeName} 44 + ''; 45 + in 46 + lib.mkIf config.cow.gdi.enable { 47 + home.packages = with pkgs; [ 48 + fira-code 49 + fira-go 50 + nerd-fonts.symbols-only 51 + noto-fonts-color-emoji 52 + unifont 53 + liberation_ttf 54 + 55 + alsa-utils 56 + 57 + hyprCursorTheme 58 + cursorTheme.package 59 + iconTheme.package 60 + 61 + swaynotificationcenter 62 + swayosd 63 + ]; 64 + 65 + wayland.windowManager.hyprland = { 66 + systemd.enable = false; 67 + enable = true; 68 + extraConfig = '' 69 + bind = SUPER,M,submap,passthru 70 + submap = passthru 71 + bind = SUPER,ESCAPE,submap,reset 72 + submap = reset 73 + ''; 74 + settings = { 75 + autogenerated = 0; 76 + ecosystem = { 77 + no_update_news = true; 78 + no_donation_nag = true; 79 + }; 80 + cursor = { 81 + no_hardware_cursors = true; 82 + enable_hyprcursor = false; 83 + }; 84 + monitor = [ 85 + ",highres,auto,1" 86 + ]; 87 + general = { 88 + border_size = 2; 89 + resize_on_border = true; 90 + "col.active_border" = "$red $peach $yellow $green $sapphire $lavender $mauve 225deg"; 91 + }; 92 + decoration = { 93 + rounding = 10; 94 + }; 95 + input = { 96 + numlock_by_default = true; 97 + kb_options = "caps:escape"; 98 + touchpad = { 99 + natural_scroll = true; 100 + }; 101 + }; 102 + xwayland = { 103 + force_zero_scaling = true; 104 + }; 105 + # debug = { 106 + # disable_logs = false; 107 + # }; 108 + misc = { 109 + enable_swallow = true; 110 + disable_hyprland_logo = true; 111 + disable_splash_rendering = true; 112 + focus_on_activate = true; 113 + mouse_move_enables_dpms = true; 114 + key_press_enables_dpms = true; 115 + }; 116 + env = [ 117 + "TERMINAL,wezterm" 118 + "GRIMBLAST_EDITOR,swappy -f " 119 + "QT_QPA_PLATFORM,wayland;xcb" 120 + "QT_AUTO_SCREEN_SCALE_FACTOR,1" 121 + ]; 122 + windowrulev2 = [ 123 + "idleinhibit fullscreen,class:(.*),title:(.*)" 124 + ]; 125 + submap = "reset"; 126 + gesture = [ 127 + "3,horizontal,workspace" 128 + "4,swipe,move" 129 + ]; 130 + bind = let 131 + powerMenu = "rofi -modi 'p:${pkgs.rofi-power-menu}/bin/rofi-power-menu' -show p --symbols-font \"FiraMono Nerd Font Mono\""; 132 + screenshot = "${pkgs.nushell}/bin/nu ${../../res/screenshot.nu}"; 133 + 134 + openTerminal = launchDesktopApp "org.wezfurlong.wezterm.desktop"; 135 + forEachWorkspace = { 136 + mod, 137 + dispatch, 138 + }: 139 + builtins.genList ( 140 + i: let 141 + num = builtins.toString i; 142 + in "${mod},${num},${dispatch},${ 143 + if num == "0" 144 + then "10" 145 + else num 146 + }" 147 + ) 148 + 10; 149 + in 150 + [ 151 + "SUPER,M,submap,passthru" 152 + ] 153 + ++ lib.optional config.cow.firefox.enable [ 154 + "SUPER,Q,exec,${launchDesktopApp "firefox-devedition.desktop"}" 155 + ] 156 + ++ [ 157 + "SUPER,Z,exec,systemctl suspend" 158 + ",XF86AudioMedia,exec,${openTerminal}" 159 + "SUPER,T,exec,${openTerminal}" 160 + "SUPER ALT CTRL SHIFT,L,exec,xdg-open https://linkedin.com" 161 + "SUPER,C,killactive," 162 + "SUPER,P,pseudo," 163 + "SUPER,R,togglefloating," 164 + "SUPER,F,fullscreen,1" 165 + "SUPER SHIFT,F,fullscreen,0" 166 + ",XF86RFKill,exec,rfkill toggle wifi" 167 + "SUPER,left,workspace,r-1" 168 + "SUPER,right,workspace,r+1" 169 + "SUPER SHIFT,left,movetoworkspace,r-1" 170 + "SUPER SHIFT,right,movetoworkspace,r+1" 171 + "SUPER,L,exec,pidof hyprlock || hyprlock --immediate" 172 + "SUPER,S,exec,${runCmd "rofi -show drun -icon-theme \"candy-icons\" -show-icons"}" 173 + "SUPER SHIFT,E,exec,${runCmd "rofi -modi emoji -show emoji"}" 174 + "SUPER SHIFT,D,exec,swaync-client -d" 175 + "SUPER,Delete,exec,${runCmd powerMenu}" 176 + ",XF86PowerOff,exec,${runCmd powerMenu}" 177 + "SUPER ALT,C,exec,${runCmd "rofi -show calc -modi calc -no-show-match -no-sort -calc-command \"echo -n '{result}' | wl-copy\""}" 178 + "SUPER,B,exec,${runCmd "${pkgs.rofi-bluetooth}/bin/rofi-bluetooth"}" 179 + "SUPER,Tab,exec,${runCmd "rofi -show window -show-icons"}" 180 + ] 181 + ++ lib.optional config.cow.yazi.enable ["SUPER,E,exec,${launchDesktopApp "yazi.desktop"}"] 182 + ++ [ 183 + "SUPER,N,exec,${runCmd "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"}" 184 + "SUPER,A,exec,${runCmd "${pkgs.pavucontrol}/bin/pavucontrol --tab 5"}" 185 + ''SUPER,V,exec,cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy'' 186 + "SUPER ALT,V,exec,echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe" 187 + ",Print,exec,${runCmd screenshot}" 188 + "SUPER SHIFT,S,exec,${runCmd screenshot}" 189 + "SUPER SHIFT,T,exec,${runCmd "${pkgs.nushell}/bin/nu ${../res/ocr.nu}"}" 190 + "SUPER SHIFT,C,exec,${runCmd "${pkgs.hyprpicker}/bin/hyprpicker -a"}" 191 + ] 192 + ++ forEachWorkspace { 193 + mod = "SUPER"; 194 + dispatch = "workspace"; 195 + } 196 + ++ forEachWorkspace { 197 + mod = "SUPER SHIFT"; 198 + dispatch = "movetoworkspace"; 199 + }; 200 + bindr = [ 201 + "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT ||${runCmd "${pkgs.nushell}/bin/nu ${../res/screenrec.nu}"}" 202 + "CAPS,Caps_Lock,exec,swayosd-client --caps-lock" 203 + ",Scroll_Lock,exec,swayosd-client --scroll-lock" 204 + ",Num_Lock,exec,swayosd-client --num-lock" 205 + ]; 206 + bindl = [ 207 + ",switch:on:Lid Switch,exec,${screenOffCmd}" 208 + ",switch:off:Lid Switch,exec,${screenOnCmd}" 209 + ",XF86AudioPlay,exec,playerctl play-pause" 210 + ",XF86AudioPause,exec,playerctl pause" 211 + ",XF86AudioStop,exec,playerctl stop" 212 + ",XF86AudioNext,exec,playerctl next" 213 + ",XF86AudioPrev,exec,playerctl previous" 214 + ]; 215 + bindel = [ 216 + ",XF86MonBrightnessUp,exec,swayosd-client --brightness raise" 217 + ",XF86MonBrightnessDown,exec,swayosd-client --brightness lower" 218 + ",XF86AudioRaiseVolume,exec,swayosd-client --output-volume raise" 219 + ",XF86AudioLowerVolume,exec,swayosd-client --output-volume lower" 220 + ",XF86AudioMute,exec,swayosd-client --output-volume mute-toggle" 221 + ]; 222 + bindm = [ 223 + "SUPER,mouse:272,movewindow" 224 + "SUPER,mouse:273,resizewindow" 225 + ]; 226 + }; 227 + }; 228 + 229 + catppuccin.hyprlock.useDefaultConfig = false; 230 + programs.hyprlock = { 231 + enable = true; 232 + 233 + settings = { 234 + background = { 235 + monitor = ""; 236 + path = "${config.cow.pictures.bg}"; 237 + blur_passes = 1; 238 + }; 239 + shape = [ 240 + { 241 + monitor = ""; 242 + color = "$crust"; 243 + position = "0, 30"; 244 + rounding = 10; 245 + border_size = 2; 246 + border_color = "$mauve"; 247 + size = "500, 500"; 248 + shadow_passes = 1; 249 + shadow_size = 2; 250 + } 251 + { 252 + monitor = ""; 253 + color = "$crust"; 254 + position = "0, -30"; 255 + rounding = 10; 256 + border_size = 2; 257 + border_color = "$mauve"; 258 + size = "600, 50"; 259 + valign = "top"; 260 + shadow_passes = 1; 261 + shadow_size = 2; 262 + } 263 + ]; 264 + image = { 265 + monitor = ""; 266 + path = "${config.cow.pictures.pfp}"; 267 + size = 150; 268 + rounding = -1; 269 + border_size = 4; 270 + border_color = "$mauve"; 271 + rotate = 0; 272 + position = "0, 120"; 273 + halign = "center"; 274 + valign = "center"; 275 + }; 276 + "input-field" = { 277 + monitor = ""; 278 + size = "250, 50"; 279 + outline_thickness = 2; 280 + dots_size = 0.25; # Scale of input-field height, 0.2 - 0.8 281 + dots_spacing = 0.15; # Scale of dots' absolute size, 0.0 - 1.0 282 + dots_center = false; 283 + dots_rounding = -1; # -1 default circle, -2 follow input-field rounding 284 + outer_color = "$surface0"; 285 + inner_color = "$base"; 286 + font_color = "$text"; 287 + fade_on_empty = false; 288 + fade_timeout = 1000; # Milliseconds before fade_on_empty is triggered. 289 + placeholder_text = ''<span foreground="##cdd6f4" style="italic">Password</span>''; 290 + hide_input = false; 291 + rounding = -1; # -1 means complete rounding (circle/oval) 292 + check_color = "$peach"; 293 + fail_color = "$red"; # if authentication failed, changes outer_color and fail message color 294 + fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>"; 295 + fail_transition = 300; # transition time in ms between normal outer_color and fail_color 296 + capslock_color = -1; 297 + numlock_color = -1; 298 + bothlock_color = -1; # when both locks are active. -1 means don't change outer color (same for above) 299 + invert_numlock = false; # change color if numlock is off 300 + swap_font_color = false; # see below 301 + 302 + position = "0, -80"; 303 + halign = "center"; 304 + valign = "center"; 305 + }; 306 + label = [ 307 + { 308 + monitor = ""; 309 + text = "$DESC"; 310 + color = "$text"; 311 + font_size = 25; 312 + font_family = "sans-serif"; 313 + rotate = 0; # degrees, counter-clockwise 314 + 315 + position = "0, 0"; 316 + halign = "center"; 317 + valign = "center"; 318 + } 319 + { 320 + monitor = ""; 321 + text = ''cmd[update:30000] echo " $(date +"%A, %B %-d | %I:%M %p") | $(${pkgs.nushell}/bin/nu ${../res/bat_display.nu}) "''; 322 + color = "$text"; 323 + font_size = 20; 324 + font_family = "sans-serif"; 325 + rotate = 0; # degrees, counter-clockwise 326 + 327 + position = "0, -40"; 328 + halign = "center"; 329 + valign = "top"; 330 + } 331 + ]; 332 + }; 333 + }; 334 + 335 + catppuccin.rofi.enable = false; 336 + 337 + systemd.user.services = let 338 + target = config.wayland.systemd.target; 339 + mkShellService = { 340 + desc, 341 + service, 342 + }: { 343 + Install = { 344 + WantedBy = [target]; 345 + }; 346 + 347 + Unit = { 348 + ConditionEnvironment = "WAYLAND_DISPLAY"; 349 + Description = desc; 350 + After = [target]; 351 + PartOf = [target]; 352 + }; 353 + 354 + Service = service; 355 + }; 356 + in { 357 + battery-notif = mkShellService { 358 + desc = "Battery Notification Service"; 359 + 360 + service = { 361 + ExecStart = "${pkgs.nushell}/bin/nu ${../res/battery_notif.nu}"; 362 + Restart = "on-failure"; 363 + RestartSec = "10"; 364 + }; 365 + }; 366 + 367 + mpris-idle-inhibit = mkShellService { 368 + desc = "MPRIS Idle Inhibitor"; 369 + 370 + service = { 371 + ExecStart = ''${inputs'.wayland-mpris-idle-inhibit.packages.default}/bin/wayland-mpris-idle-inhibit --ignore "kdeconnect" --ignore "playerctld"''; 372 + Restart = "on-failure"; 373 + RestartSec = "10"; 374 + }; 375 + }; 376 + }; 377 + 378 + fonts = { 379 + antialiasing = true; 380 + fontconfig = { 381 + enable = true; 382 + defaultFonts = let 383 + mainFonts = [ 384 + "FiraGO" 385 + "Symbols Nerd Font" 386 + ]; 387 + in { 388 + serif = mainFonts; 389 + sansSerif = mainFonts; 390 + monospace = [ 391 + "Fira Code" 392 + "Symbols Nerd Font" 393 + ]; 394 + emoji = [ 395 + "Noto Color Emoji" 396 + "Symbols Nerd Font" 397 + ]; 398 + }; 399 + }; 400 + }; 401 + 402 + qt = { 403 + enable = true; 404 + platformTheme.name = "kvantum"; 405 + style.name = "kvantum"; 406 + }; 407 + 408 + home.pointerCursor = { 409 + inherit (cursorTheme) name package size; 410 + enable = true; 411 + gtk.enable = true; 412 + x11.enable = true; 413 + }; 414 + 415 + services = { 416 + hyprpolkitagent.enable = true; 417 + 418 + hyprpaper = { 419 + enable = true; 420 + settings = { 421 + ipc = "on"; 422 + splash = false; 423 + preload = ["${config.cow.pictures.bg}"]; 424 + wallpaper = [",${config.cow.pictures.bg}"]; 425 + }; 426 + }; 427 + 428 + swaync = { 429 + enable = true; 430 + settings = { 431 + control-center-exclusive-zone = false; 432 + control-center-height = 1000; 433 + control-center-margin-bottom = 10; 434 + control-center-margin-left = 10; 435 + control-center-margin-right = 10; 436 + control-center-margin-top = 0; 437 + control-center-width = 800; 438 + fit-to-screen = false; 439 + hide-on-action = true; 440 + hide-on-clear = false; 441 + image-visibility = "when-available"; 442 + keyboard-shortcuts = true; 443 + notification-body-image-height = 100; 444 + notification-body-image-width = 200; 445 + notification-icon-size = 64; 446 + notification-window-width = 500; 447 + positionX = "center"; 448 + positionY = "top"; 449 + script-fail-notify = true; 450 + scripts = { 451 + all = { 452 + exec = "${pkgs.nushell}/bin/nu ${../res/notification.nu} ${../res/notif-sounds}"; 453 + urgency = ".*"; 454 + }; 455 + }; 456 + timeout = 10; 457 + timeout-critical = 0; 458 + timeout-low = 5; 459 + transition-time = 200; 460 + widget-config = { 461 + dnd = { 462 + text = "Do Not Disturb"; 463 + }; 464 + label = { 465 + max-lines = 1; 466 + text = "Notification Center"; 467 + }; 468 + title = { 469 + button-text = "Clear All"; 470 + clear-all-button = true; 471 + text = "Notification Center"; 472 + }; 473 + }; 474 + widgets = [ 475 + "title" 476 + "dnd" 477 + "notifications" 478 + ]; 479 + }; 480 + }; 481 + 482 + hypridle = lib.mkIf config.cow.gdi.doIdle { 483 + enable = true; 484 + settings = { 485 + general = { 486 + lock_cmd = "pidof hyprlock || hyprlock --grace 5"; 487 + unlock_cmd = "pkill hyprlock --signal SIGUSR1"; 488 + before_sleep_cmd = "loginctl lock-session"; 489 + after_sleep_cmd = screenOnCmd; 490 + }; 491 + 492 + listener = let 493 + lockTimeout = 120; 494 + in [ 495 + { 496 + timeout = lockTimeout; # Lock the screen after 2 minutes of inactivity 497 + on-timeout = "loginctl lock-session"; 498 + } 499 + { 500 + timeout = lockTimeout + 120; # Turn off the screen 2 minutes after locking 501 + on-timeout = screenOffCmd; 502 + on-resume = screenOnCmd; 503 + } 504 + { 505 + timeout = lockTimeout + 600; # Suspend 10 minutes after locking 506 + on-timeout = "systemctl suspend"; 507 + } 508 + ]; 509 + }; 510 + }; 511 + 512 + cliphist = { 513 + enable = true; 514 + systemdTargets = lib.mkForce [ 515 + config.wayland.systemd.target 516 + ]; 517 + }; 518 + udiskie = { 519 + enable = true; 520 + automount = false; 521 + tray = "never"; 522 + }; 523 + playerctld.enable = true; 524 + wlsunset = { 525 + enable = true; 526 + sunrise = "6:00"; 527 + sunset = "22:00"; 528 + }; 529 + swayosd = { 530 + enable = true; 531 + stylePath = pkgs.writeText "swayosd-style.css" '' 532 + window#osd { 533 + border-radius: 5rem; 534 + } 535 + 536 + #container { 537 + padding: 5px 10px; 538 + } 539 + ''; 540 + }; 541 + }; 542 + 543 + programs = { 544 + rofi = { 545 + enable = true; 546 + package = pkgs.rofi.override { 547 + plugins = with pkgs; [ 548 + rofi-emoji 549 + rofi-power-menu 550 + rofi-bluetooth 551 + rofi-calc 552 + rofi-pulse-select 553 + ]; 554 + }; 555 + theme = let 556 + inherit (config.lib.formats.rasi) mkLiteral; 557 + in { 558 + "@import" = "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.catppuccin.rofi.flavor}.rasi"; 559 + "*" = 560 + (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 561 + "bg0" = "base"; 562 + "bg1" = "mantle"; 563 + "bg2" = "crust"; 564 + "bg3" = config.catppuccin.accent; 565 + "fg0" = "subtext1"; 566 + "fg1" = "text"; 567 + "fg2" = "subtext0"; 568 + "fg3" = "overlay0"; 569 + "fg4" = "surface0"; 570 + }) 571 + // { 572 + font = mkLiteral ''"Roboto 14"''; 573 + background-color = mkLiteral ''transparent''; 574 + text-color = mkLiteral ''@fg0''; 575 + margin = mkLiteral ''0px''; 576 + padding = mkLiteral ''0px''; 577 + spacing = mkLiteral ''0px''; 578 + }; 579 + "window" = { 580 + location = mkLiteral ''north''; 581 + y-offset = mkLiteral ''calc(50% - 176px)''; 582 + width = mkLiteral ''600''; 583 + border-radius = mkLiteral ''24px''; 584 + background-color = mkLiteral ''@bg0''; 585 + }; 586 + "mainbox" = { 587 + padding = mkLiteral ''12px''; 588 + }; 589 + "inputbar" = { 590 + background-color = mkLiteral ''@bg1''; 591 + border-color = mkLiteral ''@bg3''; 592 + border = mkLiteral ''2px''; 593 + border-radius = mkLiteral ''16px''; 594 + padding = mkLiteral ''8px 16px''; 595 + spacing = mkLiteral ''8px''; 596 + children = mkLiteral ''[ prompt, entry ]''; 597 + }; 598 + "prompt" = { 599 + text-color = mkLiteral ''@fg2''; 600 + }; 601 + "entry" = { 602 + placeholder = mkLiteral ''"Search"''; 603 + placeholder-color = mkLiteral ''@fg3''; 604 + }; 605 + "message" = { 606 + margin = mkLiteral ''12px 0 0''; 607 + border-radius = mkLiteral ''16px''; 608 + border-color = mkLiteral ''@bg2''; 609 + background-color = mkLiteral ''@bg2''; 610 + }; 611 + "textbox" = { 612 + padding = mkLiteral ''8px 24px''; 613 + }; 614 + "listview" = { 615 + background-color = mkLiteral ''transparent''; 616 + margin = mkLiteral ''12px 0 0''; 617 + lines = mkLiteral ''8''; 618 + columns = mkLiteral ''2''; 619 + fixed-height = mkLiteral ''false''; 620 + }; 621 + "element" = { 622 + padding = mkLiteral ''8px 16px''; 623 + spacing = mkLiteral ''8px''; 624 + border-radius = mkLiteral ''16px''; 625 + }; 626 + "element normal active" = { 627 + text-color = mkLiteral ''@bg3''; 628 + }; 629 + "element alternate active" = { 630 + text-color = mkLiteral ''@bg3''; 631 + }; 632 + "element selected normal, element selected active" = { 633 + text-color = mkLiteral ''@fg4''; 634 + background-color = mkLiteral ''@bg3''; 635 + }; 636 + "element-icon" = { 637 + size = mkLiteral ''1em''; 638 + vertical-align = mkLiteral ''0.5''; 639 + }; 640 + "element-text" = { 641 + text-color = mkLiteral ''inherit''; 642 + }; 643 + }; 644 + location = "center"; 645 + }; 646 + nushell.extraConfig = '' 647 + plugin add ${pkgs.nu_plugin_dbus}/bin/nu_plugin_dbus 648 + ''; 649 + 650 + wezterm = { 651 + enable = true; 652 + extraConfig = '' 653 + return { 654 + font = wezterm.font("monospace"), 655 + font_size = 18.0, 656 + color_scheme = "Catppuccin Mocha", 657 + enable_tab_bar = false, 658 + window_background_opacity = 0.92, 659 + default_cursor_style = "SteadyBar", 660 + cursor_thickness = 2, 661 + keys = { 662 + {key="o", mods="CTRL|SHIFT", action="OpenLinkAtMouseCursor"} 663 + } 664 + } 665 + ''; 666 + }; 667 + }; 668 + }; 669 + }
+94
homeModules/htop.nix
··· 1 + { 2 + lib, 3 + config, 4 + ... 5 + }: { 6 + options.cow.htop.enable = lib.mkEnableOption "htop + customizations"; 7 + 8 + config = lib.mkIf { 9 + # TODO: Actually use Nix for this 10 + xdg.configFile."htop/htoprc".text = '' 11 + htop_version=3.3.0 12 + config_reader_min_version=3 13 + fields=0 3 2 18 46 47 39 1 14 + hide_kernel_threads=1 15 + hide_userland_threads=0 16 + hide_running_in_container=0 17 + shadow_other_users=0 18 + show_thread_names=1 19 + show_program_path=0 20 + highlight_base_name=1 21 + highlight_deleted_exe=0 22 + shadow_distribution_path_prefix=0 23 + highlight_megabytes=1 24 + highlight_threads=1 25 + highlight_changes=0 26 + highlight_changes_delay_secs=5 27 + find_comm_in_cmdline=1 28 + strip_exe_from_cmdline=1 29 + show_merged_command=0 30 + header_margin=1 31 + screen_tabs=1 32 + detailed_cpu_time=0 33 + cpu_count_from_one=1 34 + show_cpu_usage=1 35 + show_cpu_frequency=0 36 + show_cpu_temperature=1 37 + degree_fahrenheit=0 38 + update_process_names=0 39 + account_guest_in_cpu_meter=1 40 + color_scheme=0 41 + enable_mouse=1 42 + delay=15 43 + hide_function_bar=0 44 + header_layout=two_67_33 45 + column_meters_0=System Hostname Date Clock Uptime Tasks CPU AllCPUs4 MemorySwap 46 + column_meter_modes_0=2 2 2 2 2 2 2 1 1 47 + column_meters_1=DiskIO DiskIO Blank NetworkIO NetworkIO 48 + column_meter_modes_1=2 3 2 2 3 49 + tree_view=0 50 + sort_key=46 51 + tree_sort_key=0 52 + sort_direction=-1 53 + tree_sort_direction=1 54 + tree_view_always_by_pid=0 55 + all_branches_collapsed=0 56 + screen:Main=PID PPID STATE NICE PERCENT_CPU PERCENT_MEM M_RESIDENT Command 57 + .sort_key=PERCENT_CPU 58 + .tree_sort_key=PID 59 + .tree_view_always_by_pid=0 60 + .tree_view=0 61 + .sort_direction=-1 62 + .tree_sort_direction=1 63 + .all_branches_collapsed=0 64 + screen:Tree=PID PPID PGRP PROCESSOR TTY USER SESSION Command 65 + .sort_key=PID 66 + .tree_sort_key=PID 67 + .tree_view_always_by_pid=0 68 + .tree_view=1 69 + .sort_direction=1 70 + .tree_sort_direction=1 71 + .all_branches_collapsed=0 72 + screen:I/O=PID PPID IO_READ_RATE IO_WRITE_RATE Command 73 + .sort_key=IO_RATE 74 + .tree_sort_key=PID 75 + .tree_view_always_by_pid=0 76 + .tree_view=0 77 + .sort_direction=-1 78 + .tree_sort_direction=1 79 + .all_branches_collapsed=0 80 + ''; 81 + programs.htop = { 82 + enable = true; 83 + }; 84 + xdg.dataFile = lib.mkIf config.cow.gdi.enable { 85 + "applications/htop.desktop".text = '' 86 + [Desktop Entry] 87 + Type=Application 88 + Name=Htop 89 + Exec=wezterm start --class="htop" htop 90 + Icon=htop 91 + ''; 92 + }; 93 + }; 94 + }
+17 -8
homeModules/imperm.nix
··· 1 - { config, lib, ... }: 2 - let 3 - listOfDirs = 4 - desc: 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: let 6 + listOfDirs = desc: 5 7 lib.mkOption { 6 - type = lib.types.listOF lib.types.str; 8 + type = lib.types.listOf lib.types.str; 9 + description = desc; 7 10 }; 8 - in 9 - { 11 + in { 10 12 options.cow.imperm = { 11 13 keepLibraries = lib.mkEnableOption "persisting library (Documents, Pictures, etc.) directories"; 12 14 keepCache = listOfDirs "List of directories to persist if impermanence is enabled. These directories are *not* meant to be backed up"; 13 15 keep = listOfDirs "List of directories to persist if impermanence is enabled. These directories should be backed up"; 16 + keepFiles = { 17 + type = lib.types.listOf lib.types.str; 18 + description = "List of files to keep. These files should be backed up"; 19 + }; 14 20 }; 15 21 16 - config = config.cow.imperm.keepLibraries { 22 + config = lib.mkIf config.cow.imperm.keepLibraries { 17 23 cow.imperm.keep = [ 18 24 "Downloads" 19 25 "Music" 20 26 "Videos" 21 27 "Pictures" 22 28 "Documents" 29 + ".ssh" 30 + ".cache" 31 + ".local/state/wireplumber" 23 32 ]; 24 33 }; 25 34 }
+13
homeModules/kde-connect.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + options.cow.kde-connect.enable = "KDE connect to connect to phones"; 7 + 8 + config = lib.mkIf config.cow.kde-connect.enable { 9 + cow.keepCache = [".config/kdeconnect"]; 10 + cow.firewall.tcp = lib.range 1714 1764; 11 + systemd.services.kdeconnect.Service.Environment = lib.mkForce []; 12 + }; 13 + }
+32
homeModules/keepassxc.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: { 7 + options.cow.keepassxc = { 8 + enable = lib.mkEnableOption "KeePassXC + autolaunch"; 9 + dbPath = { 10 + type = lib.types.nullOr lib.types.str; 11 + description = "KeePassXC DB to open on DE launch if cow.gdi is on"; 12 + default = null; 13 + }; 14 + }; 15 + 16 + config = lib.mkIf config.cow.keepassxc.enable { 17 + wayland.windowManager.hyprland.settings.exec-once = 18 + lib.optional (config.cow.gdi.enable && config.cow.keepassxc.dbPath != null) 19 + ( 20 + let 21 + cmd = "keepassxc ${config.cow.keepassxc.dbPath}"; 22 + in [ 23 + ( 24 + if config.cow.gdi.useUWSM 25 + then "uwsm app -- ${cmd}" 26 + else cmd 27 + ) 28 + ] 29 + ); 30 + home.packages = with pkgs; [keepassxc]; 31 + }; 32 + }
+27
homeModules/libraries.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + options.cow.libraries.enable = lib.mkEnableOption "Creating common library directories"; 7 + 8 + config = lib.mkIf config.cow.libraries.enable { 9 + xdg = { 10 + enable = true; 11 + userDirs = let 12 + inherit (config.home) homeDirectory; 13 + in { 14 + enable = true; 15 + createDirectories = true; 16 + desktop = "${homeDirectory}/Desktop"; 17 + documents = "${homeDirectory}/Documents"; 18 + pictures = "${homeDirectory}/Pictures"; 19 + videos = "${homeDirectory}/Videos"; 20 + music = "${homeDirectory}/Music"; 21 + extraConfig = { 22 + "XDG_SCREENSHOTS_DIR" = "${homeDirectory}/Pictures/Screenshots"; 23 + }; 24 + }; 25 + }; 26 + }; 27 + }
+45 -33
homeModules/music.nix
··· 3 3 config, 4 4 inputs', 5 5 ... 6 - }: 7 - { 6 + }: { 8 7 options.cow.music = { 9 8 enable = lib.mkEnableOption "music playback with MPD and rmpc + customizations"; 10 9 }; ··· 165 164 ( 166 165 address: "127.0.0.1:6600", 167 166 password: None, 168 - theme: ${if config.cow.cat.enable then ''Some("catppuccin")'' else "None"}, 167 + theme: ${ 168 + if config.cow.cat.enable 169 + then ''Some("catppuccin")'' 170 + else "None" 171 + }, 169 172 cache_dir: None, 170 173 lyrics_dir: "${config.services.mpd.musicDirectory}", 171 174 on_song_change: None, ··· 332 335 ], 333 336 ) 334 337 ''; 335 - in 336 - { 337 - home-manager.users.bean = { 338 - programs.cava = { 339 - enable = true; 340 - }; 338 + in { 339 + cow.imperm.keepCache = [".local/share/mpd"]; 341 340 342 - xdg.configFile = lib.mkIf config.cow.cat.enable { 343 - "rmpc/themes/catppuccin.ron".text = themeFile; 344 - }; 341 + programs.cava = { 342 + enable = true; 343 + }; 345 344 346 - programs.rmpc = { 347 - enable = true; 348 - config = configFile; 349 - }; 345 + xdg.configFile = lib.mkIf config.cow.cat.enable { 346 + "rmpc/themes/catppuccin.ron".text = themeFile; 347 + }; 350 348 351 - services = { 352 - mpd = { 353 - enable = true; 354 - extraConfig = '' 355 - audio_output { 356 - type "fifo" 357 - name "mpd_fifo" 358 - path "/tmp/mpd.fifo" 359 - format "44100:16:2" 360 - } 361 - audio_output { 362 - type "pipewire" 363 - name "Pipewire" 364 - } 365 - ''; 366 - }; 367 - mpdris2.enable = true; 349 + programs.rmpc = { 350 + enable = true; 351 + config = configFile; 352 + }; 353 + 354 + xdg.dataFile = lib.mkIf config.cow.gdi.enable { 355 + "applications/rmpc.desktop".text = '' 356 + [Desktop Entry] 357 + Type=Application 358 + Name=Music Player 359 + Exec=wezterm start --class="rmpc" rmpc 360 + Icon=playmymusic 361 + ''; 362 + }; 363 + 364 + services = { 365 + mpd = { 366 + enable = true; 367 + extraConfig = '' 368 + audio_output { 369 + type "fifo" 370 + name "mpd_fifo" 371 + path "/tmp/mpd.fifo" 372 + format "44100:16:2" 373 + } 374 + audio_output { 375 + type "pipewire" 376 + name "Pipewire" 377 + } 378 + ''; 368 379 }; 380 + mpdris2.enable = true; 369 381 }; 370 382 } 371 383 );
+366
homeModules/news.nix
··· 1 + { 2 + pkgs, 3 + config, 4 + lib, 5 + ... 6 + }: let 7 + yt-feed = id: { 8 + url = "https://www.youtube.com/feeds/videos.xml?channel_id=" + id; 9 + tags = [ 10 + "!" 11 + "youtube" 12 + ]; 13 + }; 14 + yt-subs = [ 15 + "UCa8W2_uf81Ew6gYuw0VPSeA" # Juxtaposed 16 + "UCMiyV_Ib77XLpzHPQH_q0qQ" # Veronica Explains 17 + "UC7_YxT-KID8kRbqZo7MyscQ" # Markiplier 18 + "UCUMwY9iS8oMyWDYIe6_RmoA" # No Boilerplate 19 + "UCRC6cNamj9tYAO6h_RXd5xA" # RTGame 20 + "UCYIwBA7mwDWnrckXs7gt76Q" # Snapcube 21 + "UCCHruaQlOKPHTl8iOPGDjFg" # Snapcube 2 (VODs) 22 + "UCL7DDQWP6x7wy0O6L5ZIgxg" # 2ndJerma 23 + "UC9z7EZAbkphEMg0SP7rw44A" # carykh 24 + "UCpmvp5czsIrQHsbqya4-6Jw" # Chad Chad 25 + "UC0e3QhIYukixgh5VVpKHH9Q" # Code Bullet 26 + "UCfPUcG3oCmXEYgdFuwlFh8w" # Dingo Doodles 27 + "UCsBjURrPoezykLs9EqgamOA" # Fireship 28 + "UCGwu0nbY2wSkW8N-cghnLpA" # Jaiden Animations 29 + "UClBNmmlREy6BD8PSTFBDyQg" # Kan Gao 30 + "UCm8EsftbfNzSiRHzc7I59KQ" # Kevin Faang 31 + "UCtHaxi4GTYDpJgMSGy7AeSw" # Michael Reeves 32 + "UCXq2nALoSbxLMehAvYTxt_A" # The Grumps 33 + "UCBa659QWEk1AI4Tg--mrJ2A" # Tom Scott 34 + "UCFLwN7vRu8M057qJF8TsBaA" # UpIsNotJump 35 + "UCPsSoOCRNIj-eo2UbXfcdAw" # xen 42 36 + "UCYBbrJH2H6tmQZ7VHyA_esA" # Saltydkdan 37 + "UCBZb-2BHvUtZ-WzrEj16lug" # Raicuparta 38 + "UCPDXXXJj9nax0fr0Wfc048g" # Dropout 39 + "UC8EYr_ArKMKaxfgRq-iCKzA" # WindowsG Electronics 40 + "UCJXa3_WNNmIpewOtCHf3B0g" # LaurieWired 41 + ]; 42 + in { 43 + options.cow.news.enable = lib.mkEnableOption "news feeds with newsboat"; 44 + 45 + config = lib.mkIf config.cow.news.enable { 46 + cow.imperm.keep = [".config/newsboat"]; 47 + 48 + home.packages = with pkgs; [ 49 + w3m 50 + rdrview 51 + ]; 52 + 53 + xdg.dataFile."applications/newsboat.desktop".text = '' 54 + [Desktop Entry] 55 + Type=Application 56 + Name=newsboat 57 + Icon=newsboat 58 + ''; 59 + 60 + programs.newsboat = { 61 + enable = true; 62 + browser = ''"${../../res/news-open.nu} %u"''; 63 + 64 + # notify-program ${../res/news-notify.nu} 65 + 66 + extraConfig = '' 67 + confirm-mark-feed-read no 68 + confirm-mark-all-feeds-read no 69 + wrap-scroll yes 70 + text-width 90 71 + 72 + color listnormal color8 default 73 + color listnormal_unread default default 74 + color listfocus black green 75 + color listfocus_unread black green bold 76 + ''; 77 + 78 + queries = { 79 + "Youtube" = "tags # \"youtube\""; 80 + }; 81 + 82 + urls = 83 + [ 84 + { 85 + title = "Outer Wilds Mods"; 86 + url = "https://outerwildsmods.com/feed.xml"; 87 + tags = [ 88 + "dev" 89 + "outer-wilds" 90 + ]; 91 + } 92 + # { 93 + # title = "Philly Voice"; 94 + # url = "https://www.phillyvoice.com/feed/section/news/"; 95 + # tags = ["local"]; 96 + # } 97 + # { 98 + # title = "ChesCo"; 99 + # url = "https://www.mychesco.com/feed"; 100 + # tags = ["local"]; 101 + # } 102 + { 103 + title = "Mobius Digital"; 104 + url = "https://www.mobiusdigitalgames.com/news/feed"; 105 + tags = ["outer-wilds"]; 106 + } 107 + { 108 + title = "NixOS Blog"; 109 + url = "https://nixos.org/blog/feed.xml"; 110 + tags = [ 111 + "dev" 112 + "linux" 113 + "nixos" 114 + ]; 115 + } 116 + { 117 + title = "Linux Kernel Releases"; 118 + url = "https://www.kernel.org/feeds/kdist.xml"; 119 + tags = [ 120 + "dev" 121 + "linux" 122 + ]; 123 + } 124 + { 125 + title = "Linux Weekly News"; 126 + url = "https://lwn.net/headlines/newrss"; 127 + tags = [ 128 + "dev" 129 + "linux" 130 + ]; 131 + } 132 + { 133 + title = "Linux Kernel Planet"; 134 + url = "https://planet.kernel.org/rss20.xml"; 135 + tags = [ 136 + "dev" 137 + "linux" 138 + ]; 139 + } 140 + { 141 + title = "Free Desktop Planet"; 142 + url = "https://planet.freedesktop.org/atom.xml"; 143 + tags = [ 144 + "dev" 145 + "linux" 146 + ]; 147 + } 148 + { 149 + title = "KDE Blog"; 150 + url = "https://blogs.kde.org/index.xml"; 151 + tags = [ 152 + "dev" 153 + "linux" 154 + ]; 155 + } 156 + { 157 + title = "Cloudflare Blog"; 158 + url = "https://blog.cloudflare.com/rss"; 159 + tags = [ 160 + "dev" 161 + "security" 162 + ]; 163 + } 164 + { 165 + title = "Rust Blog"; 166 + url = "https://blog.rust-lang.org/feed.xml"; 167 + tags = [ 168 + "dev" 169 + "rust" 170 + ]; 171 + } 172 + { 173 + title = "Tauri Blog"; 174 + url = "https://tauri.app/blog/rss.xml"; 175 + tags = [ 176 + "dev" 177 + "rust" 178 + ]; 179 + } 180 + { 181 + title = "Node.js Blog"; 182 + url = "https://nodejs.org/en/feed/blog.xml"; 183 + tags = [ 184 + "dev" 185 + "web" 186 + ]; 187 + } 188 + { 189 + title = "V8 Blog"; 190 + url = "https://v8.dev/blog.atom"; 191 + tags = [ 192 + "dev" 193 + "web" 194 + ]; 195 + } 196 + { 197 + title = "Vite Blog"; 198 + url = "https://vitejs.dev/blog.rss"; 199 + tags = [ 200 + "dev" 201 + "web" 202 + ]; 203 + } 204 + { 205 + title = "React Blog"; 206 + url = "https://react.dev/rss.xml"; 207 + tags = [ 208 + "dev" 209 + "web" 210 + ]; 211 + } 212 + { 213 + title = "Astro JS"; 214 + url = "https://astro.build/rss.xml"; 215 + tags = [ 216 + "dev" 217 + "web" 218 + ]; 219 + } 220 + { 221 + title = "W3C Blog"; 222 + url = "https://www.w3.org/blog/feed/"; 223 + tags = [ 224 + "dev" 225 + "web" 226 + ]; 227 + } 228 + { 229 + title = "Mozilla Blog"; 230 + url = "https://blog.mozilla.org/en/feed/"; 231 + tags = [ 232 + "dev" 233 + "web" 234 + ]; 235 + } 236 + { 237 + title = "Mozilla Nightly Blog"; 238 + url = "https://blog.nightly.mozilla.org/feed/"; 239 + tags = [ 240 + "dev" 241 + "web" 242 + ]; 243 + } 244 + { 245 + title = "Mozilla Developer Network"; 246 + url = "https://developer.mozilla.org/en-US/blog/rss.xml"; 247 + tags = [ 248 + "dev" 249 + "web" 250 + ]; 251 + } 252 + { 253 + title = "Chrome Dev Blog"; 254 + url = "https://developer.chrome.com/static/blog/feed.xml"; 255 + tags = [ 256 + "dev" 257 + "web" 258 + ]; 259 + } 260 + { 261 + title = "Webkit Blog"; 262 + url = "https://webkit.org/feed/"; 263 + tags = [ 264 + "dev" 265 + "web" 266 + ]; 267 + } 268 + { 269 + title = "GitHub Blog"; 270 + url = "https://github.blog/feed/"; 271 + tags = [ 272 + "dev" 273 + "github" 274 + ]; 275 + } 276 + { 277 + title = "GitHub Status"; 278 + url = "https://www.githubstatus.com/history.rss"; 279 + tags = [ 280 + "dev" 281 + "github" 282 + ]; 283 + } 284 + { 285 + title = "Veronica Explains"; 286 + url = "https://vkc.sh/feed/"; 287 + tags = [ 288 + "linux" 289 + "personal-blog" 290 + ]; 291 + } 292 + { 293 + title = "Tom Scott Newsletter"; 294 + url = "https://www.tomscott.com/updates.xml"; 295 + tags = ["personal-blog"]; 296 + } 297 + { 298 + title = "Dave Eddy"; 299 + url = "https://blog.daveeddy.com/rss.xml"; 300 + tags = ["personal-blog"]; 301 + } 302 + { 303 + title = "Dylan Beattie"; 304 + url = "https://dylanbeattie.net/feed.xml"; 305 + tags = ["personal-blog"]; 306 + } 307 + { 308 + title = "Xe Iaso"; 309 + url = "https://xeiaso.net/blog.rss"; 310 + tags = ["personal-blog"]; 311 + } 312 + { 313 + title = "Anil Dash"; 314 + url = "https://www.anildash.com/feed.xml"; 315 + tags = ["personal-blog"]; 316 + } 317 + { 318 + title = "Ben Romer"; 319 + url = "https://www.cyborgcentral.net/feed"; 320 + tags = ["personal-blog"]; 321 + } 322 + { 323 + title = "HiDeoo"; 324 + url = "https://hideoo.dev/notes/rss.xml"; 325 + tags = ["personal-blog"]; 326 + } 327 + { 328 + title = "Kerkour"; 329 + url = "https://kerkour.com/feed.xml"; 330 + tags = ["personal-blog"]; 331 + } 332 + { 333 + title = "Avis"; 334 + url = "https://avris.it/blog.atom"; 335 + tags = ["personal-blog"]; 336 + } 337 + { 338 + title = "Scripting News"; 339 + url = "http://scripting.com/rss.xml"; 340 + tags = ["personal-blog"]; 341 + } 342 + { 343 + title = "XKCD"; 344 + url = "https://xkcd.com/rss.xml"; 345 + tags = ["personal-blog"]; 346 + } 347 + { 348 + title = "Framework Laptop"; 349 + url = "https://frame.work/blog.rss"; 350 + tags = ["hardware"]; 351 + } 352 + { 353 + title = "Ars Technica"; 354 + url = "https://arstechnica.com/feed/"; 355 + tags = ["tech"]; 356 + } 357 + { 358 + title = "Lobste"; 359 + url = "https://lobste.rs/rss"; 360 + tags = ["tech"]; 361 + } 362 + ] 363 + ++ (map yt-feed yt-subs); 364 + }; 365 + }; 366 + }
+87 -81
homeModules/nushell.nix
··· 3 3 pkgs, 4 4 lib, 5 5 ... 6 - }: 7 - { 6 + }: { 8 7 options.cow.nushell = { 9 8 enable = lib.mkEnableOption "Nushell + Customizations"; 10 9 commandNotFound = lib.mkEnableOption "Custom Nix Command Not Found for Nushell"; 11 10 completers = { 12 - carapace = (lib.mkEnableOption "Carapace Completer In Nushell") // { 13 - default = true; 14 - }; 15 - fish = (lib.mkEnableOption "Fish Completions In Nushell") // { 16 - default = true; 17 - }; 11 + carapace = 12 + (lib.mkEnableOption "Carapace Completer In Nushell") 13 + // { 14 + default = true; 15 + }; 16 + fish = 17 + (lib.mkEnableOption "Fish Completions In Nushell") 18 + // { 19 + default = true; 20 + }; 18 21 }; 19 22 }; 20 23 21 - config = 22 - let 23 - conf = config.cow.nushell; 24 - in 24 + config = let 25 + conf = config.cow.nushell; 26 + in 25 27 lib.mkIf conf.enable { 28 + cow.imperm.keep = [".local/share/zoxide"]; 29 + cow.imperm.keepFiles = [".config/nushell/history.txt"]; 30 + 26 31 programs = { 32 + zoxide.enable = true; 27 33 command-not-found.enable = !conf.commandNotFound; 28 - nushell = 29 - let 30 - fishComplete = builtins.replaceStrings [ "__fish__" ] [ "${pkgs.fish}/bin/fish" ] ( 31 - lib.fileContents ../res/nushellCompletions/fish.nu 32 - ); 33 - carapaceComplete = builtins.replaceStrings [ "__carapace__" ] [ "${pkgs.carapace}/bin/carapace" ] ( 34 - lib.fileContents ../res/nushellCompletions/carapace.nu 35 - ); 36 - completions = '' 37 - {|spans| 38 - # if the current command is an alias, get it's expansion 39 - let expanded_alias = (scope aliases | where name == $spans.0 | get -o 0 | get -o expansion) 34 + nushell = let 35 + fishComplete = builtins.replaceStrings ["__fish__"] ["${pkgs.fish}/bin/fish"] ( 36 + lib.fileContents ../res/nushellCompletions/fish.nu 37 + ); 38 + carapaceComplete = builtins.replaceStrings ["__carapace__"] ["${pkgs.carapace}/bin/carapace"] ( 39 + lib.fileContents ../res/nushellCompletions/carapace.nu 40 + ); 41 + completions = '' 42 + {|spans| 43 + # if the current command is an alias, get it's expansion 44 + let expanded_alias = (scope aliases | where name == $spans.0 | get -o 0 | get -o expansion) 40 45 41 - # overwrite 46 + # overwrite 42 47 43 - let spans = (if $expanded_alias != null { 44 - # put the first word of the expanded alias first in the span 45 - $spans | skip 1 | prepend ($expanded_alias | split row " ") 46 - } else { $spans }) 48 + let spans = (if $expanded_alias != null { 49 + # put the first word of the expanded alias first in the span 50 + $spans | skip 1 | prepend ($expanded_alias | split row " ") 51 + } else { $spans }) 47 52 48 - match $spans.0 { 49 - ${lib.optional conf.completers.fish '' 50 - nu => ${fishComplete} 51 - git => ${fishComplete} 52 - ''} 53 - _ => ${ 54 - if conf.completers.carapace then 55 - carapaceComplete 56 - else if conf.completers.fish then 57 - fishComplete 58 - else 59 - "{|spans| []}" 60 - } 61 - } | do $in $spans 53 + match $spans.0 { 54 + ${lib.optional conf.completers.fish '' 55 + nu => ${fishComplete} 56 + git => ${fishComplete} 57 + ''} 58 + _ => ${ 59 + if conf.completers.carapace 60 + then carapaceComplete 61 + else if conf.completers.fish 62 + then fishComplete 63 + else "{|spans| []}" 64 + } 65 + } | do $in $spans 66 + } 67 + ''; 68 + cnf = lib.fileContents ../res/command_not_found.nu; 69 + nu_config = let 70 + doCompletions = builtins.any (x: x) (builtins.attrValues conf.completers); 71 + in '' 72 + { 73 + show_banner: false, 74 + completions: { 75 + external: { 76 + enable: ${doCompletions} 77 + completer: ${ 78 + if doCompletions 79 + then completions 80 + else "{|spans| []}" 81 + } 82 + }, 83 + }, 84 + hooks: { 85 + ${lib.optional conf.commandNotFound '' 86 + command_not_found: ${cnf} 87 + ''} 62 88 } 63 - ''; 64 - cnf = lib.fileContents ../res/command_not_found.nu; 65 - nu_config = 66 - let 67 - doCompletions = builtins.any (x: x) (builtins.attrValues conf.completers); 68 - in 69 - '' 70 - { 71 - show_banner: false, 72 - completions: { 73 - external: { 74 - enable: ${doCompletions} 75 - completer: ${if doCompletions then completions else "{|spans| []}"} 76 - }, 77 - }, 78 - hooks: { 79 - ${lib.optional conf.commandNotFound '' 80 - command_not_found: ${cnf} 81 - ''} 82 - } 83 - } 84 - ''; 85 - init-starship = pkgs.runCommand "starship-init" { } '' 86 - ${pkgs.starship}/bin/starship init nu > $out 87 - ''; 88 - in 89 - { 90 - enable = true; 91 - configFile = '' 92 - $env.config = ${nu_config} 89 + } 90 + ''; 91 + init-starship = pkgs.runCommand "starship-init" {} '' 92 + ${pkgs.starship}/bin/starship init nu > $out 93 + ''; 94 + in { 95 + enable = true; 96 + configFile = '' 97 + $env.config = ${nu_config} 93 98 94 - ${lib.optional config.cow.starship.enable '' 95 - source ${init-starship} 96 - ''} 97 - ''; 98 - shellAliases = { 99 - "py" = "python"; 100 - "🥺" = "sudo"; 101 - }; 99 + ${lib.optional config.cow.starship.enable '' 100 + source ${init-starship} 101 + ''} 102 + ''; 103 + shellAliases = { 104 + "cd" = "z"; 105 + "py" = "python"; 106 + "🥺" = "sudo"; 102 107 }; 108 + }; 103 109 }; 104 110 }; 105 111 }
+124 -127
homeModules/nvim.nix
··· 4 4 config, 5 5 lib, 6 6 ... 7 - }: 8 - { 9 - imports = [ inputs.nixvim.homeModules.nixvim ]; 7 + }: { 8 + imports = [inputs.nixvim.homeModules.nixvim]; 10 9 11 10 options.cow.neovim.enable = lib.mkEnableOption "Neovim + Nixvim + Customizations"; 12 11 13 12 config = lib.mkIf config.cow.neovim.enable { 13 + cow.imperm.keep = [".local/share/nvim"]; 14 + 14 15 home.packages = with pkgs; [ 15 16 ripgrep 16 17 fd ··· 21 22 settings = { 22 23 fork = true; 23 24 font = { 24 - normal = [ { family = "monospace"; } ]; 25 + normal = [{family = "monospace";}]; 25 26 size = 18.0; 26 27 }; 27 28 title-hidden = false; ··· 74 75 background = true; 75 76 }; 76 77 virtual_text = { 77 - errors = [ "italic" ]; 78 - hints = [ "italic" ]; 79 - information = [ "italic" ]; 80 - warnings = [ "italic" ]; 81 - ok = [ "italic" ]; 78 + errors = ["italic"]; 79 + hints = ["italic"]; 80 + information = ["italic"]; 81 + warnings = ["italic"]; 82 + ok = ["italic"]; 82 83 }; 83 84 underlines = { 84 - errors = [ "underline" ]; 85 - hints = [ "underline" ]; 86 - information = [ "underline" ]; 87 - warnings = [ "underline" ]; 85 + errors = ["underline"]; 86 + hints = ["underline"]; 87 + information = ["underline"]; 88 + warnings = ["underline"]; 88 89 }; 89 90 }; 90 91 }; ··· 106 107 ''; 107 108 108 109 autoGroups = { 109 - restore_cursor = { }; 110 - open_neotree = { }; 110 + restore_cursor = {}; 111 + open_neotree = {}; 111 112 }; 112 113 113 114 filetype.extension.mdx = "mdx"; ··· 130 131 autoCmd = [ 131 132 { 132 133 group = "restore_cursor"; 133 - event = [ "BufReadPost" ]; 134 + event = ["BufReadPost"]; 134 135 pattern = "*"; 135 136 callback.__raw = '' 136 137 function() ··· 147 148 } 148 149 { 149 150 group = "open_neotree"; 150 - event = [ "BufRead" ]; 151 + event = ["BufRead"]; 151 152 pattern = "*"; 152 153 once = true; 153 154 callback.__raw = '' ··· 175 176 }; 176 177 }; 177 178 178 - keymaps = 179 - let 180 - prefixMap = 181 - pre: maps: 182 - builtins.map (k: { 183 - action = "<cmd>${k.action}<cr>"; 184 - key = "${pre}${k.key}"; 185 - options = k.options; 186 - }) maps; 187 - in 179 + keymaps = let 180 + prefixMap = pre: maps: 181 + builtins.map (k: { 182 + action = "<cmd>${k.action}<cr>"; 183 + key = "${pre}${k.key}"; 184 + options = k.options; 185 + }) 186 + maps; 187 + in 188 188 lib.lists.flatten ( 189 - builtins.map (g: if builtins.hasAttr "group" g then prefixMap g.prefix g.keys else g) [ 189 + builtins.map (g: 190 + if builtins.hasAttr "group" g 191 + then prefixMap g.prefix g.keys 192 + else g) [ 190 193 { 191 194 action = ''"+p''; 192 195 key = "<C-S-V>"; ··· 332 335 } 333 336 { 334 337 action.__raw = "[[<C-\\><C-n><C-w>]]"; 335 - mode = [ "t" ]; 338 + mode = ["t"]; 336 339 key = "<C-w>"; 337 340 } 338 341 { 339 342 action.__raw = "[[<C-\\><C-n>]]"; 340 - mode = [ "t" ]; 343 + mode = ["t"]; 341 344 key = "<esc>"; 342 345 } 343 346 { ··· 348 351 ); 349 352 350 353 extraPlugins = with pkgs.vimPlugins; [ 351 - { plugin = pkgs.nvim-mdx; } 352 - { plugin = satellite-nvim; } 353 - { plugin = flatten-nvim; } 354 - { plugin = tiny-devicons-auto-colors-nvim; } 354 + {plugin = pkgs.nvim-mdx;} 355 + {plugin = satellite-nvim;} 356 + {plugin = flatten-nvim;} 357 + {plugin = tiny-devicons-auto-colors-nvim;} 355 358 ]; 356 359 357 360 plugins = { ··· 419 422 opts = { 420 423 position = "center"; 421 424 }; 422 - layout = 423 - let 424 - o = { 425 - position = "center"; 426 - }; 427 - txt = s: { 428 - type = "text"; 429 - val = s; 430 - opts = { 425 + layout = let 426 + o = { 427 + position = "center"; 428 + }; 429 + txt = s: { 430 + type = "text"; 431 + val = s; 432 + opts = 433 + { 431 434 hl = "Keyword"; 432 435 } 433 436 // o; 434 - }; 435 - grp = g: { 436 - type = "group"; 437 - val = g; 438 - opts.spacing = 1; 439 - }; 440 - btn = 441 - { 442 - val, 443 - onClick, 444 - ... 445 - }: 446 - { 447 - type = "button"; 448 - inherit val; 449 - opts = o; 450 - on_press.__raw = "function() vim.cmd[[${onClick}]] end"; 451 - }; 452 - cmd = 453 - { 454 - command, 455 - width, 456 - height, 457 - }: 458 - { 459 - type = "terminal"; 460 - inherit command width height; 461 - opts = o; 462 - }; 463 - pad = { 464 - type = "padding"; 465 - val = 2; 466 - }; 467 - in 437 + }; 438 + grp = g: { 439 + type = "group"; 440 + val = g; 441 + opts.spacing = 1; 442 + }; 443 + btn = { 444 + val, 445 + onClick, 446 + ... 447 + }: { 448 + type = "button"; 449 + inherit val; 450 + opts = o; 451 + on_press.__raw = "function() vim.cmd[[${onClick}]] end"; 452 + }; 453 + cmd = { 454 + command, 455 + width, 456 + height, 457 + }: { 458 + type = "terminal"; 459 + inherit command width height; 460 + opts = o; 461 + }; 462 + pad = { 463 + type = "padding"; 464 + val = 2; 465 + }; 466 + in 468 467 [ 469 468 pad 470 469 pad ··· 493 492 (txt " NixVim Rev ${builtins.substring 0 5 inputs.nixvim.rev}") 494 493 ]) 495 494 ]) 496 - ++ [ pad ]; 495 + ++ [pad]; 497 496 }; 498 497 499 498 trouble = { ··· 602 601 hover = { 603 602 enabled = true; 604 603 delay = 150; 605 - reveal = [ "close" ]; 604 + reveal = ["close"]; 606 605 }; 607 606 sort_by = "insert_at_end"; 608 607 diagnostics = "nvim_lsp"; ··· 617 616 618 617 statuscol = { 619 618 enable = true; 620 - settings.segments = 621 - let 622 - dispCond = { 623 - __raw = '' 624 - function(ln) 625 - return vim.bo.filetype ~= "neo-tree" 626 - end 627 - ''; 628 - }; 629 - in 630 - [ 631 - { 632 - click = "v:lua.ScSa"; 633 - condition = [ 634 - dispCond 635 - ]; 636 - text = [ 637 - "%s" 638 - ]; 639 - } 640 - { 641 - click = "v:lua.ScLa"; 642 - condition = [ dispCond ]; 643 - text = [ 644 - { 645 - __raw = "require('statuscol.builtin').lnumfunc"; 646 - } 647 - ]; 648 - } 649 - { 650 - click = "v:lua.ScFa"; 651 - condition = [ 652 - dispCond 653 - { 654 - __raw = "require('statuscol.builtin').not_empty"; 655 - } 656 - ]; 657 - text = [ 658 - { 659 - __raw = "require('statuscol.builtin').foldfunc"; 660 - } 661 - " " 662 - ]; 663 - } 664 - ]; 619 + settings.segments = let 620 + dispCond = { 621 + __raw = '' 622 + function(ln) 623 + return vim.bo.filetype ~= "neo-tree" 624 + end 625 + ''; 626 + }; 627 + in [ 628 + { 629 + click = "v:lua.ScSa"; 630 + condition = [ 631 + dispCond 632 + ]; 633 + text = [ 634 + "%s" 635 + ]; 636 + } 637 + { 638 + click = "v:lua.ScLa"; 639 + condition = [dispCond]; 640 + text = [ 641 + { 642 + __raw = "require('statuscol.builtin').lnumfunc"; 643 + } 644 + ]; 645 + } 646 + { 647 + click = "v:lua.ScFa"; 648 + condition = [ 649 + dispCond 650 + { 651 + __raw = "require('statuscol.builtin').not_empty"; 652 + } 653 + ]; 654 + text = [ 655 + { 656 + __raw = "require('statuscol.builtin').foldfunc"; 657 + } 658 + " " 659 + ]; 660 + } 661 + ]; 665 662 }; 666 663 667 664 dropbar = { ··· 687 684 688 685 options = { 689 686 theme = "catppuccin"; 690 - disabled_filetypes = [ "neo-tree" ]; 691 - ignore_focus = [ "neo-tree" ]; 687 + disabled_filetypes = ["neo-tree"]; 688 + ignore_focus = ["neo-tree"]; 692 689 }; 693 690 }; 694 691 }; ··· 790 787 cmp = { 791 788 enable = true; 792 789 settings = { 793 - sources = map (name: { inherit name; }) [ 790 + sources = map (name: {inherit name;}) [ 794 791 "nvim_lsp" 795 792 "nvim_lsp_signature_help" 796 793 "path"
-14
homeModules/pfp.nix
··· 1 - { config, lib, ... }: 2 - { 3 - options.cow.pfp = { 4 - enable = lib.mkEnableOption "Enable setting profile picture"; 5 - file = lib.mkOption { 6 - type = lib.types.string; 7 - description = "Path to Profile Picture File (PNG, 1:1 Aspect)"; 8 - }; 9 - }; 10 - 11 - config = lib.mkIf config.cow.pfp.enable { 12 - home.file.".face".source = config.cow.pfp.file; 13 - }; 14 - }
+21
homeModules/pictures.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + options.cow.pictures = { 7 + enable = lib.mkEnableOption "Enable setting profile picture"; 8 + pfp = lib.mkOption { 9 + type = lib.types.path; 10 + description = "Path to Profile Picture File (PNG, 1:1 Aspect)"; 11 + }; 12 + bg = lib.mkOption { 13 + type = lib.types.path; 14 + description = "Path to the background image to use"; 15 + }; 16 + }; 17 + 18 + config = lib.mkIf config.cow.pfp.enable { 19 + home.file.".face".source = config.cow.pfp.file; 20 + }; 21 + }
+380
homeModules/qmplay2.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: { 7 + options.cow.qmplay2.enable = lib.mkEnableOption "QMPlay2 + customizations and yt-dlp"; 8 + 9 + config = let 10 + mkQMPlayFile = lib.generators.toINI {}; 11 + mkConfigDir = files: 12 + lib.mapAttrs' ( 13 + name: value: lib.nameValuePair ("QMPlay2/" + name + ".ini") {text = mkQMPlayFile value;} 14 + ) 15 + files; 16 + in 17 + lib.mkIf config.cow.qmplay2.enable { 18 + home.packages = with pkgs; [ 19 + qmplay2 20 + ]; 21 + 22 + xdg.configFile = mkConfigDir { 23 + ALSA.General = { 24 + AutoFindMultichnDev = true; 25 + Delay = 0.1; 26 + OutputDevice = "default"; 27 + WriterEnabled = true; 28 + }; 29 + AudioCD.AudioCD = { 30 + CDDB = true; 31 + CDTEXT = true; 32 + }; 33 + AudioFilters = { 34 + General = { 35 + AVAudioFilter = false; 36 + BS2B = false; 37 + Compressor = false; 38 + Echo = false; 39 + Equalizer = false; 40 + PhaseReverse = false; 41 + SwapStereo = false; 42 + VoiceRemoval = false; 43 + }; 44 + 45 + AVAudioFilter.Filters = "@ByteArray()"; 46 + 47 + BS2B = { 48 + Fcut = 700; 49 + Feed = 4.5; 50 + }; 51 + 52 + Compressor = { 53 + FastGainCompressionRatio = 0.9; 54 + OverallCompressionRatio = 0.6; 55 + PeakPercent = 90; 56 + ReleaseTime = 0.2; 57 + }; 58 + 59 + Echo = { 60 + Delay = 500; 61 + Feedback = 50; 62 + Surround = false; 63 + Volume = 50; 64 + }; 65 + 66 + Equalizer = { 67 + "-1" = 50; 68 + "0" = 50; 69 + "1" = 50; 70 + "2" = 50; 71 + "3" = 50; 72 + "4" = 50; 73 + "5" = 50; 74 + "6" = 50; 75 + "7" = 50; 76 + count = 8; 77 + maxFreq = 18000; 78 + minFreq = 200; 79 + nbits = 10; 80 + }; 81 + 82 + PhaseReverse = { 83 + ReverseRight = false; 84 + }; 85 + }; 86 + CUVID.General = { 87 + DecodeMPEG4 = true; 88 + DeintMethod = 2; 89 + Enabled = true; 90 + }; 91 + Chiptune.General = { 92 + DefaultLength = 180; 93 + GME = true; 94 + SIDPlay = true; 95 + }; 96 + Extensions = { 97 + LastFM = { 98 + AllowBigCovers = true; 99 + DownloadCovers = true; 100 + Login = null; 101 + Password = null; 102 + UpdateNowPlayingAndScrobble = false; 103 + }; 104 + 105 + MPRIS2.Enabled = true; 106 + 107 + YouTube = { 108 + ShowUserName = false; 109 + SortBy = 0; 110 + Subtitles = true; 111 + }; 112 + }; 113 + FFmpeg.General = { 114 + AllowExperimental = true; 115 + DecoderEnabled = true; 116 + DecoderVAAPIEnabled = true; 117 + DecoderVkVideoEnabled = true; 118 + DemuxerEnabled = true; 119 + ForceSkipFrames = false; 120 + HurryUP = true; 121 + LowresValue = 0; 122 + ReconnectNetwork = true; 123 + SkipFrames = true; 124 + TeletextPage = 0; 125 + TeletextTransparent = false; 126 + ThreadTypeSlice = false; 127 + Threads = 0; 128 + VAAPIDeintMethod = 1; 129 + }; 130 + Modplug.General = { 131 + ModplugEnabled = true; 132 + ModplugResamplingMethod = 3; 133 + }; 134 + Notify.General = { 135 + CustomBody = null; 136 + CustomMsg = false; 137 + CustomSummary = null; 138 + Enabled = false; 139 + ShowPlayState = true; 140 + ShowTitle = true; 141 + ShowVolume = true; 142 + Timeout = 5000; 143 + }; 144 + Playlists.General = { 145 + M3U_enabled = true; 146 + XSPF_enabled = true; 147 + }; 148 + PulseAudio.General = { 149 + Delay = 0.1; 150 + WriterEnabled = true; 151 + }; 152 + QMPlay2 = { 153 + General = { 154 + AVBufferLocal = 100; 155 + AVBufferTimeNetwork = 500; 156 + AVBufferTimeNetworkLive = 5; 157 + AccurateSeek = 2; 158 + AllowOnlyOneInstance = false; 159 + AudioLanguage = null; 160 + AutoDelNonGroupEntries = false; 161 + AutoOpenVideoWindow = true; 162 + AutoRestoreMainWindowOnVideo = true; 163 + AutoUpdates = false; 164 + BackwardBuffer = 1; 165 + BlurCovers = true; 166 + Channels = 2; 167 + DisableSubtitlesAtStartup = false; 168 + DisplayOnlyFileName = false; 169 + EnlargeCovers = false; 170 + FallbackSubtitlesEncoding = "@ByteArray(UTF-8)"; 171 + ForceChannels = 0; 172 + ForceSamplerate = false; 173 + HideArtistMetadata = false; 174 + IconsFromTheme = true; 175 + IgnorePlaybackError = false; 176 + KeepARatio = false; 177 + KeepSpeed = false; 178 + KeepSubtitlesDelay = false; 179 + KeepSubtitlesScale = false; 180 + KeepVideoDelay = false; 181 + KeepZoom = false; 182 + LastQMPlay2Path = "${pkgs.qmplay2}/bin"; 183 + LeftMouseTogglePlay = 0; 184 + LongSeek = 30; 185 + MaxVol = 100; 186 + MiddleMouseToggleFullscreen = false; 187 + Mute = false; 188 + NoCoversCache = false; 189 + OutputFilePath = "/home/bean/Downloads"; 190 + PlayIfBuffered = 1.75; 191 + Renderer = "opengl"; 192 + RepeatMode = 0; 193 + ResamplerFirst = true; 194 + RestoreAVSState = false; 195 + RestoreRepeatMode = false; 196 + RestoreVideoEqualizer = false; 197 + Samplerate = 48000; 198 + SavePos = false; 199 + ShortSeek = 5; 200 + ShowBufferedTimeOnSlider = true; 201 + ShowCovers = true; 202 + ShowDirCovers = true; 203 + Silence = true; 204 + SkipPlaylistsWithinFiles = true; 205 + SkipYtDlpUpdate = false; 206 + StillImages = false; 207 + StoreARatioAndZoom = false; 208 + StoreUrlPos = true; 209 + Style = "kvantum"; 210 + SubtitlesLanguage = null; 211 + SyncVtoA = true; 212 + TrayNotifiesDefault = false; 213 + TrayVisible = true; 214 + UnpauseWhenSeeking = false; 215 + UpdateVersion = pkgs.qmplay2.version; 216 + Version = "@ByteArray(${pkgs.qmplay2.version})"; 217 + VideoFilters = "0FPS Doubler"; 218 + VolumeL = 100; 219 + VolumeR = 100; 220 + WheelAction = true; 221 + WheelSeek = true; 222 + screenshotFormat = ".png"; 223 + screenshotPth = "/home/bean/Pictures/Screenshots"; 224 + }; 225 + 226 + ApplyToASS = { 227 + ApplyToASS = false; 228 + ColorsAndBorders = true; 229 + FontsAndSpacing = false; 230 + MarginsAndAlignment = false; 231 + }; 232 + 233 + Deinterlace = { 234 + Auto = true; 235 + AutoParity = true; 236 + Doubler = true; 237 + ON = true; 238 + SoftwareMethod = ''Yadif 2x''; 239 + TFF = false; 240 + }; 241 + 242 + MainWidget = { 243 + AlwaysOnTop = false; 244 + CompactViewDockWidgetState = ''@ByteArray()''; 245 + DockWidgetState = ''@ByteArray()''; 246 + FullScreenDockWidgetState = ''@ByteArray()''; 247 + Geometry = ''@Rect(226 151 1805 1203)''; 248 + IsCompactView = false; 249 + KeepDocksSize = false; 250 + TabPositionNorth = false; 251 + WidgetsLocked = true; 252 + isMaximized = true; 253 + isVisible = true; 254 + }; 255 + 256 + OSD = { 257 + Alignment = 4; 258 + Background = false; 259 + BackgroundColor = ''@Variant(\0\0\0\x43\x1\x88\x88\0\0\0\0\0\0\0\0)''; 260 + Bold = false; 261 + Enabled = true; 262 + FontName = "Sans Serif"; 263 + FontSize = 32; 264 + LeftMargin = 0; 265 + Outline = 1.5; 266 + OutlineColor = ''@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\0\0\0\0)''; 267 + RightMargin = 0; 268 + Shadow = 1.5; 269 + ShadowColor = ''@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\0\0\0\0)''; 270 + Spacing = 0; 271 + TextColor = ''@Variant(\0\0\0\x43\x1\xff\xff\xaa\xaa\xff\xffUU\0\0)''; 272 + VMargin = 0; 273 + }; 274 + 275 + OpenGL = { 276 + BypassCompositor = false; 277 + OnWindow = false; 278 + VSync = true; 279 + }; 280 + 281 + Proxy = { 282 + Host = null; 283 + Login = false; 284 + Password = ''@ByteArray()''; 285 + Port = 80; 286 + Use = false; 287 + User = null; 288 + }; 289 + 290 + ReplayGain = { 291 + Album = false; 292 + Enabled = false; 293 + Preamp = 0; 294 + PreventClipping = true; 295 + }; 296 + 297 + SettingsWidget.Geometry = ''@Rect(395 263 2212 1308)''; 298 + 299 + Subtitles = { 300 + Alignment = 7; 301 + Background = true; 302 + BackgroundColor = ''@Variant(\0\0\0\x43\x1\x88\x88\0\0\0\0\0\0\0\0)''; 303 + Bold = false; 304 + FontName = "Fira Code"; 305 + FontSize = 24; 306 + LeftMargin = 15; 307 + Outline = 1; 308 + OutlineColor = ''@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\0\0\0\0)''; 309 + RightMargin = 15; 310 + Shadow = 0.5; 311 + ShadowColor = ''@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\0\0\0\0)''; 312 + Spacing = 2; 313 + TextColor = ''@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)''; 314 + VMargin = 15; 315 + }; 316 + 317 + VideoAdjustment = { 318 + Brightness = 0; 319 + Contrast = 0; 320 + Hue = 0; 321 + Negative = 0; 322 + Saturation = 0; 323 + Sharpness = 0; 324 + }; 325 + 326 + Vulkan = { 327 + AlwaysGPUDeint = true; 328 + BypassCompositor = true; 329 + Device = "@ByteArray()"; 330 + ForceVulkanYadif = false; 331 + HDR = false; 332 + HQScaleDown = false; 333 + HQScaleUp = false; 334 + VSync = 1; 335 + YadifSpatialCheck = true; 336 + }; 337 + 338 + YtDl = { 339 + CookiesFromBrowser = null; 340 + CookiesFromBrowserEnabled = false; 341 + CustomPath = "${pkgs.yt-dlp}/bin/yt-dlp"; 342 + CustomPathEnabled = true; 343 + DefaultQuality = null; 344 + DefaultQualityEnabled = false; 345 + DontAutoUpdate = true; 346 + }; 347 + }; 348 + QPainterSW.General.Enabled = true; 349 + Subtitles.General = { 350 + Classic_enabled = true; 351 + SRT_enabled = true; 352 + Sub_max_s = 5; 353 + Use_mDVD_FPS = true; 354 + }; 355 + VideoFilters.FPSDoubler = { 356 + MaxFPS = 29.99; 357 + MinFPS = 21; 358 + OnlyFullScreen = true; 359 + }; 360 + Visualizations = { 361 + General = { 362 + RefreshTime = 17; 363 + }; 364 + 365 + FFTSpectrum = { 366 + LimitFreq = 20000; 367 + Size = 8; 368 + }; 369 + 370 + SimpleVis = { 371 + SoundLength = 17; 372 + }; 373 + }; 374 + XVideo.General = { 375 + Enabled = false; 376 + UseSHM = false; 377 + }; 378 + }; 379 + }; 380 + }
+1 -2
homeModules/starship.nix
··· 2 2 config, 3 3 lib, 4 4 ... 5 - }: 6 - { 5 + }: { 7 6 options.cow.starship.enable = lib.mkEnableOption "Starship + Customizations"; 8 7 9 8 config = lib.mkIf config.cow.starship.enable {
+25
homeModules/sync.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + options.cow.sync.enable = lib.mkEnableOption "syncing via SyncThing"; 7 + 8 + config = lib.mkIf config.cow.sync.enable { 9 + cow.imperm.keepCache = [".local/share/syncthing"]; 10 + 11 + cow.firewall = { 12 + tcp = [22000]; 13 + udp = [21027 22000]; 14 + }; 15 + 16 + syncthing = { 17 + enable = true; 18 + 19 + overrideFolders = false; 20 + overrideDevices = false; 21 + 22 + settings.options.urAccepted = -1; 23 + }; 24 + }; 25 + }
+57
homeModules/user-bean.nix
··· 1 + { 2 + lib, 3 + config, 4 + ... 5 + }: 6 + let 7 + pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsVzdJra+x5aEuwTjL1FBOiMh9bftvs8QwsM1xyEbdd"; 8 + in 9 + { 10 + 11 + options.cow.bean.enable = lib.mkEnableOption "Bean user presets"; 12 + 13 + config = lib.mkIf config.cow.bean.enable { 14 + # My Personal config using most of my HM modules 15 + 16 + home = { 17 + file.".ssh/authorized_keys".text = '' 18 + ${pubkey} bean 19 + ''; 20 + username = lib.mkDefault "bean"; 21 + homeDirectory = lib.mkDefault "/home/bean"; 22 + }; 23 + 24 + programs.git.config.user = { 25 + email = "bwc9876@gmail.com"; 26 + name = "Ben C"; 27 + signingKey = pubkey; 28 + }; 29 + 30 + cow = { 31 + libraries.enable = true; 32 + imperm = { 33 + enable = true; 34 + keepLibraries = true; 35 + }; 36 + pictures = { 37 + pfp = ../res/pictures/cow.png; 38 + bg = ../res/pictures/background.png; 39 + }; 40 + nushell = { 41 + enable = true; 42 + commandNotFound = true; 43 + }; 44 + nvim.enable = true; 45 + htop.enable = true; 46 + starship.enable = true; 47 + yazi.enable = true; 48 + dev.enable = true; 49 + comma.enable = true; 50 + cat.enable = true; 51 + 52 + firefox = config.cow.gdi.enable; 53 + waybar = config.cow.gdi.enable; 54 + keepassxc.dbPath = lib.mkDefault "${config.xdg.userDirs.documents}/KeePass/DB"; 55 + }; 56 + }; 57 + }
+55
homeModules/utils.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + inputs', 6 + ... 7 + }: { 8 + options.cow.utils.enable = 9 + lib.mkEnableOption "Handy utilities to have" 10 + // { 11 + default = true; 12 + }; 13 + 14 + config = lib.mkIf config.cow.utils.enable { 15 + home.packages = with pkgs; 16 + [ 17 + binutils 18 + usbutils 19 + qrencode 20 + nmap 21 + file 22 + procfd 23 + dust 24 + zip 25 + inputs'.gh-grader-preview.packages.default 26 + wol 27 + libqalculate 28 + p7zip 29 + poop 30 + 31 + hyfetch 32 + fastfetch 33 + ] 34 + ++ lib.optional config.cow.gdi.enable [wev]; 35 + 36 + programs.hyfetch = { 37 + enable = true; 38 + settings = { 39 + backend = "fastfetch"; 40 + color_align = { 41 + custom_colors = []; 42 + fore_back = null; 43 + mode = "horizontal"; 44 + }; 45 + distro = null; 46 + light_dark = "dark"; 47 + lightness = 0.65; 48 + mode = "rgb"; 49 + preset = "interprogress"; 50 + pride_month_disable = false; 51 + pride_month_shown = []; 52 + }; 53 + }; 54 + }; 55 + }
+547
homeModules/waybar.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: { 7 + options.cow.waybar.enable = lib.mkEnableOption "Waybar + customizations"; 8 + 9 + config = let 10 + catppuccinCss = pkgs.fetchurl { 11 + url = "https://github.com/catppuccin/waybar/raw/refs/heads/main/themes/mocha.css"; 12 + hash = "sha256-puMFl8zIKOiYhE6wzqnffXOHn/VnKmpVDzrMJMk+3Rc="; 13 + }; 14 + in 15 + lib.mkIf config.cow.waybar.enable { 16 + wayland.windowManager.hyprland.settings.bind = [ 17 + "SUPER,W,exec,systemctl restart --user waybar" 18 + "SUPER SHIFT,W,exec,systemctl stop --user waybar" 19 + ]; 20 + programs.waybar = { 21 + enable = true; 22 + systemd.enable = true; 23 + style = '' 24 + @import "${catppuccinCss}"; 25 + 26 + * { 27 + font-family: sans-serif; 28 + } 29 + 30 + window#waybar { 31 + background: rgba(49, 50, 68, 0.65); 32 + color: @text; 33 + } 34 + 35 + .modules-left > * > *, 36 + .modules-right > * > * { 37 + font-size: 1.5rem; 38 + background: @crust; 39 + border: 2px solid @base; 40 + border-radius: 5rem; 41 + padding: 5px 15px; 42 + margin: 5px 2px; 43 + } 44 + 45 + #bluetooth.disabled { 46 + border-color: @red; 47 + } 48 + 49 + #waybar .modules-left > *:first-child > * { 50 + margin-left: 25px; 51 + } 52 + 53 + #waybar .modules-right > *:last-child > * { 54 + margin-right: 25px; 55 + } 56 + 57 + #waybar .modules-left, 58 + #waybar .modules-right { 59 + margin-top: 10px; 60 + margin-bottom: 5px; 61 + } 62 + 63 + #waybar .modules-center { 64 + margin-top: 5px; 65 + margin-bottom: 5px; 66 + } 67 + 68 + #battery.warning { 69 + border-color: @yellow; 70 + } 71 + 72 + #battery.critical { 73 + border-color: @red; 74 + } 75 + 76 + * > #battery.charging { 77 + border-color: @green; 78 + } 79 + 80 + #taskbar, 81 + #workspaces { 82 + padding: 10px; 83 + border-radius: 5rem; 84 + border: none; 85 + background: none; 86 + } 87 + 88 + #taskbar button, 89 + #workspaces button { 90 + color: @text; 91 + border-radius: 5rem; 92 + padding: 5px 15px; 93 + margin: 0 5px; 94 + background: @crust; 95 + border: 2px solid @base; 96 + } 97 + 98 + #taskbar button:hover, #workspaces button:hover { 99 + background: @mantle; 100 + } 101 + 102 + #workspaces button { 103 + font-size: 1.5rem; 104 + } 105 + 106 + #cpu, 107 + #memory, 108 + #temperature { 109 + font-size: 1.5rem; 110 + padding: 10px 25px; 111 + } 112 + 113 + #cpu.warning, 114 + #memory.warning { 115 + border-color: @yellow; 116 + } 117 + 118 + #cpu.critical, 119 + #memory.critical, 120 + #temperature.critical { 121 + border-color: @red; 122 + } 123 + 124 + #workspaces button.active { 125 + border: 2px solid @sapphire; 126 + } 127 + 128 + #taskbar button.active { 129 + border: 2px solid @sapphire; 130 + } 131 + 132 + #idle_inhibitor.activated { 133 + border-color: @mauve; 134 + } 135 + 136 + #custom-notification.notification { 137 + border-color: @sapphire; 138 + } 139 + 140 + #custom-notification.dnd-none, 141 + #custom-notification.dnd-notification, 142 + #custom-notification.dnd-inhibited-none, 143 + #custom-notification.dnd-inhibited-notification { 144 + border-color: @red; 145 + } 146 + 147 + #custom-notification.inhibited-none, 148 + #custom-notification.inhibited-notification { 149 + border-color: @mauve; 150 + } 151 + 152 + #network.disconnected { 153 + border-color: @red; 154 + } 155 + 156 + #privacy { 157 + background: none; 158 + border: none; 159 + margin: 0; 160 + padding: 0; 161 + } 162 + 163 + #privacy-item { 164 + font-size: 1.5rem; 165 + border-radius: 5rem; 166 + padding: 5px 15px; 167 + margin: 5px 2px; 168 + border: 2px solid @red; 169 + background-color: @crust; 170 + } 171 + 172 + #custom-weather.VeryCloudy, 173 + #custom-weather.Cloudy, 174 + #custom-weather.Fog { 175 + border-color: @overlay0; 176 + } 177 + 178 + #custom-weather.HeavyRain, 179 + #custom-weather.ThunderyHeavyRain, 180 + #custom-weather.ThunderyRain, 181 + #custom-weather.ThunderyShowers, 182 + #custom-weather.HeavyShowers, 183 + #custom-weather.LightRain, 184 + #custom-weather.LightShowers { 185 + border-color: @blue; 186 + } 187 + 188 + #custom-weather.HeavySnow, 189 + #custom-weather.LightSnow, 190 + #custom-weather.Sleet, 191 + #custom-weather.Snow, 192 + #custom-weather.LightSnowShowers, 193 + #custom-weather.LightSleetShowers { 194 + border-color: @text; 195 + } 196 + 197 + #custom-weather.Clear, 198 + #custom-weather.Sunny { 199 + border-color: @yellow; 200 + } 201 + 202 + #custom-weather.PartlyCloudy { 203 + border-color: @flamingo; 204 + } 205 + 206 + #custom-weather.PartlyCloudy.night { 207 + border-color: @lavender; 208 + } 209 + 210 + #custom-weather.Clear.night, 211 + #custom-weather.Sunny.night { 212 + border-color: @mauve; 213 + } 214 + 215 + #custom-news.utd { 216 + font-size: 1.5rem; 217 + } 218 + 219 + #custom-news.unread { 220 + border-color: @sapphire; 221 + } 222 + 223 + #mpris { 224 + opacity: 0; 225 + } 226 + 227 + #mpris.paused { 228 + opacity: 1; 229 + } 230 + 231 + #mpris.playing { 232 + opacity: 1; 233 + border-color: @sapphire; 234 + } 235 + 236 + #mpris.playing.spotify { 237 + border-color: #33B980; 238 + } 239 + 240 + #mpris.paused.kdeconnect { 241 + opacity: 0; 242 + } 243 + ''; 244 + settings = [ 245 + { 246 + battery = { 247 + format = "{icon} {capacity}󰏰"; 248 + format-charging = "{icon} {capacity}󰏰"; 249 + format-icons = { 250 + charging = [ 251 + "󰢜" 252 + "󰂆" 253 + "󰂇" 254 + "󰂈" 255 + "󰢝" 256 + "󰂉" 257 + "󰢞" 258 + "󰂊" 259 + "󰂋" 260 + "󰂅" 261 + ]; 262 + default = [ 263 + "󰁺" 264 + "󰁻" 265 + "󰁼" 266 + "󰁽" 267 + "󰁾" 268 + "󰁿" 269 + "󰂀" 270 + "󰂁" 271 + "󰂂" 272 + "󰁹" 273 + ]; 274 + }; 275 + states = { 276 + critical = 15; 277 + warning = 30; 278 + }; 279 + }; 280 + bluetooth = { 281 + format = "󰂯"; 282 + format-connected = "󰂱"; 283 + format-connected-battery = "󰂱 {device_battery_percentage}󰏰"; 284 + format-disabled = "󰂲"; 285 + format-off = "󰂲"; 286 + on-click = "rofi-bluetooth"; 287 + on-click-right = "rfkill toggle bluetooth"; 288 + tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; 289 + tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; 290 + tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; 291 + tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; 292 + }; 293 + "clock#1" = { 294 + actions = { 295 + on-click = "shift_up"; 296 + on-click-middle = "mode"; 297 + on-click-right = "shift_down"; 298 + }; 299 + calendar = { 300 + format = { 301 + days = "<span color='#ecc6d9'><b>{}</b></span>"; 302 + months = "<span color='#ffead3'><b>{}</b></span>"; 303 + today = "<span color='#ff6699'><b><u>{}</u></b></span>"; 304 + weekdays = "<span color='#ffcc66'><b>{}</b></span>"; 305 + weeks = "<span color='#99ffdd'><b>W{}</b></span>"; 306 + }; 307 + mode = "month"; 308 + mode-mon-col = 3; 309 + on-scroll = 1; 310 + weeks-pos = "right"; 311 + }; 312 + format = "󰃭 {:%A, %B %Od}"; 313 + tooltip-format = "<tt><small>{calendar}</small></tt>"; 314 + }; 315 + "clock#2" = { 316 + format = "󰥔 {:%I:%M %p}"; 317 + tooltip-format = "{:%F at %T in %Z (UTC%Ez)}"; 318 + }; 319 + "custom/kde-connect" = { 320 + exec = "${pkgs.nushell}/bin/nu ${../res/custom_waybar_modules/kdeconnect.nu}"; 321 + format = "{}"; 322 + interval = 30; 323 + on-click = "kdeconnect-settings"; 324 + return-type = "json"; 325 + }; 326 + "custom/news" = { 327 + exec = "${pkgs.nushell}/bin/nu ${../res/custom_waybar_modules/newsboat.nu}"; 328 + exec-on-event = true; 329 + format = "{}"; 330 + on-click-right = "pkill waybar -SIGRTMIN+6"; 331 + restart-interval = 1800; 332 + return-type = "json"; 333 + signal = 6; 334 + }; 335 + "custom/notification" = { 336 + escape = true; 337 + exec = "swaync-client -swb"; 338 + exec-if = "which swaync-client"; 339 + format = "{icon}"; 340 + format-icons = { 341 + dnd-inhibited-none = "󰂛"; 342 + dnd-inhibited-notification = "󰂛<sup></sup>"; 343 + dnd-none = "󰂛"; 344 + dnd-notification = "󰂛<sup></sup>"; 345 + inhibited-none = "󰂠"; 346 + inhibited-notification = "󰂠<sup></sup>"; 347 + none = "󰂚"; 348 + notification = "󱅫"; 349 + }; 350 + max-length = 3; 351 + on-click = "sleep 0.2 && swaync-client -t -sw"; 352 + on-click-middle = "sleep 0.2 && swaync-client -C -sw"; 353 + on-click-right = "sleep 0.2 && swaync-client -d -sw"; 354 + return-type = "json"; 355 + tooltip = false; 356 + }; 357 + "custom/weather" = { 358 + exec = "${pkgs.nushell}/bin/nu ${../res/custom_waybar_modules/weather.nu}"; 359 + format = "{}"; 360 + interval = 600; 361 + on-click = "xdg-open https://duckduckgo.com/?q=weather"; 362 + return-type = "json"; 363 + }; 364 + idle_inhibitor = { 365 + format = "{icon}"; 366 + format-icons = { 367 + activated = "󰒳"; 368 + deactivated = "󰒲"; 369 + }; 370 + }; 371 + layer = "top"; 372 + modules-center = []; 373 + modules-left = 374 + [ 375 + "user" 376 + "clock#1" 377 + "clock#2" 378 + ] 379 + ++ lib.optional config.cow.news.enable ["custom/news"] 380 + ++ [ 381 + "custom/weather" 382 + "mpris" 383 + ]; 384 + modules-right = 385 + [ 386 + "network" 387 + "battery" 388 + "bluetooth" 389 + "pulseaudio" 390 + ] 391 + ++ lib.optional config.cow.kde-connect.enable ["custom/kdeconnect"] 392 + ++ lib.optional config.cow.gdi.doIdle ["idle_inhibitor"] 393 + ++ [ 394 + "custom/notification" 395 + "privacy" 396 + "tray" 397 + ]; 398 + mpris = { 399 + album-len = 20; 400 + artist-len = 25; 401 + interval = 1; 402 + dynamic-importance-order = [ 403 + "title" 404 + "position" 405 + "length" 406 + "artist" 407 + "album" 408 + ]; 409 + dynamic-len = 50; 410 + dynamic-order = [ 411 + "title" 412 + "artist" 413 + "album" 414 + "position" 415 + "length" 416 + ]; 417 + format = "{player_icon} {dynamic}"; 418 + format-paused = "{status_icon} {dynamic}"; 419 + player-icons = { 420 + QMPlay2 = "󰐌"; 421 + default = "󰎆"; 422 + firefox = ""; 423 + firefox-devedition = ""; 424 + chromium = "󰖟"; 425 + kdeconnect = ""; 426 + spotify = "󰓇"; 427 + }; 428 + status-icons = { 429 + paused = "󰏤"; 430 + stopped = "󰓛"; 431 + }; 432 + title-len = 35; 433 + }; 434 + network = { 435 + format = "{ifname}"; 436 + format-disconnected = "󰪎"; 437 + format-ethernet = "󱎔 {ifname}"; 438 + format-icons = [ 439 + "󰤟" 440 + "󰤢" 441 + "󰤥" 442 + "󰤨" 443 + ]; 444 + format-linked = "󰌷 {ifname}"; 445 + format-wifi = "{icon} {essid}"; 446 + tooltip-disconnected = "Disconnected"; 447 + tooltip-format = "{ifname} via {gwaddr}"; 448 + tooltip-format-ethernet = "󱎔 {ifname}"; 449 + tooltip-format-wifi = "Connected to {essid} ({signalStrength}󰏰 Strength) over {ifname} via {gwaddr}"; 450 + }; 451 + position = "top"; 452 + privacy = { 453 + icon-size = 20; 454 + icon-spacing = 4; 455 + modules = [ 456 + { 457 + tooltip = true; 458 + tooltip-icon-size = 24; 459 + type = "screenshare"; 460 + } 461 + { 462 + tooltip = true; 463 + tooltip-icon-size = 24; 464 + type = "audio-in"; 465 + } 466 + ]; 467 + transition-duration = 200; 468 + }; 469 + pulseaudio = { 470 + format = "{icon} {volume:2}󰏰"; 471 + format-bluetooth = "{icon} {volume}󰏰"; 472 + format-icons = { 473 + car = ""; 474 + default = [ 475 + "󰖀" 476 + "󰕾" 477 + ]; 478 + hands-free = "󰋋"; 479 + headphone = "󰋋"; 480 + headset = "󰋋"; 481 + phone = ""; 482 + portable = ""; 483 + }; 484 + format-muted = "󰝟"; 485 + on-click = "pamixer -t"; 486 + on-click-right = "pavucontrol"; 487 + scroll-step = 5; 488 + }; 489 + tray = { 490 + icon-size = 25; 491 + show-passive-items = true; 492 + spacing = 5; 493 + }; 494 + user = { 495 + format = " {user}"; 496 + icon = true; 497 + }; 498 + } 499 + { 500 + cpu = { 501 + format = "󰍛 {usage}󰏰"; 502 + states = { 503 + critical = 95; 504 + warning = 80; 505 + }; 506 + }; 507 + "hyprland/workspaces" = { 508 + disable-scroll = true; 509 + format = "{name}"; 510 + }; 511 + layer = "top"; 512 + memory = { 513 + format = " {}󰏰 ({used:0.1f}/{total:0.1f} GiB)"; 514 + states = { 515 + critical = 90; 516 + warning = 70; 517 + }; 518 + }; 519 + modules-center = ["wlr/taskbar"]; 520 + modules-left = ["hyprland/workspaces"]; 521 + modules-right = [ 522 + "temperature" 523 + "cpu" 524 + "memory" 525 + ]; 526 + position = "bottom"; 527 + temperature = { 528 + critical-threshold = 80; 529 + format = "{icon} {temperatureC} °C"; 530 + format-critical = "{icon}! {temperatureC} °C"; 531 + format-icons = [ 532 + "󱃃" 533 + "󰔏" 534 + "󱃂" 535 + ]; 536 + thermal-zone = 1; 537 + }; 538 + "wlr/taskbar" = { 539 + format = "{icon}"; 540 + icon-size = 35; 541 + on-click = "activate"; 542 + }; 543 + } 544 + ]; 545 + }; 546 + }; 547 + }
+9 -4
homeModules/yazi.nix
··· 3 3 lib, 4 4 pkgs, 5 5 ... 6 - }: 7 - { 6 + }: { 8 7 options.cow.yazi.enable = lib.mkEnableOption "Yazi + Customizations"; 9 8 10 9 config = lib.mkIf config.cow.yazi.enable { 11 10 home.packages = with pkgs; [ 11 + yazi 12 12 mediainfo 13 13 exiftool 14 14 ]; 15 15 16 + wayland.windowManager.hyprland.settings.bind = 17 + lib.optional config.cow.gdi.enable [ 18 + ]; 19 + 16 20 programs.yazi = { 17 21 enable = true; 18 22 enableBashIntegration = true; ··· 34 38 keymap.mgr.prepend_keymap = [ 35 39 { 36 40 run = "plugin mount"; 37 - on = [ "M" ]; 41 + on = ["M"]; 38 42 desc = "Disk Mounting"; 39 43 } 40 44 { ··· 48 52 ]; 49 53 50 54 plugins = { 51 - inherit (pkgs.yaziPlugins) 55 + inherit 56 + (pkgs.yaziPlugins) 52 57 ouch 53 58 mount 54 59 chmod
+72
nixosModules/base.nix
··· 1 + { 2 + pkgs, 3 + inputs, 4 + config, 5 + lib, 6 + ... 7 + }: 8 + { 9 + time.timeZone = lib.mkDefault "America/New_York"; 10 + 11 + environment.etc."machine-id".text = lib.mkDefault ( 12 + builtins.hashString "md5" config.networking.hostName 13 + ); 14 + 15 + environment.variables."HOSTNAME" = lib.mkDefault config.networking.hostName; 16 + environment.systemPackages = with pkgs; [ 17 + uutils-coreutils-noprefix 18 + 19 + nh 20 + nix-output-monitor 21 + git 22 + ]; 23 + environment.etc."flake-src".source = inputs.self; 24 + 25 + boot.tmp.cleanOnBoot = lib.mkDefault true; 26 + services.logind.settings.Login.RuntimeDirectorySize = lib.mkDefault "100M"; 27 + 28 + # Make Nix builder lower OOM priority so it's killed before other stuff 29 + systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = lib.mkDefault 250; 30 + 31 + # Keep flake inputs when GC-ing 32 + system.extraDependencies = 33 + with builtins; 34 + let 35 + flakeDeps = 36 + flake: 37 + [ flake.outPath ] ++ (foldl' (a: b: a ++ b) [ ] (map flakeDeps (attrValues flake.inputs or { }))); 38 + in 39 + flakeDeps inputs.self; 40 + 41 + boot = { 42 + initrd.systemd = { 43 + enable = lib.mkDefault true; 44 + }; 45 + 46 + # Use latest kernel with sysrqs and lockdown enabled 47 + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; 48 + kernelParams = lib.mkDefault [ "lockdown=confidentiality" ]; 49 + kernel.sysctl."kernel.sysrq" = lib.mkDefault 1; 50 + }; 51 + 52 + nix = { 53 + channel.enable = false; 54 + registry.p.flake = inputs.self; 55 + package = pkgs.lix; 56 + settings = { 57 + # So we can do `import <nixpkgs>` 58 + nix-path = "nixpkgs=${inputs.nixpkgs}"; 59 + experimental-features = [ 60 + "nix-command" 61 + "flakes" 62 + "pipe-operator" 63 + ]; 64 + auto-optimise-store = true; 65 + fallback = true; 66 + }; 67 + gc = { 68 + automatic = lib.mkDefault false; 69 + dates = lib.mkDefault "weekly"; 70 + }; 71 + }; 72 + }
+14
nixosModules/cat.nix
··· 1 + {config, lib, inputs, ...}: { 2 + 3 + imports = [inputs.catppuccin.nixosModules.catppuccin]; 4 + 5 + options.cow.cat.enable = lib.mkEnableOption "Catppuccin theming everywhere"; 6 + 7 + config = lib.mkIf config.cow.cat.enable { 8 + catppuccin = { 9 + enable = true; 10 + flavor = "mocha"; 11 + accent = "green"; 12 + }; 13 + }; 14 + }
+70
nixosModules/disks.nix
··· 1 + { config, lib, ... }: 2 + { 3 + options.cow.disks = { 4 + enable = lib.mkEnableOption "allowing cow to create a UEFI-compatible layout"; 5 + swap = lib.mkEnableOption "look for and swapon a swap device"; 6 + luks = lib.mkEnableOption "do dev mapping for encrypted LUKS volumes"; 7 + partition-prefix = { 8 + type = lib.types.nullOr lib.types.str; 9 + default = null; 10 + description = "A prefix to place before partition names (more multiboots, etc.)"; 11 + }; 12 + }; 13 + 14 + config = 15 + let 16 + conf = config.cow.disks; 17 + prefix = if conf.partition-prefix == null then "" else "${conf.partition-prefix}-"; 18 + primaryPart = "/dev/disk/by-partlabel/${prefix}NIXOS"; 19 + swapPart = "/dev/disk/by-partlabel/${prefix}SWAP"; 20 + bootPart = "/dev/disk/by-partlabel/${prefix}BOOT"; 21 + cryptroot = "/dev/mapper/cryptroot"; 22 + cryptswap = "/dev/mapper/cryptswap"; 23 + in 24 + lib.mkIf config.cow.disks.enable { 25 + boot.initrd.luks.devices = lib.mkIf conf.luks { 26 + "cryptroot".device = primaryPart; 27 + "cryptswap".device = swapPart; 28 + }; 29 + swapDevices = [ 30 + { device = if conf.luks then cryptswap else swapPart; } 31 + ]; 32 + fileSystems."/boot" = { 33 + device = bootPart; # Boot partition is always unencrypted 34 + fsType = "vfat"; 35 + options = [ 36 + "fmask=0022" 37 + "dmask=0022" 38 + "nosuid" 39 + "nodev" 40 + "noexec" 41 + "noatime" 42 + ]; 43 + }; 44 + fileSystems."/nix" = lib.mkIf config.cow.imperm.enable { 45 + device = if conf.luks then cryptroot else primaryPart; 46 + fsType = "ext4"; 47 + options = [ 48 + "lazytime" 49 + "nodev" 50 + "nosuid" 51 + ]; 52 + neededForBoot = true; 53 + }; 54 + fileSystems."/" = 55 + if config.cow.imperm.enable then 56 + { 57 + fsType = "tmpfs"; 58 + options = [ 59 + "size=512M" 60 + "mode=755" 61 + ]; 62 + neededForBoot = true; 63 + } 64 + else 65 + { 66 + device = if conf.luks then cryptroot else primaryPart; 67 + fsType = "ext4"; 68 + }; 69 + }; 70 + }
+20
nixosModules/firewall.nix
··· 1 + { config, lib, ... }: 2 + { 3 + options.cow.firewall.openForUsers = lib.mkEnableOption "Opening firewall from HM configs for all users"; 4 + 5 + config = 6 + lib.mkIf config.cow.hm.enable 7 + && config.cow.firewall.openForUsers ( 8 + let 9 + getFirewall = lib.attrByPath [ "cow" "firewall" ] {}; 10 + allFirewalls = map getFirewall (builtins.attrValues config.home-manager.users); 11 + selectPortType = ty: builtins.foldl' (acc: elem: acc ++ elem.${ty}) []; 12 + in 13 + { 14 + networking.firewall = { 15 + allowedTCPPorts = selectPortType "tcp" allFirewalls; 16 + allowedUDPPorts = selectPortType "udp" allFirewalls; 17 + }; 18 + } 19 + ); 20 + }
+28
nixosModules/gaming.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + { 8 + options.cow.gaming.enable = lib.mkEnableOption "Gaming stuff"; 9 + 10 + config = lib.mkIf config.cow.gaming.enable { 11 + programs.steam = { 12 + enable = true; 13 + remotePlay.openFirewall = true; 14 + dedicatedServer.openFirewall = true; 15 + localNetworkGameTransfers.openFirewall = true; 16 + extest.enable = true; 17 + }; 18 + 19 + programs.gamescope.enable = true; 20 + 21 + environment.systemPackages = with pkgs; [ 22 + prismlauncher 23 + owmods-gui 24 + owmods-cli 25 + cemu 26 + ]; 27 + }; 28 + }
+56
nixosModules/gdi.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + { 8 + options.cow.gdi = { 9 + enable = lib.mkEnableOption "Enable Hyprland with graphical apps, etc."; 10 + showGreet = lib.mkEnableOption "Show a greeter interface that runs UWSM to launch a Wayland window manager"; 11 + }; 12 + 13 + config = lib.mkIf config.cow.gdi.enable { 14 + environment = { 15 + systemPackages = with pkgs; [ 16 + hyprpicker 17 + uwsm 18 + ]; 19 + variables = { 20 + NIXOS_OZONE_WL = "1"; 21 + _JAVA_AWT_WM_NONEREPARENTING = "1"; 22 + GDK_BACKEND = "wayland,x11"; 23 + ANKI_WAYLAND = "1"; 24 + MOZ_ENABLE_WAYLAND = "1"; 25 + XDG_SESSION_TYPE = "wayland"; 26 + SDL_VIDEODRIVER = "wayland"; 27 + CLUTTER_BACKEND = "wayland"; 28 + }; 29 + }; 30 + 31 + xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; 32 + 33 + programs.hyprland = { 34 + enable = true; 35 + withUWSM = true; 36 + }; 37 + 38 + services.greetd = lib.mkIf config.cow.gdi.showGreet { 39 + enable = true; 40 + settings = { 41 + default_session = 42 + let 43 + greeting = ''--greeting "Authenticate into ${lib.toUpper config.networking.hostName}"''; 44 + deCmd = pkgs.writeScript "start-session.sh" '' 45 + #!/usr/bin/env sh 46 + exec uwsm start ${pkgs.hyprland}/share/wayland-sessions/hyprland.desktop 47 + ''; 48 + cmd = ''--cmd "systemd-inhibit --what=handle-power-key:handle-lid-switch ${deCmd}"''; 49 + in 50 + { 51 + command = "${pkgs.tuigreet}/bin/tuigreet --remember --time ${greeting} ${cmd}"; 52 + }; 53 + }; 54 + }; 55 + }; 56 + }
+4
nixosModules/hm.nix
··· 1 + {lib, inputs, ...}: { 2 + imports = [inputs.hm.nixosModules.default]; 3 + options.cow.hm.enable = lib.mkEnableOption "Home Manager"; 4 + }
+70
nixosModules/imperm.nix
··· 1 + { 2 + config, 3 + lib, 4 + inputs, 5 + ... 6 + }: 7 + { 8 + 9 + imports = [ inputs.imperm.nixosModules.default ]; 10 + 11 + options.cow.imperm = { 12 + enable = lib.mkEnableOption "Impermanence, turns off mutable users and expects you to define their password hashes"; 13 + persistRoot = { 14 + type = lib.types.str; 15 + default = "/nix/persist"; 16 + description = "Path to store persisted data"; 17 + }; 18 + cacheRoot = { 19 + type = lib.types.str; 20 + default = "/nix/persist-cache"; 21 + description = "Path to store cache data"; 22 + }; 23 + keep = { 24 + type = lib.types.listOf lib.types.str; 25 + description = "Paths to keep that should be backed up"; 26 + }; 27 + keepCache = { 28 + type = lib.types.listOf lib.types.str; 29 + description = "Paths to keep that shouldn't be backed up"; 30 + }; 31 + }; 32 + 33 + config = 34 + let 35 + users = if config.cow.hm.enable then config.home-manager.users else { }; 36 + persistRoot = config.cow.imperm.persistRoot; # Anything important we want backed up 37 + cacheRoot = config.cow.imperm.cacheRoot; # Anything not as important that we can stand losing 38 + in 39 + lib.mkIf config.cow.impem.enable { 40 + users.mutableUsers = false; 41 + 42 + environment.persistence = { 43 + "${cacheRoot}" = { 44 + enable = true; 45 + hideMounts = true; 46 + directories = [ 47 + "/var/log" 48 + "/var/lib/nixos" 49 + "/var/lib/systemd/coredump" 50 + "/var/lib/systemd/timers" 51 + "/var/lib/systemd/rfkill" 52 + "/var/lib/systemd/backlight" 53 + ] 54 + ++ config.cow.imperm.keep; 55 + users = builtins.mapAttrs (_: v: { 56 + directories = lib.attrByPath [ "cow" "imperm" "keepCache" ] [ ] v; 57 + }) users; 58 + }; 59 + "${persistRoot}" = { 60 + enable = true; 61 + hideMounts = true; 62 + directories = config.cow.imperm.keepCache; 63 + users = builtins.mapAttrs (_: v: { 64 + directories = lib.attrByPath [ "cow" "imperm" "keep" ] [ ] v; 65 + files = lib.attrByPath [ "cow" "imperm" "keepFiles" ] [ ] v; 66 + }) users; 67 + }; 68 + }; 69 + }; 70 + }
+59
nixosModules/network.nix
··· 1 + { config, lib, ... }: 2 + { 3 + options.cow.network = { 4 + wireless = lib.mkEnableOption "wireless networking with IWD"; 5 + bluetooth = lib.mkEnableOption "bluetooth networking"; 6 + }; 7 + 8 + config = { 9 + hardware.bluetooth = lib.mkIf config.cow.network.bluetooth { 10 + enable = true; 11 + settings = { 12 + General = { 13 + Experimental = true; 14 + }; 15 + }; 16 + }; 17 + 18 + cow.imperm.keepCache = 19 + (lib.optional config.cow.network.bluetooth [ 20 + "/var/lib/bluetooh" 21 + ]) 22 + ++ (lib.optional config.cow.network.wireless [ "/var/lib/iwd" ]); 23 + 24 + networking = lib.mkIf config.cow.network.wireless { 25 + iwd.enable = true; 26 + useNetworkd = true; 27 + useDHCP = true; 28 + }; 29 + 30 + systemd.network = { 31 + enable = lib.mkDefault config.cow.network.wireless; 32 + wait-online = { 33 + enable = lib.mkDefault false; 34 + }; 35 + }; 36 + 37 + services = lib.mkIf config.cow.network.wireless { 38 + resolved = { 39 + enable = true; 40 + llmnr = "false"; 41 + fallbackDns = [ 42 + "2606:4700:4700::1111" 43 + "2606:4700:4700::1001" 44 + "1.1.1.1" 45 + "1.0.0.1" 46 + ]; 47 + }; 48 + timesyncd.servers = map (x: "time-${x}-g.nist.gov") [ 49 + "a" 50 + "b" 51 + "c" 52 + "d" 53 + "e" 54 + "f" 55 + "g" 56 + ]; 57 + }; 58 + }; 59 + }
+28
nixosModules/print.nix
··· 1 + { config, lib, ... }: 2 + { 3 + options.cow.print.enable = lib.mkEnableOption "stateless printing + WCU printers"; 4 + 5 + config = lib.mkIf config.cow.print.enable { 6 + services.printing = { 7 + enable = true; 8 + stateless = true; 9 + }; 10 + 11 + hardware.printers = { 12 + ensurePrinters = [ 13 + { 14 + name = "RamPrint"; 15 + description = "WCU RamPrint"; 16 + deviceUri = "https://wcuprintp01.wcupa.net:9164/printers/RamPrint"; 17 + model = "drv:///sample.drv/generic.ppd"; 18 + } 19 + { 20 + name = "FHG_IMC_Color"; 21 + description = "FHG IMC Color"; 22 + deviceUri = "https://wcuprintp01.wcupa.net:9164/printers/FHG_IMC_Color"; 23 + model = "drv:///sample.drv/generic.ppd"; 24 + } 25 + ]; 26 + }; 27 + }; 28 + }
+29
nixosModules/role-laptop.nix
··· 1 + { config, lib, ... }: 2 + { 3 + options.cow.role-laptop = { 4 + enable = lib.mkEnableOption "configuring a laptop with a GUI and bean setup for mobile use"; 5 + fingerPrintSensor = lib.mkEnableOption "fprintd and persist prints"; 6 + }; 7 + 8 + config = lib.mkIf config.cow.role-laptop.enable { 9 + cow = { 10 + user-bean.enable = true; 11 + firewall.openforUsers = true; 12 + print.enable = true; 13 + hm.enable = true; 14 + network = { 15 + bluetooth = true; 16 + wireless = true; 17 + }; 18 + cat.enable = true; 19 + gdi.enable = true; 20 + imperm = lib.mkIf config.cow.role-laptop.fingerPrintSensor { 21 + keep = [ "/var/lib/fprintd" ]; 22 + }; 23 + }; 24 + 25 + services.fprintd = lib.mkIf config.cow.role-laptop.fingerPrintSensor { 26 + enable = true; 27 + }; 28 + }; 29 + }
+21
nixosModules/user-bean.nix
··· 1 + {config, lib, outputs, ...}: { 2 + options.cow.bean = { 3 + enable = lib.mkEnableOption "Bean user"; 4 + sudoer = lib.mkEnableOption "Bean being a sudoer"; 5 + }; 6 + 7 + config = lib.mkIf config.cow.bean.enable { 8 + users.users.bean = { 9 + isNormalUser = true; 10 + description = "Ben C"; 11 + extraGroups = lib.optional config.cow.bean.sudoer ["wheel"]; 12 + }; 13 + 14 + home-manager.users.bean = lib.mkIf config.cow.hm.enable { 15 + imports = builtins.attrValues outputs.homeModules; 16 + cow.bean.enable = true; 17 + cow.gdi.enable = config.cow.gdi.enable; 18 + home.stateVersion = "25.05"; 19 + }; 20 + }; 21 + }
-1
oldNixosModules/graphics/apps.nix
··· 9 9 ''; 10 10 11 11 environment.wordlist.enable = true; 12 - services.usbmuxd.enable = true; 13 12 14 13 home-manager.users.bean.xdg.configFile = { 15 14 # "Nickvision Cavalier/cava_config".text = ''
-113
oldNixosModules/graphics/hypr.nix
··· 25 25 26 26 home-manager.users.bean = { 27 27 wayland.systemd.target = "wayland-session@hyprland.desktop.target"; 28 - wayland.windowManager.hyprland = { 29 - systemd.enable = false; 30 - enable = true; 31 - extraConfig = '' 32 - bind = SUPER,M,submap,passthru 33 - submap = passthru 34 - bind = SUPER,ESCAPE,submap,reset 35 - submap = reset 36 - ''; 37 - settings = { 38 - autogenerated = 0; 39 - ecosystem = { 40 - no_update_news = true; 41 - no_donation_nag = true; 42 - }; 43 - cursor = { 44 - no_hardware_cursors = true; 45 - enable_hyprcursor = false; 46 - }; 47 - monitor = [ 48 - ",highres,auto,1" 49 - ]; 50 - general = { 51 - border_size = 2; 52 - resize_on_border = true; 53 - "col.active_border" = "$red $peach $yellow $green $sapphire $lavender $mauve 225deg"; 54 - }; 55 - decoration = { 56 - rounding = 10; 57 - }; 58 - input = { 59 - numlock_by_default = true; 60 - kb_options = "caps:escape"; 61 - touchpad = { 62 - natural_scroll = true; 63 - }; 64 - }; 65 - xwayland = { 66 - force_zero_scaling = true; 67 - }; 68 - # debug = { 69 - # disable_logs = false; 70 - # }; 71 - misc = { 72 - enable_swallow = true; 73 - disable_hyprland_logo = true; 74 - disable_splash_rendering = true; 75 - focus_on_activate = true; 76 - mouse_move_enables_dpms = true; 77 - key_press_enables_dpms = true; 78 - }; 79 - env = [ 80 - "TERMINAL,wezterm" 81 - "QT_QPA_PLATFORM,wayland;xcb" 82 - "QT_AUTO_SCREEN_SCALE_FACTOR,1" 83 - ]; 84 - windowrulev2 = [ 85 - "idleinhibit fullscreen,class:(.*),title:(.*)" 86 - ]; 87 - submap = "reset"; 88 - gesture = [ 89 - "3,horizontal,workspace" 90 - "4,swipe,move" 91 - ]; 92 - bind = let 93 - openTerminal = "uwsm app -- org.wezfurlong.wezterm.desktop"; 94 - forEachWorkspace = { 95 - mod, 96 - dispatch, 97 - }: 98 - builtins.genList ( 99 - i: let 100 - num = builtins.toString i; 101 - in "${mod},${num},${dispatch},${ 102 - if num == "0" 103 - then "10" 104 - else num 105 - }" 106 - ) 107 - 10; 108 - in 109 - [ 110 - "SUPER,M,submap,passthru" 111 - "SUPER,Q,exec,uwsm app -- firefox-devedition.desktop" 112 - "SUPER,Z,exec,systemctl suspend" 113 - ",XF86AudioMedia,exec,${openTerminal}" 114 - "SUPER,T,exec,${openTerminal}" 115 - "SUPER ALT CTRL SHIFT,L,exec,xdg-open https://linkedin.com" 116 - "SUPER,C,killactive," 117 - "SUPER,P,pseudo," 118 - "SUPER,R,togglefloating," 119 - "SUPER,F,fullscreen,1" 120 - "SUPER SHIFT,F,fullscreen,0" 121 - ",XF86RFKill,exec,rfkill toggle wifi" 122 - "SUPER,left,workspace,r-1" 123 - "SUPER,right,workspace,r+1" 124 - "SUPER SHIFT,left,movetoworkspace,r-1" 125 - "SUPER SHIFT,right,movetoworkspace,r+1" 126 - ] 127 - ++ forEachWorkspace { 128 - mod = "SUPER"; 129 - dispatch = "workspace"; 130 - } 131 - ++ forEachWorkspace { 132 - mod = "SUPER SHIFT"; 133 - dispatch = "movetoworkspace"; 134 - }; 135 - bindm = [ 136 - "SUPER,mouse:272,movewindow" 137 - "SUPER,mouse:273,resizewindow" 138 - ]; 139 - }; 140 - }; 141 28 }; 142 29 }
+255 -260
oldNixosModules/graphics/shell.nix
··· 53 53 # Needed to open the firewall, actual service is managed in HM 54 54 programs.kdeconnect.enable = true; 55 55 56 - home-manager.users.bean = let 57 - screenOffCmd = "hyprctl dispatch dpms off; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-add \"timeout\""; 58 - screenOnCmd = "hyprctl dispatch dpms on; ${pkgs.swaynotificationcenter}/bin/swaync-client --inhibitor-remove \"timeout\""; 59 - in { 60 - xdg.configFile = { 61 - "swappy/config".text = '' 62 - [Default] 63 - save_dir=$HOME/Pictures/Screenshots 64 - save_filename_format=%Y-%m-%dT%H:%M:%S-edited.png 65 - show_panel=true 66 - line_size=5 67 - text_size=20 68 - text_font=monospace 69 - paint_mode=brush 70 - early_exit=false 71 - fill_shape=false 72 - ''; 73 - "kdeconnect/config".text = '' 74 - [General] 75 - name=${lib.toUpper config.networking.hostName} 76 - ''; 77 - }; 56 + xdg.configFile = { 57 + "swappy/config".text = '' 58 + [Default] 59 + save_dir=$HOME/Pictures/Screenshots 60 + save_filename_format=%Y-%m-%dT%H:%M:%S-edited.png 61 + show_panel=true 62 + line_size=5 63 + text_size=20 64 + text_font=monospace 65 + paint_mode=brush 66 + early_exit=false 67 + fill_shape=false 68 + ''; 69 + "kdeconnect/config".text = '' 70 + [General] 71 + name=${lib.toUpper config.networking.hostName} 72 + ''; 73 + }; 78 74 79 - # Doing our own thing for rofi 80 - catppuccin.rofi.enable = false; 75 + # Doing our own thing for rofi 76 + catppuccin.rofi.enable = false; 81 77 82 - systemd.user.services = let 83 - target = config.home-manager.users.bean.wayland.systemd.target; 84 - mkShellService = { 85 - desc, 86 - service, 87 - }: { 88 - Install = { 89 - WantedBy = [target]; 90 - }; 78 + systemd.user.services = let 79 + target = config.home-manager.users.bean.wayland.systemd.target; 80 + mkShellService = { 81 + desc, 82 + service, 83 + }: { 84 + Install = { 85 + WantedBy = [target]; 86 + }; 91 87 92 - Unit = { 93 - ConditionEnvironment = "WAYLAND_DISPLAY"; 94 - Description = desc; 95 - After = [target]; 96 - PartOf = [target]; 97 - }; 98 - 99 - Service = service; 88 + Unit = { 89 + ConditionEnvironment = "WAYLAND_DISPLAY"; 90 + Description = desc; 91 + After = [target]; 92 + PartOf = [target]; 100 93 }; 101 - in { 102 - battery-notif = mkShellService { 103 - desc = "Battery Notification Service"; 104 94 105 - service = { 106 - ExecStart = "${pkgs.nushell}/bin/nu ${../../res/battery_notif.nu}"; 107 - Restart = "on-failure"; 108 - RestartSec = "10"; 109 - }; 95 + Service = service; 96 + }; 97 + in { 98 + battery-notif = mkShellService { 99 + desc = "Battery Notification Service"; 100 + 101 + service = { 102 + ExecStart = "${pkgs.nushell}/bin/nu ${../../res/battery_notif.nu}"; 103 + Restart = "on-failure"; 104 + RestartSec = "10"; 110 105 }; 106 + }; 111 107 112 - kdeconnect.Service.Environment = lib.mkForce []; 108 + kdeconnect.Service.Environment = lib.mkForce []; 113 109 114 - mpris-idle-inhibit = mkShellService { 115 - desc = "MPRIS Idle Inhibitor"; 110 + mpris-idle-inhibit = mkShellService { 111 + desc = "MPRIS Idle Inhibitor"; 116 112 117 - service = { 118 - ExecStart = ''${inputs'.wayland-mpris-idle-inhibit.packages.default}/bin/wayland-mpris-idle-inhibit --ignore "kdeconnect" --ignore "playerctld"''; 119 - Restart = "on-failure"; 120 - RestartSec = "10"; 121 - }; 113 + service = { 114 + ExecStart = ''${inputs'.wayland-mpris-idle-inhibit.packages.default}/bin/wayland-mpris-idle-inhibit --ignore "kdeconnect" --ignore "playerctld"''; 115 + Restart = "on-failure"; 116 + RestartSec = "10"; 122 117 }; 123 118 }; 124 - 125 - services = { 126 - hyprpolkitagent.enable = true; 127 - kdeconnect.enable = true; 128 - hypridle = { 129 - enable = true; 130 - settings = { 131 - general = { 132 - lock_cmd = "pidof hyprlock || hyprlock --grace 5"; 133 - unlock_cmd = "pkill hyprlock --signal SIGUSR1"; 134 - before_sleep_cmd = "loginctl lock-session"; 135 - after_sleep_cmd = screenOnCmd; 136 - }; 119 + }; 137 120 138 - listener = let 139 - lockTimeout = 120; 140 - in [ 141 - { 142 - timeout = lockTimeout; # Lock the screen after 2 minutes of inactivity 143 - on-timeout = "loginctl lock-session"; 144 - } 145 - { 146 - timeout = lockTimeout + 120; # Turn off the screen 2 minutes after locking 147 - on-timeout = screenOffCmd; 148 - on-resume = screenOnCmd; 149 - } 150 - { 151 - timeout = lockTimeout + 600; # Suspend 10 minutes after locking 152 - on-timeout = "systemctl suspend"; 153 - } 154 - ]; 121 + services = { 122 + hyprpolkitagent.enable = true; 123 + kdeconnect.enable = true; 124 + hypridle = { 125 + enable = true; 126 + settings = { 127 + general = { 128 + lock_cmd = "pidof hyprlock || hyprlock --grace 5"; 129 + unlock_cmd = "pkill hyprlock --signal SIGUSR1"; 130 + before_sleep_cmd = "loginctl lock-session"; 131 + after_sleep_cmd = screenOnCmd; 155 132 }; 156 - }; 157 - cliphist = { 158 - enable = true; 159 - systemdTargets = lib.mkForce [ 160 - config.home-manager.users.bean.wayland.systemd.target 133 + 134 + listener = let 135 + lockTimeout = 120; 136 + in [ 137 + { 138 + timeout = lockTimeout; # Lock the screen after 2 minutes of inactivity 139 + on-timeout = "loginctl lock-session"; 140 + } 141 + { 142 + timeout = lockTimeout + 120; # Turn off the screen 2 minutes after locking 143 + on-timeout = screenOffCmd; 144 + on-resume = screenOnCmd; 145 + } 146 + { 147 + timeout = lockTimeout + 600; # Suspend 10 minutes after locking 148 + on-timeout = "systemctl suspend"; 149 + } 161 150 ]; 162 151 }; 163 - udiskie = { 164 - enable = true; 165 - automount = false; 166 - tray = "never"; 167 - }; 168 - playerctld.enable = true; 169 - wlsunset = { 170 - enable = true; 171 - sunrise = "6:00"; 172 - sunset = "22:00"; 173 - }; 174 - swayosd = { 175 - enable = true; 176 - stylePath = pkgs.writeText "swayosd-style.css" '' 177 - window#osd { 178 - border-radius: 5rem; 179 - } 152 + }; 153 + cliphist = { 154 + enable = true; 155 + systemdTargets = lib.mkForce [ 156 + config.home-manager.users.bean.wayland.systemd.target 157 + ]; 158 + }; 159 + udiskie = { 160 + enable = true; 161 + automount = false; 162 + tray = "never"; 163 + }; 164 + playerctld.enable = true; 165 + wlsunset = { 166 + enable = true; 167 + sunrise = "6:00"; 168 + sunset = "22:00"; 169 + }; 170 + swayosd = { 171 + enable = true; 172 + stylePath = pkgs.writeText "swayosd-style.css" '' 173 + window#osd { 174 + border-radius: 5rem; 175 + } 180 176 181 - #container { 182 - padding: 5px 10px; 183 - } 184 - ''; 185 - }; 177 + #container { 178 + padding: 5px 10px; 179 + } 180 + ''; 186 181 }; 182 + }; 187 183 188 - programs = { 189 - rofi = { 190 - enable = true; 191 - package = pkgs.rofi.override { 192 - plugins = with pkgs; [ 193 - rofi-emoji 194 - rofi-power-menu 195 - rofi-bluetooth 196 - rofi-calc 197 - rofi-pulse-select 198 - ]; 199 - }; 200 - theme = let 201 - inherit (config.home-manager.users.bean.lib.formats.rasi) mkLiteral; 202 - in { 203 - "@import" = "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.home-manager.users.bean.catppuccin.rofi.flavor}.rasi"; 204 - "*" = 205 - (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 206 - "bg0" = "base"; 207 - "bg1" = "mantle"; 208 - "bg2" = "crust"; 209 - "bg3" = config.catppuccin.accent; 210 - "fg0" = "subtext1"; 211 - "fg1" = "text"; 212 - "fg2" = "subtext0"; 213 - "fg3" = "overlay0"; 214 - "fg4" = "surface0"; 215 - }) 216 - // { 217 - font = mkLiteral ''"Roboto 14"''; 218 - background-color = mkLiteral ''transparent''; 219 - text-color = mkLiteral ''@fg0''; 220 - margin = mkLiteral ''0px''; 221 - padding = mkLiteral ''0px''; 222 - spacing = mkLiteral ''0px''; 223 - }; 224 - "window" = { 225 - location = mkLiteral ''north''; 226 - y-offset = mkLiteral ''calc(50% - 176px)''; 227 - width = mkLiteral ''600''; 228 - border-radius = mkLiteral ''24px''; 229 - background-color = mkLiteral ''@bg0''; 230 - }; 231 - "mainbox" = { 232 - padding = mkLiteral ''12px''; 233 - }; 234 - "inputbar" = { 235 - background-color = mkLiteral ''@bg1''; 236 - border-color = mkLiteral ''@bg3''; 237 - border = mkLiteral ''2px''; 238 - border-radius = mkLiteral ''16px''; 239 - padding = mkLiteral ''8px 16px''; 240 - spacing = mkLiteral ''8px''; 241 - children = mkLiteral ''[ prompt, entry ]''; 242 - }; 243 - "prompt" = { 244 - text-color = mkLiteral ''@fg2''; 245 - }; 246 - "entry" = { 247 - placeholder = mkLiteral ''"Search"''; 248 - placeholder-color = mkLiteral ''@fg3''; 249 - }; 250 - "message" = { 251 - margin = mkLiteral ''12px 0 0''; 252 - border-radius = mkLiteral ''16px''; 253 - border-color = mkLiteral ''@bg2''; 254 - background-color = mkLiteral ''@bg2''; 255 - }; 256 - "textbox" = { 257 - padding = mkLiteral ''8px 24px''; 258 - }; 259 - "listview" = { 184 + programs = { 185 + rofi = { 186 + enable = true; 187 + package = pkgs.rofi.override { 188 + plugins = with pkgs; [ 189 + rofi-emoji 190 + rofi-power-menu 191 + rofi-bluetooth 192 + rofi-calc 193 + rofi-pulse-select 194 + ]; 195 + }; 196 + theme = let 197 + inherit (config.home-manager.users.bean.lib.formats.rasi) mkLiteral; 198 + in { 199 + "@import" = "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.home-manager.users.bean.catppuccin.rofi.flavor}.rasi"; 200 + "*" = 201 + (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 202 + "bg0" = "base"; 203 + "bg1" = "mantle"; 204 + "bg2" = "crust"; 205 + "bg3" = config.catppuccin.accent; 206 + "fg0" = "subtext1"; 207 + "fg1" = "text"; 208 + "fg2" = "subtext0"; 209 + "fg3" = "overlay0"; 210 + "fg4" = "surface0"; 211 + }) 212 + // { 213 + font = mkLiteral ''"Roboto 14"''; 260 214 background-color = mkLiteral ''transparent''; 261 - margin = mkLiteral ''12px 0 0''; 262 - lines = mkLiteral ''8''; 263 - columns = mkLiteral ''2''; 264 - fixed-height = mkLiteral ''false''; 215 + text-color = mkLiteral ''@fg0''; 216 + margin = mkLiteral ''0px''; 217 + padding = mkLiteral ''0px''; 218 + spacing = mkLiteral ''0px''; 265 219 }; 266 - "element" = { 267 - padding = mkLiteral ''8px 16px''; 268 - spacing = mkLiteral ''8px''; 269 - border-radius = mkLiteral ''16px''; 270 - }; 271 - "element normal active" = { 272 - text-color = mkLiteral ''@bg3''; 273 - }; 274 - "element alternate active" = { 275 - text-color = mkLiteral ''@bg3''; 276 - }; 277 - "element selected normal, element selected active" = { 278 - text-color = mkLiteral ''@fg4''; 279 - background-color = mkLiteral ''@bg3''; 280 - }; 281 - "element-icon" = { 282 - size = mkLiteral ''1em''; 283 - vertical-align = mkLiteral ''0.5''; 284 - }; 285 - "element-text" = { 286 - text-color = mkLiteral ''inherit''; 287 - }; 220 + "window" = { 221 + location = mkLiteral ''north''; 222 + y-offset = mkLiteral ''calc(50% - 176px)''; 223 + width = mkLiteral ''600''; 224 + border-radius = mkLiteral ''24px''; 225 + background-color = mkLiteral ''@bg0''; 226 + }; 227 + "mainbox" = { 228 + padding = mkLiteral ''12px''; 229 + }; 230 + "inputbar" = { 231 + background-color = mkLiteral ''@bg1''; 232 + border-color = mkLiteral ''@bg3''; 233 + border = mkLiteral ''2px''; 234 + border-radius = mkLiteral ''16px''; 235 + padding = mkLiteral ''8px 16px''; 236 + spacing = mkLiteral ''8px''; 237 + children = mkLiteral ''[ prompt, entry ]''; 238 + }; 239 + "prompt" = { 240 + text-color = mkLiteral ''@fg2''; 241 + }; 242 + "entry" = { 243 + placeholder = mkLiteral ''"Search"''; 244 + placeholder-color = mkLiteral ''@fg3''; 245 + }; 246 + "message" = { 247 + margin = mkLiteral ''12px 0 0''; 248 + border-radius = mkLiteral ''16px''; 249 + border-color = mkLiteral ''@bg2''; 250 + background-color = mkLiteral ''@bg2''; 251 + }; 252 + "textbox" = { 253 + padding = mkLiteral ''8px 24px''; 254 + }; 255 + "listview" = { 256 + background-color = mkLiteral ''transparent''; 257 + margin = mkLiteral ''12px 0 0''; 258 + lines = mkLiteral ''8''; 259 + columns = mkLiteral ''2''; 260 + fixed-height = mkLiteral ''false''; 261 + }; 262 + "element" = { 263 + padding = mkLiteral ''8px 16px''; 264 + spacing = mkLiteral ''8px''; 265 + border-radius = mkLiteral ''16px''; 266 + }; 267 + "element normal active" = { 268 + text-color = mkLiteral ''@bg3''; 269 + }; 270 + "element alternate active" = { 271 + text-color = mkLiteral ''@bg3''; 272 + }; 273 + "element selected normal, element selected active" = { 274 + text-color = mkLiteral ''@fg4''; 275 + background-color = mkLiteral ''@bg3''; 288 276 }; 289 - location = "center"; 277 + "element-icon" = { 278 + size = mkLiteral ''1em''; 279 + vertical-align = mkLiteral ''0.5''; 280 + }; 281 + "element-text" = { 282 + text-color = mkLiteral ''inherit''; 283 + }; 290 284 }; 291 - nushell.extraConfig = '' 292 - plugin add ${pkgs.nu_plugin_dbus}/bin/nu_plugin_dbus 293 - ''; 285 + location = "center"; 294 286 }; 287 + nushell.extraConfig = '' 288 + plugin add ${pkgs.nu_plugin_dbus}/bin/nu_plugin_dbus 289 + ''; 290 + }; 295 291 296 - wayland.windowManager.hyprland.settings = { 297 - env = [ 298 - "GRIMBLAST_EDITOR,swappy -f " 299 - ]; 292 + wayland.windowManager.hyprland.settings = { 293 + env = [ 294 + "GRIMBLAST_EDITOR,swappy -f " 295 + ]; 300 296 301 - exec-once = [ 302 - "uwsm app -- keepassxc /home/bean/Documents/Keepass/DB/Database.kdbx" 303 - ]; 297 + exec-once = [ 298 + "uwsm app -- keepassxc /home/bean/Documents/Keepass/DB/Database.kdbx" 299 + ]; 304 300 305 - bind = let 306 - powerMenu = "rofi -modi 'p:${pkgs.rofi-power-menu}/bin/rofi-power-menu' -show p --symbols-font \"FiraMono Nerd Font Mono\""; 307 - screenshot = "${pkgs.nushell}/bin/nu ${../../res/screenshot.nu}"; 308 - in [ 309 - "SUPER,S,exec,uwsm app -- rofi -show drun -icon-theme \"candy-icons\" -show-icons" 310 - "SUPER SHIFT,E,exec,uwsm app -- rofi -modi emoji -show emoji" 311 - "SUPER SHIFT,D,exec,swaync-client -d" 312 - "SUPER,Delete,exec,uwsm app -- ${powerMenu}" 313 - ",XF86PowerOff,exec,uwsm app -- ${powerMenu}" 314 - "SUPER ALT,C,exec,uwsm app -- rofi -show calc -modi calc -no-show-match -no-sort -calc-command \"echo -n '{result}' | wl-copy\"" 315 - "SUPER,B,exec,uwsm app -- ${pkgs.rofi-bluetooth}/bin/rofi-bluetooth" 316 - "SUPER,Tab,exec,uwsm app -- rofi -show window -show-icons" 317 - "SUPER,E,exec,uwsm app -- yazi.desktop" 318 - "SUPER,N,exec,uwsm app -- ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw" 319 - "SUPER,A,exec,uwsm app -- pavucontrol --tab 5" 320 - ''SUPER,V,exec,cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy'' 321 - "SUPER ALT,V,exec,echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe" 322 - ",Print,exec,uwsm app -- ${screenshot}" 323 - "SUPER SHIFT,S,exec,uwsm app -- ${screenshot}" 324 - "SUPER SHIFT,T,exec,${pkgs.nushell}/bin/nu ${../../res/ocr.nu}" 325 - "SUPER SHIFT,C,exec,uwsm app -- ${pkgs.hyprpicker}/bin/hyprpicker -a" 326 - ]; 327 - bindr = [ 328 - "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT || uwsm app -- ${pkgs.nushell}/bin/nu ${../../res/screenrec.nu}" 329 - "CAPS,Caps_Lock,exec,uwsm app -- swayosd-client --caps-lock" 330 - ",Scroll_Lock,exec,uwsm app -- swayosd-client --scroll-lock" 331 - ",Num_Lock,exec,uwsm app -- swayosd-client --num-lock" 332 - ]; 333 - bindl = [ 334 - ",switch:on:Lid Switch,exec,${screenOffCmd}" 335 - ",switch:off:Lid Switch,exec,${screenOnCmd}" 336 - ]; 337 - bindel = [ 338 - ",XF86MonBrightnessUp,exec,uwsm app -- swayosd-client --brightness raise" 339 - ",XF86MonBrightnessDown,exec,uwsm app -- swayosd-client --brightness lower" 340 - ]; 341 - }; 301 + bind = let 302 + powerMenu = "rofi -modi 'p:${pkgs.rofi-power-menu}/bin/rofi-power-menu' -show p --symbols-font \"FiraMono Nerd Font Mono\""; 303 + screenshot = "${pkgs.nushell}/bin/nu ${../../res/screenshot.nu}"; 304 + in [ 305 + "SUPER,S,exec,uwsm app -- rofi -show drun -icon-theme \"candy-icons\" -show-icons" 306 + "SUPER SHIFT,E,exec,uwsm app -- rofi -modi emoji -show emoji" 307 + "SUPER SHIFT,D,exec,swaync-client -d" 308 + "SUPER,Delete,exec,uwsm app -- ${powerMenu}" 309 + ",XF86PowerOff,exec,uwsm app -- ${powerMenu}" 310 + "SUPER ALT,C,exec,uwsm app -- rofi -show calc -modi calc -no-show-match -no-sort -calc-command \"echo -n '{result}' | wl-copy\"" 311 + "SUPER,B,exec,uwsm app -- ${pkgs.rofi-bluetooth}/bin/rofi-bluetooth" 312 + "SUPER,Tab,exec,uwsm app -- rofi -show window -show-icons" 313 + "SUPER,E,exec,uwsm app -- yazi.desktop" 314 + "SUPER,N,exec,uwsm app -- ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw" 315 + "SUPER,A,exec,uwsm app -- pavucontrol --tab 5" 316 + ''SUPER,V,exec,cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy'' 317 + "SUPER ALT,V,exec,echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe" 318 + ",Print,exec,uwsm app -- ${screenshot}" 319 + "SUPER SHIFT,S,exec,uwsm app -- ${screenshot}" 320 + "SUPER SHIFT,T,exec,${pkgs.nushell}/bin/nu ${../../res/ocr.nu}" 321 + "SUPER SHIFT,C,exec,uwsm app -- ${pkgs.hyprpicker}/bin/hyprpicker -a" 322 + ]; 323 + bindr = [ 324 + "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT || uwsm app -- ${pkgs.nushell}/bin/nu ${../../res/screenrec.nu}" 325 + "CAPS,Caps_Lock,exec,uwsm app -- swayosd-client --caps-lock" 326 + ",Scroll_Lock,exec,uwsm app -- swayosd-client --scroll-lock" 327 + ",Num_Lock,exec,uwsm app -- swayosd-client --num-lock" 328 + ]; 329 + bindl = [ 330 + ",switch:on:Lid Switch,exec,${screenOffCmd}" 331 + ",switch:off:Lid Switch,exec,${screenOnCmd}" 332 + ]; 333 + bindel = [ 334 + ",XF86MonBrightnessUp,exec,uwsm app -- swayosd-client --brightness raise" 335 + ",XF86MonBrightnessDown,exec,uwsm app -- swayosd-client --brightness lower" 336 + ]; 342 337 }; 343 338 }
-1
oldNixosModules/imperm.nix
··· 86 86 "Pictures" 87 87 "Documents" 88 88 ".mozilla" 89 - ".floorp" 90 89 { 91 90 directory = ".gnupg"; 92 91 mode = "0700";
+1 -1
oldNixosModules/latest-linux.nix
··· 11 11 # Use latest kernel with sysrqs and lockdown enabled 12 12 kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; 13 13 kernelParams = lib.mkDefault ["lockdown=confidentiality"]; 14 - kernel.sysctl."kernel.sysrq" = 1; 14 + kernel.sysctl."kernel.sysrq" = lib.mkDefault 1; 15 15 }; 16 16 }
+10 -12
oldSystemConfigs/black-mesa.nix
··· 2 2 outputs, 3 3 inputs, 4 4 ... 5 - }: 6 - { 5 + }: { 7 6 system = "x86_64-linux"; 8 - specialArgs.inputs = inputs // inputs.spoon.inputs // { inherit (inputs) self; }; 7 + specialArgs.inputs = inputs // inputs.spoon.inputs // {inherit (inputs) self;}; 9 8 10 9 modules = [ 11 10 inputs.spoon.nixosModules.black-mesa ··· 38 37 }; 39 38 } 40 39 { 41 - imports = [ inputs.bingus.nixosModules.default ]; 42 - nixpkgs.overlays = [ inputs.bingus.overlays.default ]; 40 + imports = [inputs.bingus.nixosModules.default]; 41 + nixpkgs.overlays = [inputs.bingus.overlays.default]; 43 42 44 43 services.bingus-bot = { 45 44 enable = true; ··· 56 55 config, 57 56 pkgs, 58 57 ... 59 - }: 60 - { 61 - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 58 + }: { 59 + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; 62 60 networking.hostName = "black-mesa"; 63 61 system.stateVersion = "25.05"; 64 62 ··· 70 68 "usb_storage" 71 69 "sd_mod" 72 70 ]; 73 - boot.kernelModules = [ "kvm-amd" ]; 74 - boot.extraModulePackages = [ ]; 71 + boot.kernelModules = ["kvm-amd"]; 72 + boot.extraModulePackages = []; 75 73 76 74 services.pulseaudio.enable = false; 77 75 ··· 122 120 fsType = "btrfs"; 123 121 }; 124 122 125 - swapDevices = [ ]; 123 + swapDevices = []; 126 124 127 125 hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 128 126 ··· 133 131 hardware.amdgpu = { 134 132 initrd.enable = true; 135 133 }; 136 - services.xserver.videoDrivers = [ "modesetting" ]; 134 + services.xserver.videoDrivers = ["modesetting"]; 137 135 138 136 # services.nix-serve = { 139 137 # enable = true;