OpenBSD loves hardcoding paths to programs.
The only example of this in `bsd.obj.mk` is `/bin/pwd`,
so `substituteInPlace` is fine.
Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
OpenBSD does not provide a compatibility library for running
build tools on other OSes, but we still need one.
`openbsd.compat` inspired by the `freebsd.compat` package and provides
a header-only compatibility layer that can be used across multiple
openbsd build packages. The source is included in the nixpkgs tree
because it functions similarly to per-package patches.
`openbsd.compatHook` provides a build hook that can be added into
`extraNativeBuildInputs` to include `compat` in the library search
path as a system library.
Some packages require extra hooks or tools.
Rather than overriding all of the nativeBuildInputs
and needing to specify all of them, add a field so that
we just need to specify inputs that are not always required.
Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
Before, when using things like proxy jumps, we would end up with the hostname of either localhost or the jump host (depending on whether you configure the jumphost in your ssh config file or in the SSHOPTS) instead of the hostname of the target host.
I was running the following command:
```bash
NIX_SSHOPTS='-p 6016 -J username@jumphost' nixos-rebuild --verbose --flake '.#' --target-host localhost --use-remote-sudo --fast build
```
and what was getting built was `nixosConfigurations.<localhost hostname>` instead of `nixosConfigurations.<remote hostname>`, because the SSH connection to determine the hostname didn't have the NIX_SSHOPTS added to it yet.
So I simply moved the logic to set up the tmp dir and set the SSHOPTS a bit higher up.
We are migrating packages that meet below requirements:
1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration
The tool is here: https://github.com/Aleksanaa/by-name-migrate.