Skip to content

Instantly share code, notes, and snippets.

View stigtsp's full-sized avatar
🕊️
peace, pls

Stig stigtsp

🕊️
peace, pls
View GitHub Profile
@voidus
voidus / flake.nix
Created April 22, 2023 18:35
Build a cloudinit image in nixos
{
description = "A nixos cloudinit base image without nixos-infect";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@angerman
angerman / Installation.md
Last active February 1, 2024 11:38
Installing nix on macOS BigSur

The nixos.org website suggests to use:

sh <(curl -L https://nixos.org/nix/install)

For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
@LnL7
LnL7 / nix.conf
Created December 2, 2019 19:45
sandboxing on darwin
sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
@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; }];
# };
@afresh1
afresh1 / HTTP-Tiny-nc.pm
Last active May 2, 2023 23:56
A monkey patch to let perl's HTTP::Tiny to use the OpenBSD netcat with TLS support to access https sites without installing IO::Socket::SSL and Net::SSLeay.
use v5.16;
use warnings;
package HTTP::Tiny::nc;
use parent 'HTTP::Tiny';
our $VERSION = v0.0.3;
# Copyright (c) 2019-2023 Andrew Hewus Fresh <afresh1@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@ingenieroariel
ingenieroariel / configuration.nix
Created May 2, 2019 13:15
HP Envy x360 + Nixos + Sway + i3statusbar-rs in a single file with 500 lines.
{ config, lib, pkgs, ... }:
let
domain = "puerti.co";
waylandOverlay = (import (builtins.fetchTarball ({
url = "https://github.com/piensa/wayner/archive/1e62268.tar.gz";
sha256 = "07hzhdc9ic3sk4ivd0g3lx2f7jnr3wkrrr884hf5b1n7adzglh50";
})));
@domenkozar
domenkozar / kiosk-chromium.nix
Last active January 24, 2024 14:05
Boot NixOS into chromium kiosk (tested on NixOS 14.04)
services.xserver = {
enable = true;
monitorSection = ''
Option "NODPMS"
'';
serverLayoutSection = ''
Option "BlankTime" "0"
Option "DPMS" "false"
'';
displayManager.auto.user = "guest";

Nix Flake MVP

Goals

  • To provide Nix repositories with an easy and standard way to reference other Nix repositories.

  • To allow such references to be queried and updated automatically.

  • To provide a replacement for nix-channel, NIX_PATH and Hydra

@izznogooood
izznogooood / systemd_docker.md
Last active April 9, 2022 16:32
How to use systemd as a docker manager. Nextcloud example with backup.

I have always found systemd to be a reliable manager for my docker containers, here is a few examples that should be enough to get the general idea.

I thought a symbiotic example would be best as that's about as complicated as it gets.

Some basic systemd usage skills like how to use systemctl and deamon-reload are expeted. (Remember NOT! to deamonize the containers! -d --deamonize in the docker command.)

MariaDB

for (let i = 0; i < 0x80; i++) {
try { I2C1.readFrom(i, 1); console.log(i); } catch (e) {}
}