From 03c2d57c676bb3cf013d604426c363e14b2f17dd Mon Sep 17 00:00:00 2001 From: Maaz Khokhar Date: Wed, 24 Jun 2026 21:59:08 -0500 Subject: [PATCH] changes to modules + adoption of PC --- desktops/hyprland/default.nix | 26 ++- desktops/hyprland/system.nix | 13 -- desktops/plasma/default.nix | 24 ++- flake.lock | 29 ++- flake.nix | 39 ++-- home/aariz/default.nix | 9 + home/river/config/fish/completions/bun.fish | 196 ++++++++++++++++++ .../config/fish/completions/copilot.fish | 98 +++++++++ .../fish/conf.d/fish_frozen_key_bindings.fish | 14 ++ home/river/config/fish/config.fish | 31 +++ home/river/config/fish/fish_variables | 4 + .../config/fish/functions/clone-starter.fish | 19 ++ home/river/config/fish/functions/copy.fish | 20 ++ .../config/fish/functions/copy_secret.fish | 5 + home/river/config/fish/functions/wipedns.fish | 4 + home/river/config/hypr/autostart.lua | 3 +- home/river/config/hypr/general.lua | 2 +- home/river/config/hypr/keybinds.lua | 7 + home/river/config/hypr/monitor.lua | 4 +- home/river/config/hypr/variables.lua | 5 +- home/river/default.nix | 45 +++- home/river/programs/fish.nix | 23 ++ home/river/programs/git.nix | 23 +- home/river/programs/gpg.nix | 18 ++ home/river/programs/java.nix | 6 + home/river/programs/vesktop.nix | 7 + home/river/programs/zoxide.nix | 1 + hosts/laptop/configuration.nix | 65 ------ hosts/laptop/disko.nix | 69 ------ hosts/pc/configuration.nix | 72 +++++++ hosts/pc/hardware-configuration.nix | 31 +++ modules/additionalUsers/aariz.nix | 10 + modules/bluetooth/default.nix | 24 +++ modules/core/default.nix | 81 ++++++-- modules/development/claude.nix | 7 + modules/development/default.nix | 18 +- modules/gaming/default.nix | 29 +++ modules/networking/core/default.nix | 16 +- modules/networking/tailscale.nix | 11 +- modules/obs/default.nix | 15 ++ modules/ollama/default.nix | 12 ++ modules/sunshine/default.nix | 29 +++ modules/virtualization/default.nix | 1 + modules/virtualization/lima.nix | 7 + modules/virtualization/podman.nix | 1 + modules/virtualization/qemu.nix | 14 +- 46 files changed, 970 insertions(+), 217 deletions(-) delete mode 100644 desktops/hyprland/system.nix create mode 100644 home/aariz/default.nix create mode 100644 home/river/config/fish/completions/bun.fish create mode 100644 home/river/config/fish/completions/copilot.fish create mode 100644 home/river/config/fish/conf.d/fish_frozen_key_bindings.fish create mode 100644 home/river/config/fish/config.fish create mode 100644 home/river/config/fish/fish_variables create mode 100644 home/river/config/fish/functions/clone-starter.fish create mode 100644 home/river/config/fish/functions/copy.fish create mode 100644 home/river/config/fish/functions/copy_secret.fish create mode 100644 home/river/config/fish/functions/wipedns.fish create mode 100644 home/river/programs/fish.nix create mode 100644 home/river/programs/gpg.nix create mode 100644 home/river/programs/java.nix create mode 100644 home/river/programs/vesktop.nix delete mode 100644 hosts/laptop/configuration.nix delete mode 100644 hosts/laptop/disko.nix create mode 100755 hosts/pc/configuration.nix create mode 100644 hosts/pc/hardware-configuration.nix create mode 100644 modules/additionalUsers/aariz.nix create mode 100644 modules/bluetooth/default.nix create mode 100644 modules/development/claude.nix create mode 100644 modules/gaming/default.nix create mode 100644 modules/obs/default.nix create mode 100644 modules/ollama/default.nix create mode 100644 modules/sunshine/default.nix create mode 100644 modules/virtualization/lima.nix diff --git a/desktops/hyprland/default.nix b/desktops/hyprland/default.nix index ff66a6c..07a97a4 100644 --- a/desktops/hyprland/default.nix +++ b/desktops/hyprland/default.nix @@ -1,7 +1,27 @@ -{ ... }: +{ pkgs, ... }: { - imports = [ - ./system.nix + programs.hyprland.enable = true; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; + }; + + services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; + + environment.systemPackages = with pkgs; [ + hyprpolkitagent + hyprshot + rofi + networkmanagerapplet + kdePackages.dolphin + wayvnc + awww + mpvpaper + waybar + quickshell + qt6.qtdeclarative ]; } diff --git a/desktops/hyprland/system.nix b/desktops/hyprland/system.nix deleted file mode 100644 index 32333b2..0000000 --- a/desktops/hyprland/system.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: - -{ - programs.hyprland.enable = true; - - xdg.portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; - }; - - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; -} diff --git a/desktops/plasma/default.nix b/desktops/plasma/default.nix index b4f6722..e86476e 100644 --- a/desktops/plasma/default.nix +++ b/desktops/plasma/default.nix @@ -1,9 +1,27 @@ { pkgs, ... }: { + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; # Recommended to fix xdg-open issues + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk # For file choosers in GTK apps + xdg-desktop-portal-hyprland # For Hyprland (or wlr for other wlroots) + ]; + config = { + common.default = [ "gtk" ]; # Default fallback + hyprland = { + default = [ + "hyprland" + "gtk" + ]; + "org.freedesktop.impl.portal.ScreenCast" = [ "hyprland" ]; + "org.freedesktop.impl.portal.Screenshot" = [ "hyprland" ]; + }; + }; + }; + services.desktopManager.plasma6.enable = true; services.displayManager.sddm.wayland.enable = true; - - xdg.portal.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; } diff --git a/flake.lock b/flake.lock index 54e8e64..c3bea7d 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1782051614, - "narHash": "sha256-xBRAhYLEXcjp8hM2tkkTTLb6PWU7VDxDoogl25g7Ezs=", + "lastModified": 1782233665, + "narHash": "sha256-h/xOtrByoA/Ak1lWHn0O1lVZz4qWYbwOSLQ8YSwQO0I=", "owner": "nix-community", "repo": "home-manager", - "rev": "d1ccd0721ec599866622665f3651e19e6e2d4c6a", + "rev": "062581938b4a378a82dfbb294b494808157153a1", "type": "github" }, "original": { @@ -55,11 +55,32 @@ "type": "indirect" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781847791, + "narHash": "sha256-Mo2YtNEGlcySnbq0YuP3nUKMAQCMAfE+TcCffo5vzD8=", + "ref": "refs/heads/master", + "rev": "68c2c85c33845385f7ab8147b32f1450b1e468e0", + "revCount": 824, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, "root": { "inputs": { "disko": "disko", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "quickshell": "quickshell" } } }, diff --git a/flake.nix b/flake.nix index da7d503..d269fc5 100644 --- a/flake.nix +++ b/flake.nix @@ -11,40 +11,43 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + quickshell = { + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; + + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { - self, nixpkgs, - disko, home-manager, ... - }: + }@inputs: let system = "x86_64-linux"; in { - nixosConfigurations.laptop = nixpkgs.lib.nixosSystem { + nixosConfigurations.pc = nixpkgs.lib.nixosSystem { inherit system; - - specialArgs = { - disk = "/dev/disk/by-id/nvme-SAMSUNG_MZVLB256HBHQ-000H1_S4GNNX2RC66163"; - }; - + specialArgs = { inherit inputs; }; modules = [ - disko.nixosModules.disko - - ./hosts/laptop/disko.nix - ./hosts/laptop/configuration.nix - - home-manager.nixosModules.home-manager + ./hosts/pc/configuration.nix + home-manager.nixosModules.default { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; - home-manager.users.river = import ./home/river; + backupFileExtension = "backup"; + + users = { + river = import ./home/river; + aariz = import ./home/aariz; + }; + }; } ]; }; diff --git a/home/aariz/default.nix b/home/aariz/default.nix new file mode 100644 index 0000000..2f8ea22 --- /dev/null +++ b/home/aariz/default.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + home.username = "aariz"; + home.homeDirectory = "/home/aariz"; + home.stateVersion = "26.05"; + + programs.home-manager.enable = true; +} diff --git a/home/river/config/fish/completions/bun.fish b/home/river/config/fish/completions/bun.fish new file mode 100644 index 0000000..6b2dc5b --- /dev/null +++ b/home/river/config/fish/completions/bun.fish @@ -0,0 +1,196 @@ +# This is terribly complicated +# It's because: +# 1. bun run has to have dynamic completions +# 2. there are global options +# 3. bun {install add remove} gets special options +# 4. I don't know how to write fish completions well +# Contributions very welcome!! + +function __fish__get_bun_bins + string split ' ' (bun getcompletes b) +end + +function __fish__get_bun_scripts + set -lx SHELL bash + set -lx MAX_DESCRIPTION_LEN 40 + string trim (string split '\n' (string split '\t' (bun getcompletes z))) +end + +function __fish__get_bun_packages + if test (commandline -ct) != "" + set -lx SHELL fish + string split ' ' (bun getcompletes a (commandline -ct)) + end +end + +function __history_completions + set -l tokens (commandline --current-process --tokenize) + history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' +end + +function __fish__get_bun_bun_js_files + string split ' ' (bun getcompletes j) +end + +set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global +set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" + +set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add update init pm x repl +set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x update + +function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts" + # Do nothing if we already have a builtin subcommand, + # or any subcommand other than "run". + if __fish_seen_subcommand_from $bun_builtin_cmds_without_run + or not __fish_use_subcommand && not __fish_seen_subcommand_from run + return + end + # Do we already have a bin or script subcommand? + set -l bins (__fish__get_bun_bins) + if __fish_seen_subcommand_from $bins + return + end + # Scripts have descriptions appended with a tab separator. + # Strip off descriptions for the purposes of subcommand testing. + set -l scripts (__fish__get_bun_scripts) + if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts) + return + end + # Emit scripts. + for script in $scripts + echo $script + end + # Emit binaries and JS files (but only if we're doing `bun run`). + if __fish_seen_subcommand_from run + for bin in $bins + echo "$bin"\t"package bin" + end + for file in (__fish__get_bun_bun_js_files) + echo "$file"\t"Bun.js" + end + end +end + + +# Clear existing completions +complete -e -c bun + +# Dynamically emit scripts and binaries +complete -c bun -f -a "(__bun_complete_bins_scripts)" + +# Complete flags if we have no subcommand or a flag-friendly one. +set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags" +complete -c bun \ + -n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' +complete -c bun \ + -n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' +complete -c bun \ + -n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' +complete -c bun \ + -n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' +complete -c bun \ + -n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)' +complete -c bun \ + -n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' + +# Complete dev and create as first subcommand. +complete -c bun \ + -n "__fish_use_subcommand" -a 'dev' -d 'Start dev server' +complete -c bun \ + -n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' + +# Complete "next" and "react" if we've seen "create". +complete -c bun \ + -n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project' + +complete -c bun \ + -n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project' + +# Complete "upgrade" as first subcommand. +complete -c bun \ + -n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x +# Complete "-h/--help" unconditionally. +complete -c bun \ + -s "h" -l "help" -d 'See all commands and flags' -x + +# Complete "-v/--version" if we have no subcommand. +complete -c bun \ + -n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x + +# Complete additional subcommands. +complete -c bun \ + -n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x + + +complete -c bun \ + -n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' + + +complete -c bun \ + -n "__fish_seen_subcommand_from bun" -F -d 'Bundle this' + +complete -c bun \ + -n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory" + + +complete -c bun \ + -n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' + + +for i in (seq (count $bun_install_boolean_flags)) + complete -c bun \ + -n "__fish_seen_subcommand_from install add remove update" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" +end + +complete -c bun \ + -n "__fish_seen_subcommand_from install add remove update" -l 'cwd' -d 'Change working directory' + +complete -c bun \ + -n "__fish_seen_subcommand_from install add remove update" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' + +complete -c bun \ + -n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)' + +complete -c bun \ + -n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)' + +complete -c bun \ + -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f + +complete -c bun \ + -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f + +# Add built-in subcommands with descriptions. +complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template" +complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files" +complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun" +complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary" +complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f +complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f +complete -c bun -n "__fish_use_subcommand" -a "unlink" -d "Unregister a local npm package" -f +complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f +complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f +complete -c bun -n "__fish_use_subcommand" -a "outdated" -d "Display the latest versions of outdated dependencies" -f +complete -c bun -n "__fish_use_subcommand" -a "update" -d "Update dependencies to their latest versions" -f +complete -c bun -n "__fish_use_subcommand" -a "publish" -d "Publish your package from local to npm" -f +complete -c bun -n "__fish_use_subcommand" -a "repl" -d "Start a REPL session with Bun" -f +complete -c bun -n "__fish_seen_subcommand_from repl" -s "e" -l "eval" -r -d "Evaluate argument as a script, then exit" -f +complete -c bun -n "__fish_seen_subcommand_from repl" -s "p" -l "print" -r -d "Evaluate argument as a script, print the result, then exit" -f +complete -c bun -n "__fish_seen_subcommand_from repl" -s "r" -l "preload" -r -d "Import a module before other modules are loaded" +complete -c bun -n "__fish_seen_subcommand_from repl" -l "smol" -d "Use less memory, but run garbage collection more often" -f +complete -c bun -n "__fish_seen_subcommand_from repl" -s "c" -l "config" -r -d "Specify path to Bun config file" +complete -c bun -n "__fish_seen_subcommand_from repl" -l "cwd" -r -d "Absolute path to resolve files & entry points from" +complete -c bun -n "__fish_seen_subcommand_from repl" -l "env-file" -r -d "Load environment variables from the specified file(s)" +complete -c bun -n "__fish_seen_subcommand_from repl" -l "no-env-file" -d "Disable automatic loading of .env files" -f diff --git a/home/river/config/fish/completions/copilot.fish b/home/river/config/fish/completions/copilot.fish new file mode 100644 index 0000000..37575d3 --- /dev/null +++ b/home/river/config/fish/completions/copilot.fish @@ -0,0 +1,98 @@ +# fish completion for copilot +# Generated by `copilot completion fish`. Do not edit by hand. + +complete -c copilot -n '__fish_use_subcommand' -f -a 'login' -d 'Authenticate with Copilot' +complete -c copilot -n '__fish_use_subcommand' -f -a 'help' -d 'Display help information' +complete -c copilot -n '__fish_use_subcommand' -f -a 'init' -d 'Initialize Copilot instructions' +complete -c copilot -n '__fish_use_subcommand' -f -a 'update' -d 'Download the latest version' +complete -c copilot -n '__fish_use_subcommand' -f -a 'version' -d 'Display version information' +complete -c copilot -n '__fish_use_subcommand' -f -a 'plugin' -d 'Manage plugins' +complete -c copilot -n '__fish_use_subcommand' -f -a 'mcp' -d 'Manage MCP servers' +complete -c copilot -n '__fish_use_subcommand' -f -a 'completion' -d 'Generate a shell completion script' +complete -c copilot -l version -s v -f -d 'show version information' +complete -c copilot -l interactive -s i -r -d 'Start interactive mode and automatically execute this prompt' +complete -c copilot -l prompt -s p -r -d 'Execute a prompt in non-interactive mode (exits after completion)' +complete -c copilot -l silent -s s -f -d 'Output only the agent response (no stats), useful for scripting with -p' +complete -c copilot -l model -r -d 'Set the AI model to use' +complete -c copilot -l effort -l reasoning-effort -r -d 'Set the reasoning effort level' -a 'low medium high xhigh' +complete -c copilot -l enable-reasoning-summaries -f -d 'Request reasoning summaries for OpenAI models' +complete -c copilot -l agent -r -d 'Specify a custom agent to use' +complete -c copilot -l resume -r -d 'Resume from a previous session (optionally specify session ID, task ID, or name; name matching is exact, case-insensitive)' +complete -c copilot -l continue -f -d 'Resume the most recent session' +complete -c copilot -l name -s n -r -d 'Set a name for the new session' +complete -c copilot -l connect -r -d 'Connect directly to a remote session (optionally specify session ID or task ID)' +complete -c copilot -l allow-all-tools -f -d 'Allow all tools to run automatically without confirmation; required for non-interactive mode' +complete -c copilot -l allow-all-paths -f -d 'Disable file path verification and allow access to any path' +complete -c copilot -l disallow-temp-dir -f -d 'Prevent automatic access to the system temporary directory' +complete -c copilot -l no-custom-instructions -f -d 'Disable loading of custom instructions from AGENTS.md and related files' +complete -c copilot -l no-auto-update -f -d 'Disable downloading CLI update automatically (disabled by default in CI environments)' +complete -c copilot -l no-ask-user -f -d 'Disable the ask_user tool (agent works autonomously without asking questions)' +complete -c copilot -l banner -f -d 'Show the startup banner' +complete -c copilot -l no-color -f -d 'Disable all color output' +complete -c copilot -l screen-reader -f -d 'Enable screen reader optimizations' +complete -c copilot -l plain-diff -f -d 'Disable rich diff rendering (syntax highlighting via diff tool specified by git config)' +complete -c copilot -s C -r -d 'Change working directory before doing anything else' +complete -c copilot -l log-dir -r -d 'Set log file directory (default: ~/.copilot/logs/)' +complete -c copilot -l log-level -r -d 'Set the log level' -a 'none error warning info debug all default' +complete -c copilot -l stream -r -d 'Enable or disable streaming mode' -a 'on off' +complete -c copilot -l output-format -r -d 'Output format: \'text\' (default) or \'json\' (JSONL, one JSON object per line)' -a 'text json' +complete -c copilot -l share -r -d 'Share session to markdown file after completion in non-interactive mode (default: ./copilot-session-.md)' +complete -c copilot -l share-gist -f -d 'Share session to a secret GitHub gist after completion in non-interactive mode' +complete -c copilot -l add-dir -r -d 'Add a directory to the allowed list for file access (can be used multiple times)' +complete -c copilot -l attachment -r -d 'Attach a file (image or native document) to the initial prompt; only valid in non-interactive mode (can be used multiple times)' +complete -c copilot -l disable-mcp-server -r -d 'Disable a specific MCP server (can be used multiple times)' +complete -c copilot -l disable-builtin-mcps -f -d 'Disable all built-in MCP servers (currently: github-mcp-server)' +complete -c copilot -l enable-all-github-mcp-tools -f -d 'Enable all GitHub MCP server tools instead of the default CLI subset. Overrides --add-github-mcp-toolset and --add-github-mcp-tool options.' +complete -c copilot -l add-github-mcp-toolset -r -d 'Add a toolset to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "all" for all toolsets.' +complete -c copilot -l add-github-mcp-tool -r -d 'Add a tool to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "*" for all tools.' +complete -c copilot -l plugin-dir -r -d 'Load a plugin from a local directory (can be used multiple times)' +complete -c copilot -l additional-mcp-config -r -d 'Additional MCP servers configuration as JSON string or file path (prefix with @) (can be used multiple times; augments config from ~/.copilot/mcp-config.json for this session)' +complete -c copilot -l allow-tool -r -d 'Tools the CLI has permission to use; will not prompt for permission' +complete -c copilot -l deny-tool -r -d 'Tools the CLI does not have permission to use; will not prompt for permission' +complete -c copilot -l available-tools -r -d 'Only these tools will be available to the model' +complete -c copilot -l excluded-tools -r -d 'These tools will not be available to the model' +complete -c copilot -l secret-env-vars -r -d 'Environment variable names whose values are stripped from shell and MCP server environments and redacted from output (e.g., --secret-env-vars=MY_KEY,OTHER_KEY)' +complete -c copilot -l allow-url -r -d 'Allow access to specific URLs or domains' +complete -c copilot -l deny-url -r -d 'Deny access to specific URLs or domains, takes precedence over --allow-url' +complete -c copilot -l allow-all-urls -f -d 'Allow access to all URLs without confirmation' +complete -c copilot -l allow-all -f -d 'Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)' +complete -c copilot -l yolo -f -d 'Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)' +complete -c copilot -l max-autopilot-continues -r -d 'Maximum number of continuation messages in autopilot mode' +complete -c copilot -l mode -r -d 'Set the initial agent mode' -a 'interactive plan autopilot' +complete -c copilot -l autopilot -f -d 'Start in autopilot mode' +complete -c copilot -l plan -f -d 'Start in plan mode' +complete -c copilot -l experimental -f -d 'Enable experimental features' +complete -c copilot -l no-experimental -f -d 'Disable experimental features' +complete -c copilot -l bash-env -r -d 'Enable BASH_ENV support for bash shells (on|off)' +complete -c copilot -l no-bash-env -f -d 'Disable BASH_ENV support for bash shells' +complete -c copilot -l mouse -r -d 'Enable mouse support in alt screen mode (on|off)' +complete -c copilot -l no-mouse -f -d 'Disable mouse support in alt screen mode' +complete -c copilot -l acp -f -d 'Start as Agent Client Protocol server' +complete -c copilot -l remote -f -d 'Enable remote control of your session from GitHub web and mobile' +complete -c copilot -l no-remote -f -d 'Disable remote control of your session from GitHub web and mobile' +complete -c copilot -n '__fish_seen_subcommand_from login' -l host -r -d 'GitHub host URL (default: https://github.com)' +complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'install' -d 'Install a plugin' +complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'uninstall' -d 'Uninstall a plugin' +complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'update' -d 'Update a plugin' +complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'list' -d 'List installed plugins' +complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'marketplace' -d 'Manage plugin marketplaces' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'add' -d 'Add a marketplace' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'remove' -d 'Remove a marketplace' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'list' -d 'List registered marketplaces' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'browse' -d 'Browse plugins in a marketplace' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'update' -d 'Update marketplace plugin catalogs' +complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace; and __fish_seen_subcommand_from remove' -l force -s f -f -d 'Force removal even if plugins are installed' +complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'list' -d 'List configured MCP servers' +complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'get' -d 'Show server details' +complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'add' -d 'Add an MCP server' +complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'remove' -d 'Remove an MCP server' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from list' -l json -f -d 'Output as JSON' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l json -f -d 'Output as JSON' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l show-secrets -f -d 'Show full environment variable and header values (masked by default)' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l transport -r -d 'Server transport' -a 'stdio http sse' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l env -r -d 'Environment variable (KEY=VALUE, can be repeated)' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l header -r -d 'HTTP header for remote servers, can be repeated' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l tools -r -d 'Tool filter: "*" for all, comma-separated list, or "" for none' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l timeout -r -d 'Timeout in milliseconds' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l json -f -d 'Output added config as JSON' +complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l show-secrets -f -d 'Show full environment variable and header values in output, masked by default' diff --git a/home/river/config/fish/conf.d/fish_frozen_key_bindings.fish b/home/river/config/fish/conf.d/fish_frozen_key_bindings.fish new file mode 100644 index 0000000..495aee9 --- /dev/null +++ b/home/river/config/fish/conf.d/fish_frozen_key_bindings.fish @@ -0,0 +1,14 @@ +# This file was created by fish when upgrading to version 4.3, to migrate +# the 'fish_key_bindings' variable from its old default scope (universal) +# to its new default scope (global). We recommend you delete this file +# and configure key bindings in ~/.config/fish/config.fish if needed. + +# set --global fish_key_bindings fish_default_key_bindings + +# Prior to version 4.3, fish shipped an event handler that runs +# `set --universal fish_key_bindings fish_default_key_bindings` +# whenever the fish_key_bindings variable is erased. +# This means that as long as any fish < 4.3 is still running on this system, +# we cannot complete the migration. +# As a workaround, erase the universal variable at every shell startup. +set --erase --universal fish_key_bindings diff --git a/home/river/config/fish/config.fish b/home/river/config/fish/config.fish new file mode 100644 index 0000000..f1ff551 --- /dev/null +++ b/home/river/config/fish/config.fish @@ -0,0 +1,31 @@ +if status is-interactive + starship init fish | source + zoxide init fish | source + alias cd=z + alias docker=podman + alias ls='eza --icons' + export PATH="$HOME/.npm-global/bin:$PATH" + alias kubectx='kubectl config use-context' + alias nrs="sudo nixos-rebuild switch --flake /home/river/nixos-dotfiles#pc" + alias config="nvim /home/river/nixos-dotfiles/hosts/pc/configuration.nix" + alias v=nvim +end + +function fish_greeting + +end + +# bun +set --export BUN_INSTALL "$HOME/.bun" +set --export PATH $BUN_INSTALL/bin $PATH + +alias cea="bunx create-expo-app --no-install" + +export PATH="$HOME/.local/bin:$PATH" + +set -x GPG_TTY $(tty) + +# OpenClaw Completion +test -f "/home/river/.openclaw/completions/openclaw.fish"; and source "/home/river/.openclaw/completions/openclaw.fish" + +set -gx CLAUDE_CODE_MAX_OUTPUT_TOKENS 64000 diff --git a/home/river/config/fish/fish_variables b/home/river/config/fish/fish_variables new file mode 100644 index 0000000..ed8ec5b --- /dev/null +++ b/home/river/config/fish/fish_variables @@ -0,0 +1,4 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:4300 +SETUVAR fish_user_paths:/opt/homebrew/opt/llvm/bin diff --git a/home/river/config/fish/functions/clone-starter.fish b/home/river/config/fish/functions/clone-starter.fish new file mode 100644 index 0000000..b623bdc --- /dev/null +++ b/home/river/config/fish/functions/clone-starter.fish @@ -0,0 +1,19 @@ +function clone-starter + if test (count $argv) -eq 0 + echo "Usage: clone-starter " + return 1 + end + + set project_name $argv[1] + + git clone https://github.com/pure-sagacity/turborepo-starter-project.git $project_name + + if test $status -ne 0 + echo "Error: git clone failed" + return 1 + end + + rm -rf $project_name/.git + + echo "✓ Created $project_name (git history removed)" +end diff --git a/home/river/config/fish/functions/copy.fish b/home/river/config/fish/functions/copy.fish new file mode 100644 index 0000000..0a99d71 --- /dev/null +++ b/home/river/config/fish/functions/copy.fish @@ -0,0 +1,20 @@ +function copy + if test (count $argv) -eq 0 + echo "Usage: copy " + return 1 + end + + if not test -f $argv[1] + echo "Error: File '$argv[1]' not found" + return 1 + end + + cat $argv[1] | wl-copy + + if test $status -eq 0 + echo "Copied contents of '$argv[1]' to clipboard" + else + echo "Error: Failed to copy to clipboard" + return 1 + end +end diff --git a/home/river/config/fish/functions/copy_secret.fish b/home/river/config/fish/functions/copy_secret.fish new file mode 100644 index 0000000..b413885 --- /dev/null +++ b/home/river/config/fish/functions/copy_secret.fish @@ -0,0 +1,5 @@ +function generateSecret + openssl rand -base64 32 | pbcopy + + echo "Copied secret to clipboard!" +end diff --git a/home/river/config/fish/functions/wipedns.fish b/home/river/config/fish/functions/wipedns.fish new file mode 100644 index 0000000..ee449fd --- /dev/null +++ b/home/river/config/fish/functions/wipedns.fish @@ -0,0 +1,4 @@ +function wipedns + sudo dscacheutil -flushcache + sudo killall -HUP mDNSResponder +end diff --git a/home/river/config/hypr/autostart.lua b/home/river/config/hypr/autostart.lua index 1f02e6b..f231dc7 100644 --- a/home/river/config/hypr/autostart.lua +++ b/home/river/config/hypr/autostart.lua @@ -1,8 +1,9 @@ local config = require("variables.lua") hl.on("hyprland.start", function () - hl.exec_cmd(config.terminal) + hl.exec_cmd("wayvnc 0.0.0.0 5900") hl.exec_cmd("nm-applet") + hl.exec_cmd(config.terminal) hl.exec_cmd(config.wallpaper_cmd) hl.exec_cmd(config.bar_cmd) end) \ No newline at end of file diff --git a/home/river/config/hypr/general.lua b/home/river/config/hypr/general.lua index 78786df..020d4a6 100644 --- a/home/river/config/hypr/general.lua +++ b/home/river/config/hypr/general.lua @@ -5,7 +5,7 @@ hl.config({ gaps_in = 2, gaps_out = 10, - border_size = 1, + border_size = 2, col = { active_border = theme.primary, diff --git a/home/river/config/hypr/keybinds.lua b/home/river/config/hypr/keybinds.lua index 647feec..ab5cdba 100644 --- a/home/river/config/hypr/keybinds.lua +++ b/home/river/config/hypr/keybinds.lua @@ -8,12 +8,16 @@ local mainMod = "SUPER" hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(config.terminal)) hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(config.file_manager)) hl.bind("ALT + SPACE", hl.dsp.exec_cmd(config.menu)) +hl.bind(mainMod .. " + B", hl.dsp.exec_cmd(config.browser)) hl.bind(mainMod .. " + Q", hl.dsp.window.close()) hl.bind(mainMod .. " + Escape", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'")) hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" })) hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit")) +hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" })) +hl.bind(mainMod .. " + I", hl.dsp.exec_cmd('ghostty -e bash -c "ollama"')) +hl.bind(mainMod .. " + N", hl.dsp.exec_cmd('ghostty -e bash -c "nmtui"')) -- Window Binds hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" })) @@ -36,6 +40,9 @@ end hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) +-- Screenshot +hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd(config.screen_shot_cmd)) + -- Laptop Multimedia Keys hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) diff --git a/home/river/config/hypr/monitor.lua b/home/river/config/hypr/monitor.lua index b5b3a9f..5261ab1 100644 --- a/home/river/config/hypr/monitor.lua +++ b/home/river/config/hypr/monitor.lua @@ -1,6 +1,6 @@ hl.monitor({ - output = "eDP-1", - mode = "1920x1080@60", + output = "DP-2", + mode = "2560x1440@165", position = "0x0", scale = 1, }) \ No newline at end of file diff --git a/home/river/config/hypr/variables.lua b/home/river/config/hypr/variables.lua index 5ea335a..79d4c61 100644 --- a/home/river/config/hypr/variables.lua +++ b/home/river/config/hypr/variables.lua @@ -19,7 +19,8 @@ return { file_manager = "dolphin", screen_shot_cmd = "hyprshot -m region -o ~/Pictures/Screenshots", menu = "rofi -show drun", - wallpaper_cmd = wallpaper_util("/home/river/Videos/Wallpapers/Wallpaper.mp4"), + wallpaper_cmd = wallpaper_util("/home/river/Pictures/Wallpapers/bg.png"), + --wallpaper_cmd = wallpaper_util("/home/river/Videos/Wallpapers/bg.mp4"), browser = "brave", - bar_cmd = "qs" + bar_cmd = "waybar" } \ No newline at end of file diff --git a/home/river/default.nix b/home/river/default.nix index 35db7e7..9db77f6 100644 --- a/home/river/default.nix +++ b/home/river/default.nix @@ -1,20 +1,43 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { + imports = [ ./programs/bash.nix ./programs/git.nix + ./programs/fish.nix + ./programs/vesktop.nix + ./programs/java.nix + #./programs/neovim.nix ]; - home.file = { - ".config/hypr".source = ./config/hypr; - ".config/tmux".source = ./config/tmux; - ".config/ghostty".source = ./config/ghostty; - ".config/nvim".source = ./config/nvim; + programs.home-manager.enable = true; + + home = { + packages = with pkgs; [ + git + bash + fish + vesktop + neovim + tmux + ]; + + file = { + ".config/hypr".source = ./config/hypr; + ".config/tmux".source = ./config/tmux; + ".config/ghostty".source = ./config/ghostty; + ".config/nvim".source = ./config/nvim; + ".config/fish".source = ./config/fish; + }; + + sessionVariables = { + EDITOR = "nvim"; + }; + + username = "river"; + homeDirectory = "/home/river"; + + stateVersion = "26.05"; }; - - home.username = "river"; - home.homeDirectory = "/home/river"; - - home.stateVersion = "26.05"; } diff --git a/home/river/programs/fish.nix b/home/river/programs/fish.nix new file mode 100644 index 0000000..e29f52b --- /dev/null +++ b/home/river/programs/fish.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: + +{ + imports = [ + ./eza.nix + ./starship.nix + ./zoxide.nix + ]; + + home.packages = with pkgs; [ + fish + bat + fzf + fd + zoxide + ripgrep + neovim + ]; + + home.file.".config/fish".source = ../config/fish; + + programs.fish.enable = true; +} diff --git a/home/river/programs/git.nix b/home/river/programs/git.nix index e415619..1551062 100644 --- a/home/river/programs/git.nix +++ b/home/river/programs/git.nix @@ -1,9 +1,30 @@ -{ ... }: +{ pkgs, ... }: { programs.git = { enable = true; + settings = { + user = { + name = "Maaz Khokhar"; + email = "khokharmaaz@gmail.com"; + }; + signing = { + key = "0xA8D1AEA9C92D6867"; # e.g., "0x1234567890ABCDEF" + signByDefault = true; + }; + + credential.helper = "libsecret"; + + extraConfig = { + commit.gpgSign = true; + tag.gpgSign = true; + gpg.program = "${pkgs.gnupg}/bin/gpg"; + init.defaultBranch = "main"; + pull.rebase = true; + }; + }; }; + programs.delta = { enable = true; options = { diff --git a/home/river/programs/gpg.nix b/home/river/programs/gpg.nix new file mode 100644 index 0000000..c0ae23e --- /dev/null +++ b/home/river/programs/gpg.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +{ + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + maxCacheTtl = 1800; + pinentry.package = pkgs.pinentry-curses; + }; + + programs.gpg = { + enable = true; + settings = { + auto-key-locate = "local,wkd,keyserver"; + keyserver = "hkps://keys.openpgp.org"; + }; + }; +} \ No newline at end of file diff --git a/home/river/programs/java.nix b/home/river/programs/java.nix new file mode 100644 index 0000000..8739eb4 --- /dev/null +++ b/home/river/programs/java.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: + +{ + home.file.".java/jdk-17".source = pkgs.jdk17; + home.file.".java/jdk-25".source = pkgs.jdk25; +} diff --git a/home/river/programs/vesktop.nix b/home/river/programs/vesktop.nix new file mode 100644 index 0000000..1e05fe4 --- /dev/null +++ b/home/river/programs/vesktop.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + vesktop + ]; +} diff --git a/home/river/programs/zoxide.nix b/home/river/programs/zoxide.nix index 19e30f3..07ba5ca 100644 --- a/home/river/programs/zoxide.nix +++ b/home/river/programs/zoxide.nix @@ -4,5 +4,6 @@ programs.zoxide = { enable = true; enableBashIntegration = true; + enableFishIntegration = true; }; } diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix deleted file mode 100644 index c56b09b..0000000 --- a/hosts/laptop/configuration.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./hardware-configuration.nix - ./disko.nix - - # Modules - ../../modules/core - ../../modules/development - ../../modules/networking - ../../modules/virtualization - - ## Desktop Environment - ../../desktops/hyprland - ]; - - boot = { - zfs.forceImportRoot = false; - supportedFilesystems = [ "zfs" ]; - - initrd = { - availableKernelModules = [ - "tpm_tis" - "tpm_crb" - ]; - }; - - loader = { - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - useOSProber = true; - }; - }; - - kernelModules = [ - "tpm_tis" - "tpm_crb" - ]; - }; - - security = { - tpm2.enable = true; - sudo.wheelNeedsPassword = false; - }; - - services.zfs.autoScrub.enable = true; - services.zfs.autoSnapshot.enable = true; - - networking.hostId = "8425e349"; - - environment.systemPackages = with pkgs; [ - tpm2-tools - brave - fprintd # Fingerprint - ]; - - system.stateVersion = "26.05"; -} diff --git a/hosts/laptop/disko.nix b/hosts/laptop/disko.nix deleted file mode 100644 index c7c7bcb..0000000 --- a/hosts/laptop/disko.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ disk, ... }: - -{ - disko.devices = { - disk.main = { - type = "disk"; - device = disk; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "1G"; - type = "EF00"; - - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - - luks = { - size = "100%"; - content = { - type = "luks"; - name = "cryptroot"; - # important: allow TPM-based unlocking - settings = { - allowDiscards = true; - }; - - # this is key for TPM workflows - initrdUnlock = true; - content = { - type = "zfs"; - pool = "rpool"; - }; - }; - }; - }; - }; - }; - - # Moved inside disko.devices - zpool.rpool = { - type = "zpool"; - rootFsOptions = { - compression = "zstd"; - "com.sun:auto-snapshot" = "true"; - }; - datasets = { - root = { - type = "zfs_fs"; - mountpoint = "/"; - }; - - nix = { - type = "zfs_fs"; - mountpoint = "/nix"; - }; - - home = { - type = "zfs_fs"; - mountpoint = "/home"; - }; - }; - }; - }; -} diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix new file mode 100755 index 0000000..dfb48d2 --- /dev/null +++ b/hosts/pc/configuration.nix @@ -0,0 +1,72 @@ +{ + pkgs, + inputs, + ... +}: + +{ + imports = [ + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + + # Modules + ../../modules/core + ../../modules/networking + ../../modules/bluetooth + ../../modules/gaming + ../../modules/virtualization + ../../modules/ollama + ../../modules/development + ../../modules/development/claude.nix + ../../modules/additionalUsers/aariz.nix + ../../modules/obs + + # Desktop + ../../desktops/plasma + ../../desktops/hyprland + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixos"; + + environment.systemPackages = with pkgs; [ + libsecret + tree + libxtst + usbutils + brave + pciutils + stow + termius + kdePackages.partitionmanager + python3 + fastfetch + localsend + nvtopPackages.amd + pass + pinentry-curses + github-copilot-cli + xautoclick + tsx + slack + ]; + + systemd.network.wait-online.enable = false; + boot.initrd.systemd.network.wait-online.enable = false; + services.flatpak.enable = true; + + networking.firewall.allowedTCPPorts = [ + 5900 + 16570 + 18789 + ]; + + hardware = { + enableAllFirmware = true; + enableRedistributableFirmware = true; + }; + + system.stateVersion = "25.11"; +} diff --git a/hosts/pc/hardware-configuration.nix b/hosts/pc/hardware-configuration.nix new file mode 100644 index 0000000..d97a7a7 --- /dev/null +++ b/hosts/pc/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b290de04-28e6-477f-a23e-6d146c1e36e2"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7082-DAFE"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/additionalUsers/aariz.nix b/modules/additionalUsers/aariz.nix new file mode 100644 index 0000000..ac4f60f --- /dev/null +++ b/modules/additionalUsers/aariz.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + users.users.aariz = { + isNormalUser = true; + description = "Aariz Khokhar"; + packages = with pkgs; [ google-chrome ]; + shell = pkgs.bash; + }; +} \ No newline at end of file diff --git a/modules/bluetooth/default.nix b/modules/bluetooth/default.nix new file mode 100644 index 0000000..266fb7e --- /dev/null +++ b/modules/bluetooth/default.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: + +{ + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Experimental = true; + }; + Policy = { + AutoEnable = true; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + bluez + bluez-tools + blueman + ]; + + services.blueman.enable = true; +} diff --git a/modules/core/default.nix b/modules/core/default.nix index 2fd4c75..3e10ba6 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,16 +1,26 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { + boot.kernelPackages = pkgs.linuxPackages_latest; + time.timeZone = "America/Chicago"; + programs.fish.enable = true; + users.users.river = { isNormalUser = true; + description = "Maaz Khokhar"; extraGroups = [ "wheel" "networkmanager" + "input" ]; + + shell = pkgs.fish; }; + nixpkgs.config.allowUnfree = true; + environment.systemPackages = with pkgs; [ git neovim @@ -21,24 +31,69 @@ ghostty wireplumber brightnessctl + pulseaudio + pavucontrol + ghostty + git-credential-manager ]; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; + nix = { + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + settings = { + trusted-users = [ + "root" + "river" + ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + }; }; - nix.settings.auto-optimise-store = true; + programs.nix-ld.enable = true; - services.pipewire = { - enable = true; - pulse.enable = true; - alsa.enable = true; + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; }; - services.openssh = { - enable = true; - settings.PermitRootLogin = "no"; + security.rtkit.enable = true; + + services = { + xserver.xkb = { + layout = "us"; + variant = ""; + }; + + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + openssh = { + enable = true; + settings.PermitRootLogin = "no"; + }; + + printing.enable = true; }; } diff --git a/modules/development/claude.nix b/modules/development/claude.nix new file mode 100644 index 0000000..c1b1097 --- /dev/null +++ b/modules/development/claude.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + claude-code + ]; +} diff --git a/modules/development/default.nix b/modules/development/default.nix index e2a5e8e..8917bb9 100644 --- a/modules/development/default.nix +++ b/modules/development/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ inputs, pkgs, ... }: { imports = [ @@ -10,5 +10,21 @@ git neovim nixfmt + nixd + kubectl + jq + tmux + vscode + devenv + xh + nodejs + ]; + + # Nix LSP + nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + + fonts.packages = with pkgs; [ + nerd-fonts.fira-code + nerd-fonts.jetbrains-mono ]; } diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix new file mode 100644 index 0000000..bf0d2c4 --- /dev/null +++ b/modules/gaming/default.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + steam + prismlauncher + nvtopPackages.amd + ]; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; + + programs.gamemode.enable = true; + + # GPU Driver + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ + mesa + vulkan-loader + vulkan-validation-layers + ]; + }; + + services.xserver.videoDrivers = [ "amdgpu" ]; +} diff --git a/modules/networking/core/default.nix b/modules/networking/core/default.nix index 1aa5468..e65f50d 100644 --- a/modules/networking/core/default.nix +++ b/modules/networking/core/default.nix @@ -6,8 +6,18 @@ ]; networking = { - hostName = "laptop"; - networkmanager.enable = true; + networkmanager = { + enable = true; + dns = "systemd-resolved"; + }; + extraHosts = "192.168.1.60 laptop"; + nftables.enable = true; + + nameservers = [ + "192.168.1.193" # Pi-hole + "1.1.1.1" # Cloudflare + "1.0.0.1" # Cloudflare (Secondary) + ]; }; services.resolved = { @@ -25,6 +35,4 @@ }; }; - - networking.nftables.enable = true; } diff --git a/modules/networking/tailscale.nix b/modules/networking/tailscale.nix index 8980329..57a3e57 100644 --- a/modules/networking/tailscale.nix +++ b/modules/networking/tailscale.nix @@ -1,7 +1,12 @@ { config, ... }: { - services.tailscale.enable = true; + services.tailscale = { + enable = true; + openFirewall = true; + extraSetFlags = [ "--operator=river" ]; + }; + networking.firewall = { trustedInterfaces = [ config.services.tailscale.interfaceName ]; allowedUDPPorts = [ config.services.tailscale.port ]; @@ -13,4 +18,8 @@ systemd.network.wait-online.enable = false; boot.initrd.systemd.network.wait-online.enable = false; + + users.users.river.extraGroups = [ + "tailscale" + ]; } diff --git a/modules/obs/default.nix b/modules/obs/default.nix new file mode 100644 index 0000000..3e98511 --- /dev/null +++ b/modules/obs/default.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + obs-vaapi + obs-gstreamer + obs-vkcapture + ]; + }; +} diff --git a/modules/ollama/default.nix b/modules/ollama/default.nix new file mode 100644 index 0000000..bc37635 --- /dev/null +++ b/modules/ollama/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + services.ollama = { + enable = true; + host = "0.0.0.0"; + port = 11434; + package = pkgs.ollama-rocm; + }; + + networking.firewall.allowedTCPPorts = [ 11434 ]; +} diff --git a/modules/sunshine/default.nix b/modules/sunshine/default.nix new file mode 100644 index 0000000..ff94890 --- /dev/null +++ b/modules/sunshine/default.nix @@ -0,0 +1,29 @@ +{ ... }: + +{ + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; + + networking.firewall = { + allowedTCPPorts = [ + 47984 + 47989 + 47990 + 48010 + ]; + allowedUDPPortRanges = [ + { + from = 47998; + to = 48000; + } + { + from = 8000; + to = 8010; + } + ]; + }; +} diff --git a/modules/virtualization/default.nix b/modules/virtualization/default.nix index 151214d..a29a57b 100644 --- a/modules/virtualization/default.nix +++ b/modules/virtualization/default.nix @@ -3,5 +3,6 @@ imports = [ ./podman.nix ./qemu.nix + ./lima.nix ]; } diff --git a/modules/virtualization/lima.nix b/modules/virtualization/lima.nix new file mode 100644 index 0000000..9676f94 --- /dev/null +++ b/modules/virtualization/lima.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + lima + ]; +} diff --git a/modules/virtualization/podman.nix b/modules/virtualization/podman.nix index 240516a..004bebe 100644 --- a/modules/virtualization/podman.nix +++ b/modules/virtualization/podman.nix @@ -33,5 +33,6 @@ environment.systemPackages = with pkgs; [ podman podman-compose + podman-desktop ]; } diff --git a/modules/virtualization/qemu.nix b/modules/virtualization/qemu.nix index 756c18b..6599409 100644 --- a/modules/virtualization/qemu.nix +++ b/modules/virtualization/qemu.nix @@ -1,12 +1,16 @@ -{ ... }: +{ pkgs, ... }: { virtualisation.spiceUSBRedirection.enable = true; - virtualisation.libvirtd = { - enable = true; - qemu = { - swtpm.enable = true; + virtualisation = { + containers.enable = true; + libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + swtpm.enable = true; + }; }; };