···115115116116- [Eintopf](https://eintopf.info), a community event and calendar web application. Available as [services.eintopf](options.html#opt-services.eintopf.enable).
117117118118+- [`pay-respects`](https://codeberg.org/iff/pay-respects), a terminal command correction program, alternative to `thefuck`, written in Rust. Available as [programs.pay-respects](options.html#opt-programs.pay-respects).
119119+118120- [Radicle](https://radicle.xyz), an open source, peer-to-peer code collaboration stack built on Git. Available as [services.radicle](#opt-services.radicle.enable).
119121120122- [ddns-updater](https://github.com/qdm12/ddns-updater), a service with a WebUI to update DNS records periodically for many providers. Available as [services.ddns-updater](#opt-services.ddns-updater.enable).
+56
nixos/modules/programs/pay-respects.nix
···11+{
22+ config,
33+ pkgs,
44+ lib,
55+ ...
66+}:
77+let
88+ inherit (lib)
99+ getExe
1010+ maintainers
1111+ mkEnableOption
1212+ mkIf
1313+ mkOption
1414+ types
1515+ ;
1616+ inherit (types) str;
1717+ cfg = config.programs.pay-respects;
1818+1919+ initScript =
2020+ shell:
2121+ if (shell != "fish") then
2222+ ''
2323+ eval $(${getExe pkgs.pay-respects} ${shell} --alias ${cfg.alias})
2424+ ''
2525+ else
2626+ ''
2727+ ${getExe pkgs.pay-respects} ${shell} --alias ${cfg.alias} | source
2828+ '';
2929+in
3030+{
3131+ options = {
3232+ programs.pay-respects = {
3333+ enable = mkEnableOption "pay-respects, an app which corrects your previous console command";
3434+3535+ alias = mkOption {
3636+ default = "f";
3737+ type = str;
3838+ description = ''
3939+ `pay-respects` needs an alias to be configured.
4040+ The default value is `f`, but you can use anything else as well.
4141+ '';
4242+ };
4343+ };
4444+ };
4545+4646+ config = mkIf cfg.enable {
4747+ environment.systemPackages = [ pkgs.pay-respects ];
4848+4949+ programs = {
5050+ bash.interactiveShellInit = initScript "bash";
5151+ fish.interactiveShellInit = mkIf config.programs.fish.enable initScript "fish";
5252+ zsh.interactiveShellInit = mkIf config.programs.zsh.enable initScript "zsh";
5353+ };
5454+ };
5555+ meta.maintainers = with maintainers; [ sigmasquadron ];
5656+}
···9494 '';
9595 }) super.git-annex;
96969797+ # on*Finish tests rely on a threadDelay timing differential of 0.1s.
9898+ # You'd think that's plenty of time even though immediate rescheduling
9999+ # after threadDelay is not guaranteed. However, it appears that these
100100+ # tests are quite flaky on Darwin.
101101+ immortal = dontCheck super.immortal;
102102+97103 # Prevents needing to add `security_tool` as a run-time dependency for
98104 # everything using x509-system to give access to the `security` executable.
99105 #
···427427 flake="$(dirname "$(readlink -f /etc/nixos/flake.nix)")"
428428fi
429429430430+tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX)
431431+432432+if [[ ${#tmpDir} -ge 60 ]]; then
433433+ # Very long tmp dirs lead to "too long for Unix domain socket"
434434+ # SSH ControlPath errors. Especially macOS sets long TMPDIR paths.
435435+ rmdir "$tmpDir"
436436+ tmpDir=$(TMPDIR= mktemp -t -d nixos-rebuild.XXXXXX)
437437+fi
438438+439439+cleanup() {
440440+ for ctrl in "$tmpDir"/ssh-*; do
441441+ ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true
442442+ done
443443+ rm -rf "$tmpDir"
444444+}
445445+trap cleanup EXIT
446446+447447+SSHOPTS="$NIX_SSHOPTS -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-%n -o ControlPersist=60"
448448+430449# For convenience, use the hostname as the default configuration to
431450# build from the flake.
432451if [[ -n $flake ]]; then
···449468 log "error: ‘--specialisation’ can only be used with ‘switch’ and ‘test’"
450469 exit 1
451470fi
452452-453453-tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX)
454454-455455-if [[ ${#tmpDir} -ge 60 ]]; then
456456- # Very long tmp dirs lead to "too long for Unix domain socket"
457457- # SSH ControlPath errors. Especially macOS sets long TMPDIR paths.
458458- rmdir "$tmpDir"
459459- tmpDir=$(TMPDIR= mktemp -t -d nixos-rebuild.XXXXXX)
460460-fi
461461-462462-cleanup() {
463463- for ctrl in "$tmpDir"/ssh-*; do
464464- ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true
465465- done
466466- rm -rf "$tmpDir"
467467-}
468468-trap cleanup EXIT
469471470472471473# Re-execute nixos-rebuild from the Nixpkgs tree.
···509511 fi
510512 exit 1
511513fi
512512-513513-SSHOPTS="$NIX_SSHOPTS -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-%n -o ControlPersist=60"
514514515515# First build Nix, since NixOS may require a newer version than the
516516# current one.