diff --git a/config/home-manager/packages/common/hosts/default.nix b/config/home-manager/packages/common/hosts/default.nix new file mode 100644 index 0000000..c915eb0 --- /dev/null +++ b/config/home-manager/packages/common/hosts/default.nix @@ -0,0 +1 @@ +{ ... }: { } diff --git a/config/home-manager/packages/common/hosts/fallback.nix b/config/home-manager/packages/common/hosts/fallback.nix new file mode 100644 index 0000000..e88fddd --- /dev/null +++ b/config/home-manager/packages/common/hosts/fallback.nix @@ -0,0 +1,4 @@ +{ pkgs-unstable, ... }: +{ + home.packages = with pkgs-unstable; [ ollama ]; +} diff --git a/config/home-manager/packages/common/hosts/mennos-gamingpc.nix b/config/home-manager/packages/common/hosts/mennos-gamingpc.nix new file mode 100644 index 0000000..2702216 --- /dev/null +++ b/config/home-manager/packages/common/hosts/mennos-gamingpc.nix @@ -0,0 +1,4 @@ +{ pkgs-unstable, ... }: +{ + home.packages = with pkgs-unstable; [ ollama-rocm ]; +} diff --git a/config/home-manager/packages/common/hosts/mennos-laptop.nix b/config/home-manager/packages/common/hosts/mennos-laptop.nix new file mode 100644 index 0000000..1f6e8e1 --- /dev/null +++ b/config/home-manager/packages/common/hosts/mennos-laptop.nix @@ -0,0 +1,4 @@ +{ pkgs-unstable, ... }: +{ + home.packages = with pkgs-unstable; [ ollama-cuda ]; +} diff --git a/config/home-manager/packages/common/hosts/mennos-server.nix b/config/home-manager/packages/common/hosts/mennos-server.nix new file mode 100644 index 0000000..1f6e8e1 --- /dev/null +++ b/config/home-manager/packages/common/hosts/mennos-server.nix @@ -0,0 +1,4 @@ +{ pkgs-unstable, ... }: +{ + home.packages = with pkgs-unstable; [ ollama-cuda ]; +} diff --git a/config/home-manager/packages/common/ollama.nix b/config/home-manager/packages/common/ollama.nix new file mode 100644 index 0000000..995e6e9 --- /dev/null +++ b/config/home-manager/packages/common/ollama.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + pkgs-unstable, + ... +}: +{ + # Ollama will be installed in the hosts/ configuration depending on what the host is of this system + # If none is registered, the fallback will be used which installs ollama without GPU acceleration support. + systemd.user.services.ollama = { + Unit = { + Description = "Ollama Service"; + After = [ "network.target" ]; + }; + + Service = { + # This resolves to for example: /home/menno/.nix-profile/bin/ollama + ExecStart = "${config.home.profileDirectory}/bin/ollama serve"; + Restart = "always"; + RestartSec = "10"; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + }; +} diff --git a/config/home-manager/packages/common/packages.nix b/config/home-manager/packages/common/packages.nix index 3b4e8a1..768d090 100644 --- a/config/home-manager/packages/common/packages.nix +++ b/config/home-manager/packages/common/packages.nix @@ -4,105 +4,102 @@ hostname, ... }: -let - hostSpecificPackages = - if hostname == "mennos-gamingpc" then - with pkgs-unstable; [ ollama-rocm ] - else if hostname == "mennos-laptop" then - with pkgs-unstable; [ ollama-cuda ] - else if hostname == "mennos-server" then - with pkgs-unstable; [ ollama-cuda ] - else - with pkgs-unstable; [ ollama ]; -in { - home.packages = - with pkgs; - [ - # General packages - git - gnupg - gh - nixfmt-rfc-style - wget - fastfetch + # Import host-specific packages + imports = + if hostname == "mennos-gamingpc" then + [ ./hosts/mennos-gamingpc.nix ] + else if hostname == "mennos-laptop" then + [ ./hosts/mennos-laptop.nix ] + else if hostname == "mennos-server" then + [ ./hosts/mennos-server.nix ] + else + [ ./hosts/fallback.nix ]; - # Package management - pipx - devbox + home.packages = with pkgs; [ + # General packages + git + gnupg + gh + nixfmt-rfc-style + wget + fastfetch - # Development SDKs/Toolkits - gcc - pkg-config - gnumake - stdenv.cc - rustc - cargo - cargo-edit - cargo-watch - cargo-audit - cargo-expand - cargo-tarpaulin - pyenv - act # GitHub Actions CLI + # Package management + pipx + devbox - # File and directory operations - eza # Modern ls - bat # Modern cat - zoxide # Smarter cd command - broot # Interactive directory navigator - du-dust # Modern du - duf # Modern df - zip - unzip + # Development SDKs/Toolkits + gcc + pkg-config + gnumake + stdenv.cc + rustc + cargo + cargo-edit + cargo-watch + cargo-audit + cargo-expand + cargo-tarpaulin + pyenv + act # GitHub Actions CLI - # Search and text processing - ripgrep # Modern grep - sd # Modern sed - choose # Modern cut - jq # JSON processor - yq # YAML processor - xsv # CSV processor + # File and directory operations + eza # Modern ls + bat # Modern cat + zoxide # Smarter cd command + broot # Interactive directory navigator + du-dust # Modern du + duf # Modern df + zip + unzip - # System monitoring and process management - procs # Modern ps - bottom # Modern top/htop - hyperfine # Benchmarking tool - bandwhich # Network utilization tool - doggo # Modern dig - gping # Ping with graph - htop # Interactive process viewer + # Search and text processing + ripgrep # Modern grep + sd # Modern sed + choose # Modern cut + jq # JSON processor + yq # YAML processor + xsv # CSV processor - # Development utilities - delta # Better git diff - difftastic # Structural diff tool - fzf # Fuzzy finder - tokei # Code statistics - tealdeer # Modern tldr client - lazygit # Terminal UI for git + # System monitoring and process management + procs # Modern ps + bottom # Modern top/htop + hyperfine # Benchmarking tool + bandwhich # Network utilization tool + doggo # Modern dig + gping # Ping with graph + htop # Interactive process viewer - # Shell and terminal - starship # Cross-shell prompt - blesh # Bash ble.sh - zellij # Modern terminal multiplexer - screen # Terminal multiplexer + # Development utilities + delta # Better git diff + difftastic # Structural diff tool + fzf # Fuzzy finder + tokei # Code statistics + tealdeer # Modern tldr client + lazygit # Terminal UI for git - # File viewers and processors - hexyl # Modern hexdump - chafa # Terminal image viewer - glow # Markdown renderer + # Shell and terminal + starship # Cross-shell prompt + blesh # Bash ble.sh + zellij # Modern terminal multiplexer + screen # Terminal multiplexer - # Editors - neovim - nano - micro + # File viewers and processors + hexyl # Modern hexdump + chafa # Terminal image viewer + glow # Markdown renderer - # Lolz - fortune - cowsay - cmatrix - figlet - lolcat - ] - ++ hostSpecificPackages; + # Editors + neovim + nano + micro + + # Lolz + fortune + cowsay + cmatrix + figlet + lolcat + ]; } diff --git a/config/home-manager/workstation/wireguard.nix b/config/home-manager/workstation/wireguard.nix index c74466d..74a3b06 100644 --- a/config/home-manager/workstation/wireguard.nix +++ b/config/home-manager/workstation/wireguard.nix @@ -1,4 +1 @@ -{ config, pkgs, ... }: -{ - -} +{ config, pkgs, ... }: { }