Merge pull request 'main' (#4) from jan-leila/nix-config:main into main

Reviewed-on: #4
This commit is contained in:
Lithospherical 2025-06-25 02:46:33 +00:00
commit db9d0fff09
12 changed files with 190 additions and 61 deletions

View file

@ -95,6 +95,8 @@ in {
pdfarranger pdfarranger
picard picard
gdx-liftoff
# proprietary platforms # proprietary platforms
(lib.mkIf hardware.graphicsAcceleration.enable davinci-resolve) (lib.mkIf hardware.graphicsAcceleration.enable davinci-resolve)

View file

@ -192,6 +192,9 @@
}; };
}; };
# limit arc usage to 50gb because ollama doesn't play nice with zfs using up all of the memory
boot.kernelParams = ["zfs.zfs_arc_max=53687091200"];
services = { services = {
# TODO: move zfs scrubbing into module # TODO: move zfs scrubbing into module
zfs = { zfs = {
@ -215,6 +218,8 @@
enable = true; enable = true;
exposePort = true; exposePort = true;
acceleration = false;
loadModels = [ loadModels = [
# conversation models # conversation models
"llama3.1:8b" "llama3.1:8b"

View file

@ -42,43 +42,43 @@
enable = true; enable = true;
models = { models = {
"Llama 3.1 8B" = { "Llama 3.1 8B" = {
model = "lamma3.1:8b"; model = "llama3.1:8b";
roles = ["chat" "edit" "apply"]; roles = ["chat" "edit" "apply"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"Deepseek Coder:6.7B" = { "Deepseek Coder:6.7B" = {
model = "deepseek-coder:6.7b"; model = "deepseek-coder:6.7b";
roles = ["chat" "edit" "apply"]; roles = ["chat" "edit" "apply"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"Deepseek Coder:33B" = { "Deepseek Coder:33B" = {
model = "deepseek-coder:33b"; model = "deepseek-coder:33b";
roles = ["chat" "edit" "apply"]; roles = ["chat" "edit" "apply"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"Deepseek r1:8B" = { "Deepseek r1:8B" = {
model = "deepseek-r1:8b"; model = "deepseek-r1:8b";
roles = ["chat"]; roles = ["chat"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"Deepseek r1:32B" = { "Deepseek r1:32B" = {
model = "deepseek-r1:32b"; model = "deepseek-r1:32b";
roles = ["chat"]; roles = ["chat"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"qwen2.5-coder:1.5b-base" = { "qwen2.5-coder:1.5b-base" = {
model = "qwen2.5-coder:1.5b-base"; model = "qwen2.5-coder:1.5b-base";
roles = ["autocomplete"]; roles = ["autocomplete"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
"nomic-embed-text:latest" = { "nomic-embed-text:latest" = {
model = "nomic-embed-text:latest"; model = "nomic-embed-text:latest";
roles = ["embed"]; roles = ["embed"];
apiBase = "http://twilight:11434"; apiBase = "http://defiant:11434";
}; };
}; };
}; };

71
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748832438, "lastModified": 1750680230,
"narHash": "sha256-/CtyLVfNaFP7PrOPrTEuGOJBIhcBKVQ91KiEbtXJi0A=", "narHash": "sha256-kD88T/NqmcgfOBFAwphN30ccaUdj6K6+LG0XdM2w2LA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "58d6e5a83fff9982d57e0a0a994d4e5c0af441e4", "rev": "8fd2d6c75009ac75f9a6fb18c33a239806778d01",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -28,11 +28,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1749009805, "lastModified": 1750737804,
"narHash": "sha256-eRv4m89aPJvIAX9mZQcJM+l3sYG+OJvcLsiHvAvXalg=", "narHash": "sha256-wClGd2PhxdjjphR6wIgoiDcR+Gfg4/+FyseSOjIIzVU=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "622c38d004cdded682d9a5ab7323181dc6efb0c1", "rev": "aaaf4fec792bad465ea4a35c0be5bc2a54f33095",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -115,11 +115,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749049052, "lastModified": 1750730235,
"narHash": "sha256-wIt8ZBc8diKg1H5ibi3Bw9HUcPR2w3xy4ddcuzjgLb0=", "narHash": "sha256-rZErlxiV7ssvI8t7sPrKU+fRigNc2KvoKZG3gtUtK50=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ffab96a8b4a523c4b5e2645ee09e95a75cbdbfab", "rev": "d07e9cceb4994ed64a22b9b36f8b76923e87ac38",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -185,11 +185,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749012745, "lastModified": 1750618568,
"narHash": "sha256-Cax/k9ZRPKqTz18vZtmqGR45pHRXM+sDvEVd4V/3NrU=", "narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "fa6120c32f10bd2aac9e8c9a6e71528a9d9d823b", "rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -227,11 +227,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749002682, "lastModified": 1750730765,
"narHash": "sha256-v9K6RyPF/+4r/YJhjEH8y07VWE6Vj7Vl88E/K5m/uJ0=", "narHash": "sha256-MIcOcvxqAXUv2TJjf19aVXdtVrD8Gkcfi4W4pKkT0Lw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "46eb9c16d8ccfedf8bc648be03f9b2993fe3c994", "rev": "1a1442e13dc1730de0443f80dcf02658365e999a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -242,11 +242,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1749056381, "lastModified": 1750431636,
"narHash": "sha256-QITcurR19KZlrCngBoCjsFF2BdYsiCG4UqmlrVcLb8Q=", "narHash": "sha256-vnzzBDbCGvInmfn2ijC4HsIY/3W1CWbwS/YQoFgdgPg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "029bd66faa180e11262dd1bc2732254c33415f52", "rev": "1552a9f4513f3f0ceedcf90320e48d3d47165712",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -258,11 +258,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748929857, "lastModified": 1750506804,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4", "rev": "4206c4cb56751df534751b058295ea61357bbbaa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -286,7 +286,8 @@
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"secrets": "secrets", "secrets": "secrets",
"sops-nix": "sops-nix" "sops-nix": "sops-nix",
"steam-fetcher": "steam-fetcher"
} }
}, },
"secrets": { "secrets": {
@ -312,11 +313,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747603214, "lastModified": 1750119275,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", "narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", "rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -325,6 +326,26 @@
"type": "github" "type": "github"
} }
}, },
"steam-fetcher": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1714795926,
"narHash": "sha256-PkgC9jqoN6cJ8XYzTA2PlrWs7aPJkM3BGiTxNqax0cA=",
"owner": "nix-community",
"repo": "steam-fetcher",
"rev": "12f66eafb7862d91b3e30c14035f96a21941bd9c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "steam-fetcher",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View file

@ -71,6 +71,11 @@
flake-compat = { flake-compat = {
url = "github:edolstra/flake-compat"; url = "github:edolstra/flake-compat";
}; };
steam-fetcher = {
url = "github:nix-community/steam-fetcher";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { outputs = {

View file

@ -1,3 +1,6 @@
# this folder is for derivation overlays # this folder is for derivation overlays
{...}: { {inputs, ...}: {
nixpkgs.overlays = [
inputs.steam-fetcher.overlays.default
];
} }

View file

@ -13,5 +13,11 @@
./prostudiomasters.nix ./prostudiomasters.nix
{}; {};
}) })
(final: prev: {
noita_entangled_worlds = pkgs.callPackage ./noita-entangled-worlds.nix {};
})
(final: prev: {
gdx-liftoff = pkgs.callPackage ./gdx-liftoff.nix {};
})
]; ];
} }

View file

@ -0,0 +1,44 @@
{
stdenv,
fetchurl,
makeWrapper,
jdk,
lib,
xorg,
libGL,
...
}:
stdenv.mkDerivation rec {
pname = "gdx-liftoff";
version = "1.13.5.1";
src = fetchurl {
url = "https://github.com/libgdx/gdx-liftoff/releases/download/v${version}/gdx-liftoff-${version}.jar";
hash = "sha256-9vCXGNGwI/P4VmcdIzTv2GPAX8bZb7nkfopaRAf6yMA=";
};
dontUnpack = true;
nativeBuildInputs = [makeWrapper];
runtimeDependencies = lib.makeLibraryPath [
# glfw
libGL
xorg.libX11
xorg.libXcursor
xorg.libXext
xorg.libXrandr
xorg.libXxf86vm
];
installPhase = ''
runHook preInstall
install -Dm644 $src $out/lib/gdx-liftoff-${version}.jar
makeWrapper ${lib.getExe jdk} $out/bin/gdx-liftoff-${version} \
--append-flags "-jar $out/lib/gdx-liftoff-${version}.jar"\
${lib.optionalString stdenv.hostPlatform.isLinux "--prefix LD_LIBRARY_PATH : ${runtimeDependencies}"}
runHook postInstall
'';
}

View file

@ -0,0 +1,46 @@
# not working yet
{
pkgs,
rustPlatform,
fetchFromGitHub,
...
}: let
version = "1.5.3";
repo = fetchFromGitHub {
owner = "IntQuant";
repo = "noita_entangled_worlds";
rev = "v${version}";
hash = "sha256-frrpD0aWTeDbZYtp15R+quUUAZf7OvHlbSLtGJJtAqk=";
};
in
rustPlatform.buildRustPackage {
name = "noita-proxy-${version}";
src = repo + "/noita-proxy";
prePatch = ''
substituteInPlace Cargo.toml \
--replace "path = \"../shared\"" "path = \"${repo + "/shared"}\""
'';
nativeBuildInputs = with pkgs; [
pkg-config
python3
cmake
];
buildInputs = with pkgs; [
openssl
openssl.dev
libpulseaudio
libjack2
alsa-lib
xorg.libxcb
xorg.libxcb.dev
libopus
];
propagatedBuildInputs = with pkgs; [
steamworks-sdk-redist
];
runtimeDependencies = with pkgs; [
steamworks-sdk-redist
];
doCheck = false;
cargoHash = "sha256-TzUS6d6PopgGf2i1yVaXaXdzNrvfSz+Gv67BAtxYmb4=";
}

View file

@ -11,6 +11,25 @@
host.desktop.enable = lib.mkDefault true; host.desktop.enable = lib.mkDefault true;
} }
(lib.mkIf config.host.desktop.enable { (lib.mkIf config.host.desktop.enable {
environment.gnome.excludePackages = with pkgs; [
xterm # default terminal
atomix # puzzle game
cheese # webcam tool
epiphany # web browser
geary # email reader
gedit # text editor
decibels # audio player
gnome-characters # character set viewer
gnome-music # music player
gnome-photos # photo viewer
gnome-logs # log viwer
gnome-maps # map viewer
gnome-tour # welcome tour
hitori # sudoku game
iagno # go game
tali # poker game
yelp # help viewer
];
services = { services = {
# Enable CUPS to print documents. # Enable CUPS to print documents.
printing.enable = true; printing.enable = true;
@ -21,24 +40,6 @@
# Get rid of xTerm # Get rid of xTerm
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
excludePackages = with pkgs; [
xterm
atomix # puzzle game
cheese # webcam tool
epiphany # web browser
geary # email reader
gedit # text editor
gnome-characters
gnome-music
gnome-photos
gnome-tour
gnome-logs
gnome-maps
hitori # sudoku game
iagno # go game
tali # poker game
yelp # help viewer
];
}; };
# Enable the GNOME Desktop Environment. # Enable the GNOME Desktop Environment.
@ -68,8 +69,6 @@
# enable RealtimeKit for pulse audio # enable RealtimeKit for pulse audio
security.rtkit.enable = true; security.rtkit.enable = true;
# disable welcome tour
environment.gnome.excludePackages = [pkgs.gnome-tour];
}) })
]; ];
} }

View file

@ -28,21 +28,19 @@
}; };
})) }))
(lib.mkIf config.host.impermanence.enable { (lib.mkIf config.host.impermanence.enable {
# TODO: move this somewhere common
systemd.tmpfiles.rules = [
"d /var/lib/private 0700 root root"
];
environment.persistence."/persist/system/root" = { environment.persistence."/persist/system/root" = {
enable = true; enable = true;
hideMounts = true; hideMounts = true;
directories = [ directories = [
{
directory = config.services.ollama.models;
user = config.services.ollama.user;
group = config.services.ollama.group;
}
{ {
directory = "/var/lib/private/ollama"; directory = "/var/lib/private/ollama";
user = config.services.ollama.user; user = config.services.ollama.user;
group = config.services.ollama.group; group = config.services.ollama.group;
mode = "0700"; mode = "0700";
defaultPerms.mode = "0700";
} }
]; ];
}; };

View file

@ -65,7 +65,7 @@ flake=${flake:-$target}
mode=${mode:-switch} mode=${mode:-switch}
user=${user:-$USER} user=${user:-$USER}
command="nixos-rebuild $mode --use-remote-sudo --flake .#$flake" command="nixos-rebuild $mode --use-remote-sudo --ask-sudo-password --flake .#$flake"
if [[ $host ]]; if [[ $host ]];
then then