moves ollama to it's own service file

This commit is contained in:
Menno van Leeuwen 2024-11-05 20:53:11 +01:00
parent c0626c9d27
commit 309a2a1f35
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
8 changed files with 132 additions and 94 deletions

View File

@ -0,0 +1 @@
{ ... }: { }

View File

@ -0,0 +1,4 @@
{ pkgs-unstable, ... }:
{
home.packages = with pkgs-unstable; [ ollama ];
}

View File

@ -0,0 +1,4 @@
{ pkgs-unstable, ... }:
{
home.packages = with pkgs-unstable; [ ollama-rocm ];
}

View File

@ -0,0 +1,4 @@
{ pkgs-unstable, ... }:
{
home.packages = with pkgs-unstable; [ ollama-cuda ];
}

View File

@ -0,0 +1,4 @@
{ pkgs-unstable, ... }:
{
home.packages = with pkgs-unstable; [ ollama-cuda ];
}

View File

@ -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" ];
};
};
}

View File

@ -4,105 +4,102 @@
hostname, 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 = # Import host-specific packages
with pkgs; imports =
[ if hostname == "mennos-gamingpc" then
# General packages [ ./hosts/mennos-gamingpc.nix ]
git else if hostname == "mennos-laptop" then
gnupg [ ./hosts/mennos-laptop.nix ]
gh else if hostname == "mennos-server" then
nixfmt-rfc-style [ ./hosts/mennos-server.nix ]
wget else
fastfetch [ ./hosts/fallback.nix ];
# Package management home.packages = with pkgs; [
pipx # General packages
devbox git
gnupg
gh
nixfmt-rfc-style
wget
fastfetch
# Development SDKs/Toolkits # Package management
gcc pipx
pkg-config devbox
gnumake
stdenv.cc
rustc
cargo
cargo-edit
cargo-watch
cargo-audit
cargo-expand
cargo-tarpaulin
pyenv
act # GitHub Actions CLI
# File and directory operations # Development SDKs/Toolkits
eza # Modern ls gcc
bat # Modern cat pkg-config
zoxide # Smarter cd command gnumake
broot # Interactive directory navigator stdenv.cc
du-dust # Modern du rustc
duf # Modern df cargo
zip cargo-edit
unzip cargo-watch
cargo-audit
cargo-expand
cargo-tarpaulin
pyenv
act # GitHub Actions CLI
# Search and text processing # File and directory operations
ripgrep # Modern grep eza # Modern ls
sd # Modern sed bat # Modern cat
choose # Modern cut zoxide # Smarter cd command
jq # JSON processor broot # Interactive directory navigator
yq # YAML processor du-dust # Modern du
xsv # CSV processor duf # Modern df
zip
unzip
# System monitoring and process management # Search and text processing
procs # Modern ps ripgrep # Modern grep
bottom # Modern top/htop sd # Modern sed
hyperfine # Benchmarking tool choose # Modern cut
bandwhich # Network utilization tool jq # JSON processor
doggo # Modern dig yq # YAML processor
gping # Ping with graph xsv # CSV processor
htop # Interactive process viewer
# Development utilities # System monitoring and process management
delta # Better git diff procs # Modern ps
difftastic # Structural diff tool bottom # Modern top/htop
fzf # Fuzzy finder hyperfine # Benchmarking tool
tokei # Code statistics bandwhich # Network utilization tool
tealdeer # Modern tldr client doggo # Modern dig
lazygit # Terminal UI for git gping # Ping with graph
htop # Interactive process viewer
# Shell and terminal # Development utilities
starship # Cross-shell prompt delta # Better git diff
blesh # Bash ble.sh difftastic # Structural diff tool
zellij # Modern terminal multiplexer fzf # Fuzzy finder
screen # Terminal multiplexer tokei # Code statistics
tealdeer # Modern tldr client
lazygit # Terminal UI for git
# File viewers and processors # Shell and terminal
hexyl # Modern hexdump starship # Cross-shell prompt
chafa # Terminal image viewer blesh # Bash ble.sh
glow # Markdown renderer zellij # Modern terminal multiplexer
screen # Terminal multiplexer
# Editors # File viewers and processors
neovim hexyl # Modern hexdump
nano chafa # Terminal image viewer
micro glow # Markdown renderer
# Lolz # Editors
fortune neovim
cowsay nano
cmatrix micro
figlet
lolcat # Lolz
] fortune
++ hostSpecificPackages; cowsay
cmatrix
figlet
lolcat
];
} }

View File

@ -1,4 +1 @@
{ config, pkgs, ... }: { config, pkgs, ... }: { }
{
}