Skip to content

Instantly share code, notes, and snippets.

View infinisil's full-sized avatar

Silvan Mosberger infinisil

  • Tweag
  • Switzerland
View GitHub Profile
- [f3031298b22e](https://github.com/NixOS/nixpkgs/commit/f3031298b22ed05a0b46728fa4f053a990a562f1) [@marsam](https://github.com/marsam) - chipsec: disable on non-Linux
- [2cdc05763f4f](https://github.com/NixOS/nixpkgs/commit/2cdc05763f4f857d04ead6c53fe8be23ec441903) [@marsam](https://github.com/marsam) - chipsec: disable on non-Linux
- [7bfde4b33400](https://github.com/NixOS/nixpkgs/commit/7bfde4b33400c1a9b5655a5b13960011a0d6740c) [@zimbatm](https://github.com/zimbatm) - Revert "st: enable build on darwin (#98668)"
- [020ff6989a9e](https://github.com/NixOS/nixpkgs/commit/020ff6989a9ee98f779dc5f9f74b96c4a8090f72) [@NeQuissimus](https://github.com/NeQuissimus) - 1password: 1.1.1 -> 1.7.0
- [5ab14bf6ad62](https://github.com/NixOS/nixpkgs/commit/5ab14bf6ad62873e39a3593d158b599b86267274) [@NeQuissimus](https://github.com/NeQuissimus) - vivaldi: 3.3.2022.39-1 -> 3.3.2022.47-1
- [5d4cc0e25c15](https://github.com/NixOS/nixpkgs/commit/5d4cc0e25c1589f4248c4534260c86647bc4ae73) [@rickynils](https://github.com/rickynils)
❯ cd $(mktemp -d)
❯ git init
Initialized empty Git repository in /tmp/tmp.ovd5lFO665/.git/
❯ echo 1 > foo
❯ git add foo
❯ git commit -m 'Version 1'
[main (root-commit) af124d9] Version 1
1 file changed, 1 insertion(+)
create mode 100644 foo
❯ git switch -c release
@infinisil
infinisil / shards.nix
Created May 11, 2023 20:12
Distribution of shards in Nixpkgs for RFC 140
{
system ? builtins.currentSystem,
nixpkgs ? fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/6948ef4deff7a72ebe5242244bd3730e8542b925";
sha256 = "1fw8vlbcxr3kw96rrjlw94zhbjs3a32dcnvav19cvniwlbhf2jsh";
},
}:
let
pkgs = import nixpkgs {
inherit system;
@infinisil
infinisil / count.nix
Last active May 11, 2023 18:55
The number of attributes in Nixpkgs that are affected by RFC 140
{
system ? builtins.currentSystem,
nixpkgs ? fetchTarball {
url = "https://github.com/NixOS/nixpkgs/tarball/6948ef4deff7a72ebe5242244bd3730e8542b925";
sha256 = "1fw8vlbcxr3kw96rrjlw94zhbjs3a32dcnvav19cvniwlbhf2jsh";
},
}:
let
pkgs = import nixpkgs {
inherit system;
Warning: File "./pkgs/servers/polaris/node-composition.nix" on line 3 refers to Nix search path, ignoring it: "<nixpkgs>"
Warning: File "./pkgs/data/fonts/iosevka/node-composition.nix" on line 3 refers to Nix search path, ignoring it: "<nixpkgs>"
Warning: File "./nixos/release.nix" on line 13 refers to an ignored path, ignoring it: "../.version"
Warning: File "./pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix" on line 1 refers to Nix search path, ignoring it: "<nixpkgs>"
Warning: File "./nixos/tests/cassandra.nix" on line 7 refers to non-existent path, ignoring it "./cassandra-jmx-roles"
Warning: File "./pkgs/applications/editors/jupyter-kernels/clojupyter/deps.nix" on line 2 refers to Nix search path, ignoring it: "<nixpkgs>"
Warning: File "./pkgs/applications/emulators/wine/sources.nix" on line 1 refers to Nix search path, ignoring it: "<nixpkgs>"
Warning: File "./pkgs/build-support/icon-conv-tools/default.nix" on line 7 refers to a directory that doesn't contain a default.nix file, ignor
❯ binwalk /run/current-system/initrd
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file size: "0x004e7c00"
5143700 0x4E7C94 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000b", file size: "0x00000000"
5155914 0x4EAC4A xz compressed data
5298545 0x50D971 ASCII cpio archive (SVR4 with no CRC), file name: "nix/store/gwgzkx31yng8fji52a49rm1kg6bvck7r-linux-5.18.19-modules-shrunk/lib/firmware/i915/adls_dmc_ver2_01.bin.xz", file name length: "0x00000072", file size: "0x000010bc"
5303053 0x50EB0D ASCII cpio archive (SVR4 with no CRC), file name: "nix/store/gwgzkx31yng8fji52a49rm1kg6bvck7r-linux-5.18.19-modules-shrunk/lib/firmware/i915/bxt_dmc_ver1_07.bin.xz", file name length: "0x00000071", file s
❯ dd if=/run/current-system/initrd skip=0 | cpio -t
kernel/x86/microcode/GenuineIntel.bin
10047 blocks
❯ dd if=/run/current-system/initrd skip=10047 | cpio -t
cpio: Malformed number (/`,
cpio: Malformed number /`,
cpio: Malformed number /`,
cpio: Malformed number `,
cpio: Malformed number `,
l: 1547
s: 1305
g: 1219
p: 1174
c: 1166
m: 976
a: 808
t: 739
d: 668
f: 635
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Main where
with import <nixpkgs/lib>;
let
# toHex :: Word4 -> String
toHex = elemAt (stringToCharacters "0123456789abcdef");
bytes = builtins.readFile ./bytes;
# Mapping from bytes to their values
mapping = listToAttrs (map (number: {
name = substring (number - 1) 1 bytes;
value = number;