Compare commits

...

4 Commits

Author SHA1 Message Date
3a4613d033
move ollama to profiles 2024-06-18 18:28:21 +03:00
317d838075
fix dirs creation in persist module 2024-06-18 18:26:21 +03:00
dependabot[bot]
b5dc318f23 Bump nixbuild/nix-quick-install-action from 26 to 27
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 26 to 27.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v26...v27)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 01:55:04 +00:00
dependabot[bot]
522f2e5750 Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 01:54:55 +00:00
5 changed files with 75 additions and 12 deletions

View File

@ -28,7 +28,7 @@ jobs:
ref: ${{ github.head_ref }}
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
uses: nixbuild/nix-quick-install-action@v27
with:
load_nixConfig: false
nix_conf: |

View File

@ -20,7 +20,7 @@ jobs:
ref: ${{ github.head_ref }}
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
uses: nixbuild/nix-quick-install-action@v27
with:
load_nixConfig: false
nix_conf: |
@ -40,7 +40,7 @@ jobs:
run: nix build .#Flakes-ISO
- name: Push ISO to artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nix-flakes.iso.zip
path: result/iso/*.iso

View File

@ -15,6 +15,8 @@
customProfiles.nicotine
customProfiles.sunshine
customProfiles.wine-games
customProfiles.ollama
];
security.pki.certificateFiles = [ ../../misc/mitmproxy-ca-cert.pem ];

View File

@ -111,14 +111,14 @@ in {
startAt = cfg.cache.clean.dates;
};
system.activationScripts = {
homedir.text = builtins.concatStringsSep "\n" (map (dir: ''
mkdir -p ${cfg.persistRoot}${dir}
chown ${config.mainuser}:users ${cfg.persistRoot}${dir}
'') (
(builtins.filter (lib.hasPrefix cfg.homeDir) allDirectories)
++ absoluteHomePath allHomeDirectories
));
};
# system.activationScripts = {
# homedir.text = builtins.concatStringsSep "\n" (map (dir: ''
# mkdir -p ${cfg.persistRoot}${dir}
# chown ${config.mainuser}:users ${cfg.persistRoot}${dir}
# '') (
# (builtins.filter (lib.hasPrefix cfg.homeDir) allDirectories)
# ++ absoluteHomePath allHomeDirectories
# ));
# };
};
}

View File

@ -0,0 +1,61 @@
{ config, lib, ... }:
let
gpu = config.deviceSpecific.devInfo.gpu.vendor;
in {
services.ollama = {
enable = true;
host = "127.0.0.1";
port = 11434;
sandbox = false;
acceleration =
if gpu == "amd" then
"rocm"
else if gpu == "nvidia" then
"cuda"
else false;
openFirewall = false;
environmentVariables = {
HSA_OVERRIDE_GFX_VERSION = "10.3.0";
OLLAMA_KEEP_ALIVE = "-1";
# OLLAMA_LLM_LIBRARY = "";
};
};
services.open-webui = {
enable = true;
host = "127.0.0.1";
port = 8081;
openFirewall = false;
environment = {
ANONYMIZED_TELEMETRY = "False";
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
# Disable authentication
WEBUI_AUTH = "False";
};
};
users.groups.ollama = { };
users.users.ollama = {
description = "ollama user";
isSystemUser = true;
group = "ollama";
extraGroups = [ "video" "render" ];
};
systemd.services.ollama.serviceConfig = {
DynamicUser = lib.mkForce false;
User = "ollama";
Group = "ollama";
};
systemd.services.open-webui.serviceConfig = {
DynamicUser = lib.mkForce false;
User = "ollama";
Group = "ollama";
};
persist.state.directories = [
"/var/lib/ollama"
"/var/lib/open-webui"
];
}