Skip to content

Instantly share code, notes, and snippets.

View b-'s full-sized avatar
❄️
learning nix

bri b-

❄️
learning nix
View GitHub Profile
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `nix.registry.nixpkgs.to.path' has conflicting definition values:
- In `/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/nixos/modules/config/nix-flakes.nix': "/nix/store/sssy7p3frs3vrr7ymcp7y016ykl1si7d-source"
- In `/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/nixos/modules/misc/nixpkgs-flake.nix': "/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source"
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
@b-
b- / shmerge.sh
Created December 31, 2023 05:59
shmerge
#!/bin/bash
function shmerge() { git switch -c "$1" &&shift; git commit -am"$*" && gh pr create && echo "waiting 10s to start checks" ; sleep 10s; gh run view --exit-status && gh pr merge -d}
@b-
b- / fix-onepassword-gids.sh
Created December 3, 2023 00:03
fix onepassword gid for ublue-os custom image
#!/bin/bash
# fixes 1Password GID problems on ublue-os custom images
set -euxo pipefail
OPCLI_CONF=$(</usr/lib/sysusers.d/onepassword-cli.conf)
TARGET_OPCLI_GID="${OPCLI_CONF##g onepassword-cli }"
CURRENT_OPCLI_GID=$(getent group onepassword-cli | cut -d: -f3)
OP_CONF=$(</usr/lib/sysusers.d/onepassword.conf)
CURRENT_OP_GID=$(getent group onepassword | cut -d: -f3)
TARGET_OP_GID="${OP_CONF##g onepassword }"
@b-
b- / keybase.distrobox-assemble
Created October 15, 2023 16:42
keybase.distrobox-assemble
#! /usr/bin/env -S distrobox assemble create --file
[keybase]
image=ghcr.io/briorg/ubuntu-toolbox
#image=quay.io/toolbx-images/ubuntu-toolbox:22.04
init=false
nvidia=false
pull=false
root=false
replace=true
@b-
b- / keybase-nightly.sh
Last active October 6, 2023 02:27 — forked from RogueScholar/keybase-nightly.sh
POSIX script to update keybase package to latest nightly on Distrobox
#!/usr/bin/env bash
# Keybase publishes a JSON file concurrent with every nightly build upload to their public download web server,
# though they're real cute in the way they parse the timestamp as a UNIX epoch...in milliseconds :-/ That means
# we need to fuss with rounding errors in Bash built-in computations on top of using jq as a parser for the raw
# file instead of what I expected to be some quick "awk-to-humantime-to-apt" pipeline-foo. Still it came out
# fairly snappy and is solid as a rock.
# Set this up as a cron job at the interval of your choosing, it won't do anything until it sees that the
# installed version reported by apt has an older timestamp than the one in the JSON file. When that happens it
@b-
b- / after-install.sh.diff
Created October 5, 2023 18:43
1password after-install.sh modified for kinoite post-install
commit 857e68ddc3eb63b068a1eb16e57ed1e040203819
Author: bri <284789+b-@users.noreply.github.com>
Date: Thu Oct 5 14:40:43 2023 -0400
comment out stuff
diff --git a/after-install.sh b/after-install.sh
index 07f25cd..a5eb9e2 100755
--- a/after-install.sh
+++ b/after-install.sh
@b-
b- / set-addrgroup
Last active October 13, 2023 14:49
set-addrgroup for vyos
#!/bin/sh
#
# /config/scripts/dhcp-client/post-hooks.d/set-addrgroup
# To enable this script set the following variable to "yes"
RUN="yes"
if [ "$RUN" = "yes" ]; then
tmpfile=$(mktemp /tmp/dhcp-script.XXXXXXXX)
chmod -R 755 "${tmpfile}"
@b-
b- / 99-git-commit
Last active January 6, 2023 00:01 — forked from brav0charlie/99-git-commit_vyos.sh
VyOS Git Commit & Push on Commit
#!/bin/vbash
# shellcheck shell=bash
# file: 99-git-commit
# description: Saves config commands & config json to files, commits to local
# git repo. Repo stored in /config/user-data/$CONFIG_REPO. Completes
# process with a push to the remote repo.
#
# This script is intended to be used as a post-commit hook, allowing
# for automated config backup in a git repo.
; br's personal ahk keyboard remappings
; https://github.com/b-/keyboard-customizer
; Released into the Public Domain via CC0 https://creativecommons.org/share-your-work/public-domain/cc0/
;;;;;
; Run as administrator (the scheduled task included will do so on startup) for this to work on applications also running as administrator.
; Otherwise, the keyboard mappings will simply not work.
#SingleInstance Force
#InstallKeybdHook
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
if WinActive("ahk_class SynergyDesk")
{
; We want to reload ONCE
EnvGet, IsReloading, IsReloading
if ( IsReloading = "true" ) ; we're already reloading
{
EnvSet, IsReloading, "false"
WinWaitNotActive, ahk_class SynergyDesk
} ; so don't reload again
else