commit ed7a59b56d7ba32c198d62e3aeee26efa6120e06 Author: jeirmeister Date: Tue Oct 29 23:11:22 2024 -0700 Added basic configurations, imported repo2txt as custom package diff --git a/.-dump.txt b/.-dump.txt new file mode 100644 index 0000000..8d452f4 --- /dev/null +++ b/.-dump.txt @@ -0,0 +1,617 @@ + ++--------------------------------------------+ +| Dump tree for directory: . | ++--------------------------------------------+ +├── home.nix +├── hosts +│ └── steamdeck +│ ├── configuration.nix +│ └── hardware-configuration.nix +└── users + └── jeirmeister + ├── packages + │ ├── default.nix + │ └── repo2txt.nix + └── programs + ├── appimage.nix + ├── default.nix + ├── git.nix + ├── gpg.nix + ├── obsidian.nix + ├── ssh.nix + ├── sublime.nix + ├── tailscale.nix + ├── tmux.nix + ├── vr.nix + ├── vscode.nix + └── zsh.nix + + + +--- Path: ./home.nix --- + +# home.nix +{ config, pkgs, ... }: +let + customPackages = import ./users/jeirmeister/packages { inherit pkgs; }; +in +{ + imports = [ + ./users/jeirmeister/programs + ]; + + home = { + username = "jeirmeister"; + homeDirectory = "/home/jeirmeister"; + stateVersion = "24.05"; + + packages = with pkgs; [ + htop + fortune + ripgrep + fd + jq + tree + xclip + bitwarden-desktop + floorp + bitwarden-cli + immersed + nix-prefetch-git + customPackages.repo2txt + + ]; + }; + + programs.home-manager.enable = true; + + nixpkgs = { + config = { + allowUnfree = true; + permittedInsecurePackages = [ + "openssl-1.1.1w" + ]; + }; + }; +} + + + +--- Path: ./hosts/steamdeck/configuration.nix --- + +{ config, pkgs, lib, ... }: + +let + jovianNixosRev = "f6423d86bec22c25a576b23262495c5536b0d069"; + jovianNixos = builtins.fetchTarball { + url = "https://github.com/Jovian-Experiments/Jovian-NixOS/archive/${jovianNixosRev}.tar.gz"; + sha256 = "sha256:1frd1dfqd97idwf1rj29ab0wvyfa2nx2h3bp9hkbmfa1m802avmb"; + }; +in +{ + imports = [ + ./hardware-configuration.nix + (jovianNixos + "/modules") + ]; + + nixpkgs.overlays = [ + (import (jovianNixos + "/overlay.nix")) + ]; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + substituters = [ + "https://cache.nixos.org" + ]; + allowed-users = [ "@wheel" "jeirmeister" ]; + auto-optimise-store = true; + }; + + # Hardware detection + jovian.hardware.has.amd.gpu = true; + + # Steam Deck Configuration + jovian = { + devices.steamdeck = { + enable = true; + + # Hardware features + enableControllerUdevRules = true; + enableDefaultStage1Modules = true; + enablePerfControlUdevRules = true; + enableOsFanControl = true; + enableSoundSupport = true; + enableXorgRotation = true; + enableKernelPatches = true; + + # Disable firmware updates temporarily + enableFwupdBiosUpdates = false; + autoUpdate = false; + }; + + # Steam Deck UI - disabled for now + steam.enable = false; + + # Enable workarounds + workarounds.ignoreMissingKernelModules = true; + }; + + # Add explicit permissions for fan control + services.udev.extraRules = '' + # Steam Deck Fan Control + SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/pwm1" + SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/fan1_input" + ''; + + # Modify the fan control service + systemd.services.jupiter-fan-control = { + path = [ pkgs.dmidecode ]; + serviceConfig = lib.mkForce { + Environment = "PYTHONUNBUFFERED=1"; + StandardOutput = "journal"; + StandardError = "journal"; + ExecStart = "${pkgs.jupiter-fan-control}/share/jupiter-fan-control/fancontrol.py --run"; + ExecStopPost = "${pkgs.jupiter-fan-control}/share/jupiter-fan-control/fancontrol.py --stop"; + OOMScoreAdjust = -1000; + Restart = "on-failure"; + }; + }; + + # Hardware configuration + hardware = { + enableRedistributableFirmware = lib.mkForce true; + firmware = lib.mkForce [ pkgs.linux-firmware ]; + + graphics = { + enable = true; + enable32Bit = true; + }; + }; + + # Boot configuration + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + + initrd.kernelModules = [ "amdgpu" ]; + kernelModules = [ "amdgpu" ]; + }; + + # Network configuration + networking = { + hostName = "nixos"; + networkmanager.enable = true; + }; + + # Time and Locale + 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"; + }; + + # Display and Desktop + services = { + xserver = { + enable = true; + xkb = { + layout = "us"; + variant = ""; + }; + }; + desktopManager.plasma6.enable = true; + displayManager.sddm.enable = true; + + # Important system services + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + openssh = { + enable = true; + settings = { + PasswordAuthentication = true; + AllowUsers = [ "jeirmeister" ]; + }; + }; + }; + + # User configuration + users.users.jeirmeister = { + isNormalUser = true; + description = "jeirmeister"; + extraGroups = [ + "networkmanager" + "wheel" + "input" + "video" + "audio" + "render" + "gamepad" + ]; + packages = with pkgs; [ + kdePackages.kate + tailscale + ]; + }; + + users.groups = { + gamepad = {}; + render = {}; + }; + + programs.firefox.enable = true; + nixpkgs.config.allowUnfree = true; + services.tailscale.enable = true; + # System packages + environment.systemPackages = with pkgs; [ + # Debugging tools + pciutils + usbutils + lm_sensors + dmidecode + + # Basic utilities + tree + git + wget + curl + binutils + ]; + + system.stateVersion = "24.05"; +} + + + +--- Path: ./hosts/steamdeck/hardware-configuration.nix --- + +# 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" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f3cc4aae-428e-435d-b9f7-333f7dad06b2"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/580E-5E90"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # 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.enp4s0f3u1u4u4.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} + + + +--- Path: ./users/jeirmeister/packages/default.nix --- + +# users/jeirmeister/packages/default.nix +{ pkgs }: + +{ + repo2txt = pkgs.callPackage ./repo2txt.nix {}; +} + + + +--- Path: ./users/jeirmeister/packages/repo2txt.nix --- + +# users/jeirmeister/packages/repo2txt.nix +{ pkgs }: + +let + pythonEnv = pkgs.python3.withPackages (ps: with ps; [ + # Add any future dependencies here if needed + ]); +in +pkgs.stdenv.mkDerivation { + pname = "repo2txt"; + version = "0.1.0"; + + src = pkgs.fetchFromGitHub { + owner = "pde-rent"; + repo = "repo2txt"; + rev = "2024b0eebebf739136401dc2f2df096be828558c"; + hash = "sha256-80T28lXkk8hl/chzIy3Wvs1Jbs/rspxlnvWKa2DwJnU="; + }; + + buildInputs = [ pythonEnv ]; + + installPhase = '' + mkdir -p $out/bin + cp main.py $out/bin/repo2txt + chmod +x $out/bin/repo2txt + # Ensure it uses python interpreter + sed -i "1i#!${pythonEnv}/bin/python" $out/bin/repo2txt + ''; + + meta = with pkgs.lib; { + description = "Tool to dump a repository into a single text file"; + homepage = "https://github.com/pde-rent/repo2txt"; + license = licenses.mit; + maintainers = []; + }; +} + + +--- Path: ./users/jeirmeister/programs/appimage.nix --- + +# users/jeirmeister/programs/appimage.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + # Required for AppImage support + appimage-run + + # Optional but useful tools for AppImage management + zlib + fuse + fuse3 + ]; +} + + +--- Path: ./users/jeirmeister/programs/default.nix --- + +# users/jeirmeister/programs/default.nix +{ config, pkgs, ... }: + +{ + imports = [ + ./appimage.nix + ./git.nix + ./gpg.nix + ./obsidian.nix + ./ssh.nix + ./sublime.nix + ./tailscale.nix + ./tmux.nix + ./vscode.nix + ./zsh.nix + ]; +} + + + +--- Path: ./users/jeirmeister/programs/git.nix --- + +# users/jeirmeister/programs/git.nix +{ config, pkgs, ... }: + +{ + programs.git = { + enable = true; + lfs.enable = true; + userName = "jeirmeister"; + userEmail = "jeir@jeirslab.xyz"; + extraConfig = { + init.defaultBranch = "main"; + pull.rebase = false; + }; + ignores = [ + ".DS_Store" + "*.swp" + ".vscode/" + ".idea/" + ]; + }; +} + + + +--- Path: ./users/jeirmeister/programs/gpg.nix --- + +# users/jeirmeister/programs/gpg.nix +{ config, pkgs, ... }: + +{ + programs.gpg = { + enable = true; + # settings = { + # # Basic GPG settings + # default-key = "jeir@jeirslab.xyz"; # Replace with your key ID + # keyserver = "hkps://keys.openpgp.org"; + # }; + }; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + # pinentryPackage = "curses"; # You can use "gtk2", "curses", or "tty" instead + }; + + # Make sure we have the tools we need + home.packages = with pkgs; [ + gnupg + pinentry-qt # Change this based on your pinentryFlavor + ]; +} + + + +--- Path: ./users/jeirmeister/programs/obsidian.nix --- + +# users/jeirmeister/programs/obsidian.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + obsidian + ]; +} + + + +--- Path: ./users/jeirmeister/programs/ssh.nix --- + +# users/jeirmeister/programs/ssh.nix +{ config, pkgs, ... }: + +{ + programs.ssh = { + enable = true; + # Add your SSH configurations here + # matchBlocks = { + # "github.com" = { + # hostname = "github.com"; + # user = "git"; + # identityFile = "~/.ssh/github"; + # }; + # }; + }; +} + + + +--- Path: ./users/jeirmeister/programs/sublime.nix --- + +# users/jeirmeister/programs/sublime.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + sublime4 + ]; +} + + + +--- Path: ./users/jeirmeister/programs/tailscale.nix --- + +# users/jeirmeister/programs/tailscale.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + tailscale + ]; +} + + + +--- Path: ./users/jeirmeister/programs/tmux.nix --- + +# users/jeirmeister/programs/tmux.nix +{ config, pkgs, ... }: + +{ + programs.tmux = { + enable = true; + clock24 = true; + # Add your tmux configurations here + }; +} + + + +--- Path: ./users/jeirmeister/programs/vr.nix --- + +{ config, pkgs, ... }: + +{ + programs.immersed.enable = true; +} + + + +--- Path: ./users/jeirmeister/programs/vscode.nix --- + +# users/jeirmeister/programs/vscode.nix +{ config, pkgs, ... }: + +{ + programs.vscode = { + enable = true; + package = pkgs.vscode; + + # Uncomment when you know which extensions you want + # extensions = with pkgs.vscode-extensions; [ + # vscodevim.vim + # yzhang.markdown-all-in-one + # bbenoist.nix + # ms-python.python + # ]; + + userSettings = { + "editor.fontSize" = 14; + "editor.fontFamily" = "FiraCode Nerd Font"; + "editor.formatOnSave" = true; + "files.autoSave" = "onFocusChange"; + }; + }; +} + + + +--- Path: ./users/jeirmeister/programs/zsh.nix --- + +# users/jeirmeister/programs/zsh.nix +{ config, pkgs, ... }: + +{ + programs.zsh = { + enable = true; + autosuggestion.enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + oh-my-zsh = { + enable = true; + theme = "robbyrussell"; + plugins = [ "git" "docker" "kubectl" ]; + }; + + # Add this section to ensure home-manager paths are properly sourced + initExtra = '' + # Add home-manager applications to PATH + export PATH=$HOME/.nix-profile/bin:$PATH + + # Ensure XDG directories are set + export XDG_DATA_HOME=$HOME/.local/share + export XDG_CONFIG_HOME=$HOME/.config + export XDG_CACHE_HOME=$HOME/.cache + ''; + }; + + # Make zsh the default shell + home.sessionVariables = { + SHELL = "${pkgs.zsh}/bin/zsh"; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..9f217cd --- /dev/null +++ b/home.nix @@ -0,0 +1,66 @@ +# home.nix +{ config, pkgs, ... }: +let + customPackages = import ./users/jeirmeister/packages { inherit pkgs; }; +in +{ + imports = [ + ./users/jeirmeister/programs + ]; + + home = { + username = "jeirmeister"; + homeDirectory = "/home/jeirmeister"; + stateVersion = "24.05"; + + packages = with pkgs; [ + htop + fortune + ripgrep + fd + jq + tree + xclip + bitwarden-desktop + floorp + bitwarden-cli + immersed + nix-prefetch-git + customPackages.repo2txt + # Development tools + nodejs + yarn + python3 + gcc + rustup + + # System tools + btop # Better top + neofetch + bat # Better cat + fzf # Fuzzy finder + + # Network tools + mtr + iperf3 + nmap + + # File management + unzip + p7zip + file + + ]; + }; + + programs.home-manager.enable = true; + + nixpkgs = { + config = { + allowUnfree = true; + permittedInsecurePackages = [ + "openssl-1.1.1w" + ]; + }; + }; +} diff --git a/hosts/steamdeck/configuration.nix b/hosts/steamdeck/configuration.nix new file mode 100644 index 0000000..40e3473 --- /dev/null +++ b/hosts/steamdeck/configuration.nix @@ -0,0 +1,192 @@ +{ config, pkgs, lib, ... }: + +let + jovianNixosRev = "f6423d86bec22c25a576b23262495c5536b0d069"; + jovianNixos = builtins.fetchTarball { + url = "https://github.com/Jovian-Experiments/Jovian-NixOS/archive/${jovianNixosRev}.tar.gz"; + sha256 = "sha256:1frd1dfqd97idwf1rj29ab0wvyfa2nx2h3bp9hkbmfa1m802avmb"; + }; +in +{ + imports = [ + ./hardware-configuration.nix + (jovianNixos + "/modules") + ]; + + nixpkgs.overlays = [ + (import (jovianNixos + "/overlay.nix")) + ]; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + substituters = [ + "https://cache.nixos.org" + ]; + allowed-users = [ "@wheel" "jeirmeister" ]; + auto-optimise-store = true; + }; + + # Hardware detection + jovian.hardware.has.amd.gpu = true; + + # Steam Deck Configuration + jovian = { + devices.steamdeck = { + enable = true; + + # Hardware features + enableControllerUdevRules = true; + enableDefaultStage1Modules = true; + enablePerfControlUdevRules = true; + enableOsFanControl = true; + enableSoundSupport = true; + enableXorgRotation = true; + enableKernelPatches = true; + + # Disable firmware updates temporarily + enableFwupdBiosUpdates = false; + autoUpdate = false; + }; + + # Steam Deck UI - disabled for now + steam.enable = false; + + # Enable workarounds + workarounds.ignoreMissingKernelModules = true; + }; + + # Add explicit permissions for fan control + services.udev.extraRules = '' + # Steam Deck Fan Control + SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/pwm1" + SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/fan1_input" + ''; + + # Modify the fan control service + systemd.services.jupiter-fan-control = { + path = [ pkgs.dmidecode ]; + serviceConfig = lib.mkForce { + Environment = "PYTHONUNBUFFERED=1"; + StandardOutput = "journal"; + StandardError = "journal"; + ExecStart = "${pkgs.jupiter-fan-control}/share/jupiter-fan-control/fancontrol.py --run"; + ExecStopPost = "${pkgs.jupiter-fan-control}/share/jupiter-fan-control/fancontrol.py --stop"; + OOMScoreAdjust = -1000; + Restart = "on-failure"; + }; + }; + + # Hardware configuration + hardware = { + enableRedistributableFirmware = lib.mkForce true; + firmware = lib.mkForce [ pkgs.linux-firmware ]; + + graphics = { + enable = true; + enable32Bit = true; + }; + }; + + # Boot configuration + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + + initrd.kernelModules = [ "amdgpu" ]; + kernelModules = [ "amdgpu" ]; + }; + + # Network configuration + networking = { + hostName = "nixos"; + networkmanager.enable = true; + }; + + # Time and Locale + 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"; + }; + + # Display and Desktop + services = { + xserver = { + enable = true; + xkb = { + layout = "us"; + variant = ""; + }; + }; + desktopManager.plasma6.enable = true; + displayManager.sddm.enable = true; + + # Important system services + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + openssh = { + enable = true; + settings = { + PasswordAuthentication = true; + AllowUsers = [ "jeirmeister" ]; + }; + }; + }; + + # User configuration + users.users.jeirmeister = { + isNormalUser = true; + description = "jeirmeister"; + extraGroups = [ + "networkmanager" + "wheel" + "input" + "video" + "audio" + "render" + "gamepad" + ]; + packages = with pkgs; [ + kdePackages.kate + tailscale + ]; + }; + + users.groups = { + gamepad = {}; + render = {}; + }; + + programs.firefox.enable = true; + nixpkgs.config.allowUnfree = true; + services.tailscale.enable = true; + # System packages + environment.systemPackages = with pkgs; [ + # Debugging tools + pciutils + usbutils + lm_sensors + dmidecode + + # Basic utilities + tree + git + wget + curl + binutils + ]; + + system.stateVersion = "24.05"; +} diff --git a/hosts/steamdeck/hardware-configuration.nix b/hosts/steamdeck/hardware-configuration.nix new file mode 100644 index 0000000..193d83c --- /dev/null +++ b/hosts/steamdeck/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f3cc4aae-428e-435d-b9f7-333f7dad06b2"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/580E-5E90"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # 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.enp4s0f3u1u4u4.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/users/jeirmeister/packages/default.nix b/users/jeirmeister/packages/default.nix new file mode 100644 index 0000000..cddab9c --- /dev/null +++ b/users/jeirmeister/packages/default.nix @@ -0,0 +1,6 @@ +# users/jeirmeister/packages/default.nix +{ pkgs }: + +{ + repo2txt = pkgs.callPackage ./repo2txt.nix {}; +} diff --git a/users/jeirmeister/packages/repo2txt.nix b/users/jeirmeister/packages/repo2txt.nix new file mode 100644 index 0000000..d406ad4 --- /dev/null +++ b/users/jeirmeister/packages/repo2txt.nix @@ -0,0 +1,24 @@ +# users/jeirmeister/packages/repo2txt.nix +{ pkgs }: + +pkgs.python3Packages.buildPythonPackage rec { + pname = "repo2txt"; + version = "1.0.3"; # Check PyPI for latest version + format = "pyproject"; + + src = pkgs.python3Packages.fetchPypi { + inherit pname version; + hash = "sha256-t62YxDNb7xWCpR70QeVHjkWLAXZ2bHxiPtYbz2jnSjE="; # You might need to update this + }; + + # Add any runtime dependencies if needed in the future + propagatedBuildInputs = with pkgs.python3Packages; [ ]; + + pythonImportsCheck = [ "repo2txt" ]; + + meta = with pkgs.lib; { + description = "Tool to dump repository contents into a single text file"; + homepage = "https://pypi.org/project/repo2txt/"; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/appimage.nix b/users/jeirmeister/programs/appimage.nix new file mode 100644 index 0000000..ae729bf --- /dev/null +++ b/users/jeirmeister/programs/appimage.nix @@ -0,0 +1,14 @@ +# users/jeirmeister/programs/appimage.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + # Required for AppImage support + appimage-run + + # Optional but useful tools for AppImage management + zlib + fuse + fuse3 + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/default.nix b/users/jeirmeister/programs/default.nix new file mode 100644 index 0000000..e2be420 --- /dev/null +++ b/users/jeirmeister/programs/default.nix @@ -0,0 +1,18 @@ +# users/jeirmeister/programs/default.nix +{ config, pkgs, ... }: + +{ + imports = [ + ./appimage.nix + ./direnv.nix + ./git.nix + ./gpg.nix + ./obsidian.nix + ./ssh.nix + ./sublime.nix + ./tailscale.nix + ./tmux.nix + ./vscode.nix + ./zsh.nix + ]; +} diff --git a/users/jeirmeister/programs/direnv.nix b/users/jeirmeister/programs/direnv.nix new file mode 100644 index 0000000..b5b324a --- /dev/null +++ b/users/jeirmeister/programs/direnv.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + programs.direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/git.nix b/users/jeirmeister/programs/git.nix new file mode 100644 index 0000000..765668c --- /dev/null +++ b/users/jeirmeister/programs/git.nix @@ -0,0 +1,21 @@ +# users/jeirmeister/programs/git.nix +{ config, pkgs, ... }: + +{ + programs.git = { + enable = true; + lfs.enable = true; + userName = "jeirmeister"; + userEmail = "jeir@jeirslab.xyz"; + extraConfig = { + init.defaultBranch = "main"; + pull.rebase = false; + }; + ignores = [ + ".DS_Store" + "*.swp" + ".vscode/" + ".idea/" + ]; + }; +} diff --git a/users/jeirmeister/programs/gpg.nix b/users/jeirmeister/programs/gpg.nix new file mode 100644 index 0000000..73a8604 --- /dev/null +++ b/users/jeirmeister/programs/gpg.nix @@ -0,0 +1,51 @@ +# users/jeirmeister/programs/gpg.nix +{ config, pkgs, ... }: + +{ + programs.gpg = { + enable = true; + settings = { + keyserver = "hkps://keys.openpgp.org"; + # Trust model settings + trust-model = "tofu+pgp"; + tofu-default-policy = "auto"; + # Better key discovery + keyserver-options = "auto-key-retrieve"; + # Modern cipher preferences + personal-cipher-preferences = "AES256 AES192 AES"; + personal-digest-preferences = "SHA512 SHA384 SHA256"; + personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed"; + # Default key preferences + default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed"; + }; + # If you have specific public keys to trust, add them here + publicKeys = [ + # Example: + # { + # source = ./path/to/key.pub; + # trust = "ultimate"; + # } + ]; + }; + + services.gpg-agent = { + enable = true; + enableSshSupport = true; + defaultCacheTtl = 1800; + maxCacheTtl = 7200; + # For KDE/Plasma, use pinentry-qt + pinentryPackage = "qt"; + extraConfig = '' + allow-preset-passphrase + allow-loopback-pinentry + ''; + }; + + # Make sure we have the right packages + home.packages = with pkgs; [ + gnupg + pinentry-qt + paperkey # Backup GPG keys on paper + pgpdump # Analyze PGP/GPG keys and packets + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/obsidian.nix b/users/jeirmeister/programs/obsidian.nix new file mode 100644 index 0000000..6d530f0 --- /dev/null +++ b/users/jeirmeister/programs/obsidian.nix @@ -0,0 +1,8 @@ +# users/jeirmeister/programs/obsidian.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + obsidian + ]; +} diff --git a/users/jeirmeister/programs/ssh.nix b/users/jeirmeister/programs/ssh.nix new file mode 100644 index 0000000..3d31bd1 --- /dev/null +++ b/users/jeirmeister/programs/ssh.nix @@ -0,0 +1,38 @@ +# users/jeirmeister/programs/ssh.nix +{ config, pkgs, ... }: + +{ + programs.ssh = { + enable = true; + + extraConfig = '' + AddKeysToAgent yes + UseKeychain yes + IdentitiesOnly yes + HashKnownHosts yes + ''; + + # For better security + serverAliveInterval = 60; + serverAliveCountMax = 2; + + # Manage known hosts + userKnownHostsFile = "~/.ssh/known_hosts"; + + # Example host configurations + matchBlocks = { + "github.com" = { + hostname = "github.com"; + user = "git"; + identityFile = "~/.ssh/github"; + extraOptions = { + PreferredAuthentications = "publickey"; + }; + }; + "*" = { + compression = true; + serverAliveInterval = 60; + }; + }; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/sublime.nix b/users/jeirmeister/programs/sublime.nix new file mode 100644 index 0000000..3d066b0 --- /dev/null +++ b/users/jeirmeister/programs/sublime.nix @@ -0,0 +1,8 @@ +# users/jeirmeister/programs/sublime.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + sublime4 + ]; +} diff --git a/users/jeirmeister/programs/tailscale.nix b/users/jeirmeister/programs/tailscale.nix new file mode 100644 index 0000000..4e6da80 --- /dev/null +++ b/users/jeirmeister/programs/tailscale.nix @@ -0,0 +1,8 @@ +# users/jeirmeister/programs/tailscale.nix +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + tailscale + ]; +} diff --git a/users/jeirmeister/programs/tmux.nix b/users/jeirmeister/programs/tmux.nix new file mode 100644 index 0000000..94c1076 --- /dev/null +++ b/users/jeirmeister/programs/tmux.nix @@ -0,0 +1,10 @@ +# users/jeirmeister/programs/tmux.nix +{ config, pkgs, ... }: + +{ + programs.tmux = { + enable = true; + clock24 = true; + # Add your tmux configurations here + }; +} diff --git a/users/jeirmeister/programs/vr.nix b/users/jeirmeister/programs/vr.nix new file mode 100644 index 0000000..90a4b68 --- /dev/null +++ b/users/jeirmeister/programs/vr.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + programs.immersed.enable = true; +} diff --git a/users/jeirmeister/programs/vscode.nix b/users/jeirmeister/programs/vscode.nix new file mode 100644 index 0000000..2dd6955 --- /dev/null +++ b/users/jeirmeister/programs/vscode.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: +{ + programs.vscode = { + extensions = with pkgs.vscode-extensions; [ + # Essential + vscodevim.vim + ms-vsliveshare.vsliveshare + github.copilot + + # Languages + bbenoist.nix + ms-python.python + rust-lang.rust-analyzer + + # Tools + eamodio.gitlens + ms-azuretools.vscode-docker + + # Theme & UI + pkief.material-icon-theme + dracula-theme.theme-dracula + ]; + + userSettings = { + "editor.fontSize" = 14; + "editor.fontFamily" = "FiraCode Nerd Font"; + "editor.formatOnSave" = true; + "files.autoSave" = "onFocusChange"; + "workbench.colorTheme" = "Dracula"; + "editor.minimap.enabled" = false; + "editor.rulers" = [ 80 120 ]; + "files.trimTrailingWhitespace" = true; + "editor.bracketPairColorization.enabled" = true; + }; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/zsh.nix b/users/jeirmeister/programs/zsh.nix new file mode 100644 index 0000000..9f46205 --- /dev/null +++ b/users/jeirmeister/programs/zsh.nix @@ -0,0 +1,33 @@ +# users/jeirmeister/programs/zsh.nix +{ config, pkgs, ... }: + +{ + programs.zsh = { + enable = true; + autosuggestion.enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + oh-my-zsh = { + enable = true; + theme = "robbyrussell"; + plugins = [ "git" "docker" "kubectl" ]; + }; + + # Add this section to ensure home-manager paths are properly sourced + initExtra = '' + # Add home-manager applications to PATH + export PATH=$HOME/.nix-profile/bin:$PATH + + # Ensure XDG directories are set + export XDG_DATA_HOME=$HOME/.local/share + export XDG_CONFIG_HOME=$HOME/.config + export XDG_CACHE_HOME=$HOME/.cache + ''; + }; + + # Make zsh the default shell + home.sessionVariables = { + SHELL = "${pkgs.zsh}/bin/zsh"; + }; +} \ No newline at end of file