Skip to content

Instantly share code, notes, and snippets.

View anodium's full-sized avatar

Andrea Pascal anodium

View GitHub Profile
@wd15
wd15 / README.md
Last active November 7, 2022 14:23
Nix on the cluster odyssey

Nix on the cluster

To use Nix with an ordinary install on the cluster requires access to /nix and also sharing /nix across all compute nodes. This is not feasible without a great deal of work by the sys admin. There already exist shared directories that users have access to (/users and /working). /working is used mostly for building environments and writes during job runs. There are two ways to install a non-root Nix. One is to try to install a version of Nix with a built-in alternative store location and the other is to use chroot and trick

@JayRovacsek
JayRovacsek / kvm.nix
Created September 14, 2021 10:19 — forked from Nekroze/kvm.nix
NixOS Declarative KVM Guests
## Builder for NixOS configurations defined at the end of the file to be built into KVM VM's
{ system ? builtins.currentSystem }:
let
loadcfg = cfgfile: { config, pkgs, ...}: {
imports = [ <nixos/modules/virtualisation/qemu-vm.nix> cfgfile ];
config = {
networking.extraHosts = ''
176.32.0.254 template
'';
@dbaynard
dbaynard / gist:523700a1a5bed1628fd817c833460c6e
Created June 23, 2021 15:06
Creating nixos lxc image for crostini
Install arch https://wiki.archlinux.org/title/Chrome_OS_devices/Crostini
lxc config set arch security.nesting true
Within arch, configure downloads
mkdir ~/Downloads && sudo mount -o bind /mnt/chromeos/MyFiles/Downloads ~/Downloads
Install nix (just use the standard multi-user nix installer)
Install lxd
Add user to group lxd
sudo systemctl enable lxd.service
logout cycle for arch
lxd init
@duairc
duairc / net.nix
Last active April 16, 2024 00:28
IP address arithmetic and validation in Nix
{ lib ? null, ... }:
let
net = {
ip = {
# add :: (ip | mac | integer) -> ip -> ip
#
# Examples:
@573
573 / Cargo.toml
Last active April 5, 2024 01:50
How to build webassembly via rust using just nix
cargo-features = ["edition"]
[package]
edition = "2018"
name = "wasm-pack-examples"
version = "0.1.0"
authors = ["573 <me@gmail.com>"]
[lib]
crate-type = ["cdylib"]
@adisbladis
adisbladis / podman-shell.nix
Last active April 29, 2024 14:50
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@dogtopus
dogtopus / ps4cse_public.md
Last active March 14, 2024 03:32
Licensed PS4 Controller "Security Chip" Secure Element

SE for PS4 Licensed Controllers

Disclaimer

This documentation is provided solely for education and interoperability purposes (aka persons who are tired of proprietary non-customizable hardware and want to use their own hardware for DIY controllers). It enables neither chip-cloning nor controller counterfeiting which would violate copyright and/or any other applicable laws. This documentation also comes without warranty. Use it at your own risk.

Basic info

  • Model: NXP A710x series, possibly semi-customized (Label says 7105 - A7105 does not exist)
  • Protocol: I2C
@alphapapa
alphapapa / fitness.org
Last active April 6, 2024 04:33
An Emacs food/weight/workout tracker self-contained in a single Org file

Plots

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

Tasks

#!/usr/bin/env python3
import os
"""
Cursed Code.
This code literally patches your kernel memory, proceed at your own risk.
Tested on Ubuntu 17.10 and Arch, x86_64. Should work on other distros, maybe even other architectures!
@ChristophHaag
ChristophHaag / PKGBUILD
Last active April 27, 2018 16:57
PKGBUILD mesa git for tegra
pkgname=mesa-full-tegra
pkgver=r100838.c9b153fea7
_realver=18.0
pkgrel=1
pkgdesc="Full Mesa 3D graphics library with all its components, built from the git master branch. Compiles tegra"
arch=(armv7h)
url="http://mesa3d.org/"
license=('LGPL')
depends=('libdrm' 'dri2proto' 'glproto' 'libxxf86vm' 'libxdamage' 'expat>=2.0.1' 'libxmu' 'talloc' 'llvm' 'wayland' 'libxvmc' 'python2-mako' 'libxcb')
makedepends=('pkgconfig' 'imake' 'xorg-server-devel' 'meson')