this hook queues up store paths on a unix domain socket and then spawns a service to actually push the store path to the cache through socket activation
works on MacOS and Linux
| #!/bin/sh | |
| cat "$(nix-build ci -A eval.full --max-jobs 4 --cores 2 --arg chunkSize 10000)"/outpaths.json | jq -r '.[]|values[]|values' | sort | uniq | cut -c 12-43 | xargs -P128 -I {} curl --head https://nixos.tvix.store/{}.narinfo |
| let imds = ["169.254.169.254" "fd00:ec2::254"]; in | |
| { | |
| systemd.slices."-".sliceConfig.IPAddressDeny = imds; | |
| systemd.services.my-service-that-needs-aws.serviceConfig.IPAddressAllow = imds; | |
| } |
| resource "aws_s3_bucket_item" "this" { | |
| bucket = "images" | |
| key = var.image_name | |
| source = var.image_path | |
| } | |
| resource "aws_ebs_snapshort_import" "this" { | |
| disk_container { | |
| type = "VHD" | |
| user_bucket = aws_s3_bucket_item.this.bucket |
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module MyLib (someFunc) where | |
| import Conduit (ConduitT, Flush (Chunk, Flush), Source, yield, (.|)) | |
| import Control.Concurrent (threadDelay) | |
| import Control.Monad (forM_) | |
| import Control.Monad.IO.Class | |
| import Control.Monad.Trans.Class (lift) |
| longComputation = do | |
| threaDelay 5000 | |
| pure ["a", "b" ,"c"] | |
| longComputation2 = do | |
| threadDelay 3000 | |
| pure "lol" | |
| website = do | |
| h1 "Hello, World!" |
The docs on https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta#4239539 are sparse and incomplete and don't tell you at all how to set this up. Lets trial and error our way through this.
| #!/bin/sh | |
| #If already set (e.g. in github actions); use that instead | |
| if [ -z "$GITHUB_TOKEN" ]; then | |
| nix run nixpkgs#gh auth status || nix run nixpkgs#gh auth login | |
| GITHUB_TOKEN="$(nix run nixpkgs#gh auth token)" | |
| export GITHUB_TOKEN | |
| fi | |
| NIX_CONFIG="access-tokens = github.com=$GITHUB_TOKEN" |
| use flake .#dira |
| [root@nixos:~]# poweroff | |
| [root@nixos:~]# Stopping Session 1 of User root... | |
| Stopping Session 2 of User root... | |
| [ OK ] Removed slice Slice /system/modprobe. | |
| [ OK ] Stopped target Multi-User System. | |
| [ OK ] Stopped target Login Prompts. | |
| [ OK ] Stopped target Containers. | |
| [ OK ] Stopped target Network is Online. |