Skip to content

Instantly share code, notes, and snippets.

View K900's full-sized avatar
💤
Occasionally sane

K900

💤
Occasionally sane
View GitHub Profile
@K900
K900 / check-missing-deps.py
Created September 8, 2024 11:11
Check nixos installer for missing deps
import functools
import json
import os.path
import subprocess
import sys
@functools.lru_cache(None)
def _get_drv_info(drv):
raw = subprocess.check_output([
Running fsck online
bcachefs (nvme0n1p6): check_alloc_info... done
bcachefs (nvme0n1p6): check_lrus... done
bcachefs (nvme0n1p6): check_btree_backpointers... done
bcachefs (nvme0n1p6): check_backpointers_to_extents... done
bcachefs (nvme0n1p6): check_extents_to_backpointers... done
bcachefs (nvme0n1p6): check_alloc_to_lru_refs... done
bcachefs (nvme0n1p6): check_snapshot_trees... done
bcachefs (nvme0n1p6): check_snapshots... done
bcachefs (nvme0n1p6): check_subvols... done
[ 868.078404] bcachefs (nvme0n1p6): dirent points to inode that does not point back:
u64s 8 type dirent 1353538093:7712435901067112190:U32_MAX len 0 ver 0: ldconfig -> 7597909 type reg
inum: 7597909 mode=100755
flags= (15300000)
journal_seq=6962140
bi_size=991016
bi_sectors=1936
bi_version=0
bi_atime=13474708023790027
bi_ctime=13230690551898714
{
imports = [ ./users.nix ];
x.users.alice.editor = "hx";
x.users.bob.editor = "vi";
x.users.clive.editor = "code";
boot.loader.grub.enable = false;
fileSystems."/" = { device = "/dev/sda1"; };
}
{pkgs ? import <nixpkgs> {}}: let
package = {
stdenv,
fetchFromGitLab,
autoreconfHook,
automake,
xorg-autoconf,
pkg-config,
xorg,
}:
let
pkgs = (import <nixpkgs> {});
inherit (pkgs) stdenv python3;
flit-core = stdenv.mkDerivation rec {
pname = "flit-core";
version = "3.8.0";
src = python3.pkgs.fetchPypi {
@K900
K900 / pipewire.md
Last active May 29, 2024 14:27
Pipewire migration guide

Why

Because the Pipewire config semantics don't really match the NixOS module semantics, so it's extremely awkward to override the default config, especially when lists are involved. Also, upstream added a lot of accomodations to allow doing most of the things you'd want to do with a config edit in better ways.

Migrating your configuration

Compare your settings to the defaults. Note what your configuration changes.

===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Autoconf 12 563 462 11 90
BASH 8 822 592 112 118
C 35 2549 1806 354 389
C Header 6 1734 871 629 234
CMake 4 31 25 0 6
C# 1 36 15 17 4
C++ 4 753 634 51 68
@K900
K900 / dllmain.cpp
Created June 20, 2020 06:04
So this turned out easier than I expected
#include "pch.h"
#include <winsock.h>
#include <detours.h>
#include <map>
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "ws2_32.lib")
#
# Введение: про термины
#
# iterable - это любой объект, который определяет метод __iter__,
# то есть от него можно получить итератор.
#
# Итератор - это объект, который определяет метод __next__.
# По нему можно итерироваться (т.е. дергать у него __next__, пока не
# вылетит StopIteration).
#