Skip to content

Instantly share code, notes, and snippets.

{
# The script uses either the CLI or GUI program depending on being in a shell or not.
environment.interactiveShellInit = "export PINENTRY_USER_DATA=$TTY";
}
#!/usr/bin/env bash
nix-path() {
if (( $# < 1 )) || [[ $1 == --help ]]; then
echo "Usage: nix-path <pkg_name>..." >&2
return 1
fi
if [[ -z $NIX_PATH ]]; then return 1; fi
local ret=0 needle found name nix_path
for needle in "$@"; do
@ottidmes
ottidmes / default.nix
Last active May 23, 2021 18:41
VS Code Live Share extension
# Baseed on previous attempts of others: https://github.com/NixOS/nixpkgs/issues/41189
{ lib, vscode-utils, autoPatchelfHook, bash, file, makeWrapper, dotnet-sdk
, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, utillinux, zlib
, enableDiagnosticsWorkaround ? false, gccStdenv
}:
with lib;
let
# https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#install-prerequisites-manually
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.boot.initrd.network.ssh;
sshdConfig = pkgs.writeText "sshd_config" ''
Protocol 2
Port ${toString cfg.port}
@ottidmes
ottidmes / premium-xcursor-theme.nix
Created July 21, 2017 01:12
Custom X cursor in NixOS
{ stdenv, lib, fetchurl, variants ? [ "Premium" "Premium-left" ] }:
with lib;
stdenv.mkDerivation rec {
name = "${package-name}-${version}";
package-name = "premium-xcursor-theme";
version = "0.3";
src = fetchurl {