diff --git a/dotfiles/flake.nix b/dotfiles/flake.nix index ff72a9e6..ee42011c 100644 --- a/dotfiles/flake.nix +++ b/dotfiles/flake.nix @@ -62,6 +62,29 @@ }; in { nixosConfigurations = { + installer = lib.nixosSystem { + modules = [ + ./nixos/installer/configuration.nix + inputs.nix-flatpak.nixosModules.nix-flatpak + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + users.joey = import ./home-manager/installer/home.nix; + sharedModules = [ + inputs.nix-flatpak.homeManagerModules.nix-flatpak + inputs.stylix.homeManagerModules.stylix + ]; + extraSpecialArgs = { inherit pkgs pkgs-unstable inputs; inherit vars; }; + }; + } + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix" + ]; + inherit system; + specialArgs = { + inherit pkgs pkgs-unstable inputs; + inherit vars; + }; + }; desktop = lib.nixosSystem { modules = [ ./nixos/desktop/configuration.nix diff --git a/dotfiles/home-manager/desktop/apps/ai.nix b/dotfiles/home-manager/desktop/apps/ai.nix index 91f961fc..877345df 100644 --- a/dotfiles/home-manager/desktop/apps/ai.nix +++ b/dotfiles/home-manager/desktop/apps/ai.nix @@ -2,27 +2,31 @@ home.packages = with pkgs; [ ollama-rocm ( writeShellApplication { - name = "ollama-quick-chat"; # { filePath }: { none } (side-effect: transcodes & remuxes file to x264/mp4) + name = "ollama-chat"; runtimeInputs = [ libnotify ]; text = '' #!/bin/bash - MODEL=''$''\{1:-""} - if [ -z "''$''\{MODEL}" ]; then - echo "No model selected. Choose a model from the list below:" - unset modellist - while read -r model; do - modellist+=( "$model" ) - done< <(${pkgs.ollama-rocm}/bin/ollama list | tail -n+2) - select model in "''$''\{modellist[@]}"; do - MODEL=$(echo "$model" | tr -s ' ' | cut -d' ' -f1) - echo "Selected: $MODEL" - export MODEL - break - done - fi + # shellcheck disable=SC2034 + DEFAULT_MODEL="llama3.2:3b" + + MODEL=''$''\{1:-DEFAULT_MODEL} + + # if [ -z "''$''\{MODEL}" ]; then + # echo "No model selected. Choose a model from the list below:" + # unset modellist + # while read -r model; do + # modellist+=( "$model" ) + # done< <(${pkgs.ollama-rocm}/bin/ollama list | tail -n+2) + # select model in "''$''\{modellist[@]}"; do + # MODEL=$(echo "$model" | tr -s ' ' | cut -d' ' -f1) + # echo "Selected: $MODEL" + # export MODEL + # break + # done + # fi echo "Loading model $MODEL" ${pkgs.ollama-rocm}/bin/ollama run "$MODEL" "" @@ -37,11 +41,12 @@ ]; xdg.desktopEntries.ollama = { - exec = "kitty-popup ollama-quick-chat"; + exec = "kitty-popup ollama-wrapped"; icon = "/home/${vars.user.username}/.icons/custom/ollama.png"; name = "AI Chat"; categories = [ "Utility" ]; type = "Application"; + actions = {}; }; home.file."ollama.png" = { @@ -52,11 +57,33 @@ }; }; - home.file."assistant.Modelfile" = { - target = ".ollama/assistant.Modelfile"; + home.file."codewriter.Modelfile" = { + target = ".ollama/codewriter.Modelfile"; text = '' - FROM llama3.2 - SYSTEM You are an assistant specialized in providing concise answers to prompts. Your answers should never be longer than 300 words. If the user asks a question with a complex answer, use references to outside resources such as specialized wikis to direct the user toward the answer to their question. + FROM llama3.3:70b + PARAMETER temperature 1 + SYSTEM """ + I want you to act as a senior full-stack tech leader and top-tier brilliant software developer, you embody technical excellence and a deep understanding of a wide range of technologies. + Your expertise covers not just coding, but also algorithm design, system architecture, and technology strategy. + For every question there is no need to explain, only give the solution. + + Coding Mastery: Possess exceptional skills in programming languages including Python, JavaScript, SQL, NoSQL, mySQL, C++, C, Rust, Groovy, Go, and Java. + Your proficiency goes beyond mere syntax; you explore and master the nuances and complexities of each language, crafting code that is both highly efficient and robust. + Your capability to optimize performance and manage complex codebases sets the benchmark in software development. + Python | JavaScript | C++ | C | RUST | Groovy | Go | Java | SQL | MySQL | NoSQL + Efficient, Optimal, Good Performance, Excellent Complexity, Robust Code + + Cutting-Edge Technologies: Adept at leveraging the latest technologies, frameworks, and tools to drive innovation and efficiency. + Experienced with Docker, Kubernetes, React, Angular, AWS, Supabase, Firebase, Azure, and Google Cloud. + Your understanding of these platforms enables you to architect and deploy scalable, resilient applications that meet modern business demands. + Docker | Kubernetes | React | Angular | AWS | Supabase | Firebase | Azure | Google Cloud Seamlessly Integrating Modern Tech Stacks Complex Algorithms & Data Structures Optimized Solutions for Enhanced Performance & Scalability + + Solution Architect: Your comprehensive grasp of the software development lifecycle empowers you to design solutions that are not only technically sound but also align perfectly with business goals. From concept to deployment, you ensure adherence to industry best practices and agile methodologies, making the development process both agile and effective. + + Interactive Solutions: When crafting user-facing features, employ modern ES6 JavaScript, TypeScript, and native browser APIs to manage interactivity seamlessly, enabling a dynamic and engaging user experience. Your focus lies in delivering functional, ready-to-deploy code, ensuring that explanations are succinct and directly aligned with the required solutions. + + Never explain the code just write code. + """ ''; }; diff --git a/dotfiles/home-manager/desktop/apps/password-manager.nix b/dotfiles/home-manager/desktop/apps/password-manager.nix index ddfa88ac..6de13c19 100644 --- a/dotfiles/home-manager/desktop/apps/password-manager.nix +++ b/dotfiles/home-manager/desktop/apps/password-manager.nix @@ -1,7 +1,7 @@ { vars, pkgs, ... }: { home.packages = with pkgs; [ - rofi-rbw + rofi-rbw-wayland wl-clipboard dotool ]; @@ -11,6 +11,10 @@ }; programs.rofi = { enable = false; + configPath = "$XDG_CONFIG_HOME/rofi/config.rasi"; + extraConfig = {}; + location = "center"; + terminal = "${pkgs.kitty}/bin/kitty"; }; programs.wofi = { enable = true; @@ -21,14 +25,14 @@ settings = { base_url = "https://bitwarden.jafner.tools"; email = "jafner425@gmail.com"; - lock_timeout = 604800; + lock_timeout = 2592000; pinentry = pkgs.pinentry-qt; }; }; xdg.desktopEntries = { rofi-rbw = { - exec = "${pkgs.rofi-rbw}/bin/rofi-rbw"; + exec = "${pkgs.rofi-rbw-wayland}/bin/rofi-rbw"; icon = "/home/${vars.user.username}/.icons/custom/bitwarden.png"; name = "Bitwarden"; categories = [ "Utility" "Security" ]; @@ -40,12 +44,12 @@ target = ".config/rofi-rbw.rc"; text = '' action="type" - typing-key-delay=5 - no-folder + typing-key-delay=0 selector-args="-W 40% -H 30%" selector="wofi" clipboarder="wl-copy" typer="dotool" + keybindings="Enter:type:username:enter:tab:type:password:enter:copy:totp" ''; }; diff --git a/dotfiles/home-manager/desktop/configuration/defaultApps.nix b/dotfiles/home-manager/desktop/configuration/defaultApps.nix new file mode 100644 index 00000000..65cbae72 --- /dev/null +++ b/dotfiles/home-manager/desktop/configuration/defaultApps.nix @@ -0,0 +1,13 @@ +{ ... }: { + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/plain" = "codium.desktop"; + "text/html" = "zen.desktop"; + "x-scheme-handler/http" = "zen.desktop"; + "x-scheme-handler/https" = "zen.desktop"; + "x-scheme-handler/about" = "zen.desktop"; + "x-scheme-handler/unknown" = "zen.desktop"; + }; + }; +} \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/configuration/mangohud.nix b/dotfiles/home-manager/desktop/configuration/mangohud.nix new file mode 100644 index 00000000..b8599d88 --- /dev/null +++ b/dotfiles/home-manager/desktop/configuration/mangohud.nix @@ -0,0 +1,44 @@ +{ lib, ... }: { + programs.mangohud = { + enable = true; + settings = { + # Metrics + cpu_stats = 0; + gpu_stats = 0; + frame_timing = 0; + vram = 0; + fps = 1; + fps_color_change = 1; + fps_value = "59,239"; + frametime = 1; + # Env info + vulkan_driver = 1; + gamemode = 1; + present_mode = 0; + throttling_status = 1; + # Graphs + graphs = ""; + # Appearance & presentation + legacy_layout = 1; + hud_no_margin = 1; + font_size = lib.mkForce 14; + no_small_font = 1; + position = "top-left"; + offset_x = 3; + offset_y = 24; + width = 0; + height = 0; + table_columns = 0; + horizontal = 1; + horizontal_stretch = 0; + hud_compact = 1; + toggle_hud = "Shift_R+F12"; + background_alpha = lib.mkForce 0.5; + alpha = lib.mkForce 1.0; + }; + }; +} + +# OW HUD background: #1d253a +# OW HUD text: #b2bedc +# cat ~/.config/MangoHud/MangoHud.conf \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/configuration/nixGL.nix b/dotfiles/home-manager/desktop/configuration/nixGL.nix new file mode 100644 index 00000000..1d2a8985 --- /dev/null +++ b/dotfiles/home-manager/desktop/configuration/nixGL.nix @@ -0,0 +1,7 @@ +{ ... }: { + nixGL = { + vulkan.enable = true; + defaultWrapper = "mesa"; + installScripts = [ "mesa" ]; + }; +} \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/hardware/amdgpu.nix b/dotfiles/home-manager/desktop/hardware/amdgpu.nix deleted file mode 100644 index 7128f152..00000000 --- a/dotfiles/home-manager/desktop/hardware/amdgpu.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs.rocmPackages; [ - rocm-smi - rocminfo - ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/hardware/game-controller.nix b/dotfiles/home-manager/desktop/hardware/game-controller.nix deleted file mode 100644 index fc631a4f..00000000 --- a/dotfiles/home-manager/desktop/hardware/game-controller.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - gamepad-tool - linuxKernel.packages.linux_6_11.xpadneo - ]; -} \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/hardware/razer.nix b/dotfiles/home-manager/desktop/hardware/razer.nix deleted file mode 100644 index 0351441e..00000000 --- a/dotfiles/home-manager/desktop/hardware/razer.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: { - services.flatpak.packages = [ "xyz.z3ntu.razergenie/x86_64/stable" ]; -} - \ No newline at end of file diff --git a/dotfiles/home-manager/desktop/home.nix b/dotfiles/home-manager/desktop/home.nix index 2b5df454..a114b341 100644 --- a/dotfiles/home-manager/desktop/home.nix +++ b/dotfiles/home-manager/desktop/home.nix @@ -4,6 +4,8 @@ ./configuration/stylix.nix ./configuration/git.nix ./configuration/keys.nix + ./configuration/defaultApps.nix + ./configuration/mangohud.nix ./apps/browser.nix ./apps/discord.nix ./apps/obs-studio.nix @@ -19,14 +21,11 @@ ./apps/email.nix ./apps/emulators.nix ./apps/ai.nix - ./hardware/goxlr.nix - ./hardware/razer.nix - ./hardware/game-controller.nix - ./hardware/amdgpu.nix ./services/flatpak.nix ./services/kdeconnect.nix ./services/nextcloud.nix ./services/protonmail.nix + ./services/goxlr-utility.nix ./scripts/ffmpeg.nix ./scripts/kitty-popup.nix ]; diff --git a/dotfiles/home-manager/desktop/hardware/goxlr.nix b/dotfiles/home-manager/desktop/services/goxlr-utility.nix similarity index 88% rename from dotfiles/home-manager/desktop/hardware/goxlr.nix rename to dotfiles/home-manager/desktop/services/goxlr-utility.nix index fbfb85cb..31f63f8f 100644 --- a/dotfiles/home-manager/desktop/hardware/goxlr.nix +++ b/dotfiles/home-manager/desktop/services/goxlr-utility.nix @@ -1,5 +1,7 @@ { pkgs, ... }: { - home.packages = [ pkgs.goxlr-utility ]; + home.packages = with pkgs; [ + goxlr-utility + ]; systemd.user.services = { goxlr-utility = { Unit = { diff --git a/dotfiles/nixos/desktop/addons/gaming.nix b/dotfiles/nixos/desktop/addons/gaming.nix deleted file mode 100644 index d5c98007..00000000 --- a/dotfiles/nixos/desktop/addons/gaming.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - steam - steam-run - lutris-unwrapped - protonup-ng - ]; -} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/peripherals.nix b/dotfiles/nixos/desktop/addons/peripherals.nix deleted file mode 100644 index a8e35729..00000000 --- a/dotfiles/nixos/desktop/addons/peripherals.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: { - services.goxlr-utility.enable = true; - hardware.wooting.enable = true; - hardware.xpadneo.enable = true; - hardware.openrazer = { - enable = true; - users = [ "joey" ]; - batteryNotifier = { - enable = true; - frequency = 600; - percentage = 40; - }; - }; -} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/plasma6.nix b/dotfiles/nixos/desktop/addons/plasma6.nix deleted file mode 100644 index 2726a484..00000000 --- a/dotfiles/nixos/desktop/addons/plasma6.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: { - services.displayManager.defaultSession = "plasma"; - services.desktopManager.plasma6.enable = true; - programs.kdeconnect.enable = true; - environment.systemPackages = with pkgs.kdePackages; [ kcalc ]; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - elisa - kate - okular - discover - ]; -} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/configuration.nix b/dotfiles/nixos/desktop/configuration.nix index de17e0bd..7b26f90d 100644 --- a/dotfiles/nixos/desktop/configuration.nix +++ b/dotfiles/nixos/desktop/configuration.nix @@ -1,162 +1,26 @@ -{ pkgs, ... }: -{ +{ ... }: { imports = [ - ./hardware-configuration.nix - ./addons/peripherals.nix - ./addons/samba-client.nix - ./addons/plasma6.nix - ./addons/gaming.nix - ./addons/fonts.nix - ./addons/ollama.nix + ./hardware/amdgpu.nix + ./hardware/audio.nix + ./hardware/boot.nix + ./hardware/filesystems.nix + ./hardware/networking.nix + ./hardware/peripherals.nix + ./hardware/samba-client.nix + + ./services/flatpak.nix + ./services/ollama.nix + ./services/printing.nix + ./services/ssh.nix + + ./sysconfig/desktop-environment.nix + ./sysconfig/fonts.nix + ./sysconfig/gaming.nix + ./sysconfig/localization.nix + ./sysconfig/nixos.nix + ./sysconfig/user.nix + ./sysconfig/ydotool.nix ]; - - home-manager.backupFileExtension = "backup"; - - # Configure user - programs.zsh.enable = true; - users.users.joey = { - isNormalUser = true; - shell = pkgs.zsh; - description = "joey"; - extraGroups = [ "networkmanager" "wheel" ]; - openssh.authorizedKeys.keys = let - authorizedKeys = pkgs.fetchurl { - url = "https://github.com/Jafner.keys"; - sha256 = "1i3Vs6mPPl965g3sRmbXGzx6zQBs5geBCgNx2zfpjF4="; - }; - in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys); - }; - - services.flatpak = { - enable = true; - uninstallUnmanaged = true; - remotes = [ { name = "flathub"; location = "https://flathub.org/repo/flathub.flatpakrepo"; } ]; - }; - - time.timeZone = "America/Los_Angeles"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.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"; - }; - - # Enable passwordless sudo - security.sudo = { - enable = true; - extraRules = [{ - commands = [ - { - command = "ALL"; - options = [ "NOPASSWD" ]; - } - ]; - groups = [ "wheel" ]; - }]; - }; - - # Enable SSH server with exclusively key-based auth - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - settings.KbdInteractiveAuthentication = false; - }; - - # Configure system packages - environment.systemPackages = with pkgs; [ - git - networkmanagerapplet - ]; - - # Configure mouse and touchpad - services.libinput = { - enable = true; - mouse.naturalScrolling = true; - touchpad.naturalScrolling = true; - }; - - # Enable flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Configure bootloader - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Configure networking - networking.hostName = "joey-desktop-nixos"; - networking.networkmanager.enable = true; - - # Disable systemd's getty and autovt on tty1 - systemd.services = { - "getty@tty1".enable = false; - "autovt@tty1".enable = false; - }; - - # Enable printing service - services.printing.enable = true; - - # Configure audio - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - - # Configure XDG - xdg.portal.enable = true; - xdg.portal.wlr.enable = true; - xdg.portal.extraPortals = with pkgs; [ - xdg-desktop-portal-gtk - ]; - - nixpkgs.config.allowUnfree = true; - programs.steam.enable = true; - - programs.nix-ld = { - enable = true; - }; - - hardware.graphics = { - enable = true; - enable32Bit = true; - extraPackages = []; - }; - hardware.amdgpu = { - amdvlk.enable = true; - opencl.enable = true; - }; - - - # Configure displayManager - services.displayManager = { - enable = true; - autoLogin.enable = true; - autoLogin.user = "joey"; - sddm = { - enable = true; - autoNumlock = true; - }; - }; - - # Configure X11 server - services.xserver = { - enable = true; - excludePackages = [ pkgs.xterm ]; - xkb = { - layout = "us"; - variant = ""; - }; - }; # DO NOT CHANGE system.stateVersion = "24.11"; diff --git a/dotfiles/nixos/desktop/hardware-configuration.nix b/dotfiles/nixos/desktop/hardware-configuration.nix deleted file mode 100644 index d3f2da5c..00000000 --- a/dotfiles/nixos/desktop/hardware-configuration.nix +++ /dev/null @@ -1,47 +0,0 @@ -# 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" "xhci_pci" "ahci" "usbhid" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/e29ec340-6231-4afe-91a8-aaa2da613282"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/CC5A-CDFE"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - fileSystems."/mnt/fedora" = - { device = "/dev/disk/by-uuid/15454185-1268-4559-a074-bb154dc20a93"; - fsType = "btrfs"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/73e8e737-1c5c-4ead-80c6-e616be538145"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0f1.useDHCP = lib.mkDefault true; - # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/amdgpu.nix b/dotfiles/nixos/desktop/hardware/amdgpu.nix new file mode 100644 index 00000000..9eb77ec7 --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/amdgpu.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + hardware = { + amdgpu.amdvlk.enable = false; + graphics = { + enable = true; + enable32Bit = true; + }; + }; + environment.systemPackages = with pkgs; [ + rocmPackages.rocm-smi + rocmPackages.rocminfo + ]; + environment.variables = { + AMD_VULKAN_ICD = "RADV"; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/audio.nix b/dotfiles/nixos/desktop/hardware/audio.nix new file mode 100644 index 00000000..748c6994 --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/audio.nix @@ -0,0 +1,12 @@ +{ ... }: { + # Configure audio + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/boot.nix b/dotfiles/nixos/desktop/hardware/boot.nix new file mode 100644 index 00000000..ea808f06 --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/boot.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + hardware.enableRedistributableFirmware = true; + hardware.cpu.amd.updateMicrocode = true; + boot = { + #kernelPackages = pkgs.linuxKernel.kernels.linux_xanmod_latest + kernelPackages = pkgs.linuxPackages_6_11; + initrd = { + availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; + kernelModules = [ ]; + }; + kernelModules = [ "amdgpu" "kvm-amd" ]; + extraModulePackages = [ ]; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/filesystems.nix b/dotfiles/nixos/desktop/hardware/filesystems.nix new file mode 100644 index 00000000..79c920f4 --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/filesystems.nix @@ -0,0 +1,19 @@ +{ ... }: { + fileSystems."/" = { + device = "/dev/disk/by-uuid/e29ec340-6231-4afe-91a8-aaa2da613282"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/CC5A-CDFE"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + fileSystems."/mnt/fedora" = { + device = "/dev/disk/by-uuid/15454185-1268-4559-a074-bb154dc20a93"; + fsType = "btrfs"; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/73e8e737-1c5c-4ead-80c6-e616be538145"; } ]; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/networking.nix b/dotfiles/nixos/desktop/hardware/networking.nix new file mode 100644 index 00000000..0f864c7d --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/networking.nix @@ -0,0 +1,11 @@ +{ pkgs, lib, ... }: { + networking = { + hostName = "joey-desktop-nixos"; + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; + # Configure system packages + environment.systemPackages = with pkgs; [ + networkmanagerapplet + ]; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/hardware/peripherals.nix b/dotfiles/nixos/desktop/hardware/peripherals.nix new file mode 100644 index 00000000..42a41105 --- /dev/null +++ b/dotfiles/nixos/desktop/hardware/peripherals.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + # Configure mouse and touchpad + services.libinput = { + enable = true; + mouse.naturalScrolling = true; + touchpad.naturalScrolling = true; + }; + services.goxlr-utility.enable = true; + hardware.wooting.enable = true; + hardware.xpadneo.enable = true; + hardware.openrazer = { + enable = true; + users = [ "joey" ]; + batteryNotifier = { + enable = true; + frequency = 600; + percentage = 40; + }; + }; + environment.systemPackages = with pkgs; [ + razergenie + gamepad-tool + linuxKernel.packages.linux_6_11.xpadneo + ]; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/samba-client.nix b/dotfiles/nixos/desktop/hardware/samba-client.nix similarity index 100% rename from dotfiles/nixos/desktop/addons/samba-client.nix rename to dotfiles/nixos/desktop/hardware/samba-client.nix diff --git a/dotfiles/nixos/desktop/services/flatpak.nix b/dotfiles/nixos/desktop/services/flatpak.nix new file mode 100644 index 00000000..a3ef70b6 --- /dev/null +++ b/dotfiles/nixos/desktop/services/flatpak.nix @@ -0,0 +1,7 @@ + { ... }: { + services.flatpak = { + enable = true; + uninstallUnmanaged = true; + remotes = [ { name = "flathub"; location = "https://flathub.org/repo/flathub.flatpakrepo"; } ]; + }; + } \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/ollama.nix b/dotfiles/nixos/desktop/services/ollama.nix similarity index 100% rename from dotfiles/nixos/desktop/addons/ollama.nix rename to dotfiles/nixos/desktop/services/ollama.nix diff --git a/dotfiles/nixos/desktop/services/printing.nix b/dotfiles/nixos/desktop/services/printing.nix new file mode 100644 index 00000000..668a56a3 --- /dev/null +++ b/dotfiles/nixos/desktop/services/printing.nix @@ -0,0 +1,4 @@ + { ... }: { + # Enable printing service + services.printing.enable = true; + } \ No newline at end of file diff --git a/dotfiles/nixos/desktop/services/ssh.nix b/dotfiles/nixos/desktop/services/ssh.nix new file mode 100644 index 00000000..df585172 --- /dev/null +++ b/dotfiles/nixos/desktop/services/ssh.nix @@ -0,0 +1,8 @@ +{ ... }: { + # Enable SSH server with exclusively key-based auth + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + settings.KbdInteractiveAuthentication = false; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/sysconfig/desktop-environment.nix b/dotfiles/nixos/desktop/sysconfig/desktop-environment.nix new file mode 100644 index 00000000..018526a9 --- /dev/null +++ b/dotfiles/nixos/desktop/sysconfig/desktop-environment.nix @@ -0,0 +1,60 @@ +{ pkgs, ... }: { + programs.kdeconnect.enable = true; + environment.systemPackages = with pkgs; [ kdePackages.kcalc wl-color-picker ]; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + elisa + kate + okular + discover + ]; + # Disable systemd's getty and autovt on tty1 + systemd.services = { + "getty@tty1".enable = false; + "autovt@tty1".enable = false; + }; + + # Configure displayManager + services.displayManager = { + enable = true; + defaultSession = "plasma"; + autoLogin.enable = true; + autoLogin.user = "joey"; + sddm = { + enable = true; + autoNumlock = true; + wayland.enable = true; + wayland.compositor = "kwin"; + }; + }; + + # Configure desktopManager + services.desktopManager = { + plasma6.enable = true; + }; + + # Configure X11 server + services.xserver = { + enable = true; + videoDrivers = [ "amdgpu" ]; + excludePackages = [ pkgs.xterm ]; + xkb = { + layout = "us"; + variant = ""; + }; + }; + + # Configure xwayland + programs.xwayland = { + enable = true; + }; + + # Configure XDG + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + ]; + }; + +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/fonts.nix b/dotfiles/nixos/desktop/sysconfig/fonts.nix similarity index 100% rename from dotfiles/nixos/desktop/addons/fonts.nix rename to dotfiles/nixos/desktop/sysconfig/fonts.nix diff --git a/dotfiles/nixos/desktop/sysconfig/gaming.nix b/dotfiles/nixos/desktop/sysconfig/gaming.nix new file mode 100644 index 00000000..45c622f7 --- /dev/null +++ b/dotfiles/nixos/desktop/sysconfig/gaming.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + steam + steam-run + lutris-unwrapped + protonup-ng + vulkan-tools + mangohud + ]; + programs.steam = { + enable = true; + extraPackages = with pkgs; []; + }; + programs.gamescope = { + enable = true; + capSysNice = false; + }; + programs.gamemode = { + enable = true; + enableRenice = true; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/sysconfig/localization.nix b/dotfiles/nixos/desktop/sysconfig/localization.nix new file mode 100644 index 00000000..11b9e15e --- /dev/null +++ b/dotfiles/nixos/desktop/sysconfig/localization.nix @@ -0,0 +1,15 @@ +{ ... }: { + time.timeZone = "America/Los_Angeles"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.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"; + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/sysconfig/nixos.nix b/dotfiles/nixos/desktop/sysconfig/nixos.nix new file mode 100644 index 00000000..84eec068 --- /dev/null +++ b/dotfiles/nixos/desktop/sysconfig/nixos.nix @@ -0,0 +1,10 @@ +{ pkgs, lib, ... }: { + nixpkgs.config.allowUnfree = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ ]; + }; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + home-manager.backupFileExtension = "backup"; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/sysconfig/user.nix b/dotfiles/nixos/desktop/sysconfig/user.nix new file mode 100644 index 00000000..2ec3988d --- /dev/null +++ b/dotfiles/nixos/desktop/sysconfig/user.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: { + # Enable passwordless sudo + security.sudo = { + enable = true; + extraRules = [{ + commands = [ + { + command = "ALL"; + options = [ "NOPASSWD" ]; + } + ]; + groups = [ "wheel" ]; + }]; + }; + + # Configure user + programs.zsh.enable = true; + users.users.joey = { + isNormalUser = true; + shell = pkgs.zsh; + description = "joey"; + extraGroups = [ "networkmanager" "wheel" ]; + openssh.authorizedKeys.keys = let + authorizedKeys = pkgs.fetchurl { + url = "https://github.com/Jafner.keys"; + sha256 = "1i3Vs6mPPl965g3sRmbXGzx6zQBs5geBCgNx2zfpjF4="; + }; + in pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys); + }; +} \ No newline at end of file diff --git a/dotfiles/nixos/desktop/addons/ydotool.nix b/dotfiles/nixos/desktop/sysconfig/ydotool.nix similarity index 100% rename from dotfiles/nixos/desktop/addons/ydotool.nix rename to dotfiles/nixos/desktop/sysconfig/ydotool.nix diff --git a/dotfiles/nixos/installer/configuration.nix b/dotfiles/nixos/installer/configuration.nix new file mode 100644 index 00000000..e69de29b diff --git a/dotfiles/pubkeys/gpg/joey.desktop@jafner.net.pub b/dotfiles/pubkeys/gpg/joey.desktop@jafner.net.pub new file mode 100644 index 00000000..e69de29b diff --git a/dotfiles/pubkeys/ssh/joey.desktop@jafner.net.pub b/dotfiles/pubkeys/ssh/joey.desktop@jafner.net.pub new file mode 100644 index 00000000..23aec444 --- /dev/null +++ b/dotfiles/pubkeys/ssh/joey.desktop@jafner.net.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMbzncsWNWxoDSqeva/ZoGHv32A0ggUMWfzx2Gz6Kmkk joey.desktop@jafner.net \ No newline at end of file