diff --git a/boxes/desktop/configuration.nix b/boxes/desktop/configuration.nix index 5283a06..3e0aeb7 100644 --- a/boxes/desktop/configuration.nix +++ b/boxes/desktop/configuration.nix @@ -9,6 +9,7 @@ # Include the results of the hardware scan. ./hardware-configuration.nix ../../common/systemModules/boot.nix + ../../common/systemModules/kernel.nix ../../common/systemModules/audio.nix ../../common/systemModules/kde.nix ../../common/systemModules/tailscale.nix @@ -44,11 +45,11 @@ environment.systemPackages = with pkgs; [ + ddcutil clinfo + i2c-tools fuse ifuse - ddcutil - i2c-tools gcc neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. curl diff --git a/boxes/wsl/configuration.nix b/boxes/wsl/configuration.nix index e2785b1..54e7db7 100644 --- a/boxes/wsl/configuration.nix +++ b/boxes/wsl/configuration.nix @@ -7,131 +7,74 @@ { imports = [ - inputs.sops-nix.nixosModules.sops + ../../common/users/meyer-wsl + ../../common/systemModules/wsl.nix + ../../common/systemModules/kernel.nix + ../../common/systemModules/crypt.nix + ../../common/systemModules/stylix.nix ]; - sops.defaultSopsFile = ../../secrets.yaml; - sops.defaultSopsFormat = "yaml"; - sops.age.keyFile = "/home/meyer/.config/sops/age/keys.txt"; - sops.secrets.password.neededForUsers = true; - wsl.enable = true; - wsl.defaultUser = "meyer"; - # Use the systemd-boot EFI boot loader. - users.users.meyer = { - isNormalUser = true; - hashedPasswordFile = config.sops.secrets.password.path; - extraGroups = [ - "wheel" # Enable ‘sudo’ for the user. - "input" - "tty" - ]; - shell = pkgs.zsh; - }; - home-manager = { - extraSpecialArgs = { inherit inputs; }; - users = { - "meyer" = import ./home.nix; - }; - }; - boot.kernelPackages = pkgs.linuxPackages_zen; - hardware.i2c.enable = true; - networking.hostName = "nix-wsl"; # Define your hostname. + hardware.i2c.enable = true; + + networking.hostName = "arm-laptop-evo4b5"; # Define your hostname. + + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Set your time zone. time.timeZone = "America/New_York"; - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - # }; - # Enable the X11 windowing system. - # servives.desktopManager.plasma6.enable = true; - # services.desktopManager.plasma6.enable = true; - - - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - # Enable sound. - # hardware.pulseaudio.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - - - programs.zsh.enable = true; - nixpkgs.config.allowUnfree = true; - # networking.nameservers = ["10.0.0.97" "1.1.1.1"]; - networking.nameservers = [ "10.0.0.97" ]; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ ddcutil i2c-tools - # python311 - # python311Packages.evdev - # python311Packages.xlib + fuse gcc neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. curl wget - git ripgrep tldr - gnupg - openssh - pinentry-curses - pinentry libnotify file ]; #LD fix programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ - pkgs.curlWithGnuTls + libGL + alsa-lib + expat + mesa + libxkbcommon + xorg.libxcb + xorg.libXrandr + xorg.libXfixes + xorg.libXext + xorg.libXdamage + xorg.libXcomposite + xorg.libX11 + cairo + pango + gtk3 + libdrm + cups + at-spi2-atk + lzo + dbus + nspr + nss + glib + curlWithGnuTls + fuse + fuse3 + mimalloc + libstdcxx5 ]; programs.ssh.startAgent = true; # programs.ssh.askPassword = pkgs.lib.mkForce "${pkgs.ksshaskpass.out}/bin/ksshaskpass"; - programs.gnupg.agent = { - enable = true; - }; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # diff --git a/boxes/wsl/home.nix b/boxes/wsl/home.nix deleted file mode 100644 index 81153fa..0000000 --- a/boxes/wsl/home.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - _s1 = import ../../common/sops.nix {inherit config; }; - files = import ../../common/files.nix { inherit config; }; - shell = import ../../common/shell.nix { inherit config pkgs; }; - p = import ../../common/pkgs.nix { inherit pkgs config; }; - _p1 = p.dev ++ p.general ++ p.scripts ++ p.wsl; - zshInitArgs = [ - "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme" - "source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" - "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" - "setopt globstarshort" - ]; - _z1 = lib.concatMapStrings (x: x + "\n") zshInitArgs; - -in -{ -imports = [ - inputs.sops-nix.homeManagerModules.sops -]; -sops = _s1; - programs.zsh.enable = true; - programs.zsh.oh-my-zsh.enable = true; - programs.zsh.initExtra = builtins.trace _z1 _z1; - programs.java.enable = true; - programs.java.package = pkgs.temurin-bin-17; - programs.zoxide.enable = true; - programs.zoxide.enableZshIntegration = true; - programs.git.enable = true; - programs.git.userName = "sadan"; - programs.git.userEmail = "117494111+sadan4@users.noreply.github.com"; - programs.git.extraConfig = { - gpg.format = "ssh"; - user = { - signingkey = "~/.ssh/id_ed25519"; - }; - commit.gpgsign = true; - core.autocrlf = "input"; - pull.rebase = true; - push.autoSetupRemote = true; - init.defaultBranch = "main"; - rerere.enabled = true; - }; - - nixpkgs.config.allowUnfreePredicate = (pkg: true); - # Home Manager needs a bit of information about you and the paths it should - # nixpkg.config.allowUnfree = true; - # manage. - home.username = "meyer"; - home.homeDirectory = "/home/meyer"; - - - services = { - flameshot = { - enable = true; - settings.General.showDesktopNotification = false; - settings.General.startupLaunch = false; - # settings.Shortcuts.TYPE_IMAGEUPLOADER = ""; - # settings.Shortcuts.TYPE_COPY = "Return"; - }; - }; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = _p1; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = files; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/meyer/etc/profile.d/hm-session-vars.sh - # - home.shellAliases = shell.dev.aliases; - home.sessionPath = shell.dev.path; - home.sessionVariables = shell.dev.env; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/common/files.nix b/common/files.nix deleted file mode 100644 index 91e3f11..0000000 --- a/common/files.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - config, - cpkg, -}: -let -in -{ - lazygit = { - recursive = true; - source = ../dotfiles/lazygit; - target = "./.config/lazygit"; - }; - kitty = { - recursive = true; - source = ../dotfiles/kitty; - target = "./.config/kitty"; - }; - eslint_d_config = { - source = ../dotfiles/eslintrc.json; - target = "./.config/.eslintrc.json"; - }; - gh = { - source = ../dotfiles/gh/config.yml; - target = "./.config/gh/config.yml"; - }; - btop = { - recursive = true; - source = ../dotfiles/btop; - target = "./.config/btop"; - }; - nvim = { - recursive = true; - source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/nvim"; - target = "./.config/nvim"; - }; - p10k = { - recursive = true; - source = ../dotfiles/.p10k.zsh; - target = ".p10k.zsh"; - }; - rofi = { - recursive = true; - source = ../dotfiles/rofi; - target = "./.config/rofi"; - }; - scripts = { - source = "${cpkg.scripts}"; - target = ".scripts"; - }; - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; -} diff --git a/common/pkgs.nix b/common/pkgs.nix deleted file mode 100644 index 72e7970..0000000 --- a/common/pkgs.nix +++ /dev/null @@ -1,211 +0,0 @@ -{ - pkgs, - config, - inputs, - cpkg, -}: -let - pinned = import ./pinned.nix { inherit pkgs config; }; -in -{ - dev = with pkgs; [ - meson - nixfmt-rfc-style - nil - deno - rustup - android-studio-tools - vscode-langservers-extracted - cmake - nodePackages_latest.typescript-language-server - lua - go - eslint_d - typescript - php - clang - gnumake - gradle - lazygit - linuxHeaders - eslint - nodePackages.nodemon - nodePackages.ts-node - nodePackages.pnpm - corepack_22 - prisma - prisma-engines - nodePackages.live-server - gh - glib - glibc - (python312.withPackages ( - ps: with ps; [ - pytesseract - pillow - pyzbar - pygobject3 - nanoid - loguru - evdev - setuptools - xlib - ] - )) - nodejs_22 - ]; - gui = with pkgs; [ - cpkg.frog - legcord - obsidian - bottles - parsec-bin - jadx - android-studio - wireshark - pinned.vscode - pinned.etcher - insomnia - teamviewer - davinci-resolve - warp-terminal - gnome.gnome-calculator - libsForQt5.kcolorchooser - python312Packages.openai-whisper - firefox-devedition - cinny-desktop - element-desktop - protonvpn-gui - xclicker - polychromatic - jellyfin-media-player - arrpc - filezilla - virt-manager - qemu_full - shotcut - pinta - gimp - inkscape - #OCR ENGINE - tesseract4 - (pkgs.discord.override { - withVencord = true; - }) - vesktop - xsel - spotify - pulseaudioFull - pavucontrol - # jetbrains.pycharm-community - jbeap.idea-ultimate - google-chrome - bitwarden - nerdfonts - # vscodium - kitty - rofi - thunderbird - vlc - jellyfin-web - obs-studio - tokyo-night-gtk - ksshaskpass - libsForQt5.kinit - ]; - general = with pkgs; [ - imagemagick - onefetch - p7zip - dig - bat - usbutils - tree - ffmpeg - yt-dlp - neofetch - sops - hyfetch - fzf - zsh-powerlevel10k - zsh-syntax-highlighting - jq - unzip - btop - ]; - gaming = with pkgs; [ - (prismlauncher.override { - jdks = [ - jdk8 - jdk17 - jdk22 - ]; - }) - protontricks - lutris - ]; - scripts = [ - (pkgs.writeShellScriptBin "hashi18n" '' - xsel -ob | node ${cpkg.scripts}/hash.js | tr -d '\n' | xsel -ib - '') - (pkgs.writeShellScriptBin "paste" '' - command -v xsel > /dev/null - if [[ $? -eq 0 ]]; then - xsel -ob && exit 0 - fi - command -v wslclip > /dev/null - if [[ $? -eq 0 ]]; then - wslclip -g && exit 0 - fi - '') - (pkgs.writeShellScriptBin "http2ssh" '' - set -eo pipefail - - if [[ -z $1 ]]; then - echo "You need to provide a remote name"; - echo "Avilable remotes"; - git remote -v; - exit 1; - fi - URL=''$(git remote get-url $1); - URL=''${URL/https:\/\//git@}; - URL=''${URL/\//:}; - git remote set-url $1 $URL; - '') - (pkgs.writeShellScriptBin "copy" '' - command -v xsel > /dev/null - if [[ $? -eq 0 ]]; then - xsel -ib $@ && exit 0 - fi - command -v wslclip > /dev/null - if [[ $? -eq 0 ]]; then - wslclip $@ && exit 0 - fi - - '') - (pkgs.writeShellScriptBin "git_fetchAll" '' - git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "''${remote#origin/}" "$remote"; done - git fetch --all - git pull --all - '') - (pkgs.writeShellScriptBin "install_eslint" '' - set -x - cp /home/${config.home.username}/.config/.eslintrc.json . - pkgs=("@stylistic/eslint-plugin" "@typescript-eslint/eslint-plugin") - if [[ -z $1 ]]; then - echo please specify npm, pnpm, or yarn - exit 1 - fi - for i in "''${pkgs[@]}"; do - `$1 i -D $i` - done - '') - (pkgs.writeShellScriptBin "math" '' - set -e - python3 -c "print($*)" - '') - ]; - wsl = with pkgs; [ - wslu - ]; -} diff --git a/common/services.nix b/common/services.nix deleted file mode 100644 index 4d1b1e0..0000000 --- a/common/services.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, config }: { - polychromatic = { - Unit = { - Description = "razer chroma applet/daemon"; - }; - Install = { - WantedBy = [ "default.target" ]; - }; - Service = { - ExecStart = "${pkgs.polychromatic}/bin/polychromatic-tray-applet"; - }; - }; -} diff --git a/common/shell.nix b/common/shell.nix deleted file mode 100644 index 4cd84d5..0000000 --- a/common/shell.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, pkgs, cpkg }: -rec { - dev = { - env = common.env // { - PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine"; - PRISMA_SCHEMA_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/schema-engine"; - PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node"; - }; - path = common.path ++ [ - - ]; - aliases = common.aliases // { - lg = "lazygit"; - sd = ''lsusb | grep Elgato | grep --perl-regexp "(?<=Device 0{0,10})[1-9]+" --only-matching | xargs printf "usb.device_address eq %s" | copy''; - }; - }; - common = { - env = { - LG_CONFIG_FILE = "/home/${config.home.username}/.config/lazygit/tokyonight_night.conf"; - BAT_THEME = "Dracula"; - EDITOR = "nvim"; - MANPAGER = "nvim +Man!"; - MADWIDTH = "999"; - SSH_ASKPASS_REQUIRE = "prefer"; - }; - path = [ - "$HOME/.local/bin" - ]; - aliases = { - # paste = "xsel -ob || wslclip -g"; - # copy = "xsel -ib || wslclip"; - b = "/home/${config.home.username}/nixos/build"; - }; - }; - -} diff --git a/common/systemModules/boot.nix b/common/systemModules/boot.nix index a435894..e4801fd 100644 --- a/common/systemModules/boot.nix +++ b/common/systemModules/boot.nix @@ -9,6 +9,5 @@ efiInstallAsRemovable = true; }; }; - kernelPackages = pkgs.linuxPackages_latest; }; } diff --git a/common/systemModules/kernel.nix b/common/systemModules/kernel.nix new file mode 100644 index 0000000..156ba1f --- /dev/null +++ b/common/systemModules/kernel.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + boot = { + kernelPackages = pkgs.linuxPackages_latest; + }; +} \ No newline at end of file diff --git a/common/systemModules/razer.nix b/common/systemModules/razer.nix index 71890e2..c90e08b 100644 --- a/common/systemModules/razer.nix +++ b/common/systemModules/razer.nix @@ -1,4 +1,8 @@ { NAME }: { ... }: { + + environment.systemPackages = with pkgs; [ + polychromatic + ]; hardware = { openrazer = { enable = true; diff --git a/common/systemModules/stylix.nix b/common/systemModules/stylix.nix index 64588e1..22ae607 100644 --- a/common/systemModules/stylix.nix +++ b/common/systemModules/stylix.nix @@ -3,6 +3,9 @@ imports = [ inputs.stylix.nixosModules.stylix ]; + environment.systemPackages = with pkgs; [ + nerdfonts + ]; stylix = { enable = true; image = ./wallpaper.jpg; diff --git a/common/systemModules/wsl.nix b/common/systemModules/wsl.nix new file mode 100644 index 0000000..084b5d6 --- /dev/null +++ b/common/systemModules/wsl.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + wsl = { + enable = true; + defaultUser = "meyer"; + } +} \ No newline at end of file diff --git a/common/users/homeModules/desktopEntries.nix b/common/users/homeModules/audio.nix similarity index 75% rename from common/users/homeModules/desktopEntries.nix rename to common/users/homeModules/audio.nix index f458bf9..c2b8e16 100644 --- a/common/users/homeModules/desktopEntries.nix +++ b/common/users/homeModules/audio.nix @@ -1,5 +1,11 @@ -{ ... }: -{ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + spotify + pulseaudioFull + pavucontrol + ]; + }; xdg = { desktopEntries = { spotifyOpen = { @@ -14,4 +20,4 @@ }; }; }; -} +} \ No newline at end of file diff --git a/common/users/homeModules/btop.nix b/common/users/homeModules/btop.nix new file mode 100644 index 0000000..e7b8725 --- /dev/null +++ b/common/users/homeModules/btop.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + btop + ]; + file = { + btop = { + recursive = true; + source = ../dotfiles/btop; + target = "./.config/btop"; + }; + } + } +} \ No newline at end of file diff --git a/common/users/homeModules/dev/cpp.nix b/common/users/homeModules/dev/cpp.nix new file mode 100644 index 0000000..7ce36f9 --- /dev/null +++ b/common/users/homeModules/dev/cpp.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + meson + cmake + clang + glib + glibc + llvmPackages_19.clang-tools + ]; + file = { + eslint_d_config = { + source = ../dotfiles/eslintrc.json; + target = "./.config/.eslintrc.json"; + }; + }; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/default.nix b/common/users/homeModules/dev/default.nix new file mode 100644 index 0000000..91f025f --- /dev/null +++ b/common/users/homeModules/dev/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + gnumake + linuxHeaders + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/go.nix b/common/users/homeModules/dev/go.nix new file mode 100644 index 0000000..a57693c --- /dev/null +++ b/common/users/homeModules/dev/go.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + go + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/ide/default.nix b/common/users/homeModules/dev/ide/default.nix new file mode 100644 index 0000000..6a0eadc --- /dev/null +++ b/common/users/homeModules/dev/ide/default.nix @@ -0,0 +1,12 @@ +{pkgs, config, ...}: +let + pinned = import ../pinned.nix { inherit pkgs config; }; +in { + home = { + packages = with pkgs; [ + pinned.vscode + # codium + zed-editor + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/ide/jb/default.nix b/common/users/homeModules/dev/ide/jb/default.nix new file mode 100644 index 0000000..e2021fb --- /dev/null +++ b/common/users/homeModules/dev/ide/jb/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./idea.nix + ]; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/ide/jb/idea.nix b/common/users/homeModules/dev/ide/jb/idea.nix new file mode 100644 index 0000000..356de72 --- /dev/null +++ b/common/users/homeModules/dev/ide/jb/idea.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + jetbrains.idea-ultimate + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/javascript.nix b/common/users/homeModules/dev/javascript.nix new file mode 100644 index 0000000..e5d31bf --- /dev/null +++ b/common/users/homeModules/dev/javascript.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + imports = [ + ../prisma.nix + ] + home = { + packages = with pkgs; [ + deno + eslint_d + vscode-langservers-extracted + nodePackages_latest.typescript-language-server + typescript + eslint + corepack_22 + nodejs_22 + ] ++ (with pkgs.nodePackages; [ + nodemon + ts-node + pnpm + live-server + ]); + } +} \ No newline at end of file diff --git a/common/users/homeModules/dev/jvm.nix b/common/users/homeModules/dev/jvm.nix new file mode 100644 index 0000000..5bccab8 --- /dev/null +++ b/common/users/homeModules/dev/jvm.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: { + home = { + packages = with pkgs; [ + android-studio-tools + gradle + jadx + android-studio + jetbrains.idea-ultimate + # jbeap.idea-ultimate + # jetbrains.pycharm-community + ]; + }; + programs = { + java = { + enable = true; + package = pkgs.temurin-bin-17; + }; + }; +} diff --git a/common/users/homeModules/dev/lua.nix b/common/users/homeModules/dev/lua.nix new file mode 100644 index 0000000..a2f3df3 --- /dev/null +++ b/common/users/homeModules/dev/lua.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + lua + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/nix.nix b/common/users/homeModules/dev/nix.nix new file mode 100644 index 0000000..41b19e5 --- /dev/null +++ b/common/users/homeModules/dev/nix.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + nixfmt-rfc-style + nil + ]; + } +} \ No newline at end of file diff --git a/common/users/homeModules/dev/php.nix b/common/users/homeModules/dev/php.nix new file mode 100644 index 0000000..d978395 --- /dev/null +++ b/common/users/homeModules/dev/php.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + php + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/python.nix b/common/users/homeModules/dev/python.nix new file mode 100644 index 0000000..bcaea78 --- /dev/null +++ b/common/users/homeModules/dev/python.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + (python312.withPackages ( + ps: with ps; [ + pytesseract + pillow + pyzbar + pygobject3 + nanoid + loguru + evdev + setuptools + xlib + ] + )) + python312Packages.openai-whisper + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/dev/rust.nix b/common/users/homeModules/dev/rust.nix new file mode 100644 index 0000000..c6872ac --- /dev/null +++ b/common/users/homeModules/dev/rust.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + rustup + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/frog.nix b/common/users/homeModules/frog.nix new file mode 100644 index 0000000..a25d0e7 --- /dev/null +++ b/common/users/homeModules/frog.nix @@ -0,0 +1,11 @@ +{pkgs, inputs, ...}: +let + cpkg = import ../../../customPackages { inherit pkgs inputs; }; +in +{ + home = { + packages = [ + cpkg.frog + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/gaming.nix b/common/users/homeModules/gaming.nix new file mode 100644 index 0000000..b2c5d27 --- /dev/null +++ b/common/users/homeModules/gaming.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + xclicker + bottles + (prismlauncher.override { + jdks = [ + jdk8 + jdk17 + jdk22 + ]; + }) + protontricks + lutris + ]; + }; +} \ No newline at end of file diff --git a/common/users/meyer/git.nix b/common/users/homeModules/git.nix similarity index 55% rename from common/users/meyer/git.nix rename to common/users/homeModules/git.nix index 3cd28c4..7a4a40b 100644 --- a/common/users/meyer/git.nix +++ b/common/users/homeModules/git.nix @@ -1,4 +1,28 @@ -{ ... }: { +{ pkgs, ... }: { + home = { + packages = with pkgs; [ + git + lazygit + gh + ]; + file = { + lazygit = { + recursive = true; + source = ../dotfiles/lazygit; + target = "./.config/lazygit"; + }; + gh = { + source = ../dotfiles/gh/config.yml; + target = "./.config/gh/config.yml"; + }; + }; + shellAliases = { + lg = "lazygit"; + } + sessionVariables { + LG_CONFIG_FILE = "/home/${config.home.username}/.config/lazygit/tokyonight_night.conf"; + }; + } programs = { git = { enable = true; diff --git a/common/users/homeModules/java.nix b/common/users/homeModules/java.nix deleted file mode 100644 index 03664b6..0000000 --- a/common/users/homeModules/java.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - programs = { - java = { - enable = true; - package = pkgs.temurin-bin-17; - }; - }; -} diff --git a/common/users/homeModules/kde.nix b/common/users/homeModules/kde.nix new file mode 100644 index 0000000..726290e --- /dev/null +++ b/common/users/homeModules/kde.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + ksshaskpass + xsel + libsForQt5.kinit + libsForQt5.kcolorchooser + gnome.gnome-calculator + ]; + } +} \ No newline at end of file diff --git a/common/users/homeModules/media/cli.nix b/common/users/homeModules/media/cli.nix new file mode 100644 index 0000000..884c0d4 --- /dev/null +++ b/common/users/homeModules/media/cli.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + imagemagick + ffmpeg + yt-dlp + ]; + } +} \ No newline at end of file diff --git a/common/users/homeModules/media/davinci.nix b/common/users/homeModules/media/davinci.nix new file mode 100644 index 0000000..86c31d2 --- /dev/null +++ b/common/users/homeModules/media/davinci.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + davinci-resolve + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/media/default.nix b/common/users/homeModules/media/default.nix new file mode 100644 index 0000000..6cdda89 --- /dev/null +++ b/common/users/homeModules/media/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./cli.nix + ./gui.nix + ]; +} \ No newline at end of file diff --git a/common/users/homeModules/media/gui.nix b/common/users/homeModules/media/gui.nix new file mode 100644 index 0000000..61f44e2 --- /dev/null +++ b/common/users/homeModules/media/gui.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + shotcut + pinta + gimp + inkscape + obs-studio + ]; + } +} \ No newline at end of file diff --git a/common/users/homeModules/networking.nix b/common/users/homeModules/networking.nix new file mode 100644 index 0000000..a60df7c --- /dev/null +++ b/common/users/homeModules/networking.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + parsec-bin + protonvpn-gui + insomnia + teamviewer + filezilla + bitwarden + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/nvim.nix b/common/users/homeModules/nvim.nix new file mode 100644 index 0000000..18a6151 --- /dev/null +++ b/common/users/homeModules/nvim.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + neovim + ]; + file = { + nvim = { + recursive = true; + source = pkgs.lib.file.mkOutOfStoreSymlink "${pkgs.home.homeDirectory}/nixos/dotfiles/nvim"; + target = "./.config/nvim"; + }; + }; + sessionVariables = { + EDITOR = "nvim"; + MANPAGER = "nvim +Man!"; + MANWIDTH = "999"; + }; + } +} \ No newline at end of file diff --git a/common/users/homeModules/obsidian.nix b/common/users/homeModules/obsidian.nix new file mode 100644 index 0000000..2396884 --- /dev/null +++ b/common/users/homeModules/obsidian.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + obsidian + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/prisma.nix b/common/users/homeModules/prisma.nix new file mode 100644 index 0000000..7bca261 --- /dev/null +++ b/common/users/homeModules/prisma.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + prisma + prisma-engines + ]; + sessionVariables = { + PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine"; + PRISMA_SCHEMA_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/schema-engine"; + PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node"; + }; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/rofi.nix b/common/users/homeModules/rofi.nix new file mode 100644 index 0000000..9610801 --- /dev/null +++ b/common/users/homeModules/rofi.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + rofi + ]; + file = { + rofi = { + recursive = true; + source = ../dotfiles/rofi; + target = "./.config/rofi"; + }; + }; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/scripts/copy.sh b/common/users/homeModules/scripts/copy.sh new file mode 100644 index 0000000..59429c0 --- /dev/null +++ b/common/users/homeModules/scripts/copy.sh @@ -0,0 +1,8 @@ +command -v xsel > /dev/null +if [[ $? -eq 0 ]]; then + xsel -ib $@ && exit 0 +fi +command -v wslclip > /dev/null +if [[ $? -eq 0 ]]; then + wslclip $@ && exit 0 +fi \ No newline at end of file diff --git a/common/users/homeModules/scripts/default.nix b/common/users/homeModules/scripts/default.nix new file mode 100644 index 0000000..fe8e24a --- /dev/null +++ b/common/users/homeModules/scripts/default.nix @@ -0,0 +1,62 @@ +{pkgs, lib, inputs, ...}: +let +cpkg = import ../../../customPackages { inherit pkgs inputs; }; +# https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6 +mkScript = { name, version ? "0.0.1", file, env ? [ ] }: + pkgs.writeTextFile { + name = "${name}-${version}"; + executable = true; + destination = "/bin/${name}"; + text = '' + for i in ${lib.concatStringsSep " " env}; do + export PATH="$i/bin:$PATH" + done + + exec ${bash}/bin/bash ${file} $@ + ''; + }; +in +{ + home = { + packages = with pkgs; [ + # env for clipboard command will be required by their respective environemnts + (mkScript { + name = "paste"; + file = ./paste.sh; + }) + (mkScript { + name = "copy"; + file = ./copy.sh; + }) + (mkScript { + name = "http2ssh"; + file = ./http2ssh.sh; + env = [git]; + }) + (mkScript { + name = "git_fetchAll"; + file = ./git_fetchAll.sh; + env = [git]; + }) + (mkScript { + name = "install_eslint"; + file = ./install_eslint.sh; + }) + (mkScript { + name = "math"; + file = ./math.sh; + env = [python3]; + }) + (mkScript { + name = "hashi18n"; + file = ./hashi18n.sh; + }) + ]; + file = { + scripts = { + source = "${cpkg.scripts}"; + target = ".scripts"; + }; + }; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/scripts/git_fetchAll.sh b/common/users/homeModules/scripts/git_fetchAll.sh new file mode 100644 index 0000000..210bfdc --- /dev/null +++ b/common/users/homeModules/scripts/git_fetchAll.sh @@ -0,0 +1,3 @@ +git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done +git fetch --all +git pull --all \ No newline at end of file diff --git a/common/users/homeModules/scripts/hashi18n.sh b/common/users/homeModules/scripts/hashi18n.sh new file mode 100644 index 0000000..07e16ae --- /dev/null +++ b/common/users/homeModules/scripts/hashi18n.sh @@ -0,0 +1 @@ +xsel -ob | node $HOME/.scripts/hash.js | tr -d '\n' | xsel -ib \ No newline at end of file diff --git a/common/users/homeModules/scripts/http2ssh.sh b/common/users/homeModules/scripts/http2ssh.sh new file mode 100644 index 0000000..945cb95 --- /dev/null +++ b/common/users/homeModules/scripts/http2ssh.sh @@ -0,0 +1,12 @@ +set -eo pipefail + +if [[ -z $1 ]]; then + echo "You need to provide a remote name"; + echo "Avilable remotes"; + git remote -v; + exit 1; +fi +URL=$(git remote get-url $1); +URL=${URL/https:\/\//git@}; +URL=${URL/\//:}; +git remote set-url $1 $URL; \ No newline at end of file diff --git a/common/users/homeModules/scripts/install_eslint.sh b/common/users/homeModules/scripts/install_eslint.sh new file mode 100644 index 0000000..336e938 --- /dev/null +++ b/common/users/homeModules/scripts/install_eslint.sh @@ -0,0 +1,10 @@ +set -x +cp $HOME/.config/.eslintrc.json . +pkgs=("@stylistic/eslint-plugin" "@typescript-eslint/eslint-plugin") +if [[ -z $1 ]]; then + echo please specify npm, pnpm, or yarn + exit 1 +fi +for i in "${pkgs[@]}"; do +`$1 i -D $i` +done \ No newline at end of file diff --git a/common/users/homeModules/scripts/math.sh b/common/users/homeModules/scripts/math.sh new file mode 100644 index 0000000..a32707a --- /dev/null +++ b/common/users/homeModules/scripts/math.sh @@ -0,0 +1,2 @@ +set -e +python3 -c "print($*)" \ No newline at end of file diff --git a/common/users/homeModules/scripts/paste.sh b/common/users/homeModules/scripts/paste.sh new file mode 100644 index 0000000..0c68c24 --- /dev/null +++ b/common/users/homeModules/scripts/paste.sh @@ -0,0 +1,8 @@ +command -v xsel > /dev/null +if [[ $? -eq 0 ]]; then + xsel -ob && exit 0 +fi +command -v wslclip > /dev/null +if [[ $? -eq 0 ]]; then + wslclip -g && exit 0 +fi \ No newline at end of file diff --git a/common/users/homeModules/social.nix b/common/users/homeModules/social.nix new file mode 100644 index 0000000..ba2cc5b --- /dev/null +++ b/common/users/homeModules/social.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + imports = [ + ./arrpc.nix + ]; + home = { + packages = with pkgs;[ + legcord + cinny-desktop + element-desktop + (pkgs.discord.override { + withVencord = true; + }) + vesktop + ]; + }; +} \ No newline at end of file diff --git a/common/users/meyer/sops.nix b/common/users/homeModules/sops.nix similarity index 100% rename from common/users/meyer/sops.nix rename to common/users/homeModules/sops.nix diff --git a/common/users/homeModules/terminal.nix b/common/users/homeModules/terminal.nix new file mode 100644 index 0000000..8e1d076 --- /dev/null +++ b/common/users/homeModules/terminal.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + warp-terminal + kitty + onefetch + hyfetch + neofetch + ]; + file = { + kitty = { + recursive = true; + source = ../dotfiles/kitty; + target = "./.config/kitty"; + }; + }; + } +} \ No newline at end of file diff --git a/common/users/homeModules/utils.nix b/common/users/homeModules/utils.nix new file mode 100644 index 0000000..108f09f --- /dev/null +++ b/common/users/homeModules/utils.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + p7zip + dig + bat + usbutils + tree + sops + fzf + jq + unzip + ]; + sessionVariables = { + BAT_THEME = "Dracula"; + SSH_ASKPASS_REQUIRE = "prefer"; + }; + sessionPath = [ + "$HOME/.local/bin" + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/virt.nix b/common/users/homeModules/virt.nix new file mode 100644 index 0000000..277dca1 --- /dev/null +++ b/common/users/homeModules/virt.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + bottles + virt-manager + qemu_full + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/web.nix b/common/users/homeModules/web.nix new file mode 100644 index 0000000..726a432 --- /dev/null +++ b/common/users/homeModules/web.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + firefox-devedition + google-chrome + thunderbird + jellyfin-web + jellyfin-media-player + vlc + ]; + }; +} \ No newline at end of file diff --git a/common/users/homeModules/zsh.nix b/common/users/homeModules/zsh.nix index a139041..5089ac6 100644 --- a/common/users/homeModules/zsh.nix +++ b/common/users/homeModules/zsh.nix @@ -1,6 +1,7 @@ { lib, pkgs, ... }: let + # TODO: make these modular _ = [ "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme" "source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" @@ -12,6 +13,19 @@ let zshInitArgs = lib.concatMapStrings (x: x + "\n") _; in { + home = { + packages = with pkgs; [ + zsh-powerlevel10k + zsh-syntax-highlighting + ]; + file = { + p10k = { + recursive = true; + source = ../dotfiles/.p10k.zsh; + target = ".p10k.zsh"; + }; + }; + }; programs = { zoxide = { enable = true; diff --git a/common/users/meyer-wsl/default.nix b/common/users/meyer-wsl/default.nix new file mode 100644 index 0000000..c74b8ac --- /dev/null +++ b/common/users/meyer-wsl/default.nix @@ -0,0 +1,33 @@ +{ pkgs, inputs, ... }: +let + NAME = "meyer"; +in +{ + imports = [ + (import ../../systemModules/sops.nix { inherit NAME; }) + (import ../../systemModules/nixHelper.nix { inherit NAME; }) + ]; + users = { + users = { + "${NAME}" = { + isNormalUser = true; + extraGroups = [ + "wheel" # Enable ‘sudo’ for the user. + "audio" + "sound" + "video" + "input" + "tty" + "plugdev" + ]; + shell = pkgs.zsh; + }; + }; + }; + home-manager = { + extraSpecialArgs = { inherit inputs; }; + users = { + "${NAME}" = import ./home.nix; + }; + }; +} diff --git a/common/users/meyer-wsl/home.nix b/common/users/meyer-wsl/home.nix new file mode 100644 index 0000000..1d53781 --- /dev/null +++ b/common/users/meyer-wsl/home.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + nixpkgs.config.allowInsecurePredicate = (pkg: true); + nixpkgs.config.allowUnfreePredicate = (pkg: true); + imports = [ + ../homeModules/util.nix + ../homeModules/dev + ../homeModules/dev/cpp.nix + ../homeModules/dev/javascript.nix + ../homeModules/dev/python.nix + ../homeModules/scripts + ../homeModules/btop.nix + ../homeModules/git.nix + ../homeModules/nvim.nix + ../homeModules/sops.nix + ../homeModules/zsh.nix + ]; + + home.username = "meyer"; + home.homeDirectory = "/home/meyer"; + + home = { + packages = with pkgs; [ + wslu + ]; + }; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} \ No newline at end of file diff --git a/common/users/meyer/default.nix b/common/users/meyer/default.nix index c71d2ac..9145206 100644 --- a/common/users/meyer/default.nix +++ b/common/users/meyer/default.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, ... }: +{ pkgs, inputs, systemImports, ... }: let NAME = "meyer"; in diff --git a/common/users/meyer/home.nix b/common/users/meyer/home.nix index 0bf6a4d..0e4fa0d 100644 --- a/common/users/meyer/home.nix +++ b/common/users/meyer/home.nix @@ -3,35 +3,40 @@ pkgs, inputs, ... -}: - -let - file = import ../../files.nix { inherit config cpkg; }; - shell = import ../../shell.nix { inherit config pkgs cpkg; }; - cpkg = import ../../../customPackages { inherit pkgs inputs; }; - pkgTypes = import ../../pkgs.nix { - inherit - pkgs - config - inputs - cpkg - ; - }; - packages = pkgTypes.dev ++ pkgTypes.gui ++ pkgTypes.general ++ pkgTypes.scripts ++ pkgTypes.gaming; -in -{ +}: let + pinned = import ./pinned.nix { inherit pkgs config; }; +in { nixpkgs.config.allowInsecurePredicate = (pkg: true); nixpkgs.config.allowUnfreePredicate = (pkg: true); + imports = [ + ../homeModules/util.nix + ../homeModules/dev + ../homeModules/dev/ide + ../homeModules/dev/ide/jb/idea.nix + ../homeModules/dev/javascript.nix + ../homeModules/dev/cpp.nix + ../homeModules/dev/jvm.nix + ../homeModules/dev/python.nix + ../homeModules/media + ../homeModules/scripts + ../homeModules/audio.nix + ../homeModules/btop.nix ../homeModules/flameshot.nix - ../homeModules/arrpc.nix + ../homeModules/frog.nix + ../homeModules/gaming.nix + ../homeModules/git.nix + ../homeModules/kde.nix + ../homeModules/networking.nix + ../homeModules/nvim.nix + ../homeModules/obsidian.nix + ../homeModules/rofi.nix + ../homeModules/social.nix + ../homeModules/sops.nix + ../homeModules/terminal.nix + ../homeModules/virt.nix + ../homeModules/web.nix ../homeModules/zsh.nix - ../homeModules/desktopEntries.nix - ../homeModules/java.nix - ../homeModules/jetbrains - ../homeModules/notion.nix - ./sops.nix - ./git.nix ]; # Home Manager needs a bit of information about you and the paths it should @@ -43,11 +48,13 @@ in # The home.packages option allows you to install Nix packages into your # environment. home = { - inherit packages file; + packages = with pkgs; [ + pinned.etcher + ] + }; + home.shellAliases = { + sd = ''lsusb | grep Elgato | grep --perl-regexp "(?<=Device 0{0,10})[1-9]+" --only-matching | xargs printf "usb.device_address eq %s" | copy''; }; - home.shellAliases = shell.dev.aliases; - home.sessionPath = shell.dev.path; - home.sessionVariables = shell.dev.env; # Home Manager is pretty good at managing dotfiles. The primary way to manage # plain files is through 'home.file'. diff --git a/flake.nix b/flake.nix index 0d779ca..2d7a9aa 100644 --- a/flake.nix +++ b/flake.nix @@ -77,8 +77,8 @@ { programs.nix-index-database.comma.enable = true; } ]; }; - wsl = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + laptop-evo4b5 = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; specialArgs = { inherit inputs; };