Compile qemu-binfmt-wrapper.c with QEMU_RISCV_BINDIR set to the bin directory qemu-riscv is installed in, and name the binary /run/binfmt/riscv64. Then riscv.conf in /etc/binfmt.d on a systemd system will have qemu-user interpret all riscv64 binaries, including respecting setuid bit. On non-systemd you'll need to add the binfmt registration some other way.
This file contains hidden or 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
| let qemuBinfmtWrapperSource = pkgs.writeTextDir "qemu-binfmt-wrapper.c" | |
| '' | |
| #include <unistd.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <sys/auxv.h> | |
| int main(int argc,char ** argv) { | |
| int fd = (int) getauxval(AT_EXECFD); | |
| size_t sz = snprintf(NULL, 0, "/proc/self/fd/%d", fd) + 1; |
This file contains hidden or 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
| lib: let inherit (lib) extrec; in | |
| { testSimpleExtrec = | |
| { expr = | |
| let base = extrec."{"{ x = 123; | |
| y = self: self.x; | |
| }"}"; | |
| overrides = extrec."{"{ x = 456; | |
| z = self: self.y; | |
| }"}"; |
This file contains hidden or 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
| let pkgs = import ./. { system = "riscv64-linux"; }; in | |
| builtins.toFile "ugh" '' | |
| ${builtins.unsafeDiscardOutputDependency pkgs.stdenv.drvPath} | |
| '' |
This file contains hidden or 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
| @nix { "action": "setPhase", "phase": "unpackPhase" } | |
| unpacking sources | |
| unpacking source archive /nix/store/qk6d52igqsnakwa8c8q5jmh16xfmdhpw-perl-5.24.3.tar.gz | |
| source root is perl-5.24.3 | |
| unpacking source archive /nix/store/85jfz2bkpmnb1f0dh9zdjkw7lwanqpgr-perl-cross-1.1.8.tar.gz | |
| setting SOURCE_DATE_EPOCH to timestamp 1506110117 of file perl-5.24.3/pod/perldelta.pod | |
| @nix { "action": "setPhase", "phase": "patchPhase" } | |
| patching sources | |
| applying patch /nix/store/2xihh65mm3hjwd3d6lfrh1r54pnbghzp-no-sys-dirs.patch | |
| patching file Configure |
This file contains hidden or 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
| # This is a generated file. Do not edit! | |
| # | |
| # To make changes, edit the fileSystems and swapDevices NixOS options | |
| # in your /etc/nixos/configuration.nix file. | |
| # Filesystems. | |
| tmpfs / tmpfs defaults,mode=755 0 0 | |
| /dev/disk/by-label/ESP /boot vfat defaults 0 2 | |
| /dev/disk/by-label/root /etc-persistent btrfs defaults,subvol=/etc-persistent 0 0 | |
| /dev/disk/by-label/root /home-persistent/shlevy btrfs defaults,subvol=/home-persistent/shlevy 0 0 |
This file contains hidden or 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
| #include <thread> | |
| #include <mutex> | |
| #include <iostream> | |
| extern "C" { | |
| #include <poll.h> | |
| #include <unistd.h> | |
| } | |
| std::mutex stdio_mutex; |
This file contains hidden or 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
| haskellPackages: | |
| let overrideHaskellPackages = orig: | |
| { buildHaskellPackages = | |
| orig.buildHaskellPackages.override overrideHaskellPackages; | |
| ghc = orig.ghc.override { deterministicProfiling = true; }; | |
| }; | |
| in haskellPackages.override overrideHaskellPackages |
This file contains hidden or 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
| Require Import Unicode.Utf8. | |
| Require Import Arith.Compare_dec. | |
| Require Vectors.Vector. | |
| Set Implicit Arguments. | |
| Fixpoint pow (n : nat) (e : nat) : nat := | |
| match e with | |
| | 0 => 1 | |
| | S e' => n * pow n e' |
This file contains hidden or 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
| ;; -*- mode: Ledger; -*- | |
| 2018/01/01 Target | |
| Expenses:Food ($2.95 * 19/20) | |
| Expenses:Clothing ($0.40 * 19/20) | |
| ; With the following line commented, normal balance report rounds to | |
| ; cents and --unround shows 1/4 of a cent left over. With it uncommented, | |
| ; balance report rounds to 100ths of a cent | |
| ;Income:Red Card Rounding (-$0.0025) | |
| Liabilities:Red Card -$3.18 |