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,
...
}:
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
];
}

View File

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