Compare commits
3 Commits
feature/mv
...
hotfix/rev
| Author | SHA1 | Date | |
|---|---|---|---|
| e90ba28713 | |||
| a4e644fbbc | |||
| 9bb9eb585f |
78
modules/kubernetes.nix
Normal file
78
modules/kubernetes.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
services.kubernetes = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable Kubernetes services";
|
||||
};
|
||||
|
||||
version = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "1.28.0";
|
||||
description = "Kubernetes version to use";
|
||||
};
|
||||
|
||||
clusterName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "palatine-hill-cluster";
|
||||
description = "Name of the Kubernetes cluster";
|
||||
};
|
||||
|
||||
controlPlaneEndpoint = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "localhost:6443";
|
||||
description = "Control plane endpoint";
|
||||
};
|
||||
|
||||
networking = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = { };
|
||||
description = "Kubernetes networking configuration";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.kubernetes.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
kubectl
|
||||
kubernetes
|
||||
];
|
||||
|
||||
# Enable containerd for Kubernetes
|
||||
virtualisation.containerd.enable = true;
|
||||
|
||||
# Enable kubelet
|
||||
services.kubelet = {
|
||||
enable = true;
|
||||
extraFlags = {
|
||||
"pod-infra-container-image" = "registry.k8s.io/pause:3.9";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable kubeadm for cluster initialization
|
||||
environment.etc."kubeadm.yaml".text = ''
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: InitConfiguration
|
||||
localAPIEndpoint:
|
||||
advertiseAddress: 127.0.0.1
|
||||
bindPort: 6443
|
||||
---
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: ClusterConfiguration
|
||||
clusterName: ${config.services.kubernetes.clusterName}
|
||||
controlPlaneEndpoint: ${config.services.kubernetes.controlPlaneEndpoint}
|
||||
networking:
|
||||
serviceSubnet: 10.96.0.0/12
|
||||
podSubnet: 10.244.0.0/16
|
||||
dnsDomain: cluster.local
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
@@ -78,7 +77,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
users.users.alice.extraGroups = [ "calibre-web" ];
|
||||
users.users = {
|
||||
alice.extraGroups = [ "calibre-web" ];
|
||||
};
|
||||
users.groups.ollama = { };
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
@@ -86,6 +88,10 @@
|
||||
"KWIN_DRM_NO_DIRECT_SCANOUT" = "1";
|
||||
};
|
||||
|
||||
#nixpkgs.config = {
|
||||
# rocmSupport = true;
|
||||
#};
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = ./secrets.yaml;
|
||||
#secrets = {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
candy-icons
|
||||
chromium
|
||||
chromedriver
|
||||
claude-code
|
||||
croc
|
||||
deadnix
|
||||
direnv
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
./minio.nix
|
||||
./networking.nix
|
||||
./nextcloud.nix
|
||||
./ollama.nix
|
||||
#./plex
|
||||
./postgresql.nix
|
||||
./samba.nix
|
||||
@@ -25,9 +26,11 @@
|
||||
|
||||
programs.git.lfs.enable = false;
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
nixpkgs.config = {
|
||||
packageOverrides = pkgs: {
|
||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader.grub.device = "/dev/sda";
|
||||
@@ -97,6 +100,13 @@
|
||||
smartd.enable = true;
|
||||
calibre-server.enable = false;
|
||||
|
||||
# Kubernetes example configuration
|
||||
# To enable Kubernetes, uncomment the following:
|
||||
# kubernetes = {
|
||||
# enable = true;
|
||||
# clusterName = "palatine-hill-cluster";
|
||||
# controlPlaneEndpoint = "localhost:6443";
|
||||
# };
|
||||
};
|
||||
|
||||
nix.gc.options = "--delete-older-than 150d";
|
||||
|
||||
53
systems/palatine-hill/ollama.nix
Normal file
53
systems/palatine-hill/ollama.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
ollama = {
|
||||
enable = true;
|
||||
package = pkgs.ollama;
|
||||
syncModels = true;
|
||||
loadModels = [
|
||||
"gemma3"
|
||||
"deepseek-r1:latest"
|
||||
"deepseek-r1:1.5b"
|
||||
"qwen3"
|
||||
#"qwen3-coder-next"
|
||||
"qwen3-coder"
|
||||
"lennyerik/zeta"
|
||||
"llama3.1:8b"
|
||||
"qwen2.5-coder:1.5b-base"
|
||||
"nomic-embed-text:latest"
|
||||
];
|
||||
environmentVariables = {
|
||||
FLASH_ATTENTION = "1";
|
||||
OLLAMA_KV_CACHE_TYPE = "q8_0";
|
||||
# Ollama memory configuration
|
||||
OLLAMA_MAX_LOADED_MODELS = "2";
|
||||
OLLAMA_MAX_QUEUE = "4";
|
||||
OLLAMA_NUM_PARALLEL = "2";
|
||||
|
||||
# ROCm memory optimization
|
||||
#HIP_VISIBLE_DEVICES = "0";
|
||||
#ROCR_VISIBLE_DEVICES = "0";
|
||||
|
||||
# context length for agents
|
||||
OLLAMA_CONTEXT_LENGTH = "64000";
|
||||
};
|
||||
};
|
||||
open-webui = {
|
||||
enable = true;
|
||||
port = 21212;
|
||||
};
|
||||
};
|
||||
users.users.ollama = {
|
||||
extraGroups = [
|
||||
"render"
|
||||
"video"
|
||||
];
|
||||
group = "ollama";
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups.ollama = { };
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
{ pkgs, outputs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.emacs = {
|
||||
programs = {
|
||||
emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs30-pgtk;
|
||||
};
|
||||
programs.vesktop = {
|
||||
vesktop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
appBadge = false;
|
||||
@@ -21,7 +22,7 @@
|
||||
notifyAboutUpdates = false;
|
||||
plugins = {
|
||||
AnonymiseFileNames.enabled = true;
|
||||
BetterFolders.enabled = true;
|
||||
BetterFolders.enabled = false;
|
||||
BetterGifAltText.enabled = true;
|
||||
CallTimer.enabled = true;
|
||||
ClearURLs.enabled = true;
|
||||
@@ -46,6 +47,77 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
zed-editor = {
|
||||
enable = true;
|
||||
mutableUserSettings = false;
|
||||
extensions = [
|
||||
"nix"
|
||||
"toml"
|
||||
"rust"
|
||||
"java"
|
||||
"kotlin"
|
||||
"git firefly"
|
||||
"make"
|
||||
"dockerfile"
|
||||
"sql"
|
||||
"latex"
|
||||
"terraform"
|
||||
"log"
|
||||
];
|
||||
userSettings = {
|
||||
colorize_brackets = true;
|
||||
hard_tabs = false;
|
||||
vim_mode = true;
|
||||
minimap = {
|
||||
show = "auto";
|
||||
};
|
||||
buffer_line_height = "comfortable";
|
||||
auto_update = false;
|
||||
autosave = "on_focus_change";
|
||||
agent = {
|
||||
default_model = {
|
||||
provider = "ollama";
|
||||
model = "qwen2.5-coder:latest";
|
||||
};
|
||||
favorite_models = [ ];
|
||||
model_parameters = [ ];
|
||||
};
|
||||
telemetry = {
|
||||
diagnostics = false;
|
||||
metrics = false;
|
||||
};
|
||||
journal = {
|
||||
hour_format = "hour24";
|
||||
};
|
||||
edit_preditions = {
|
||||
provider = "open_ai_compatible_api";
|
||||
open_ai_compatible_api = {
|
||||
api_url = "http://localhost:11434/v1/completions";
|
||||
model = "zeta:latest";
|
||||
prompt_format = "infer";
|
||||
max_requests = 64;
|
||||
};
|
||||
};
|
||||
texlab = {
|
||||
build = {
|
||||
onSave = true;
|
||||
forwardSearchAfter = true;
|
||||
};
|
||||
forwardSearch = {
|
||||
executable = "zathura";
|
||||
args = [
|
||||
"--synctex-forward"
|
||||
"%l:1:%f"
|
||||
"-x"
|
||||
"zed %%{input}:%%{line}"
|
||||
"%p"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cmake
|
||||
shellcheck
|
||||
|
||||
Reference in New Issue
Block a user