Skip to content

Instantly share code, notes, and snippets.

View terlar's full-sized avatar

Terje Larsen terlar

View GitHub Profile
@marcellodesales
marcellodesales / Ollama-API-CLI-Docker-Models-in-10-minutes.md
Last active March 18, 2025 02:58
Ollama hacking with Docker + Shell + API Server + Models Storage
@wmertens
wmertens / nix-store-in-git.md
Last active September 7, 2022 19:57
Store Nix store in git

Store Nix store in git

The Nix store is an immutable file tree store, addressed by output hashes ($outhash-$name or $out), but could also be tweaked to be addressed by the content hash of the file tree ($cas).

Git is a content-addressed immutable object store. It is optimized for storing files as blobs and directories as tree objects.

Here we consider using a git repository for deduplicating, compressing and distributing the Nix store. We want to achieve maximum deduplication so we extract small changes from files before storing, so they become more similar.

Method

@jnetod
jnetod / Arcan.nix
Last active February 28, 2021 06:36 — forked from egasimus/Arcan.nix
Building Arcan on NixOS, 2020 version
({ lib, newScope, stdenv, pkgs }: let
# nicer aliases
derive = stdenv.mkDerivation;
concat = builtins.concatStringsSep " ";
# vendored libuvc: don't build, just make sources available
libuvc-src = derive {
name = "libuvc-src";
# using fetchgit instead fetchFromGitHub because
@egasimus
egasimus / Arcan.nix
Last active May 17, 2021 09:39
Building Arcan on NixOS, 2020 version
({ lib, newScope, stdenv, pkgs }: let
# nicer aliases
derive = stdenv.mkDerivation;
concat = builtins.concatStringsSep " ";
# vendored libuvc: don't build, just make sources available
libuvc-src = derive {
name = "libuvc-src";
# using fetchgit instead fetchFromGitHub because
@clemera
clemera / peek-xref.el
Created August 18, 2019 16:34
Peek frame with xref
(advice-add 'xref--pop-to-location
:filter-args (lambda (args)
(list (car args) 'frame)))
(setq pop-up-frame-function
(defun peek-frame-pop-up-frame+ ()
(let* ((frame (make-frame `((parent-frame . ,(selected-frame))
(minibuffer . nil)
(name . "*Emacs Peek*")
(width . 80)
@adisbladis
adisbladis / zoom-us.nix
Created August 1, 2019 14:22
Run Zoom in Xephyr
{ pkgs ? import <nixpkgs> {} }:
let
xinitRc = pkgs.writeScript "zoom-xinitrc" ''
#!${pkgs.runtimeShell}
${pkgs.zoom-us}/bin/zoom-us &
exec ${pkgs.icewm}/bin/icewm
'';
@alphapapa
alphapapa / fitness.org
Last active February 19, 2025 04:32
An Emacs food/weight/workout tracker self-contained in a single Org file

Plots

/home/me/org/double-plot.png

Tasks

@telent
telent / default.nix
Created November 28, 2018 12:02
arcan build with nixos
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "arcan";
version="1";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake git
] ;
CMAKE_CXX_FLAGS = "-msse4.1";
DRM_INCLUDE_DIR = "${pkgs.libdrm.dev}/include/libdrm";
with import ./lisp.nix { a = null; }; eval
(defun fib (n)
(defun fib2 (a b n)
(iff (lt n 2) b
(def (next (plus a b))
(fib2 b next (minus n 1))))
(fib2 0 1 n))
(fib 60))
@wolkenarchitekt
wolkenarchitekt / window_tiler.py
Last active August 10, 2024 21:14
Move window on Linux systems using Python, xdotool and wmctrl
#!/usr/bin/python3.7
#
# Move and resize window into screen corners.
# works with multiple, horizontally aligned displays.
#
# Requirements:
# * Python3.7 (for dataclass)
# * wmctrl
# * xdotool
# pip: screeninfo, click