feat(nvim): add gen.nvim and ollama service
This commit is contained in:
parent
ddc2989620
commit
82ffbcbde4
6 changed files with 74 additions and 1 deletions
27
modules/services/ollama.nix
Normal file
27
modules/services/ollama.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.ollama;
|
||||
in
|
||||
{
|
||||
options.my.services.ollama = {
|
||||
enable = mkEnableOption "ollama";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.ollama;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.ollama = {
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1s";
|
||||
ExecStart = "${getExe cfg.package} serve";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue