This is a simplistic setup trying to emulate at least part of i3 behaviour on MacOS using yabai. Key-bindings are partially replicated due to the presence of MacOS built-in bindings
Start with installing (and understanding) following tools
#!/usr/bin/env -S bash -c 'nix-shell --pure $0 -A env' | |
# Usage: | |
# 1. run directly to enter bash (inside venv): `./venv-py37.nix` | |
# 2. build a standalone executable: `nix bundle -f ./venv-py37.nix` #this not works yet since it cause nested `unshare -U` call | |
# 3. run bash with extra arguments: `nix run -f ./venv-py37.nix '' -- -c 'python --version'` | |
# More: | |
# 1. commit id of nixpkgs can be found here: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=python3 | |
let |
{ config, pkgs, lib, ... }: | |
let | |
cfg = config.services.btrbk; | |
sshEnabled = cfg.sshAccess != [ ]; | |
serviceEnabled = cfg.instances != { }; | |
attr2Lines = attr: | |
let | |
pairs = lib.attrsets.mapAttrsToList (name: value: { inherit name value; }) attr; | |
isSubsection = value: | |
if builtins.isAttrs value then true |
# 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, ... }: | |
let | |
# Get the last working revision with nvidia 460.x | |
nixos-unstable-pinned = import (builtins.fetchTarball { | |
name = "nixos-unstable_nvidia-x11-470.57.02"; |
#!/usr/bin/env bb | |
(ns oidc-client | |
"Get end-user access token from an OIDC provider, caching the access/refresh token in an encrypted file. Code in https://babashka.org | |
Usage: | |
/path/to/oidc_client.clj | |
When there are no cached, valid tokens, it will open a browser with the OIDC provider login URL and start a HTTPS-enabled | |
callback server on localhost. Make sure that the resulting redirect_uri is registered with your provider. | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = false | |
max_line_length = 100 | |
tab_width = 2 | |
ij_continuation_indent_size = 4 | |
ij_formatter_off_tag = @formatter:off |
#!/usr/bin/env bash | |
# | |
# These are the commands available in an .envrc context | |
# | |
# ShellCheck exceptions: | |
# | |
# SC1090: Can't follow non-constant source. Use a directive to specify location. | |
# SC1091: Not following: (file missing) | |
# SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n". | |
# SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo". |
This is a simplistic setup trying to emulate at least part of i3 behaviour on MacOS using yabai. Key-bindings are partially replicated due to the presence of MacOS built-in bindings
Start with installing (and understanding) following tools
{ lib, config, pkgs, ... }: | |
with lib; | |
{ | |
options.v4l2 = mkEnableOption "Enable the confguration to use the reflex as a webcam"; | |
config = mkIf config.v4l2 { | |
# 20.03: v4l2loopback 0.12.5 is required for kernel >= 5.5 | |
# https://github.com/umlaeute/v4l2loopback/issues/257 |
#!/usr/bin/env bash | |
# Exit on error. Append "|| true" if you expect an error. | |
set -o errexit | |
# Exit on error inside any functions or subshells. | |
set -o errtrace | |
# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR | |
set -o nounset | |
# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip` | |
set -o pipefail | |
# Turn on traces, useful while debugging but commented out by default |
SELECT table, | |
name, | |
formatReadableSize(c) compressed, | |
formatReadableSize(u) uncompressed, | |
floor((c/u) * 100, 4) percent | |
FROM ( | |
SELECT table, | |
name, | |
sum(data_compressed_bytes) c, | |
sum(data_uncompressed_bytes) u |