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,21 +4,19 @@
|
|||||||
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
|
||||||
|
[ ./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 ];
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
# General packages
|
# General packages
|
||||||
git
|
git
|
||||||
gnupg
|
gnupg
|
||||||
@ -103,6 +101,5 @@ in
|
|||||||
cmatrix
|
cmatrix
|
||||||
figlet
|
figlet
|
||||||
lolcat
|
lolcat
|
||||||
]
|
];
|
||||||
++ hostSpecificPackages;
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }: { }
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user