moves ollama to it's own service file
This commit is contained in:
parent
c0626c9d27
commit
309a2a1f35
1
config/home-manager/packages/common/hosts/default.nix
Normal file
1
config/home-manager/packages/common/hosts/default.nix
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ ... }: { }
|
4
config/home-manager/packages/common/hosts/fallback.nix
Normal file
4
config/home-manager/packages/common/hosts/fallback.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs-unstable, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs-unstable; [ ollama ];
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs-unstable, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs-unstable; [ ollama-rocm ];
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs-unstable, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs-unstable; [ ollama-cuda ];
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs-unstable, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs-unstable; [ ollama-cuda ];
|
||||||
|
}
|
27
config/home-manager/packages/common/ollama.nix
Normal file
27
config/home-manager/packages/common/ollama.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -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
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }: { }
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user