Disko это утилита и модуль Nixos для декларативной разметки дисков.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 1 0x01 147 39984 2088515013 55466767689355 | |
name type data | |
hits 4 227098528 | |
iohits 4 162963 | |
misses 4 1148629 | |
demand_data_hits 4 48027529 | |
demand_data_iohits 4 659 | |
demand_data_misses 4 267582 | |
demand_metadata_hits 4 178122149 | |
demand_metadata_iohits 4 4992 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import re | |
import sys | |
import os | |
import subprocess | |
import curses.ascii | |
import binascii | |
from typing import Tuple, Optional | |
def parse_network_manager(filename: str) -> Tuple[Optional[str], Optional[str]]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Containers | |
General introduction to containers/namespaces/cgroups (40min): https://www.youtube.com/watch?v=GMs3kLteZvk | |
Slides: https://github.com/ls1-adv-sys-prog-course/docs/blob/main/slides/01-containers.pdf | |
Assignment explained (10min): https://www.youtube.com/watch?v=INyb4Rj073U | |
## Intro |
First generate the image script:
$ nix build .#nixosConfigurations.myhost.config.system.build.diskoImagesScript
Next we build the image:
$ sudo ./result --build-memory 2048
Tvix is a new implementation of the Nix language and package manager.
In this benchmark we test it's performance when instantiating the hello package from nix.
Note that at the time tvix does not have its own store implementation yet and it has to
execute nix-store
whenever it needs to copy files to the store.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import http.client | |
import json | |
import os | |
import time | |
import urllib.parse | |
import urllib.request | |
from pathlib import Path | |
from typing import Any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## USAGE | |
# $ nix-build kexec-installer.nix | |
# can be deployed remote like this | |
# $ rsync -aL -e ssh result/ root@host: | |
# $ ssh root@host ./kexec-installer | |
## Customize it like this | |
# # custom-installer.nix | |
# import ./kexec-installer.nix { | |
# extraConfig = {pkgs, ... } { | |
# user.extraUsers.root.openssh.authorizedKeys.keys = [ "<your-key>" ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell -i bash -p sqlite -p bash | |
SQL=$(cat <<EOF | |
select * from DerivationOutputs do | |
inner join ValidPaths vp on vp.id = do.drv | |
inner join Refs r1 on r1.referrer = vp.id | |
inner join ValidPaths vp2 on r1.reference = vp2.id | |
where do.path GLOB '/nix/store/$1-*' | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
fixWrapper = pkgs.runCommand "fix-wrapper" {} '' | |
mkdir -p $out/bin | |
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do | |
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i") | |
done | |
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do | |
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i") |
NewerOlder