clean up & consoldiation of custom pkgs from flakes & herdr
This commit is contained in:
1 parent
6229440107
commit
bdfcb9e814
22 files changed
+207
-446
No files matched your search
+1
-1
@@ -120,7 +120,7 @@ option. Default should be `false` unless the feature is universally required.
|
|||||||
- When in doubt, keep it in the host file and extract later if reuse emerges
|
- When in doubt, keep it in the host file and extract later if reuse emerges
|
||||||
|
|
||||||
### Package Placement
|
### Package Placement
|
||||||
- Packages needed on all desktops → `modules/nixos/desktop/packages.nix`
|
- Packages needed on all desktops → `modules/nixos/desktop/default.nix` (non-slim mode)
|
||||||
- Packages for one host only → `environment.systemPackages` in the host file
|
- Packages for one host only → `environment.systemPackages` in the host file
|
||||||
- Custom/third-party packages not in nixpkgs → `pkgs/<name>/default.nix` with an overlay in `modules/core/default.nix`
|
- Custom/third-party packages not in nixpkgs → `pkgs/<name>/default.nix` with an overlay in `modules/core/default.nix`
|
||||||
|
|
||||||
|
|||||||
Generated
+79
-22
@@ -611,10 +611,29 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"herdr": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_5",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1788910531,
|
||||||
|
"narHash": "sha256-IfO2SVreHPRwWmRMR2mgd1ffuP67TxLsR7YrcC4z/EU=",
|
||||||
|
"owner": "herdrdev",
|
||||||
|
"repo": "herdr",
|
||||||
|
"rev": "b9ce96869e89937278d673d70ae4c135dd318469",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "herdrdev",
|
||||||
|
"repo": "herdr",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"hermes-agent": {
|
"hermes-agent": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_6",
|
||||||
"npm-lockfile-fix": "npm-lockfile-fix",
|
"npm-lockfile-fix": "npm-lockfile-fix",
|
||||||
"pyproject-build-systems": "pyproject-build-systems",
|
"pyproject-build-systems": "pyproject-build-systems",
|
||||||
"pyproject-nix": "pyproject-nix",
|
"pyproject-nix": "pyproject-nix",
|
||||||
@@ -774,7 +793,7 @@
|
|||||||
"hyprutils": "hyprutils",
|
"hyprutils": "hyprutils",
|
||||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||||
"hyprwire": "hyprwire",
|
"hyprwire": "hyprwire",
|
||||||
"nixpkgs": "nixpkgs_6",
|
"nixpkgs": "nixpkgs_7",
|
||||||
"pre-commit-hooks": "pre-commit-hooks_2",
|
"pre-commit-hooks": "pre-commit-hooks_2",
|
||||||
"systems": "systems_3",
|
"systems": "systems_3",
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
@@ -963,7 +982,7 @@
|
|||||||
"hyprutils": "hyprutils_2",
|
"hyprutils": "hyprutils_2",
|
||||||
"hyprwayland-scanner": "hyprwayland-scanner_2",
|
"hyprwayland-scanner": "hyprwayland-scanner_2",
|
||||||
"hyprwire": "hyprwire_2",
|
"hyprwire": "hyprwire_2",
|
||||||
"nixpkgs": "nixpkgs_7",
|
"nixpkgs": "nixpkgs_8",
|
||||||
"systems": "systems_4"
|
"systems": "systems_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -1311,7 +1330,7 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_8"
|
"nixpkgs": "nixpkgs_9"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1786867632,
|
"lastModified": 1786867632,
|
||||||
@@ -1390,6 +1409,20 @@
|
|||||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_10": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1786711500,
|
||||||
|
"narHash": "sha256-QvnceIGTBeDvDd9oCn+GvdsnkquliuwbVgpiRH68qaQ=",
|
||||||
|
"rev": "02e08985a27c65ffd33d434eeb2e660a2e4dc84d",
|
||||||
|
"revCount": 1011966,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1011966%2Brev-02e08985a27c65ffd33d434eeb2e660a2e4dc84d/01a003f1-59bd-7782-b0ed-5cbf8697f61e/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/NixOS/nixpkgs/0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1784160687,
|
"lastModified": 1784160687,
|
||||||
@@ -1435,6 +1468,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779911860,
|
||||||
|
"narHash": "sha256-ubcLAcKBDCZjhxw/kH5DL5GdBZQdzLqpkTe7HonvJVs=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c0a89c379b4ac67c7b13b051ddbd4e0dbc9b0eaf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1785318670,
|
"lastModified": 1785318670,
|
||||||
"narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=",
|
"narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=",
|
||||||
@@ -1450,7 +1499,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1787736819,
|
"lastModified": 1787736819,
|
||||||
"narHash": "sha256-cV5xEJJK3BvhU8rEd4mC9UsmDi5qscv/kzGPhBRC5WA=",
|
"narHash": "sha256-cV5xEJJK3BvhU8rEd4mC9UsmDi5qscv/kzGPhBRC5WA=",
|
||||||
@@ -1466,7 +1515,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_8": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1786247143,
|
"lastModified": 1786247143,
|
||||||
"narHash": "sha256-8S3Kcxs7D4UtxJxSJZz0m14CGhuW0MxfrIwJxeGWGnQ=",
|
"narHash": "sha256-8S3Kcxs7D4UtxJxSJZz0m14CGhuW0MxfrIwJxeGWGnQ=",
|
||||||
@@ -1482,7 +1531,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_8": {
|
"nixpkgs_9": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767892417,
|
"lastModified": 1767892417,
|
||||||
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
|
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
|
||||||
@@ -1495,20 +1544,6 @@
|
|||||||
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_9": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1786711500,
|
|
||||||
"narHash": "sha256-QvnceIGTBeDvDd9oCn+GvdsnkquliuwbVgpiRH68qaQ=",
|
|
||||||
"rev": "02e08985a27c65ffd33d434eeb2e660a2e4dc84d",
|
|
||||||
"revCount": 1011966,
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1011966%2Brev-02e08985a27c65ffd33d434eeb2e660a2e4dc84d/01a003f1-59bd-7782-b0ed-5cbf8697f61e/source.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"noctalia": {
|
"noctalia": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -1678,6 +1713,7 @@
|
|||||||
"dms": "dms",
|
"dms": "dms",
|
||||||
"flox": "flox",
|
"flox": "flox",
|
||||||
"git-hooks": "git-hooks",
|
"git-hooks": "git-hooks",
|
||||||
|
"herdr": "herdr",
|
||||||
"hermes-agent": "hermes-agent",
|
"hermes-agent": "hermes-agent",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
@@ -1686,7 +1722,7 @@
|
|||||||
"nix-flatpak": "nix-flatpak",
|
"nix-flatpak": "nix-flatpak",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_9",
|
"nixpkgs": "nixpkgs_10",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"noctalia": "noctalia",
|
"noctalia": "noctalia",
|
||||||
"stylix": "stylix",
|
"stylix": "stylix",
|
||||||
@@ -1711,6 +1747,27 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"herdr",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1783577481,
|
||||||
|
"narHash": "sha256-EWMxOWrJ031f8f/lrcEmhTRs4npw1/5N3Hcjin846c8=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "4cdea398dc491b082dccdce0fad1ed0b75fa3394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"stylix": {
|
"stylix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"base16": "base16",
|
"base16": "base16",
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
url = "github:zackb/tether";
|
url = "github:zackb/tether";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
herdr.url = "github:herdrdev/herdr";
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
{ self
|
{ self
|
||||||
@@ -85,8 +86,9 @@
|
|||||||
, nix-index-database
|
, nix-index-database
|
||||||
, agenix
|
, agenix
|
||||||
, hermes-agent
|
, hermes-agent
|
||||||
, claude-desktop
|
|
||||||
, tether
|
, tether
|
||||||
|
, herdr
|
||||||
|
, claude-desktop
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# Libs
|
# Libs
|
||||||
@@ -124,6 +126,7 @@
|
|||||||
flox
|
flox
|
||||||
determinate
|
determinate
|
||||||
tether
|
tether
|
||||||
|
herdr
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -203,15 +206,10 @@
|
|||||||
openwrt-glmain = (openwrt (import ./openwrt-routers/glmain.nix)).deployScript;
|
openwrt-glmain = (openwrt (import ./openwrt-routers/glmain.nix)).deployScript;
|
||||||
openwrt-glmain-dry-run = (openwrt (import ./openwrt-routers/glmain.nix)).dryRunScript;
|
openwrt-glmain-dry-run = (openwrt (import ./openwrt-routers/glmain.nix)).dryRunScript;
|
||||||
grok-cli = lib.pkgs.${system}.grok-cli;
|
grok-cli = lib.pkgs.${system}.grok-cli;
|
||||||
# CPU variant of DwarfStar (antirez/ds4); buildable on any system.
|
|
||||||
# GPU variants (ds4-rocm/ds4-cuda) are overlay-only — see modules/core.
|
|
||||||
ds4 = lib.pkgs.${system}.ds4;
|
ds4 = lib.pkgs.${system}.ds4;
|
||||||
claude-desktop = pkgs.callPackage ./pkgs/claude-desktop { };
|
|
||||||
# Buzz Desktop AppImage (block/buzz) with NixOS FHS extras.
|
|
||||||
buzz-desktop = lib.pkgs.${system}.buzz-desktop;
|
buzz-desktop = lib.pkgs.${system}.buzz-desktop;
|
||||||
# CPU variant of colibrì (JustVugg/colibri); the ROCm variant
|
|
||||||
# (colibri-rocm) is overlay-only — see modules/core.
|
|
||||||
colibri = lib.pkgs.${system}.colibri;
|
colibri = lib.pkgs.${system}.colibri;
|
||||||
|
herdr = herdr.packages.${system}.default;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -3,8 +3,6 @@
|
|||||||
, lib
|
, lib
|
||||||
, user
|
, user
|
||||||
, unstablePkgs
|
, unstablePkgs
|
||||||
, claude-desktop
|
|
||||||
, flox
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -214,7 +212,7 @@ in
|
|||||||
orca-slicer
|
orca-slicer
|
||||||
devcontainer
|
devcontainer
|
||||||
gpu-screen-recorder
|
gpu-screen-recorder
|
||||||
flox.packages.${pkgs.stdenv.hostPlatform.system}.default
|
flox_dev
|
||||||
|
|
||||||
# Run macos apps
|
# Run macos apps
|
||||||
darling-dmg
|
darling-dmg
|
||||||
@@ -243,6 +241,7 @@ in
|
|||||||
claude-code
|
claude-code
|
||||||
buzz-desktop
|
buzz-desktop
|
||||||
bubblewrap
|
bubblewrap
|
||||||
|
herdr
|
||||||
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,6 @@
|
|||||||
{ pkgs
|
{ pkgs
|
||||||
, config
|
, config
|
||||||
, skygUtils
|
, unstablePkgs
|
||||||
, lib
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -153,12 +152,13 @@ in
|
|||||||
# development
|
# development
|
||||||
zed-editor-fhs
|
zed-editor-fhs
|
||||||
nix-prefetch
|
nix-prefetch
|
||||||
|
herdr
|
||||||
|
|
||||||
# Steam
|
# Steam
|
||||||
mangohud
|
mangohud
|
||||||
|
|
||||||
# LLM Stuff
|
# LLM Stuff
|
||||||
ollama-rocm
|
unstablePkgs.ollama-rocm
|
||||||
grok-cli
|
grok-cli
|
||||||
# stable-diffusion-cpp-rocm
|
# stable-diffusion-cpp-rocm
|
||||||
lmstudio
|
lmstudio
|
||||||
|
|||||||
+17
-6
@@ -1,12 +1,23 @@
|
|||||||
{ lib, pkgs, config, determinate, ... }:
|
{ lib
|
||||||
|
, pkgs
|
||||||
|
, config
|
||||||
|
, determinate
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
skyg = {
|
skyg = {
|
||||||
user.enable = true;
|
user.enable = false;
|
||||||
nixos = {
|
nixos = {
|
||||||
common.ssh-server.enable = true;
|
common = {
|
||||||
common.hardware = {
|
minimal = true;
|
||||||
sound.enable = true;
|
fonts.minimal = true;
|
||||||
pipewire.enable = true;
|
ssh-server.enable = true;
|
||||||
|
containers.enable = false;
|
||||||
|
networking.nfsServer.enable = false;
|
||||||
|
hardware = {
|
||||||
|
sound.enable = true;
|
||||||
|
pipewire.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
desktop = {
|
desktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ core/
|
|||||||
|
|
||||||
- **Overlays** (`default.nix`): exposes the `pkgs/` packages — `grok-cli`, `ds4`
|
- **Overlays** (`default.nix`): exposes the `pkgs/` packages — `grok-cli`, `ds4`
|
||||||
(+`ds4-rocm`/`ds4-cuda`), `colibri` (+`colibri-rocm`), `niri-touchscreen-gestures`,
|
(+`ds4-rocm`/`ds4-cuda`), `colibri` (+`colibri-rocm`), `niri-touchscreen-gestures`,
|
||||||
`buzz-desktop`, `ollama` (+`ollama-rocm`/`ollama-vulkan`) — and patches
|
`buzz-desktop`, — and patches `python3Packages.pipx` to skip its flaky install check on nixpkgs 26.05.
|
||||||
`python3Packages.pipx` to skip its flaky install check on nixpkgs 26.05.
|
|
||||||
- **Distributed builds** (`default.nix`): registers `bigbox1.lab.internal` and
|
- **Distributed builds** (`default.nix`): registers `bigbox1.lab.internal` and
|
||||||
`fwdesk.lab.internal` as remote `x86_64-linux` build machines and enables
|
`fwdesk.lab.internal` as remote `x86_64-linux` build machines and enables
|
||||||
`builders-use-substitutes`.
|
`builders-use-substitutes`.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ lib, ... }:
|
{ lib, herdr, flox, claude-desktop, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./user.nix
|
./user.nix
|
||||||
@@ -29,11 +29,12 @@
|
|||||||
niri-touchscreen-gestures = final.callPackage ../../pkgs/niri-touchscreen-gestures { };
|
niri-touchscreen-gestures = final.callPackage ../../pkgs/niri-touchscreen-gestures { };
|
||||||
# Buzz Desktop AppImage wrapper, see pkgs/buzz-desktop.
|
# Buzz Desktop AppImage wrapper, see pkgs/buzz-desktop.
|
||||||
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
||||||
# ollama pinned ahead of nixpkgs (0.32.14 vs the 0.32.7 in stable/unstable).
|
# Claude Desktop (Linux), see pkgs/claude-desktop.
|
||||||
# See pkgs/ollama for hashing instructions.
|
claude-desktop = claude-desktop.packages.${final.system}.default;
|
||||||
ollama = final.callPackage ../../pkgs/ollama { };
|
# herdr (herdrdev/herdr) — see flake.nix input.
|
||||||
ollama-rocm = final.callPackage ../../pkgs/ollama { acceleration = "rocm"; };
|
herdr = herdr.packages.${final.system}.default;
|
||||||
ollama-vulkan = final.callPackage ../../pkgs/ollama { acceleration = "vulkan"; };
|
# flox (flox/flox) — see flake.nix input.
|
||||||
|
flox_dev = flox.packages.${final.system}.default;
|
||||||
})
|
})
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ Most leaf modules expose a `skyg.nixos.common.*` enable flag and stay inert unti
|
|||||||
```
|
```
|
||||||
common/
|
common/
|
||||||
├── default.nix # Imports everything below + always-on env defaults
|
├── default.nix # Imports everything below + always-on env defaults
|
||||||
├── core.nix # System packages, nh, nix-ld, timezone (Toronto), locale, GC cron
|
├── core.nix # System packages, nh, nix-ld, timezone (Toronto), locale, GC cron; skyg.nixos.common.minimal
|
||||||
├── networking.nix # skyg.core.hostName, NetworkManager, NFS server
|
├── networking.nix # skyg.core.hostName, NetworkManager, NFS server (skyg.nixos.common.networking.nfsServer)
|
||||||
├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell
|
├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell
|
||||||
├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …)
|
├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …); skyg.nixos.common.fonts.minimal
|
||||||
├── ssh-server.nix # skyg.nixos.common.ssh-server — hardened sshd + master pubkey
|
├── ssh-server.nix # skyg.nixos.common.ssh-server — hardened sshd + master pubkey
|
||||||
├── ssh-notify.nix # skyg.nixos.common.ssh-notify — forward notify-send from SSH sessions to a desktop client
|
├── ssh-notify.nix # skyg.nixos.common.ssh-notify — forward notify-send from SSH sessions to a desktop client
|
||||||
├── qemu.nix # skyg.core.qemu — QEMU/quickemu + SPICE guest tooling
|
├── qemu.nix # skyg.core.qemu — QEMU/quickemu + SPICE guest tooling
|
||||||
@@ -43,7 +43,10 @@ skyg.core.qemu.* → qemu.nix
|
|||||||
skyg.nixos.common.ssh-server.* → ssh-server.nix
|
skyg.nixos.common.ssh-server.* → ssh-server.nix
|
||||||
skyg.nixos.common.ssh-notify.* → ssh-notify.nix
|
skyg.nixos.common.ssh-notify.* → ssh-notify.nix
|
||||||
skyg.nixos.common.cachePush.* → binary-cache.nix
|
skyg.nixos.common.cachePush.* → binary-cache.nix
|
||||||
skyg.nixos.common.containers.* → containers/
|
skyg.nixos.common.minimal → core.nix (skip heavy always-on system packages)
|
||||||
|
skyg.nixos.common.fonts.minimal → fonts.nix (install only a minimal font set)
|
||||||
|
skyg.nixos.common.networking.nfsServer → networking.nix (enable/disable the NFS server)
|
||||||
|
skyg.nixos.common.containers.* → containers/
|
||||||
skyg.nixos.common.hardware.* → hardware/
|
skyg.nixos.common.hardware.* → hardware/
|
||||||
skyg.nixos.common.pritunl.* → pritunl/
|
skyg.nixos.common.pritunl.* → pritunl/
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ consistently (compose tooling, user group membership, OCI backend, metrics).
|
|||||||
### Option namespace
|
### Option namespace
|
||||||
|
|
||||||
```
|
```
|
||||||
|
skyg.nixos.common.containers.enable → false to disable the container runtime entirely
|
||||||
skyg.nixos.common.containers.runtime → "docker" | "podman"
|
skyg.nixos.common.containers.runtime → "docker" | "podman"
|
||||||
skyg.nixos.common.containers.enableOnBoot
|
skyg.nixos.common.containers.enableOnBoot
|
||||||
skyg.nixos.common.containers.localDockerRegistries
|
skyg.nixos.common.containers.localDockerRegistries
|
||||||
|
|||||||
@@ -8,6 +8,11 @@
|
|||||||
];
|
];
|
||||||
options = {
|
options = {
|
||||||
skyg.nixos.common.containers = {
|
skyg.nixos.common.containers = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
description = "Whether to enable the container runtime (docker/podman).";
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
runtime = lib.mkOption {
|
runtime = lib.mkOption {
|
||||||
description = "Docker vs podman";
|
description = "Docker vs podman";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let
|
|||||||
cfg = config.skyg.nixos.common.containers;
|
cfg = config.skyg.nixos.common.containers;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf (cfg.runtime == "docker") {
|
config = lib.mkIf (cfg.enable && cfg.runtime == "docker") {
|
||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autoPrune.enable = true;
|
autoPrune.enable = true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ let
|
|||||||
cfg = config.skyg.nixos.common.containers;
|
cfg = config.skyg.nixos.common.containers;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf (cfg.runtime == "podman") {
|
config = lib.mkIf (cfg.enable && cfg.runtime == "podman") {
|
||||||
virtualisation.oci-containers.backend = "podman";
|
virtualisation.oci-containers.backend = "podman";
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
podman = {
|
podman = {
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
default = 7;
|
default = 7;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
nixos.common.minimal = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "Minimal common system: skip heavy always-on packages for lean hosts.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = let skyg = config.skyg; in {
|
config = let skyg = config.skyg; in {
|
||||||
|
|
||||||
@@ -29,35 +34,39 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
clean.enable = true;
|
clean.enable = true;
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages =
|
||||||
# shell tools
|
(with pkgs; [
|
||||||
git
|
# shell tools
|
||||||
usbutils
|
git
|
||||||
|
usbutils
|
||||||
|
|
||||||
# system utils
|
# shell tools
|
||||||
nfs-utils
|
wget
|
||||||
lm_sensors
|
])
|
||||||
hwinfo
|
# On lean hosts, skip the heavy server/nix-dev extra tools.
|
||||||
dig
|
++ (lib.optionals (!config.skyg.nixos.common.minimal) (with pkgs; [
|
||||||
iperf
|
# system utils
|
||||||
|
nfs-utils
|
||||||
|
lm_sensors
|
||||||
|
hwinfo
|
||||||
|
dig
|
||||||
|
iperf
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
glib-networking
|
glib-networking
|
||||||
glib
|
glib
|
||||||
glibc
|
glibc
|
||||||
|
|
||||||
# printer
|
# printer
|
||||||
system-config-printer
|
system-config-printer
|
||||||
|
|
||||||
# nix utils
|
# nix utils
|
||||||
nix-index
|
nix-index
|
||||||
nil
|
nil
|
||||||
cachix
|
cachix
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
nvd
|
nvd
|
||||||
# shell tools
|
]));
|
||||||
wget
|
|
||||||
];
|
|
||||||
services.xserver.excludePackages = with pkgs; [
|
services.xserver.excludePackages = with pkgs; [
|
||||||
xterm
|
xterm
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
fontPackages = with pkgs; [
|
fullFontPackages = with pkgs; [
|
||||||
nerd-fonts.fira-code
|
nerd-fonts.fira-code
|
||||||
nerd-fonts.droid-sans-mono
|
nerd-fonts.droid-sans-mono
|
||||||
nerd-fonts.fira-mono
|
nerd-fonts.fira-mono
|
||||||
@@ -14,20 +14,38 @@ let
|
|||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
noto-fonts-color-emoji
|
noto-fonts-color-emoji
|
||||||
];
|
];
|
||||||
|
minimalFontPackages = with pkgs; [
|
||||||
|
fira-code
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-color-emoji
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = fontPackages;
|
options.skyg.nixos.common.fonts = {
|
||||||
fonts = {
|
minimal = lib.mkOption {
|
||||||
packages = fontPackages;
|
type = lib.types.bool;
|
||||||
enableDefaultPackages = true;
|
description = "Install only a minimal font set (for lean hosts).";
|
||||||
fontDir.enable = true;
|
default = false;
|
||||||
fontconfig = {
|
|
||||||
enable = true;
|
|
||||||
defaultFonts = {
|
|
||||||
serif = [ "Fira Code" "DroidSansMono" ];
|
|
||||||
sansSerif = [ "Fira Code" "DroidSansMono" ];
|
|
||||||
monospace = [ "Fira Code" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
fontPackages = if config.skyg.nixos.common.fonts.minimal then minimalFontPackages else fullFontPackages;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = fontPackages;
|
||||||
|
fonts = {
|
||||||
|
packages = fontPackages;
|
||||||
|
enableDefaultPackages = true;
|
||||||
|
fontDir.enable = true;
|
||||||
|
fontconfig = {
|
||||||
|
enable = true;
|
||||||
|
defaultFonts = {
|
||||||
|
serif = [ "Fira Code" "DroidSansMono" ];
|
||||||
|
sansSerif = [ "Fira Code" "DroidSansMono" ];
|
||||||
|
monospace = [ "Fira Code" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,13 @@ in
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
skyg.nixos.common.networking = {
|
||||||
|
nfsServer.enable = lib.mkOption {
|
||||||
|
description = "Enable the NFS server (services.nfs.server).";
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
# Define hostname.
|
# Define hostname.
|
||||||
@@ -19,7 +26,7 @@ in
|
|||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
# NFS Support
|
# NFS Support
|
||||||
services.nfs.server.enable = true;
|
services.nfs.server.enable = config.skyg.nixos.common.networking.nfsServer.enable;
|
||||||
|
|
||||||
# Disable the flaky nm service
|
# Disable the flaky nm service
|
||||||
systemd.services.NetworkManager-wait-online.enable = false;
|
systemd.services.NetworkManager-wait-online.enable = false;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg.name != "" && cfg.createSystemUser) {
|
config = lib.mkIf (cfg.name != "" && cfg.createSystemUser) {
|
||||||
|
programs.zsh.enable = true;
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ independent `skyg.nixos.server.services.<name>.enable` flag. Most run as OCI con
|
|||||||
```
|
```
|
||||||
services/
|
services/
|
||||||
├── default.nix # imports the services below
|
├── default.nix # imports the services below
|
||||||
├── ai-services.nix # skyg.nixos.server.services.ai — ollama + Wyoming (whisper/piper/wake)
|
├── ai-services.nix # skyg.nixos.server.services.ai — Wyoming (whisper/piper/wake)
|
||||||
├── audiobookshelf.nix # skyg.nixos.server.services.audiobookshelf — audiobook/podcast server
|
├── audiobookshelf.nix # skyg.nixos.server.services.audiobookshelf — audiobook/podcast server
|
||||||
├── ds4.nix # skyg.nixos.server.services.ds4 — ds4-server HTTP API (DwarfStar local inference)
|
├── ds4.nix # skyg.nixos.server.services.ds4 — ds4-server HTTP API (DwarfStar local inference)
|
||||||
├── jellyfin.nix # skyg.nixos.server.services.jellyfin — media server (uid/gid 7777)
|
├── jellyfin.nix # skyg.nixos.server.services.jellyfin — media server (uid/gid 7777)
|
||||||
@@ -21,7 +21,7 @@ services/
|
|||||||
|
|
||||||
## Notable details
|
## Notable details
|
||||||
|
|
||||||
- **`ai-services.nix`** runs ollama (GPU-passthrough) and openwakeword as containers and
|
- **`ai-services.nix`** openwakeword as containers and
|
||||||
enables NixOS-native Wyoming faster-whisper + piper. Opens 11434/10200/10300/10400.
|
enables NixOS-native Wyoming faster-whisper + piper. Opens 11434/10200/10300/10400.
|
||||||
- **`ds4.nix`** runs `ds4-server` (the OpenAI/Anthropic-compatible HTTP API for DwarfStar
|
- **`ds4.nix`** runs `ds4-server` (the OpenAI/Anthropic-compatible HTTP API for DwarfStar
|
||||||
DeepSeek V4 inference) as a native systemd service. `package` selects the backend
|
DeepSeek V4 inference) as a native systemd service. `package` selects the backend
|
||||||
|
|||||||
@@ -24,13 +24,6 @@ in
|
|||||||
networking.firewall.allowedTCPPorts = openPorts;
|
networking.firewall.allowedTCPPorts = openPorts;
|
||||||
virtualisation.oci-containers = {
|
virtualisation.oci-containers = {
|
||||||
containers = {
|
containers = {
|
||||||
# ollama = {
|
|
||||||
# autoStart = true;
|
|
||||||
# image = "ollama/ollama";
|
|
||||||
# extraOptions = [ "--device=nvidia.com/gpu=all" ];
|
|
||||||
# ports = [ "11434:11434" ];
|
|
||||||
# volumes = [ "ollama:/root/.ollama" ];
|
|
||||||
# };
|
|
||||||
openwakeword = {
|
openwakeword = {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
image = "rhasspy/wyoming-openwakeword";
|
image = "rhasspy/wyoming-openwakeword";
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ Packages here are exposed via an overlay defined in `modules/core/default.nix`.
|
|||||||
| `ds4/` | DwarfStar (`antirez/ds4`) DeepSeek V4 local inference engine, built from source. Backend-parameterized (`backend = "cpu" \| "rocm" \| "cuda"`); tracks `main` and builds per-host. Exposed as `pkgs.ds4` (cpu, default), `pkgs.ds4-rocm` (Strix Halo / gfx1151), `pkgs.ds4-cuda`. Installs the `ds4`, `ds4-server`, `ds4-bench`, `ds4-eval`, `ds4-agent` binaries plus a `ds4-download-model` helper for fetching GGUF weights. Model weights are a runtime concern and not packaged. |
|
| `ds4/` | DwarfStar (`antirez/ds4`) DeepSeek V4 local inference engine, built from source. Backend-parameterized (`backend = "cpu" \| "rocm" \| "cuda"`); tracks `main` and builds per-host. Exposed as `pkgs.ds4` (cpu, default), `pkgs.ds4-rocm` (Strix Halo / gfx1151), `pkgs.ds4-cuda`. Installs the `ds4`, `ds4-server`, `ds4-bench`, `ds4-eval`, `ds4-agent` binaries plus a `ds4-download-model` helper for fetching GGUF weights. Model weights are a runtime concern and not packaged. |
|
||||||
| `colibri/` | colibrì (`JustVugg/colibri`) — GLM-5.2/OLMoE local inference engine, built from source, pinned to a tagged release. Backend-parameterized (`backend = "cpu" \| "rocm"`). Exposed as `pkgs.colibri` (cpu, default), `pkgs.colibri-rocm` (Strix Halo / gfx1151). Installs the `coli` CLI (wrapped with the Python env its converter/bench subcommands need) plus the bundled `colibri`/`olmoe` engine binaries. Model weights are a runtime concern and not packaged. |
|
| `colibri/` | colibrì (`JustVugg/colibri`) — GLM-5.2/OLMoE local inference engine, built from source, pinned to a tagged release. Backend-parameterized (`backend = "cpu" \| "rocm"`). Exposed as `pkgs.colibri` (cpu, default), `pkgs.colibri-rocm` (Strix Halo / gfx1151). Installs the `coli` CLI (wrapped with the Python env its converter/bench subcommands need) plus the bundled `colibri`/`olmoe` engine binaries. Model weights are a runtime concern and not packaged. |
|
||||||
| `niri-touchscreen-gestures/` | Python daemon that reads multi-touch events from a touchscreen via `evdev`, detects 2/3/4-finger swipes (up/down/left/right), and dispatches configurable `niri msg action` commands. Configured via TOML; exposed as `pkgs.niri-touchscreen-gestures`. |
|
| `niri-touchscreen-gestures/` | Python daemon that reads multi-touch events from a touchscreen via `evdev`, detects 2/3/4-finger swipes (up/down/left/right), and dispatches configurable `niri msg action` commands. Configured via TOML; exposed as `pkgs.niri-touchscreen-gestures`. |
|
||||||
| `ollama/` | Ollama local LLM inference server, pinned ahead of nixpkgs (0.32.14 vs 0.32.7 in stable/unstable). Derived from nixpkgs master's 0.32.13 derivation (FetchContent-based llama.cpp, Vulkan/ROCm backends) bumped to 0.32.14. Exposed as `pkgs.ollama` (cpu), `pkgs.ollama-rocm` (Strix Halo / gfx1151), `pkgs.ollama-vulkan`. |
|
|
||||||
| `buzz-desktop/` | Block Buzz desktop (Type-2 AppImage from `block/buzz`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.buzz-desktop` (`buzz-desktop` binary + desktop entry / icons). |
|
| `buzz-desktop/` | Block Buzz desktop (Type-2 AppImage from `block/buzz`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.buzz-desktop` (`buzz-desktop` binary + desktop entry / icons). |
|
||||||
| `claude-desktop/` | Claude Desktop (Linux) — `.deb` fetched from `downloads.claude.ai`, unpacked and re-wrapped with `makeWrapper` (binary moved aside, `LD_LIBRARY_PATH` pointed at its bundled libs). Exposed as the `claude-desktop` flake output (via `pkgs.callPackage` in `flake.nix`, not the core overlay) and installed on `fwbook`. |
|
|
||||||
|
|
||||||
## Adding a New Package
|
## Adding a New Package
|
||||||
|
|
||||||
|
|||||||
@@ -1,339 +0,0 @@
|
|||||||
# ollama — local LLM inference server, version-pinned ahead of nixpkgs.
|
|
||||||
#
|
|
||||||
# Derived from nixpkgs master's ollama package.nix at the 0.32.13 commit
|
|
||||||
# (which introduced the FetchContent-based llama.cpp build, Vulkan/ROCm/CUDA
|
|
||||||
# backends, and spirv-headers). Updated to 0.32.14.
|
|
||||||
#
|
|
||||||
# UPDATING THIS PACKAGE
|
|
||||||
# =====================
|
|
||||||
# 1. Set `version` to the new tag (without "v").
|
|
||||||
# 2. Set `src.hash` to `lib.fakeHash` and attempt a build.
|
|
||||||
# Copy the "got: sha256-..." value from the Nix error output.
|
|
||||||
# 3. Set `vendorHash` to `lib.fakeHash` and attempt a build again.
|
|
||||||
# Copy the "got: sha256-..." value from the Nix error output.
|
|
||||||
# 4. Check whether LLAMA_CPP_VERSION changed in the new release tag.
|
|
||||||
# If so, also update `llamaCppVersion` and `llamaCppSrc.hash`.
|
|
||||||
|
|
||||||
{ lib
|
|
||||||
, buildGoModule
|
|
||||||
, fetchFromGitHub
|
|
||||||
, buildEnv
|
|
||||||
, makeBinaryWrapper
|
|
||||||
, stdenv
|
|
||||||
, addDriverRunpath
|
|
||||||
, cmake
|
|
||||||
, gitMinimal
|
|
||||||
, clblast
|
|
||||||
, libdrm
|
|
||||||
, rocmPackages
|
|
||||||
, rocmGpuTargets ? rocmPackages.clr.localGpuTargets or (rocmPackages.clr.gpuTargets or [ ])
|
|
||||||
, cudaPackages
|
|
||||||
, cudaArches ? cudaPackages.flags.realArches or [ ]
|
|
||||||
, autoAddDriverRunpath
|
|
||||||
, apple-sdk_15
|
|
||||||
, vulkan-tools
|
|
||||||
, vulkan-headers
|
|
||||||
, vulkan-loader
|
|
||||||
, spirv-headers
|
|
||||||
, shaderc
|
|
||||||
, ccache
|
|
||||||
, versionCheckHook
|
|
||||||
, writableTmpDirAsHomeHook
|
|
||||||
, config
|
|
||||||
, # one of `[ null false "rocm" "cuda" "vulkan" ]`
|
|
||||||
acceleration ? null
|
|
||||||
,
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert builtins.elem acceleration [
|
|
||||||
null
|
|
||||||
false
|
|
||||||
"rocm"
|
|
||||||
"cuda"
|
|
||||||
"vulkan"
|
|
||||||
];
|
|
||||||
|
|
||||||
let
|
|
||||||
validateFallback = lib.warnIf (config.rocmSupport && config.cudaSupport)
|
|
||||||
(lib.concatStrings [
|
|
||||||
"both `nixpkgs.config.rocmSupport` and `nixpkgs.config.cudaSupport` are enabled, "
|
|
||||||
"but they are mutually exclusive; falling back to cpu"
|
|
||||||
])
|
|
||||||
(!(config.rocmSupport && config.cudaSupport));
|
|
||||||
shouldEnable =
|
|
||||||
mode: fallback: (acceleration == mode) || (fallback && acceleration == null && validateFallback);
|
|
||||||
|
|
||||||
rocmRequested = shouldEnable "rocm" config.rocmSupport;
|
|
||||||
cudaRequested = shouldEnable "cuda" config.cudaSupport;
|
|
||||||
vulkanRequested = acceleration == "vulkan";
|
|
||||||
|
|
||||||
enableRocm = rocmRequested && stdenv.hostPlatform.isLinux;
|
|
||||||
enableCuda = cudaRequested && stdenv.hostPlatform.isLinux;
|
|
||||||
enableVulkan = vulkanRequested && stdenv.hostPlatform.isLinux;
|
|
||||||
|
|
||||||
rocmLibs = [
|
|
||||||
rocmPackages.clr
|
|
||||||
rocmPackages.hipblas-common
|
|
||||||
rocmPackages.hipblas
|
|
||||||
rocmPackages.rocblas
|
|
||||||
rocmPackages.rocsolver
|
|
||||||
rocmPackages.rocsparse
|
|
||||||
rocmPackages.rocm-device-libs
|
|
||||||
rocmPackages.rocm-smi
|
|
||||||
];
|
|
||||||
rocmPath = buildEnv {
|
|
||||||
name = "rocm-path";
|
|
||||||
paths = rocmLibs;
|
|
||||||
};
|
|
||||||
|
|
||||||
cudaLibs = [
|
|
||||||
cudaPackages.cuda_cudart
|
|
||||||
cudaPackages.libcublas
|
|
||||||
cudaPackages.cccl
|
|
||||||
];
|
|
||||||
|
|
||||||
vulkanLibs = [
|
|
||||||
vulkan-headers
|
|
||||||
vulkan-loader
|
|
||||||
];
|
|
||||||
|
|
||||||
cudaMajorVersion = lib.versions.major cudaPackages.cuda_cudart.version;
|
|
||||||
|
|
||||||
cudaToolkit = buildEnv {
|
|
||||||
name = "cuda-merged-${cudaMajorVersion}";
|
|
||||||
paths = map lib.getLib cudaLibs ++ [
|
|
||||||
(lib.getOutput "static" cudaPackages.cuda_cudart)
|
|
||||||
(lib.getBin (cudaPackages.cuda_nvcc.__spliced.buildHost or cudaPackages.cuda_nvcc))
|
|
||||||
];
|
|
||||||
ignoreCollisions = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
cudaPath = lib.removeSuffix "-${cudaMajorVersion}" cudaToolkit;
|
|
||||||
|
|
||||||
# Since v0.30, llama.cpp is consumed via CMake FetchContent rather than
|
|
||||||
# vendored in-tree. Pre-stage the pin so the FetchContent step uses our
|
|
||||||
# copy instead of trying to clone over the network in the sandbox.
|
|
||||||
# Check LLAMA_CPP_VERSION in the ollama source tree when bumping.
|
|
||||||
llamaCppVersion = "b10434";
|
|
||||||
llamaCppSrc = fetchFromGitHub {
|
|
||||||
owner = "ggml-org";
|
|
||||||
repo = "llama.cpp";
|
|
||||||
tag = llamaCppVersion;
|
|
||||||
hash = "sha256-Sz0kW1q91YzdrKbZUqMbFJ0DLZrzARSGheUrtCKcoQo=";
|
|
||||||
};
|
|
||||||
|
|
||||||
wrapperOptions = [
|
|
||||||
"--suffix LD_LIBRARY_PATH : '${addDriverRunpath.driverLink}/lib'"
|
|
||||||
]
|
|
||||||
++ lib.optionals enableRocm [
|
|
||||||
"--suffix LD_LIBRARY_PATH : '${rocmPath}/lib'"
|
|
||||||
"--set-default HIP_PATH '${rocmPath}'"
|
|
||||||
]
|
|
||||||
++ lib.optionals enableCuda [
|
|
||||||
"--suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath (map lib.getLib cudaLibs)}'"
|
|
||||||
]
|
|
||||||
++ lib.optionals enableVulkan [
|
|
||||||
"--suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath (map lib.getLib vulkanLibs)}'"
|
|
||||||
"--set-default OLLAMA_VULKAN '1'"
|
|
||||||
];
|
|
||||||
wrapperArgs = builtins.concatStringsSep " " wrapperOptions;
|
|
||||||
|
|
||||||
goBuild =
|
|
||||||
if enableCuda then
|
|
||||||
buildGoModule.override { stdenv = cudaPackages.backendStdenv; }
|
|
||||||
else if enableRocm then
|
|
||||||
buildGoModule.override { inherit (rocmPackages) stdenv; }
|
|
||||||
else if enableVulkan then
|
|
||||||
buildGoModule.override { inherit (vulkan-tools) stdenv; }
|
|
||||||
else
|
|
||||||
buildGoModule;
|
|
||||||
|
|
||||||
inherit (lib) licenses platforms maintainers;
|
|
||||||
in
|
|
||||||
goBuild (finalAttrs: {
|
|
||||||
pname = "ollama";
|
|
||||||
version = "0.32.14";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "ollama";
|
|
||||||
repo = "ollama";
|
|
||||||
tag = "v${finalAttrs.version}";
|
|
||||||
hash = "sha256-wvEG7L61gYI63pfHZ9UnTVQh8QMG3wHMfxEBeshtIKQ=";
|
|
||||||
};
|
|
||||||
|
|
||||||
vendorHash = "sha256-HMwoaFBMbpoy8f0I+O+i7kIa9BslLu3FcVWeaIOkpvs=";
|
|
||||||
proxyVendor = true;
|
|
||||||
|
|
||||||
env =
|
|
||||||
lib.optionalAttrs enableRocm
|
|
||||||
{
|
|
||||||
ROCM_PATH = rocmPath;
|
|
||||||
CLBlast_DIR = "${clblast}/lib/cmake/CLBlast";
|
|
||||||
HIP_PATH = rocmPath;
|
|
||||||
CFLAGS = "-Wno-c++17-extensions -I${rocmPath}/include";
|
|
||||||
CXXFLAGS = "-Wno-c++17-extensions -I${rocmPath}/include";
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs enableCuda { CUDA_PATH = cudaPath; }
|
|
||||||
// lib.optionalAttrs enableVulkan { VULKAN_SDK = shaderc.bin; };
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cmake
|
|
||||||
gitMinimal
|
|
||||||
]
|
|
||||||
++ lib.optionals enableRocm (
|
|
||||||
rocmLibs
|
|
||||||
++ [
|
|
||||||
rocmPackages.llvm.bintools
|
|
||||||
]
|
|
||||||
)
|
|
||||||
++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]
|
|
||||||
++ lib.optionals (enableRocm || enableCuda) [
|
|
||||||
makeBinaryWrapper
|
|
||||||
autoAddDriverRunpath
|
|
||||||
]
|
|
||||||
++ lib.optionals enableVulkan [
|
|
||||||
ccache
|
|
||||||
spirv-headers
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs =
|
|
||||||
lib.optionals enableRocm (rocmLibs ++ [ libdrm ])
|
|
||||||
++ lib.optionals enableCuda cudaLibs
|
|
||||||
++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ]
|
|
||||||
++ lib.optionals enableVulkan vulkanLibs;
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace version/version.go \
|
|
||||||
--replace-fail 0.0.0 '${finalAttrs.version}'
|
|
||||||
|
|
||||||
rm cmd/launch/*_test.go
|
|
||||||
|
|
||||||
rm -r app
|
|
||||||
|
|
||||||
if [[ ${llamaCppVersion} != $(cat LLAMA_CPP_VERSION) ]]; then
|
|
||||||
echo "llama-cpp version mismatch, expected ${llamaCppVersion}, but found $(cat LLAMA_CPP_VERSION)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cp -r ${llamaCppSrc} $TMPDIR/llama-cpp-src
|
|
||||||
chmod -R +w $TMPDIR/llama-cpp-src
|
|
||||||
( cd $TMPDIR/llama-cpp-src && \
|
|
||||||
cmake -DPATCH_DIR=$NIX_BUILD_TOP/source/llama/compat \
|
|
||||||
-P $NIX_BUILD_TOP/source/llama/compat/apply-patch.cmake )
|
|
||||||
'';
|
|
||||||
|
|
||||||
overrideModAttrs = _: _: {
|
|
||||||
preBuild = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
preBuild =
|
|
||||||
let
|
|
||||||
removeSMPrefix =
|
|
||||||
str:
|
|
||||||
let
|
|
||||||
matched = builtins.match "sm_(.*)" str;
|
|
||||||
in
|
|
||||||
if matched == null then str else builtins.head matched;
|
|
||||||
|
|
||||||
cudaArchitectures = builtins.concatStringsSep ";" (map removeSMPrefix cudaArches);
|
|
||||||
rocmTargets = builtins.concatStringsSep ";" rocmGpuTargets;
|
|
||||||
|
|
||||||
rocmMajorVersion = lib.versions.major rocmPackages.clr.version;
|
|
||||||
rocmMinorVersion = lib.versions.minor rocmPackages.clr.version;
|
|
||||||
llamaBackend =
|
|
||||||
if enableCuda then
|
|
||||||
"cuda_v${cudaMajorVersion}"
|
|
||||||
else if enableRocm then
|
|
||||||
"rocm_v${rocmMajorVersion}_${rocmMinorVersion}"
|
|
||||||
else if enableVulkan then
|
|
||||||
"vulkan"
|
|
||||||
else
|
|
||||||
"";
|
|
||||||
|
|
||||||
cmakeFlagsCudaArchitectures = lib.optionalString enableCuda "-DCMAKE_CUDA_ARCHITECTURES='${cudaArchitectures}'";
|
|
||||||
cmakeFlagsRocmTargets = lib.optionalString enableRocm "-DAMDGPU_TARGETS='${rocmTargets}'";
|
|
||||||
cmakeFlagsBackend = lib.optionalString
|
|
||||||
(
|
|
||||||
llamaBackend != ""
|
|
||||||
) "-DOLLAMA_LLAMA_BACKENDS=${llamaBackend}";
|
|
||||||
in
|
|
||||||
''
|
|
||||||
${lib.optionalString enableVulkan ''
|
|
||||||
export CMAKE_PREFIX_PATH="${spirv-headers}''${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}"
|
|
||||||
export NIX_CFLAGS_COMPILE="-isystem ${spirv-headers}/include $NIX_CFLAGS_COMPILE"
|
|
||||||
''}
|
|
||||||
cmake -B build \
|
|
||||||
-DCMAKE_SKIP_BUILD_RPATH=ON \
|
|
||||||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
|
||||||
-DFETCHCONTENT_SOURCE_DIR_LLAMA_CPP="$TMPDIR/llama-cpp-src" \
|
|
||||||
-DOLLAMA_MLX_BACKENDS="" \
|
|
||||||
$cmakeFlags \
|
|
||||||
${cmakeFlagsCudaArchitectures} \
|
|
||||||
${cmakeFlagsRocmTargets} \
|
|
||||||
${cmakeFlagsBackend}
|
|
||||||
|
|
||||||
cmake --build build -j $NIX_BUILD_CORES
|
|
||||||
'';
|
|
||||||
|
|
||||||
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
||||||
find $out/lib/ollama -type f \( -name '*.so' -o -name '*.so.*' \) \
|
|
||||||
-exec patchelf --shrink-rpath --allowed-rpath-prefixes /nix/store {} +
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp -r build/lib/ollama $out/lib/
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup =
|
|
||||||
lib.optionalString (enableRocm || enableCuda) ''
|
|
||||||
wrapProgram "$out/bin/ollama" ${wrapperArgs}
|
|
||||||
'';
|
|
||||||
|
|
||||||
ldflags = [
|
|
||||||
"-X=github.com/ollama/ollama/version.Version=${finalAttrs.version}"
|
|
||||||
"-X=github.com/ollama/ollama/server.mode=release"
|
|
||||||
];
|
|
||||||
|
|
||||||
__darwinAllowLocalNetworking = true;
|
|
||||||
|
|
||||||
sandboxProfile = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
(allow file-read* (subpath "/System/Library/Extensions"))
|
|
||||||
(allow iokit-open (iokit-user-client-class "AGXDeviceUserClient"))
|
|
||||||
'';
|
|
||||||
|
|
||||||
checkFlags =
|
|
||||||
let
|
|
||||||
skippedTests = [
|
|
||||||
"TestPushHandler/unauthorized_push"
|
|
||||||
"TestPiRun_InstallAndWebSearchLifecycle"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
|
||||||
|
|
||||||
doInstallCheck = true;
|
|
||||||
nativeInstallCheckInputs = [
|
|
||||||
versionCheckHook
|
|
||||||
writableTmpDirAsHomeHook
|
|
||||||
];
|
|
||||||
versionCheckKeepEnvironment = "HOME";
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit llamaCppSrc llamaCppVersion;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description =
|
|
||||||
"Get up and running with large language models locally"
|
|
||||||
+ lib.optionalString rocmRequested ", using ROCm for AMD GPU acceleration"
|
|
||||||
+ lib.optionalString cudaRequested ", using CUDA for NVIDIA GPU acceleration"
|
|
||||||
+ lib.optionalString vulkanRequested ", using Vulkan for generic GPU acceleration";
|
|
||||||
homepage = "https://github.com/ollama/ollama";
|
|
||||||
changelog = "https://github.com/ollama/ollama/releases/tag/v${finalAttrs.version}";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms =
|
|
||||||
if (rocmRequested || cudaRequested || vulkanRequested) then platforms.linux else platforms.unix;
|
|
||||||
mainProgram = "ollama";
|
|
||||||
maintainers = with maintainers; [ prusnak ];
|
|
||||||
broken = stdenv.buildPlatform != stdenv.hostPlatform;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
Binary file not shown.
Reference in new issue
Block a user