Skip to content

Instantly share code, notes, and snippets.

View anpin's full-sized avatar
:shipit:
Working from home

Pavel Anpin anpin

:shipit:
Working from home
  • Earth
View GitHub Profile
@clamydo
clamydo / configuration.nix
Created April 4, 2024 09:17
Minimal example how to pass a sops-nix secret into a systemd-nspawn container via systemd's credential system.
{ config, lib, pkgs, ... }:
{
imports = [
${builtins.fetchTarball
"https://github.com/Mic92/sops-nix/archive/master.tar.gz"
}/modules/sops"
];
users = {
@kborling
kborling / configuration.nix
Created December 24, 2021 23:59
NixOS Configuration (Sway/Wayland Enabled)
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
@munrocket
munrocket / wgsl_2d_sdf.md
Last active June 4, 2024 09:46
WGSL 2D SDF Primitives

WGSL 2D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/398

Circle - exact

fn sdCircle(p: vec2f, r: f32) -> f32 {
  return length(p) - r;
}
@munrocket
munrocket / wgsl_3d_sdf.md
Last active July 13, 2024 05:11
WGSL 3D SDF Primitives

WGSL 3D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/407

Sphere - exact

fn sdSphere(p: vec3f, r: f32) -> f32 {
  return length(p) - r;
}
@steinuil
steinuil / Nuget2Nix.fsx
Last active May 23, 2023 21:39
Code for the .NET packaging post
open System
open System.IO
open System.Net
open System.Text.Json
open System.Collections.Generic
open System.Security.Cryptography
/// Taken from hash.cc in the nix codebase
/// https://github.com/NixOS/nix/blob/a7540294cfae82c098e8691cd5212a9184add574/src/libutil/hash.cc
module Base32 =
@domenkozar
domenkozar / README.md
Last active February 14, 2023 08:19
nixos + e-residency

Install card drivers

   services.pcscd.enable = true;
   services.pcscd.plugins = [ pkgs.acsccid ];
   environment.systemPackages = [ pkgs.qdigidoc ];

Verify access to the card

$ qdigidoc4
@adisbladis
adisbladis / podman-shell.nix
Last active May 12, 2024 09:21
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; }];
# };
@caadar
caadar / autologin-tty-nixos.org
Last active July 22, 2024 22:34
How to make a user autologin at the console on NixOS

Autologin a user at the console (NixOS)

Problem

NixOS provide services.mingetty.autologinUser option, but it can’t be used for the specific TTY.

Minimal working example

TTY1 and user “guest”:

@lamcw
lamcw / win
Created July 15, 2019 09:53
QEMU launch script for Windows 10
#!/bin/sh
# Wrapper script for launching a qemu instance for Windows 10.
#
# This script is used in a Dell XPS 13 host.
#
# Usage: win [custom_qemu_options]
#
# Example:
# Assigning host USB device to guest VM