···1+{ config, pkgs, lib, ... }:
2+3+{
4+ config = lib.mkIf (config.boot.initrd.enable && config.boot.initrd.systemd.enable) {
5+ # Copy secrets into the initrd if they cannot be appended
6+ boot.initrd.systemd.contents = lib.mkIf (!config.boot.loader.supportsInitrdSecrets)
7+ (lib.mapAttrs' (dest: source: lib.nameValuePair "/.initrd-secrets/${dest}" { source = if source == null then dest else source; }) config.boot.initrd.secrets);
8+9+ # Copy secrets to their respective locations
10+ boot.initrd.systemd.services.initrd-nixos-copy-secrets = lib.mkIf (config.boot.initrd.secrets != {}) {
11+ description = "Copy secrets into place";
12+ # Run as early as possible
13+ wantedBy = [ "sysinit.target" ];
14+ before = [ "cryptsetup-pre.target" ];
15+ unitConfig.DefaultDependencies = false;
16+17+ # We write the secrets to /.initrd-secrets and move them because this allows
18+ # secrets to be written to /run. If we put the secret directly to /run and
19+ # drop this service, we'd mount the /run tmpfs over the secret, making it
20+ # invisible in stage 2.
21+ script = ''
22+ for secret in $(cd /.initrd-secrets; find . -type f); do
23+ mkdir -p "$(dirname "/$secret")"
24+ cp "/.initrd-secrets/$secret" "/$secret"
25+ done
26+ '';
27+28+ unitConfig = {
29+ Type = "oneshot";
30+ RemainAfterExit = true;
31+ };
32+ };
33+ # The script needs this
34+ boot.initrd.systemd.extraBin.find = "${pkgs.findutils}/bin/find";
35+ };
36+}
···21, enableGold ? execFormatIsELF stdenv.targetPlatform
22, enableShared ? !stdenv.hostPlatform.isStatic
23 # WARN: Enabling all targets increases output size to a multiple.
24-, withAllTargets ? false, libbfd, libopcodes
25}:
2627# WARN: configure silently disables ld.gold if it's unsupported, so we need to
···183 # Fails
184 doCheck = false;
185186- postFixup = lib.optionalString (enableShared && withAllTargets) ''
187- rm "$out"/lib/lib{bfd,opcodes}-${version}.so
188- ln -s '${lib.getLib libbfd}/lib/libbfd-${version}.so' "$out/lib/"
189- ln -s '${lib.getLib libopcodes}/lib/libopcodes-${version}.so' "$out/lib/"
190- '';
191192 # INFO: Otherwise it fails with:
193 # `./sanity.sh: line 36: $out/bin/size: not found`
···21, enableGold ? execFormatIsELF stdenv.targetPlatform
22, enableShared ? !stdenv.hostPlatform.isStatic
23 # WARN: Enabling all targets increases output size to a multiple.
24+, withAllTargets ? false
25}:
2627# WARN: configure silently disables ld.gold if it's unsupported, so we need to
···183 # Fails
184 doCheck = false;
185186+ # Remove on next bump. It's a vestige of past conditional. Stays here to avoid
187+ # mass rebuild.
188+ postFixup = "";
00189190 # INFO: Otherwise it fails with:
191 # `./sanity.sh: line 36: $out/bin/size: not found`
+3
pkgs/games/dwarf-fortress/dfhack/default.nix
···131132 patches = [ ./fix-stonesense.patch ];
133000134 # As of
135 # https://github.com/DFHack/dfhack/commit/56e43a0dde023c5a4595a22b29d800153b31e3c4,
136 # dfhack gets its goodies from the directory above the Dwarf_Fortress
···131132 patches = [ ./fix-stonesense.patch ];
133134+ # gcc 11 fix
135+ NIX_CFLAGS_COMPILE = "-fpermissive";
136+137 # As of
138 # https://github.com/DFHack/dfhack/commit/56e43a0dde023c5a4595a22b29d800153b31e3c4,
139 # dfhack gets its goodies from the directory above the Dwarf_Fortress