diff options
Diffstat (limited to '')
45 files changed, 1006 insertions, 886 deletions
diff --git a/pkgs/athena-bccr/default.nix b/pkgs/athena-bccr/default.nix index f9276c1..a5f79ca 100644 --- a/pkgs/athena-bccr/default.nix +++ b/pkgs/athena-bccr/default.nix @@ -1,32 +1,30 @@ -{ callPackage -, lib -}: -let +{ + callPackage, + lib, +}: let latest = "deb64-rev26"; - releases = lib.mapAttrs (name: release: release // { name = name; }) (import ./releases.nix); + releases = lib.mapAttrs (name: release: release // {name = name;}) (import ./releases.nix); - overrideUnwrapped = default: new: - let - args = default // new; - unwrappedPkgs = lib.filterAttrs (name: _: ! lib.elem name [ "override" "overrideDerivation" ]) (callPackage ./unwrapped.nix args); - in - lib.fix (unwrapped: lib.mapAttrs (_: pkg: callPackage pkg unwrapped) unwrappedPkgs) // { + overrideUnwrapped = default: new: let + args = default // new; + unwrappedPkgs = lib.filterAttrs (name: _: ! lib.elem name ["override" "overrideDerivation"]) (callPackage ./unwrapped.nix args); + in + lib.fix (unwrapped: lib.mapAttrs (_: pkg: callPackage pkg unwrapped) unwrappedPkgs) + // { override = overrideUnwrapped args; }; - pkgsForRelease = release: - let - ase-pkcs11 = unwrapped.ase-idprotect.lib; - libasep11 = "${ase-pkcs11}/lib/x64-athena/libASEP11.so"; - unwrapped = overrideUnwrapped { inherit release; } { }; - in - { - inherit ase-pkcs11 libasep11; - inherit (unwrapped) ase-idprotect bccr-cacerts; + pkgsForRelease = release: let + ase-pkcs11 = unwrapped.ase-idprotect.lib; + libasep11 = "${ase-pkcs11}/lib/x64-athena/libASEP11.so"; + unwrapped = overrideUnwrapped {inherit release;} {}; + in { + inherit ase-pkcs11 libasep11; + inherit (unwrapped) ase-idprotect bccr-cacerts; - gaudi = callPackage ./gaudi-env.nix { inherit unwrapped; }; - firmador = callPackage ./firmador.nix { inherit libasep11; }; - }; + gaudi = callPackage ./gaudi-env.nix {inherit unwrapped;}; + firmador = callPackage ./firmador.nix {inherit libasep11;}; + }; in -lib.mapAttrs (_: pkgsForRelease) (releases // { latest = releases.${latest}; }) + lib.mapAttrs (_: pkgsForRelease) (releases // {latest = releases.${latest};}) diff --git a/pkgs/athena-bccr/firmador.nix b/pkgs/athena-bccr/firmador.nix index eef413b..d280b56 100644 --- a/pkgs/athena-bccr/firmador.nix +++ b/pkgs/athena-bccr/firmador.nix @@ -1,58 +1,57 @@ -{ fetchgit -, lib -, makeWrapper -, maven -, openjdk -, wrapGAppsHook - -, libasep11 ? null -}: -let +{ + fetchgit, + lib, + makeWrapper, + maven, + openjdk, + wrapGAppsHook, + libasep11 ? null, +}: let jdk = openjdk.override { enableJavaFX = true; }; version = "1.9.8"; in -maven.buildMavenPackage { - pname = "firmador"; - inherit version; - - src = fetchgit { - url = "https://codeberg.org/firmador/firmador"; - rev = version; - hash = "sha256-xdiVPjihRADPK4nG+WQHWsDzVYLCeN6ouQ6SDtjf1qQ="; - }; + maven.buildMavenPackage { + pname = "firmador"; + inherit version; - patches = [ - ./0001-Remove-CheckUpdatePlugin-from-default-list.patch - ]; + src = fetchgit { + url = "https://codeberg.org/firmador/firmador"; + rev = version; + hash = "sha256-xdiVPjihRADPK4nG+WQHWsDzVYLCeN6ouQ6SDtjf1qQ="; + }; - mvnHash = "sha256-h1zoStTgaE7toWWKq0Y0ahOORyltChwjmaMYjLgs1VE="; + patches = [ + ./0001-Remove-CheckUpdatePlugin-from-default-list.patch + ]; - nativeBuildInputs = [ - makeWrapper - wrapGAppsHook - ]; + mvnHash = "sha256-h1zoStTgaE7toWWKq0Y0ahOORyltChwjmaMYjLgs1VE="; - postPatch = lib.optionalString (libasep11 != null) '' - sed -i 's@/usr/lib/x64-athena/libASEP11.so@${libasep11}@g' src/main/java/cr/libre/firmador/CRSigner.java - ''; + nativeBuildInputs = [ + makeWrapper + wrapGAppsHook + ]; - installPhase = '' - runHook preInstall + postPatch = lib.optionalString (libasep11 != null) '' + sed -i 's@/usr/lib/x64-athena/libASEP11.so@${libasep11}@g' src/main/java/cr/libre/firmador/CRSigner.java + ''; - mkdir -p $out/bin $out/share/java - install -Dm644 target/firmador.jar $out/share/java + installPhase = '' + runHook preInstall - makeWrapper ${jdk}/bin/java $out/bin/firmador \ - --add-flags "-jar $out/share/java/firmador.jar" + mkdir -p $out/bin $out/share/java + install -Dm644 target/firmador.jar $out/share/java - runHook postInstall - ''; + makeWrapper ${jdk}/bin/java $out/bin/firmador \ + --add-flags "-jar $out/share/java/firmador.jar" - meta = { - homepage = "https://firmador.libre.cr"; - license = lib.licenses.gpl3Plus; - }; -} + runHook postInstall + ''; + + meta = { + homepage = "https://firmador.libre.cr"; + license = lib.licenses.gpl3Plus; + }; + } diff --git a/pkgs/athena-bccr/gaudi-env.nix b/pkgs/athena-bccr/gaudi-env.nix index 1ced54e..0ca1b82 100644 --- a/pkgs/athena-bccr/gaudi-env.nix +++ b/pkgs/athena-bccr/gaudi-env.nix @@ -1,63 +1,62 @@ -{ buildFHSEnv -, curl -, lib -, writeShellScriptBin - -, gaudiHash ? null -, unwrapped -}: -let - unwrappedWithGaudi = unwrapped.override { inherit gaudiHash; }; +{ + buildFHSEnv, + curl, + lib, + writeShellScriptBin, + gaudiHash ? null, + unwrapped, +}: let + unwrappedWithGaudi = unwrapped.override {inherit gaudiHash;}; in -buildFHSEnv { - name = "gaudi"; + buildFHSEnv { + name = "gaudi"; - targetPkgs = pkgs: [ - unwrappedWithGaudi.ase-idprotect.lib - unwrappedWithGaudi.gaudi + targetPkgs = pkgs: [ + unwrappedWithGaudi.ase-idprotect.lib + unwrappedWithGaudi.gaudi - (writeShellScriptBin "launch-gaudi" '' - set -o errexit - set -o pipefail - set -o nounset + (writeShellScriptBin "launch-gaudi" '' + set -o errexit + set -o pipefail + set -o nounset - PATH="${lib.makeBinPath [ curl ]}:$PATH" + PATH="${lib.makeBinPath [curl]}:$PATH" - echo "$0: testing for incompatible releases..." >&2 + echo "$0: testing for incompatible releases..." >&2 - jar_name=bccr-firma-fva-clienteMultiplataforma.jar - url="https://www.firmadigital.go.cr/Bccr.Firma.Fva.Actualizador.ClienteFirmadorJava//recursosLiberica17/actualizador/$jar_name" - ca_file="${unwrappedWithGaudi.bccr-cacerts}/root-ca.pem" - url_hash=$(curl -sS --cacert "$ca_file" "$url" | sha256sum | cut -d' ' -f1) - jar_path="${unwrappedWithGaudi.gaudi}/share/java/$jar_name" - jar_hash=$(sha256sum "$jar_path" | cut -d' ' -f1) + jar_name=bccr-firma-fva-clienteMultiplataforma.jar + url="https://www.firmadigital.go.cr/Bccr.Firma.Fva.Actualizador.ClienteFirmadorJava//recursosLiberica17/actualizador/$jar_name" + ca_file="${unwrappedWithGaudi.bccr-cacerts}/root-ca.pem" + url_hash=$(curl -sS --cacert "$ca_file" "$url" | sha256sum | cut -d' ' -f1) + jar_path="${unwrappedWithGaudi.gaudi}/share/java/$jar_name" + jar_hash=$(sha256sum "$jar_path" | cut -d' ' -f1) - if [ "$url_hash" != "$jar_hash" ]; then - last_modified=$(curl -sS --head --cacert "$ca_file" "$url" | grep -i '^last-modified:' | head -1) + if [ "$url_hash" != "$jar_hash" ]; then + last_modified=$(curl -sS --head --cacert "$ca_file" "$url" | grep -i '^last-modified:' | head -1) - echo "$0: sha256 mismatch for $jar_path due to server-side update" >&2 - echo "$0: expected: $url_hash" >&2 - echo "$0: actual: $jar_hash" >&2 - echo "$0: $last_modified" >&2 - echo "$0: run the following to download the new client JAR, then update your derivation:" >&2 - echo "$0: \$ ${unwrappedWithGaudi.update-gaudi}" >&2 + echo "$0: sha256 mismatch for $jar_path due to server-side update" >&2 + echo "$0: expected: $url_hash" >&2 + echo "$0: actual: $jar_hash" >&2 + echo "$0: $last_modified" >&2 + echo "$0: run the following to download the new client JAR, then update your derivation:" >&2 + echo "$0: \$ ${unwrappedWithGaudi.update-gaudi}" >&2 - exit 1 - fi + exit 1 + fi - cache_path_1="''${XDG_CACHE_HOME:-$HOME/.cache}/Agente-GAUDI" - cache_path_2="''${XDG_CACHE_HOME:-$HOME/.cache}/Firmador-BCCR" + cache_path_1="''${XDG_CACHE_HOME:-$HOME/.cache}/Agente-GAUDI" + cache_path_2="''${XDG_CACHE_HOME:-$HOME/.cache}/Firmador-BCCR" - for cache_path in "$cache_path_1" "$cache_path_2"; do - mkdir -p "$cache_path" - ln -sf -- ${unwrappedWithGaudi.gaudi}/share/java/bccr-firma-fva-clienteMultiplataforma.jar "$cache_path" - done + for cache_path in "$cache_path_1" "$cache_path_2"; do + mkdir -p "$cache_path" + ln -sf -- ${unwrappedWithGaudi.gaudi}/share/java/bccr-firma-fva-clienteMultiplataforma.jar "$cache_path" + done - cp -f --no-preserve=mode -t "$cache_path_1" -- "${unwrappedWithGaudi.gaudi}/share/java/config.properties" + cp -f --no-preserve=mode -t "$cache_path_1" -- "${unwrappedWithGaudi.gaudi}/share/java/config.properties" - exec gaudi - '') - ]; + exec gaudi + '') + ]; - runScript = "launch-gaudi"; -} + runScript = "launch-gaudi"; + } diff --git a/pkgs/athena-bccr/unwrapped.nix b/pkgs/athena-bccr/unwrapped.nix index 55ef107..d6f3f38 100644 --- a/pkgs/athena-bccr/unwrapped.nix +++ b/pkgs/athena-bccr/unwrapped.nix @@ -1,11 +1,10 @@ -{ lib -, requireFile - -, release -, gaudiHash ? null -, ... -}: -let +{ + lib, + requireFile, + release, + gaudiHash ? null, + ... +}: let inherit (release) srcPaths; src = requireFile { @@ -15,40 +14,47 @@ let inherit (release) hash; }; - gaudiUpdateSrc = { update-gaudi }: requireFile { - url = "${update-gaudi}"; - name = "gaudi-update-${release.name}.zip"; + gaudiUpdateSrc = {update-gaudi}: + requireFile { + url = "${update-gaudi}"; + name = "gaudi-update-${release.name}.zip"; - hash = gaudiHash; - }; + hash = gaudiHash; + }; - moduleFromDeb = name: args@{ stdenv, dpkg, unzip, srcPath, ... }: + moduleFromDeb = name: args @ { + stdenv, + dpkg, + unzip, + srcPath, + ... + }: stdenv.mkDerivation ({ - pname = "${name}-unwrapped"; - version = release.name; - - inherit src; - - nativeBuildInputs = [ dpkg unzip ] ++ (args.nativeBuildInputs or [ ]); - - postUnpack = '' - dpkg -x ${lib.escapeShellArg "${release.basename}/${srcPath}"} ${lib.escapeShellArg release.basename} - ''; - } // lib.removeAttrs args [ "stdenv" "dpkg" "unzip" "srcPath" "nativeBuildInputs" ]); -in -{ - ase-idprotect = - { autoPatchelfHook - , dpkg - , fontconfig - , freetype - , pcsclite - , stdenv - , unzip - , xorg - , zlib - , ... - }: + pname = "${name}-unwrapped"; + version = release.name; + + inherit src; + + nativeBuildInputs = [dpkg unzip] ++ (args.nativeBuildInputs or []); + + postUnpack = '' + dpkg -x ${lib.escapeShellArg "${release.basename}/${srcPath}"} ${lib.escapeShellArg release.basename} + ''; + } + // lib.removeAttrs args ["stdenv" "dpkg" "unzip" "srcPath" "nativeBuildInputs"]); +in { + ase-idprotect = { + autoPatchelfHook, + dpkg, + fontconfig, + freetype, + pcsclite, + stdenv, + unzip, + xorg, + zlib, + ... + }: moduleFromDeb "ase-idprotect" { inherit dpkg stdenv unzip; srcPath = srcPaths.idprotect; @@ -67,7 +73,7 @@ in autoPatchelfHook ]; - outputs = [ "out" "lib" ]; + outputs = ["out" "lib"]; installPhase = '' runHook preInstall @@ -85,28 +91,26 @@ in ''; }; - gaudi = - { autoPatchelfHook - , dpkg - , makeWrapper - , openjdk - , pkgs - , stdenv - , unzip - , writeShellScriptBin - - , update-gaudi - , ... - }: - let - jdk = openjdk.override { - enableJavaFX = true; - openjfx_jdk = pkgs."openjfx${lib.head (lib.splitString "." openjdk.version)}".override { withWebKit = true; }; - }; - - fakeSudo = writeShellScriptBin "sudo" ""; - gaudiUpdate = gaudiUpdateSrc { inherit update-gaudi; }; - in + gaudi = { + autoPatchelfHook, + dpkg, + makeWrapper, + openjdk, + pkgs, + stdenv, + unzip, + writeShellScriptBin, + update-gaudi, + ... + }: let + jdk = openjdk.override { + enableJavaFX = true; + openjfx_jdk = pkgs."openjfx${lib.head (lib.splitString "." openjdk.version)}".override {withWebKit = true;}; + }; + + fakeSudo = writeShellScriptBin "sudo" ""; + gaudiUpdate = gaudiUpdateSrc {inherit update-gaudi;}; + in moduleFromDeb "gaudi" { inherit dpkg stdenv unzip; srcPath = srcPaths.gaudi; @@ -159,12 +163,12 @@ in ''; }; - bccr-cacerts = - { openssl - , stdenv - , unzip - , ... - }: + bccr-cacerts = { + openssl, + stdenv, + unzip, + ... + }: stdenv.mkDerivation { pname = "bccr-cacerts"; version = release.name; @@ -182,14 +186,13 @@ in ''; }; - update-gaudi = - { wget - , writeShellScript - , zip - - , bccr-cacerts - , ... - }: + update-gaudi = { + wget, + writeShellScript, + zip, + bccr-cacerts, + ... + }: writeShellScript "update-gaudi" '' set -o errexit set -o pipefail @@ -199,7 +202,7 @@ in trap 'cd / && rm -rf -- "$temp_dir"' EXIT cd "$temp_dir" - PATH="${lib.makeBinPath [ wget zip ]}:$PATH" + PATH="${lib.makeBinPath [wget zip]}:$PATH" ca_cert="${bccr-cacerts}/root-ca.pem" base_url="https://www.firmadigital.go.cr/Bccr.Firma.Fva.Actualizador.ClienteFirmadorJava//recursosLiberica17/actualizador" diff --git a/pkgs/btclone/btclone.nix b/pkgs/btclone/btclone.nix index 6b8e809..68673a7 100755 --- a/pkgs/btclone/btclone.nix +++ b/pkgs/btclone/btclone.nix @@ -1,13 +1,13 @@ '' usage() { echo "Usage: $0 <subvolume> <target> [<up-to>]" >&2; exit 1; } - + [[ $# -ge 2 && $# -le 3 && ( $# -ne 3 || $(("$3" + 0)) = "$3" ) ]] || usage [[ $UID -eq 0 ]] || { echo "$0: requires root privileges" >&2; exit 1; } - + SOURCE="$1" TARGET="$2" [ $# -ge 3 ] && UP_TO="$3" || UP_TO= - + get_snapshots() { FILTER="\$1 > 0" [[ -n "$UP_TO" ]] && FILTER="\$1 > 0 && \$1 <= $UP_TO" @@ -15,7 +15,7 @@ find "$1" -follow -maxdepth 1 -printf '%f\n' \ | sed 's@/$@@g' | awk "$FILTER { print }" | sort -n } - + clone() { if [[ -n "$2" ]]; then echo "Cloning $1 (incremental from $2)..." >&2 @@ -24,44 +24,44 @@ echo "Cloning $1 (non-incremental)..." >&2 PARENT_ARG="--" fi - + FROM="$SOURCE/$1" INTO="$TARGET/$1" - + [[ -d "$INTO" ]] || mkdir "$INTO" btrfs send "$PARENT_ARG" "$FROM/snapshot" | pv | btrfs receive "$INTO" cp -a "$FROM/info.xml" "$INTO/" } - + cleanup() { echo "Removing $1..." >&2 - + AT="$TARGET/$1" [[ -d "$AT/snapshot" ]] && btrfs subvolume delete "$AT/snapshot" rm -f "$AT/info.xml" rmdir "$AT" } - + while true; do ls -- "$SOURCE/" "$TARGET/" >/dev/null mapfile -t SNAPSHOTS < <(get_snapshots "$SOURCE") [[ ''${#SNAPSHOTS} -eq 0 ]] && { echo "$0: nothing to do" >&2; exit; } mapfile -t EXISTENT < <(get_snapshots "$TARGET") - + RESET=0 PARENT= ALL_ARE_BAD=0 for SNAPSHOT in "''${SNAPSHOTS[@]}"; do if [[ ! -e "$SOURCE/$SNAPSHOT" ]]; then echo "Notice: resetting listings due to time lapse" >&2 - + RESET=1 break elif [[ ! -s "$SOURCE/$SNAPSHOT/info.xml" ]]; then echo "Warning: skipping source $SNAPSHOT due to invalid info.xml" >&2 continue fi - + CLONE=0 if [[ ! -e "$TARGET/$SNAPSHOT" ]]; then CLONE=1 @@ -69,25 +69,25 @@ echo -n "Warning: bad copy $SNAPSHOT (" >&2 [[ $ALL_ARE_BAD -eq 1 ]] && echo -n "bad chain" >&2 || echo -n "incomplete" >&2 echo "), recreating..." >&2 - + cleanup "$SNAPSHOT" - + CLONE=1 ALL_ARE_BAD=1 fi - + if [[ $CLONE -eq 1 ]]; then clone "$SNAPSHOT" "$PARENT" elif [[ -z "$PARENT" ]]; then echo "Initial snapshot present, all copies will be incremental" >&2 fi - + chmod 750 "$TARGET/$SNAPSHOT" PARENT="$SNAPSHOT" done - + [[ $RESET -eq 1 ]] && continue - + echo "Copies updated, cleaning up..." >&2 for SNAPSHOT in "''${EXISTENT[@]}"; do FOUND="" @@ -100,9 +100,9 @@ [ -n "$FOUND" ] || cleanup "$SNAPSHOT" done - + break done - + echo "Done" >&2 '' diff --git a/pkgs/btclone/default.nix b/pkgs/btclone/default.nix index bb207ef..2484f33 100644 --- a/pkgs/btclone/default.nix +++ b/pkgs/btclone/default.nix @@ -1,6 +1,11 @@ -{ btrfs-progs, pv, writeShellApplication, ... }: +{ + btrfs-progs, + pv, + writeShellApplication, + ... +}: writeShellApplication { name = "btclone"; - runtimeInputs = [ btrfs-progs pv ]; + runtimeInputs = [btrfs-progs pv]; text = import ./btclone.nix; } diff --git a/pkgs/cocotb/default.nix b/pkgs/cocotb/default.nix index 1fe3d98..12aebf4 100644 --- a/pkgs/cocotb/default.nix +++ b/pkgs/cocotb/default.nix @@ -1,4 +1,8 @@ -{ cocotb, fetchFromGitHub, find-libpython }: +{ + cocotb, + fetchFromGitHub, + find-libpython, +}: cocotb.overridePythonAttrs (prev: { version = "master-2023-03-16"; @@ -10,6 +14,6 @@ cocotb.overridePythonAttrs (prev: { sha256 = "sha256-7IlEaGSnd47tTxRu8QGW9mExCCZe47S41tlQatACLxU="; }; - propagatedBuildInputs = [ find-libpython ]; + propagatedBuildInputs = [find-libpython]; doCheck = false; }) diff --git a/pkgs/cocotb/exts/wishbone.nix b/pkgs/cocotb/exts/wishbone.nix index 5dd375b..44baa12 100644 --- a/pkgs/cocotb/exts/wishbone.nix +++ b/pkgs/cocotb/exts/wishbone.nix @@ -1,4 +1,11 @@ -{ buildPythonPackage, cocotb, cocotb-bus, fetchFromGitHub, git, setuptools-scm }: +{ + buildPythonPackage, + cocotb, + cocotb-bus, + fetchFromGitHub, + git, + setuptools-scm, +}: buildPythonPackage { pname = "cocotbext-wishbone"; version = "master-2022-04-26"; @@ -13,6 +20,6 @@ buildPythonPackage { leaveDotGit = true; }; - nativeBuildInputs = [ git setuptools-scm ]; - propagatedBuildInputs = [ cocotb cocotb-bus setuptools-scm ]; + nativeBuildInputs = [git setuptools-scm]; + propagatedBuildInputs = [cocotb cocotb-bus setuptools-scm]; } diff --git a/pkgs/config/default.nix b/pkgs/config/default.nix index 03972e8..9fc9c79 100644 --- a/pkgs/config/default.nix +++ b/pkgs/config/default.nix @@ -1,4 +1,4 @@ -{ lib }: { +{lib}: { android_sdk.accept_license = true; allowUnfreePredicate = pkg: import ./unfree.nix lib (lib.getName pkg); } diff --git a/pkgs/default.nix b/pkgs/default.nix index 82927a4..93d34b8 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,31 +1,30 @@ final: prev: with prev.lib; let inherit (final) callPackage fetchpatch; -in -{ - lib = callPackage ./lib { }; +in { + lib = callPackage ./lib {}; - athena-bccr = callPackage ./athena-bccr { }; - btclone = callPackage ./btclone { }; - gem5 = callPackage ./gem5.nix { gem5ISA = "x86"; }; - git-aliases = callPackage ./git-aliases.nix { }; - increment-zone-serials = callPackage ./increment-zone-serials { }; - kbuild-standalone = callPackage ./kbuild-standalone.nix { }; - mssql-tools = callPackage ./mssql-tools.nix { }; - oregano = callPackage ./oregano { }; - pass-bcr = callPackage ./pass-bcr { }; - pass-tail = callPackage ./pass-tail { }; - rqlite = callPackage ./rqlite.nix { }; - rv8 = callPackage ./rv8.nix { }; - scripts = callPackage ./scripts { }; - simple-scalar = callPackage ./simple-scalar { }; - spliit = callPackage ./spliit { }; - tmux-lift = callPackage ./tmux-lift { }; - tmux-open = callPackage ./tmux-open { }; - tmux-pass = callPackage ./tmux-pass.nix { }; + athena-bccr = callPackage ./athena-bccr {}; + btclone = callPackage ./btclone {}; + gem5 = callPackage ./gem5.nix {gem5ISA = "x86";}; + git-aliases = callPackage ./git-aliases.nix {}; + increment-zone-serials = callPackage ./increment-zone-serials {}; + kbuild-standalone = callPackage ./kbuild-standalone.nix {}; + mssql-tools = callPackage ./mssql-tools.nix {}; + oregano = callPackage ./oregano {}; + pass-bcr = callPackage ./pass-bcr {}; + pass-tail = callPackage ./pass-tail {}; + rqlite = callPackage ./rqlite.nix {}; + rv8 = callPackage ./rv8.nix {}; + scripts = callPackage ./scripts {}; + simple-scalar = callPackage ./simple-scalar {}; + spliit = callPackage ./spliit {}; + tmux-lift = callPackage ./tmux-lift {}; + tmux-open = callPackage ./tmux-open {}; + tmux-pass = callPackage ./tmux-pass.nix {}; st = prev.st.override { - conf = import ./st.nix { }; + conf = import ./st.nix {}; patches = [ (fetchpatch { @@ -35,55 +34,58 @@ in ]; }; - override = { - home-assistant-custom-components = prev.home-assistant-custom-components // { - dreame_vacuum = final.home-assistant.python.pkgs.callPackage ./dreame-vacuum.nix { }; - smartthinq_sensors = final.home-assistant.python.pkgs.callPackage ./smartthinq-sensors.nix { }; - }; + override = + { + home-assistant-custom-components = + prev.home-assistant-custom-components + // { + dreame_vacuum = final.home-assistant.python.pkgs.callPackage ./dreame-vacuum.nix {}; + smartthinq_sensors = final.home-assistant.python.pkgs.callPackage ./smartthinq-sensors.nix {}; + }; - home-assistant-custom-lovelace-modules = prev.home-assistant-custom-lovelace-modules // { - xiaomi-vacuum-map-card = final.callPackage ./lovelace-xiaomi-vacuum-map-card { }; - }; + home-assistant-custom-lovelace-modules = + prev.home-assistant-custom-lovelace-modules + // { + xiaomi-vacuum-map-card = final.callPackage ./lovelace-xiaomi-vacuum-map-card {}; + }; - # Tomado de all-packages.nix - msmtp = callPackage ./msmtp { - inherit (final.darwin.apple_sdk.frameworks) Security; - autoreconfHook = final.buildPackages.autoreconfHook269; - }; + # Tomado de all-packages.nix + msmtp = callPackage ./msmtp { + inherit (final.darwin.apple_sdk.frameworks) Security; + autoreconfHook = final.buildPackages.autoreconfHook269; + }; - postfix = callPackage ./postfix { inherit (prev) postfix; }; - xandikos = final.python3Packages.callPackage ./xandikos { inherit (prev) xandikos; }; - } // ( - let - makePyOverrides = version: - let + postfix = callPackage ./postfix {inherit (prev) postfix;}; + xandikos = final.python3Packages.callPackage ./xandikos {inherit (prev) xandikos;}; + } + // ( + let + makePyOverrides = version: let name = "python3${toString version}"; - in - { + in { inherit name; value = prev.${name}.override { packageOverrides = nextPy: prevPy: { - cocotb = nextPy.callPackage ./cocotb { inherit (prevPy) cocotb; }; - cocotbext-wishbone = nextPy.callPackage ./cocotb/exts/wishbone.nix { }; - find-libpython = nextPy.callPackage ./find-libpython.nix { }; - hdl-convertor = nextPy.callPackage ./hdl-convertor { }; - hdl-convertor-ast = nextPy.callPackage ./hdl-convertor/ast.nix { }; - iced-x86 = nextPy.callPackage ./iced-x86 { }; + cocotb = nextPy.callPackage ./cocotb {inherit (prevPy) cocotb;}; + cocotbext-wishbone = nextPy.callPackage ./cocotb/exts/wishbone.nix {}; + find-libpython = nextPy.callPackage ./find-libpython.nix {}; + hdl-convertor = nextPy.callPackage ./hdl-convertor {}; + hdl-convertor-ast = nextPy.callPackage ./hdl-convertor/ast.nix {}; + iced-x86 = nextPy.callPackage ./iced-x86 {}; }; }; }; - pyVersionRange' = start: end: - let + pyVersionRange' = start: end: let next = end + 1; in - if prev ? "python3${toString next}" - then pyVersionRange' start next - else range start end; + if prev ? "python3${toString next}" + then pyVersionRange' start next + else range start end; - pyVersionRange = start: pyVersionRange' start start; - in - listToAttrs (map makePyOverrides (pyVersionRange 9)) - ); + pyVersionRange = start: pyVersionRange' start start; + in + listToAttrs (map makePyOverrides (pyVersionRange 9)) + ); } diff --git a/pkgs/dreame-vacuum.nix b/pkgs/dreame-vacuum.nix index 1039405..1dd7255 100644 --- a/pkgs/dreame-vacuum.nix +++ b/pkgs/dreame-vacuum.nix @@ -1,40 +1,40 @@ -{ buildHomeAssistantComponent -, callPackage -, fetchFromGitHub -, numpy -, paho-mqtt -, pillow -, pybase64 -, pycryptodome -, python-miio -, requests -}: -let +{ + buildHomeAssistantComponent, + callPackage, + fetchFromGitHub, + numpy, + paho-mqtt, + pillow, + pybase64, + pycryptodome, + python-miio, + requests, +}: let version = "2.0.0b15"; in -buildHomeAssistantComponent { - owner = "tasshack"; - domain = "dreame_vacuum"; - inherit version; + buildHomeAssistantComponent { + owner = "tasshack"; + domain = "dreame_vacuum"; + inherit version; - src = fetchFromGitHub { - repo = "dreame-vacuum"; - owner = "Tasshack"; + src = fetchFromGitHub { + repo = "dreame-vacuum"; + owner = "Tasshack"; - rev = "v${version}"; - hash = "sha256-ydWirMQsO6DYU5UdygHRXCx8I3M7haYX9zPLela9H7E="; - }; + rev = "v${version}"; + hash = "sha256-ydWirMQsO6DYU5UdygHRXCx8I3M7haYX9zPLela9H7E="; + }; - dontBuild = true; + dontBuild = true; - propagatedBuildInputs = [ - numpy - paho-mqtt - pillow - pybase64 - pycryptodome - python-miio - requests - (callPackage ./py-mini-racer.nix { }) - ]; -} + propagatedBuildInputs = [ + numpy + paho-mqtt + pillow + pybase64 + pycryptodome + python-miio + requests + (callPackage ./py-mini-racer.nix {}) + ]; + } diff --git a/pkgs/find-libpython.nix b/pkgs/find-libpython.nix index 80da67f..cc351c3 100644 --- a/pkgs/find-libpython.nix +++ b/pkgs/find-libpython.nix @@ -1,13 +1,15 @@ -{ buildPythonPackage, fetchPypi }: -let +{ + buildPythonPackage, + fetchPypi, +}: let pname = "find_libpython"; version = "0.3.0"; in -buildPythonPackage { - inherit pname version; - - src = fetchPypi { + buildPythonPackage { inherit pname version; - sha256 = "sha256-bn/l2a9/rW3AZstVFaDpyQpx8f6yuy+OTNu0+DJ26eU="; - }; -} + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-bn/l2a9/rW3AZstVFaDpyQpx8f6yuy+OTNu0+DJ26eU="; + }; + } diff --git a/pkgs/force-riscv/default.nix b/pkgs/force-riscv/default.nix index 35907ce..097fb8d 100644 --- a/pkgs/force-riscv/default.nix +++ b/pkgs/force-riscv/default.nix @@ -1,40 +1,46 @@ -{ fetchFromGitHub, lib, makeWrapper, python3, stdenv }: -with lib; stdenv.mkDerivation { - pname = "force-riscv"; - version = "master-2023-01-31"; +{ + fetchFromGitHub, + lib, + makeWrapper, + python3, + stdenv, +}: +with lib; + stdenv.mkDerivation { + pname = "force-riscv"; + version = "master-2023-01-31"; - src = fetchFromGitHub { - repo = "force-riscv"; - owner = "openhwgroup"; + src = fetchFromGitHub { + repo = "force-riscv"; + owner = "openhwgroup"; - rev = "192bcc15e0dde8aaf25621da4317569b3f374047"; - sha256 = "sha256-Eol973IMGRVAuw/rsYiK61+KVYkmbqq9yudaNbMCzJ0="; - }; + rev = "192bcc15e0dde8aaf25621da4317569b3f374047"; + sha256 = "sha256-Eol973IMGRVAuw/rsYiK61+KVYkmbqq9yudaNbMCzJ0="; + }; - buildInputs = [ python3 ]; - nativeBuildInputs = [ makeWrapper ]; + buildInputs = [python3]; + nativeBuildInputs = [makeWrapper]; - patches = [ - ./remove-pyeval-initthreads.patch - ./wno-error-range-loop-construct.patch - ./imageio-include-string.patch - ./testio-include-string.patch - ./urbg-static-constexpr-min-max.patch - ]; + patches = [ + ./remove-pyeval-initthreads.patch + ./wno-error-range-loop-construct.patch + ./imageio-include-string.patch + ./testio-include-string.patch + ./urbg-static-constexpr-min-max.patch + ]; - postPatch = '' - patchShebangs utils/ fpix/utils/ - ''; + postPatch = '' + patchShebangs utils/ fpix/utils/ + ''; - makeFlags = [ - "FORCE_CC=${stdenv.cc.targetPrefix}c++" - "FORCE_PYTHON_LIB=${python3}/lib" - "FORCE_PYTHON_INC=${python3}/include/${python3.libPrefix}" - ]; + makeFlags = [ + "FORCE_CC=${stdenv.cc.targetPrefix}c++" + "FORCE_PYTHON_LIB=${python3}/lib" + "FORCE_PYTHON_INC=${python3}/include/${python3.libPrefix}" + ]; - # Ver setenv.bash - installPhase = - let + # Ver setenv.bash + installPhase = let paths = [ "3rd_party/py" "utils" @@ -45,8 +51,7 @@ with lib; stdenv.mkDerivation { ]; pythonPath = concatStringsSep ":" (map (p: "$out/${p}") paths); - in - '' + in '' mkdir -p $out/ $out/fpix/ $out/riscv/ $out/3rd_party/ # SimApiHANDCAR.so queda en bin (?), al parecer es así @@ -64,4 +69,4 @@ with lib; stdenv.mkDerivation { cp -r config/ utils/ $out/ cp -r riscv/arch_data/ $out/riscv/ ''; -} + } diff --git a/pkgs/gem5.nix b/pkgs/gem5.nix index 3174553..9795c0e 100644 --- a/pkgs/gem5.nix +++ b/pkgs/gem5.nix @@ -1,65 +1,66 @@ -{ boost -, lib -, fetchFromGitHub -, gnum4 -, gperftools -, hdf5-cpp -, libpng -, protobuf -, python3 -, scons -, stdenv -, zlib -, enableHdf5 ? true -, enableLibpng ? true -, enableTrace ? true -, enableSystemC ? true -, enableTcmalloc ? true -, gem5ISA -}: -let +{ + boost, + lib, + fetchFromGitHub, + gnum4, + gperftools, + hdf5-cpp, + libpng, + protobuf, + python3, + scons, + stdenv, + zlib, + enableHdf5 ? true, + enableLibpng ? true, + enableTrace ? true, + enableSystemC ? true, + enableTcmalloc ? true, + gem5ISA, +}: let version = "22.1.0.0"; - isa = assert lib.assertMsg (lib.elem gem5ISA [ "arm" "null" "mips" "power" "x86" ]) - "${gem5ISA} is not a valid gem5 target ISA"; + isa = assert lib.assertMsg (lib.elem gem5ISA ["arm" "null" "mips" "power" "x86"]) + "${gem5ISA} is not a valid gem5 target ISA"; lib.toUpper gem5ISA; target = "build/${isa}/gem5.opt"; in -stdenv.mkDerivation { - pname = "gem5"; - version = "${gem5ISA}-${version}"; + stdenv.mkDerivation { + pname = "gem5"; + version = "${gem5ISA}-${version}"; - src = fetchFromGitHub { - repo = "gem5"; - owner = "gem5"; + src = fetchFromGitHub { + repo = "gem5"; + owner = "gem5"; - rev = "v${version}"; - sha256 = "sha256-Yxag8emR6hf7oX4GAtQi/YYcKrpXicUoQg5+rjKyjc0="; - }; + rev = "v${version}"; + sha256 = "sha256-Yxag8emR6hf7oX4GAtQi/YYcKrpXicUoQg5+rjKyjc0="; + }; - buildInputs = [ zlib ] - ++ lib.optional enableHdf5 hdf5-cpp - ++ lib.optional enableLibpng libpng - ++ lib.optional enableTrace boost - ++ lib.optional enableSystemC protobuf - ++ lib.optional enableTcmalloc gperftools; + buildInputs = + [zlib] + ++ lib.optional enableHdf5 hdf5-cpp + ++ lib.optional enableLibpng libpng + ++ lib.optional enableTrace boost + ++ lib.optional enableSystemC protobuf + ++ lib.optional enableTcmalloc gperftools; - nativeBuildInputs = [ gnum4 scons ]; + nativeBuildInputs = [gnum4 scons]; - sconsFlags = [ target ]; + sconsFlags = [target]; - enableParallelBuilding = true; + enableParallelBuilding = true; - # Without this we get "ValueError: invalid width 0 (must be > 0)" - COLUMNS = 80; + # Without this we get "ValueError: invalid width 0 (must be > 0)" + COLUMNS = 80; - postPatch = '' - patchShebangs util/ - ''; + postPatch = '' + patchShebangs util/ + ''; - installPhase = '' - mkdir -p $out/bin/ - cp ${target} $out/bin/ - ''; -} + installPhase = '' + mkdir -p $out/bin/ + cp ${target} $out/bin/ + ''; + } diff --git a/pkgs/git-aliases.nix b/pkgs/git-aliases.nix index aa72ab1..0b88f12 100644 --- a/pkgs/git-aliases.nix +++ b/pkgs/git-aliases.nix @@ -1,4 +1,4 @@ -{ writeText, ... }: +{writeText, ...}: writeText "git-aliases.zsh" '' alias g='git' alias ga='git add' diff --git a/pkgs/hdl-convertor/ast.nix b/pkgs/hdl-convertor/ast.nix index 52bd656..d6f833b 100644 --- a/pkgs/hdl-convertor/ast.nix +++ b/pkgs/hdl-convertor/ast.nix @@ -1,4 +1,8 @@ -{ lib, buildPythonPackage, fetchFromGitHub }: +{ + lib, + buildPythonPackage, + fetchFromGitHub, +}: buildPythonPackage { pname = "hdl-convertor-ast"; version = "master-2022-07-25"; diff --git a/pkgs/hdl-convertor/default.nix b/pkgs/hdl-convertor/default.nix index 08e16d6..12581aa 100644 --- a/pkgs/hdl-convertor/default.nix +++ b/pkgs/hdl-convertor/default.nix @@ -1,12 +1,13 @@ -{ antlr -, buildPythonPackage -, cmake -, cython -, fetchFromGitHub -, hdl-convertor-ast -, jre -, python3 -, scikit-build +{ + antlr, + buildPythonPackage, + cmake, + cython, + fetchFromGitHub, + hdl-convertor-ast, + jre, + python3, + scikit-build, }: buildPythonPackage { pname = "hdl-convertor"; @@ -20,9 +21,9 @@ buildPythonPackage { sha256 = "sha256-Ketz5r7Z8kjshr7mjfdqF+QAOHGM/iTDpT6TMbYl6QU="; }; - nativeBuildInputs = [ antlr cmake jre cython ]; - propagatedBuildInputs = [ antlr.runtime.cpp hdl-convertor-ast ]; - propagatedNativeBuildInputs = [ scikit-build ]; + nativeBuildInputs = [antlr cmake jre cython]; + propagatedBuildInputs = [antlr.runtime.cpp hdl-convertor-ast]; + propagatedNativeBuildInputs = [scikit-build]; postPatch = '' sed -i 's/antlr4\(-complete\)/${antlr.name}\1/g' src/CMake_antlr4.txt diff --git a/pkgs/iced-x86/default.nix b/pkgs/iced-x86/default.nix index 6f7652d..ac1ad06 100644 --- a/pkgs/iced-x86/default.nix +++ b/pkgs/iced-x86/default.nix @@ -1,5 +1,12 @@ -{ buildPythonPackage, cargo, lib, fetchPypi, setuptools-rust, rustc, rustPlatform }: -let +{ + buildPythonPackage, + cargo, + lib, + fetchPypi, + setuptools-rust, + rustc, + rustPlatform, +}: let pname = "iced-x86"; version = "1.19.0"; @@ -8,22 +15,22 @@ let sha256 = "sha256-YljWeJNOk7eF1iPymarxNLj3rLnXJGC/Qsajb9YWXnE="; }; in -buildPythonPackage { - inherit pname src version; + buildPythonPackage { + inherit pname src version; - nativeBuildInputs = [ - cargo - rustc - rustPlatform.cargoSetupHook - setuptools-rust - ]; + nativeBuildInputs = [ + cargo + rustc + rustPlatform.cargoSetupHook + setuptools-rust + ]; - # Esta gente no le puso Cargo.lock - cargoDeps = rustPlatform.importCargoLock { - lockFile = ./Cargo.lock; - }; + # Esta gente no le puso Cargo.lock + cargoDeps = rustPlatform.importCargoLock { + lockFile = ./Cargo.lock; + }; - patches = [ - ./0001-add-Cargo.lock.patch - ]; -} + patches = [ + ./0001-add-Cargo.lock.patch + ]; + } diff --git a/pkgs/increment-zone-serials/default.nix b/pkgs/increment-zone-serials/default.nix index b5b6cd6..f2d6f02 100644 --- a/pkgs/increment-zone-serials/default.nix +++ b/pkgs/increment-zone-serials/default.nix @@ -1,12 +1,13 @@ -{ python3 -, stdenv +{ + python3, + stdenv, }: stdenv.mkDerivation { pname = "increment-zone-serials"; version = "1.0.0"; propagatedBuildInputs = [ - (python3.withPackages (py: [ ])) + (python3.withPackages (py: [])) ]; dontUnpack = true; diff --git a/pkgs/kbuild-standalone.nix b/pkgs/kbuild-standalone.nix index 9f82883..2296b50 100644 --- a/pkgs/kbuild-standalone.nix +++ b/pkgs/kbuild-standalone.nix @@ -1,26 +1,36 @@ -{ autoreconfHook, bison, fetchFromGitHub, flex, ncurses, lib, pkg-config, stdenv }: -with lib; stdenv.mkDerivation { - pname = "kbuild-standalone"; - version = "6.0"; +{ + autoreconfHook, + bison, + fetchFromGitHub, + flex, + ncurses, + lib, + pkg-config, + stdenv, +}: +with lib; + stdenv.mkDerivation { + pname = "kbuild-standalone"; + version = "6.0"; - src = fetchFromGitHub { - repo = "kbuild-standalone"; - owner = "WangNan0"; + src = fetchFromGitHub { + repo = "kbuild-standalone"; + owner = "WangNan0"; - rev = "5e8d3496b69162684d682bda8a165cecdb66bfec"; - sha256 = "sha256-OugvJToOiczFM6G6GkcoN8GdjOd3wLhPhh7huBGA8io="; - }; + rev = "5e8d3496b69162684d682bda8a165cecdb66bfec"; + sha256 = "sha256-OugvJToOiczFM6G6GkcoN8GdjOd3wLhPhh7huBGA8io="; + }; - buildInputs = [ ncurses ]; - nativeBuildInputs = [ autoreconfHook bison flex pkg-config ]; + buildInputs = [ncurses]; + nativeBuildInputs = [autoreconfHook bison flex pkg-config]; - preBuild = '' - mkdir -p $out/lib/pkgconfig $out/share + preBuild = '' + mkdir -p $out/lib/pkgconfig $out/share - patchShebangs kbuild/_fixdep - cp kbuild-standalone.pc $out/lib/pkgconfig/ - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$out/lib/pkgconfig" + patchShebangs kbuild/_fixdep + cp kbuild-standalone.pc $out/lib/pkgconfig/ + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$out/lib/pkgconfig" - cp -r kbuild/ $out/share/kbuild-standalone/ - ''; -} + cp -r kbuild/ $out/share/kbuild-standalone/ + ''; + } diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index a273758..e3ab56e 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -1,4 +1,3 @@ -{ callPackage }: -{ - importAll = callPackage ./importAll.nix { }; +{callPackage}: { + importAll = callPackage ./importAll.nix {}; } diff --git a/pkgs/lib/importAll.nix b/pkgs/lib/importAll.nix index 30a1dd9..6acabe9 100644 --- a/pkgs/lib/importAll.nix +++ b/pkgs/lib/importAll.nix @@ -1,17 +1,20 @@ -{ lib }: -{ root, exclude ? [ ] }: -with builtins; with lib; - +{lib}: { + root, + exclude ? [], +}: +with builtins; +with lib; # http://chriswarbo.net/projects/nixos/useful_hacks.html -let - basename = removeSuffix ".nix"; + let + basename = removeSuffix ".nix"; - isMatch = name: type: (hasSuffix ".nix" name || type == "directory") - && ! elem name (map basename exclude); + isMatch = name: type: + (hasSuffix ".nix" name || type == "directory") + && ! elem name (map basename exclude); - entry = name: _: { - name = basename name; - value = import (root + "/${name}"); - }; -in -mapAttrs' entry (filterAttrs isMatch (readDir root)) + entry = name: _: { + name = basename name; + value = import (root + "/${name}"); + }; + in + mapAttrs' entry (filterAttrs isMatch (readDir root)) diff --git a/pkgs/lovelace-xiaomi-vacuum-map-card/default.nix b/pkgs/lovelace-xiaomi-vacuum-map-card/default.nix index 2fa048d..4b837de 100644 --- a/pkgs/lovelace-xiaomi-vacuum-map-card/default.nix +++ b/pkgs/lovelace-xiaomi-vacuum-map-card/default.nix @@ -1,39 +1,39 @@ -{ buildNpmPackage -, fetchFromGitHub -}: -let +{ + buildNpmPackage, + fetchFromGitHub, +}: let pname = "lovelace-xiaomi-vacuum-map-card"; version = "2.2.4"; in -buildNpmPackage rec { - inherit pname version; + buildNpmPackage rec { + inherit pname version; - src = fetchFromGitHub { - repo = pname; - owner = "PiotrMachowski"; + src = fetchFromGitHub { + repo = pname; + owner = "PiotrMachowski"; - rev = "v${version}"; - hash = "sha256-ameZzwhs1XRB31w2993MiP03hAUvf4aLM1syDmPZF60="; - }; + rev = "v${version}"; + hash = "sha256-ameZzwhs1XRB31w2993MiP03hAUvf4aLM1syDmPZF60="; + }; - npmDepsHash = "sha256-H72nYi+9zEC2daSbchfKcNECofw0eaLBTvLCsVAk9Hc="; + npmDepsHash = "sha256-H72nYi+9zEC2daSbchfKcNECofw0eaLBTvLCsVAk9Hc="; - patches = [ - ./0001-Fix-error-during-rollup-c.patch - ]; + patches = [ + ./0001-Fix-error-during-rollup-c.patch + ]; - postPatch = '' - cp -v ${./package-lock.json} package-lock.json - ''; + postPatch = '' + cp -v ${./package-lock.json} package-lock.json + ''; - installPhase = '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir $out - cp dist/xiaomi-vacuum-map-card.js $out + mkdir $out + cp dist/xiaomi-vacuum-map-card.js $out - runHook postInstall - ''; + runHook postInstall + ''; - passthru.entrypoint = "xiaomi-vacuum-map-card.js"; -} + passthru.entrypoint = "xiaomi-vacuum-map-card.js"; + } diff --git a/pkgs/msmtp/default.nix b/pkgs/msmtp/default.nix index 18036f5..23559c5 100644 --- a/pkgs/msmtp/default.nix +++ b/pkgs/msmtp/default.nix @@ -1,28 +1,27 @@ -{ resholve -, stdenv -, symlinkJoin -, lib -, fetchFromGitHub -, autoreconfHook -, pkg-config -, bash -, coreutils -, gnugrep -, gnutls -, gsasl -, libidn2 -, netcat-gnu -, texinfo -, which -, Security -, withKeyring ? true -, libsecret -, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd -, systemd -, withScripts ? true -}: - -let +{ + resholve, + stdenv, + symlinkJoin, + lib, + fetchFromGitHub, + autoreconfHook, + pkg-config, + bash, + coreutils, + gnugrep, + gnutls, + gsasl, + libidn2, + netcat-gnu, + texinfo, + which, + Security, + withKeyring ? true, + libsecret, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, + systemd, + withScripts ? true, +}: let inherit (lib) getBin getExe optionals; version = "1.8.22"; @@ -38,7 +37,7 @@ let description = "Simple and easy to use SMTP client with excellent sendmail compatibility"; homepage = "https://marlam.de/msmtp/"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ peterhoeg ]; + maintainers = with maintainers; [peterhoeg]; platforms = platforms.unix; mainProgram = "msmtp"; }; @@ -51,14 +50,16 @@ let ./0001-msmtp-run-passwordeval-if-tls_key_file-is-provided-e.patch ]; - configureFlags = [ "--sysconfdir=/etc" "--with-libgsasl" ] - ++ optionals stdenv.isDarwin [ "--with-macosx-keyring" ]; + configureFlags = + ["--sysconfdir=/etc" "--with-libgsasl"] + ++ optionals stdenv.isDarwin ["--with-macosx-keyring"]; - buildInputs = [ gnutls gsasl libidn2 ] - ++ optionals stdenv.isDarwin [ Security ] - ++ optionals withKeyring [ libsecret ]; + buildInputs = + [gnutls gsasl libidn2] + ++ optionals stdenv.isDarwin [Security] + ++ optionals withKeyring [libsecret]; - nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]; + nativeBuildInputs = [autoreconfHook pkg-config texinfo]; enableParallelBuilding = true; @@ -72,11 +73,15 @@ let pname = "msmtp-scripts"; inherit version src meta; - patches = [ ./paths.patch ]; + patches = [./paths.patch]; postPatch = '' substituteInPlace scripts/msmtpq/msmtpq \ - --replace @journal@ ${if withSystemd then "Y" else "N"} + --replace @journal@ ${ + if withSystemd + then "Y" + else "N" + } ''; dontConfigure = true; @@ -100,41 +105,47 @@ let solutions = { msmtpq = { - scripts = [ "bin/msmtpq" ]; + scripts = ["bin/msmtpq"]; interpreter = getExe bash; - inputs = [ - binaries - coreutils - gnugrep - netcat-gnu - which - ] ++ optionals withSystemd [ systemd ]; - execer = [ - "cannot:${getBin binaries}/bin/msmtp" - "cannot:${getBin netcat-gnu}/bin/nc" - ] ++ optionals withSystemd [ - "cannot:${getBin systemd}/bin/systemd-cat" - ]; - fix."$MSMTP" = [ "msmtp" ]; - fake.external = [ "ping" ] - ++ optionals (!withSystemd) [ "systemd-cat" ]; + inputs = + [ + binaries + coreutils + gnugrep + netcat-gnu + which + ] + ++ optionals withSystemd [systemd]; + execer = + [ + "cannot:${getBin binaries}/bin/msmtp" + "cannot:${getBin netcat-gnu}/bin/nc" + ] + ++ optionals withSystemd [ + "cannot:${getBin systemd}/bin/systemd-cat" + ]; + fix."$MSMTP" = ["msmtp"]; + fake.external = + ["ping"] + ++ optionals (!withSystemd) ["systemd-cat"]; }; msmtp-queue = { - scripts = [ "bin/msmtp-queue" ]; + scripts = ["bin/msmtp-queue"]; interpreter = getExe bash; - inputs = [ "${placeholder "out"}/bin" ]; - execer = [ "cannot:${placeholder "out"}/bin/msmtpq" ]; + inputs = ["${placeholder "out"}/bin"]; + execer = ["cannot:${placeholder "out"}/bin/msmtpq"]; }; }; }; - in -if withScripts then - symlinkJoin - { - name = "msmtp-${version}"; - inherit version meta; - paths = [ binaries scripts ]; - passthru = { inherit binaries scripts; }; - } else binaries + if withScripts + then + symlinkJoin + { + name = "msmtp-${version}"; + inherit version meta; + paths = [binaries scripts]; + passthru = {inherit binaries scripts;}; + } + else binaries diff --git a/pkgs/mssql-tools.nix b/pkgs/mssql-tools.nix index 9213c16..ecf2b37 100644 --- a/pkgs/mssql-tools.nix +++ b/pkgs/mssql-tools.nix @@ -1,52 +1,55 @@ # Basado en derivación para skypeforlinux en nixpkgs # Ver environment.unixODBCDrivers - -{ lib, stdenv, fetchurl, dpkg, glibc, unixODBC }: -let +{ + lib, + stdenv, + fetchurl, + dpkg, + glibc, + unixODBC, +}: let version = "17.9.1.1-1"; ubuntuRelease = "21.10"; in -stdenv.mkDerivation { - pname = "mssql-tools"; - inherit version; + stdenv.mkDerivation { + pname = "mssql-tools"; + inherit version; - system = "x86_64-linux"; + system = "x86_64-linux"; - src = - if stdenv.hostPlatform.system == "x86_64-linux" then - fetchurl + src = + if stdenv.hostPlatform.system == "x86_64-linux" + then + fetchurl { url = "https://packages.microsoft.com/ubuntu/${ubuntuRelease}/prod/pool/main/m/mssql-tools/mssql-tools_${version}_amd64.deb"; sha256 = "0ya9643assr80yh6g0nd3i6iw819frhbb1m421khwplk9iq793kk"; } - else - throw "mssql-tools is not supported on ${stdenv.hostPlatform.system}"; + else throw "mssql-tools is not supported on ${stdenv.hostPlatform.system}"; - buildInputs = [ dpkg ]; - dontUnpack = true; - outputs = [ "out" "doc" ]; + buildInputs = [dpkg]; + dontUnpack = true; + outputs = ["out" "doc"]; - installPhase = '' - mkdir -p $out - dpkg -x $src $out - mv $out/opt/mssql-tools/{bin,share} $out - mv $out/usr/share/doc/mssql-tools $doc - rm -r $out/opt $out/usr - ''; + installPhase = '' + mkdir -p $out + dpkg -x $src $out + mv $out/opt/mssql-tools/{bin,share} $out + mv $out/usr/share/doc/mssql-tools $doc + rm -r $out/opt $out/usr + ''; - postFixup = - let - rpath = lib.makeLibraryPath [ glibc stdenv.cc.cc unixODBC ]; - in - '' + postFixup = let + rpath = lib.makeLibraryPath [glibc stdenv.cc.cc unixODBC]; + in '' for file in $(find $out/bin -type f); do patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" patchelf --set-rpath ${rpath} $file done ''; - meta = with lib; { - license = licenses.unfree; - platforms = [ "x86_64-linux" ]; - }; -} + meta = with lib; { + license = licenses.unfree; + platforms = ["x86_64-linux"]; + }; + } diff --git a/pkgs/oregano/default.nix b/pkgs/oregano/default.nix index 5e2e872..14108d5 100644 --- a/pkgs/oregano/default.nix +++ b/pkgs/oregano/default.nix @@ -1,69 +1,75 @@ -{ fetchFromGitHub -, glib -, goocanvas2 -, gnucap -, groff -, gtk3 -, gtksourceview -, intltool -, libxml2 -, lib -, makeWrapper -, ngspice -, perl -, pkg-config -, python3 -, stdenv -, wafHook -, wrapGAppsHook -, useNgspice ? false -}: -let +{ + fetchFromGitHub, + glib, + goocanvas2, + gnucap, + groff, + gtk3, + gtksourceview, + intltool, + libxml2, + lib, + makeWrapper, + ngspice, + perl, + pkg-config, + python3, + stdenv, + wafHook, + wrapGAppsHook, + useNgspice ? false, +}: let version = "0.84.43"; in -stdenv.mkDerivation { - pname = "oregano"; - inherit version; + stdenv.mkDerivation { + pname = "oregano"; + inherit version; - src = fetchFromGitHub { - owner = "drahnr"; - repo = "oregano"; - rev = "v${version}"; - hash = "sha256-1GsL0N3O0clqdgkXoPKMhvW+y4Rzg4QSeOA54nH4kz4="; - }; + src = fetchFromGitHub { + owner = "drahnr"; + repo = "oregano"; + rev = "v${version}"; + hash = "sha256-1GsL0N3O0clqdgkXoPKMhvW+y4Rzg4QSeOA54nH4kz4="; + }; - nativeBuildInputs = [ makeWrapper wafHook wrapGAppsHook ]; - patches = [ ./check-cfg-gio-unix.patch ]; + nativeBuildInputs = [makeWrapper wafHook wrapGAppsHook]; + patches = [./check-cfg-gio-unix.patch]; - buildInputs = [ - glib - goocanvas2 - groff - gtk3 - gtksourceview - intltool - libxml2 - perl - pkg-config - python3 - ]; + buildInputs = [ + glib + goocanvas2 + groff + gtk3 + gtksourceview + intltool + libxml2 + perl + pkg-config + python3 + ]; - postFixup = '' - wrapProgram $out/bin/oregano \ - --suffix PATH : ${lib.makeBinPath [ (if useNgspice then ngspice else gnucap) ]} - ''; - - meta = with lib; { - description = "Schematic capture and circuit simulator"; - longDescription = '' - Oregano is an application for schematic capture and simulation of - electronic circuits. The actual simulation is performed by Berkeley - Spice, GNUcap or the new generation ngspice. + postFixup = '' + wrapProgram $out/bin/oregano \ + --suffix PATH : ${lib.makeBinPath [ + ( + if useNgspice + then ngspice + else gnucap + ) + ]} ''; - homepage = "https://github.com/drahnr/oregano/"; - license = licenses.gpl2; - platforms = lib.platforms.linux; - maintainers = with maintainers; [ _3442 ]; - }; -} + meta = with lib; { + description = "Schematic capture and circuit simulator"; + longDescription = '' + Oregano is an application for schematic capture and simulation of + electronic circuits. The actual simulation is performed by Berkeley + Spice, GNUcap or the new generation ngspice. + ''; + + homepage = "https://github.com/drahnr/oregano/"; + license = licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with maintainers; [_3442]; + }; + } diff --git a/pkgs/pass-bcr/default.nix b/pkgs/pass-bcr/default.nix index 6db814c..72d08fb 100644 --- a/pkgs/pass-bcr/default.nix +++ b/pkgs/pass-bcr/default.nix @@ -1,4 +1,4 @@ -{ stdenv, ... }: +{stdenv, ...}: stdenv.mkDerivation { pname = "pass-bcr"; version = "1.0"; diff --git a/pkgs/pass-tail/default.nix b/pkgs/pass-tail/default.nix index 61f207c..e664a93 100644 --- a/pkgs/pass-tail/default.nix +++ b/pkgs/pass-tail/default.nix @@ -1,6 +1,7 @@ -{ fetchFromGitHub -, lib -, stdenv +{ + fetchFromGitHub, + lib, + stdenv, }: stdenv.mkDerivation { pname = "pass-tail"; diff --git a/pkgs/postfix/default.nix b/pkgs/postfix/default.nix index 39481e7..b625a71 100644 --- a/pkgs/postfix/default.nix +++ b/pkgs/postfix/default.nix @@ -1,7 +1,9 @@ -{ postfix }: +{postfix}: postfix.overrideAttrs { # Nota: hay que cambiar prefix postfix/src/ -> src/ en el patch porque las release tarballs vienen así - patches = (postfix.patches or [ ]) ++ [ - ./0001-smtpd-implement-CCERTS-action-for-access-5-tables.patch - ]; + patches = + (postfix.patches or []) + ++ [ + ./0001-smtpd-implement-CCERTS-action-for-access-5-tables.patch + ]; } diff --git a/pkgs/py-mini-racer.nix b/pkgs/py-mini-racer.nix index 5f2bcbc..e51fbe8 100644 --- a/pkgs/py-mini-racer.nix +++ b/pkgs/py-mini-racer.nix @@ -1,20 +1,20 @@ -{ buildPythonPackage -, fetchPypi -, pytest -, six -, tox -}: -let +{ + buildPythonPackage, + fetchPypi, + pytest, + six, + tox, +}: let pname = "py_mini_racer"; version = "0.6.0"; in -buildPythonPackage { - inherit pname version; - - src = fetchPypi { + buildPythonPackage { inherit pname version; - hash = "sha256-9x42tkPZR7ppjFfNm9IjLIPKmXsIAvwvf3lYI3cEDBE="; - }; - doCheck = false; -} + src = fetchPypi { + inherit pname version; + hash = "sha256-9x42tkPZR7ppjFfNm9IjLIPKmXsIAvwvf3lYI3cEDBE="; + }; + + doCheck = false; + } diff --git a/pkgs/rqlite.nix b/pkgs/rqlite.nix index 86468b4..4dd8f74 100644 --- a/pkgs/rqlite.nix +++ b/pkgs/rqlite.nix @@ -1,18 +1,21 @@ -{ lib, buildGoModule, fetchFromGitHub }: -let +{ + lib, + buildGoModule, + fetchFromGitHub, +}: let version = "7.5.0"; in -buildGoModule { - pname = "rqlite"; - inherit version; + buildGoModule { + pname = "rqlite"; + inherit version; - src = fetchFromGitHub { - owner = "rqlite"; - repo = "rqlite"; - rev = "v${version}"; - sha256 = "0hi5kq8w26i8azlcxy750zmbciga6l5n090ir261n00djigm5m59"; - }; + src = fetchFromGitHub { + owner = "rqlite"; + repo = "rqlite"; + rev = "v${version}"; + sha256 = "0hi5kq8w26i8azlcxy750zmbciga6l5n090ir261n00djigm5m59"; + }; - vendorHash = "sha256-YT1nK1vFmNCRJyWOiQhSJr83qW8uxkHXCZ81/Ch6qpg="; - doCheck = false; -} + vendorHash = "sha256-YT1nK1vFmNCRJyWOiQhSJr83qW8uxkHXCZ81/Ch6qpg="; + doCheck = false; + } diff --git a/pkgs/rv8.nix b/pkgs/rv8.nix index 8527601..63579de 100644 --- a/pkgs/rv8.nix +++ b/pkgs/rv8.nix @@ -1,4 +1,11 @@ -{ callPackage, lib, fetchFromGitHub, stdenv, writeText, ... }: +{ + callPackage, + lib, + fetchFromGitHub, + stdenv, + writeText, + ... +}: stdenv.mkDerivation { pname = "rv8"; version = "master"; @@ -11,7 +18,7 @@ stdenv.mkDerivation { fetchSubmodules = true; }; - makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" "DEST_DIR=$(out)" ]; + makeFlags = ["AR=${stdenv.cc.targetPrefix}ar" "DEST_DIR=$(out)"]; preInstall = '' mkdir -p $out/bin $out/lib @@ -28,7 +35,7 @@ stdenv.mkDerivation { #include <map> #include <set> +#include <limits> - + #include "util.h" #include "cmdline.h" diff --git a/src/gen/gen-fpu-test.cc b/src/gen/gen-fpu-test.cc @@ -40,7 +47,7 @@ stdenv.mkDerivation { #include <map> #include <set> +#include <limits> - + #include "util.h" #include "cmdline.h" '') diff --git a/pkgs/scripts/clip.nix b/pkgs/scripts/clip.nix index b801ccf..3e16e3e 100644 --- a/pkgs/scripts/clip.nix +++ b/pkgs/scripts/clip.nix @@ -1,44 +1,50 @@ -{ lib -, writeShellScriptBin -, gnome-screenshot -, xclip -, file -, imagemagick -, toPDF -, ... +{ + lib, + writeShellScriptBin, + gnome-screenshot, + xclip, + file, + imagemagick, + toPDF, + ... }: with lib; let - name = if toPDF then "clip-pdf" else "clip"; + name = + if toPDF + then "clip-pdf" + else "clip"; pdfCmdline = optionalString toPDF '' if [ $# -lt 1 ]; then echo "Usage: $0 <out.pdf> [opts...]" >&2 exit 1 fi - + OUT="$1" shift ''; copyOut = - if toPDF then '' + if toPDF + then '' ${imagemagick}/bin/convert "$CLIP" "$OUT" - '' else '' + '' + else '' ${xclip}/bin/xclip -selection clipboard \ -t $(${file}/bin/file -b --mime-type $CLIP) <"$CLIP" ''; in -writeShellScriptBin name '' - ${pdfCmdline} + writeShellScriptBin name '' + ${pdfCmdline} + + OPTIONS=-a + if [ "x$@" != "x" ]; then + OPTIONS="$@" + fi - OPTIONS=-a - if [ "x$@" != "x" ]; then - OPTIONS="$@" - fi - - CLIP="$HOME/vtmp/$$.png" - ${gnome-screenshot}/bin/gnome-screenshot "$OPTIONS" -f "$CLIP" - ${copyOut} + CLIP="$HOME/vtmp/$$.png" + ${gnome-screenshot}/bin/gnome-screenshot "$OPTIONS" -f "$CLIP" + ${copyOut} - rm "$CLIP" -'' + rm "$CLIP" + '' diff --git a/pkgs/scripts/default.nix b/pkgs/scripts/default.nix index 43eae89..ed18647 100644 --- a/pkgs/scripts/default.nix +++ b/pkgs/scripts/default.nix @@ -1,9 +1,13 @@ -{ callPackage, symlinkJoin, ... }: +{ + callPackage, + symlinkJoin, + ... +}: symlinkJoin { name = "scripts"; paths = [ - (callPackage ./clip.nix { toPDF = false; }) - (callPackage ./clip.nix { toPDF = true; }) - (callPackage ./merge-pdfs.nix { }) + (callPackage ./clip.nix {toPDF = false;}) + (callPackage ./clip.nix {toPDF = true;}) + (callPackage ./merge-pdfs.nix {}) ]; } diff --git a/pkgs/scripts/merge-pdfs.nix b/pkgs/scripts/merge-pdfs.nix index 584505a..cb7d678 100644 --- a/pkgs/scripts/merge-pdfs.nix +++ b/pkgs/scripts/merge-pdfs.nix @@ -1,16 +1,20 @@ -{ writeShellScriptBin, pdftk, ... }: +{ + writeShellScriptBin, + pdftk, + ... +}: writeShellScriptBin "merge-pdfs" '' set -e export PATH="$PATH:${pdftk}/bin" - + if [ $# -lt 3 ]; then echo "Usage: $0 <output> <PDFs...>" >&2 exit 1 fi - + OUTPUT="$1" shift - + WORKDIR="$HOME/vtmp/merge-pdfs.$$" BOOKMARKS="$WORKDIR/bookmarks.txt" FMT="BookmarkBegin @@ -18,9 +22,9 @@ writeShellScriptBin "merge-pdfs" '' BookmarkLevel: 1 BookmarkPageNumber: 1 " - + mkdir "$WORKDIR" - + N=0 for SOURCE in "$@"; do BASE="$(basename "$SOURCE")" @@ -28,7 +32,7 @@ writeShellScriptBin "merge-pdfs" '' pdftk "$SOURCE" update_info "$BOOKMARKS" output "$WORKDIR/"$(printf "%04d" $N).pdf N=$((N+1)) done - + pdftk "$WORKDIR"/*.pdf cat output "$OUTPUT" rm -r "$WORKDIR" '' diff --git a/pkgs/simple-scalar/default.nix b/pkgs/simple-scalar/default.nix index c0774d1..01e8ee4 100644 --- a/pkgs/simple-scalar/default.nix +++ b/pkgs/simple-scalar/default.nix @@ -1,5 +1,5 @@ -{ callPackage }: { - gcc-sslittle-na-sstrix = callPackage ./gcc-sslittle-na-sstrix.nix { }; - simplesim = callPackage ./simplesim.nix { }; - wattchg7 = callPackage ./simplesim.nix { isWattch = true; }; +{callPackage}: { + gcc-sslittle-na-sstrix = callPackage ./gcc-sslittle-na-sstrix.nix {}; + simplesim = callPackage ./simplesim.nix {}; + wattchg7 = callPackage ./simplesim.nix {isWattch = true;}; } diff --git a/pkgs/simple-scalar/gcc-sslittle-na-sstrix.nix b/pkgs/simple-scalar/gcc-sslittle-na-sstrix.nix index 7ad3cbe..9cb6d30 100644 --- a/pkgs/simple-scalar/gcc-sslittle-na-sstrix.nix +++ b/pkgs/simple-scalar/gcc-sslittle-na-sstrix.nix @@ -1,35 +1,39 @@ # https://www.cse.iitd.ac.in/~cs5070217/csl718/assignment1/ss_install_instructions.html -{ bison, fetchurl, flex, multiStdenv, stdenv_32bit }: -let +{ + bison, + fetchurl, + flex, + multiStdenv, + stdenv_32bit, +}: let host = "i686-pc-linux"; target = "sslittle-na-sstrix"; gcc-version = "2.7.2.3"; makeflags = "LANGUAGES=c CC=\"$CC -m32 $CFLAGS\" prefix=$out"; in -multiStdenv.mkDerivation { - pname = "gcc-sslittle-na-sstrix"; - version = "1998-08-11"; # !!! + multiStdenv.mkDerivation { + pname = "gcc-sslittle-na-sstrix"; + version = "1998-08-11"; # !!! - nativeBuildInputs = [ flex bison ]; + nativeBuildInputs = [flex bison]; - sourceRoot = "."; + sourceRoot = "."; - srcs = [ - (fetchTarball { - name = "simpleutils-990811"; + srcs = [ + (fetchTarball { + name = "simpleutils-990811"; - url = "https://www.cse.iitd.ac.in/~cs5070217/csl718/simpleutils-990811.tar.gz"; - sha256 = "sha256:0w952z382s7ghrxwrad7fd058b1kj5ad1abh8idxwwk47va72cdf"; - }) - ]; + url = "https://www.cse.iitd.ac.in/~cs5070217/csl718/simpleutils-990811.tar.gz"; + sha256 = "sha256:0w952z382s7ghrxwrad7fd058b1kj5ad1abh8idxwwk47va72cdf"; + }) + ]; - # El código es muy viejo y Nix usa opciones muy estrictas por defecto - CFLAGS = "-O3 -Wno-error=format-security"; + # El código es muy viejo y Nix usa opciones muy estrictas por defecto + CFLAGS = "-O3 -Wno-error=format-security"; - # Algunas tarballs vienen sin directorio de primer nivel y además requieren arreglos - postUnpack = - let + # Algunas tarballs vienen sin directorio de primer nivel y además requieren arreglos + postUnpack = let simpletools = fetchurl { url = "https://www.cse.iitd.ac.in/~cs5070217/csl718/simpletools-2v0.tgz"; sha256 = "sha256-FTDTqyQWZCnuNPmTcu3Hcjgp4pHNoUcC0GOGhSJV9Iw="; @@ -44,8 +48,7 @@ multiStdenv.mkDerivation { url = "https://www.cse.iitd.ac.in/~cs5070217/csl718/ar_and_ranlib.tar.gz"; sha256 = "sha256-MRTO6cAg3WeXlk3jDy2lVuiSXDRz1+LLa2XDkBDygMU="; }; - in - '' + in '' tar xf ${simpletools} rm -r gcc-2.6.3 @@ -57,50 +60,50 @@ multiStdenv.mkDerivation { chmod -R +w gcc-${gcc-version} ar-and-ranlib ''; - patches = [ - ./0001-fix-case-of-YY_CURRENT_BUFFER.patch - ./0002-define-sys_nerr.patch - ./0003-fix-obstack.h-post-increment.patch - ./0004-stdarg.h-instead-of-varargs.h.patch - ]; - - postPatch = '' - patchelf \ - --set-interpreter "$(<${stdenv_32bit.cc}/nix-support/dynamic-linker-m32)" \ - ar-and-ranlib/{ar,ranlib} - ''; - - configurePhase = '' - BUILD=$PWD - - cd $BUILD/simpleutils-990811 - ./configure --host=${host} --target=${target} --with-gnu-as --with-gnu-ld --prefix=$out - - cd $BUILD/gcc-${gcc-version} - ./configure --host=${host} --target=${target} --with-gnu-as --with-gnu-ld --prefix=$out - ''; - - buildPhase = '' - make -C $BUILD/simpleutils-990811 - - # GCC necesita binutils para compilar - make -C $BUILD/simpleutils-990811 install - cp $BUILD/ar-and-ranlib/{ar,ranlib} $out/${target}/bin/ - - cd $BUILD/gcc-${gcc-version} - - mkdir -p $out/lib - cp patched/sys/cdefs.h $BUILD/${target}/include/sys/cdefs.h - cp -r $BUILD/${target} $out/ - cp $BUILD/${target}/lib/{libc.a,crt0.o} $out/lib/ - sed -i '130s@-I/usr/include@-I./include@' Makefile - - ! make ${makeflags} - sed -i 's/\(return "FIXME\\n\)/\1\\/g' insn-output.c - PATH="$out/${target}/bin:$PATH" make ${makeflags} - ''; - - installPhase = '' - PATH="$out/${target}/bin:$PATH" make -C $BUILD/gcc-${gcc-version} ${makeflags} install - ''; -} + patches = [ + ./0001-fix-case-of-YY_CURRENT_BUFFER.patch + ./0002-define-sys_nerr.patch + ./0003-fix-obstack.h-post-increment.patch + ./0004-stdarg.h-instead-of-varargs.h.patch + ]; + + postPatch = '' + patchelf \ + --set-interpreter "$(<${stdenv_32bit.cc}/nix-support/dynamic-linker-m32)" \ + ar-and-ranlib/{ar,ranlib} + ''; + + configurePhase = '' + BUILD=$PWD + + cd $BUILD/simpleutils-990811 + ./configure --host=${host} --target=${target} --with-gnu-as --with-gnu-ld --prefix=$out + + cd $BUILD/gcc-${gcc-version} + ./configure --host=${host} --target=${target} --with-gnu-as --with-gnu-ld --prefix=$out + ''; + + buildPhase = '' + make -C $BUILD/simpleutils-990811 + + # GCC necesita binutils para compilar + make -C $BUILD/simpleutils-990811 install + cp $BUILD/ar-and-ranlib/{ar,ranlib} $out/${target}/bin/ + + cd $BUILD/gcc-${gcc-version} + + mkdir -p $out/lib + cp patched/sys/cdefs.h $BUILD/${target}/include/sys/cdefs.h + cp -r $BUILD/${target} $out/ + cp $BUILD/${target}/lib/{libc.a,crt0.o} $out/lib/ + sed -i '130s@-I/usr/include@-I./include@' Makefile + + ! make ${makeflags} + sed -i 's/\(return "FIXME\\n\)/\1\\/g' insn-output.c + PATH="$out/${target}/bin:$PATH" make ${makeflags} + ''; + + installPhase = '' + PATH="$out/${target}/bin:$PATH" make -C $BUILD/gcc-${gcc-version} ${makeflags} install + ''; + } diff --git a/pkgs/simple-scalar/simplesim.nix b/pkgs/simple-scalar/simplesim.nix index 3b73267..43bc656 100644 --- a/pkgs/simple-scalar/simplesim.nix +++ b/pkgs/simple-scalar/simplesim.nix @@ -1,19 +1,30 @@ -{ fetchFromGitHub, stdenv, isWattch ? false }: +{ + fetchFromGitHub, + stdenv, + isWattch ? false, +}: stdenv.mkDerivation { - pname = if isWattch then "wattchg7" else "SimpleSim"; - version = if isWattch then "master-2014-03-20" else "2003-10-08"; # !!! + pname = + if isWattch + then "wattchg7" + else "SimpleSim"; + version = + if isWattch + then "master-2014-03-20" + else "2003-10-08"; # !!! src = if isWattch then fetchFromGitHub - { - repo = "wattchg7"; - owner = "n-sreek"; + { + repo = "wattchg7"; + owner = "n-sreek"; - rev = "b1c2c1447584b7e850c6dc0743a2209c9d021a39"; - sha256 = "sha256-JMM2+6dgReSP3MKSC0ZOYt0Pcmef8DRzIkC26e4dk+Y="; - } else + rev = "b1c2c1447584b7e850c6dc0743a2209c9d021a39"; + sha256 = "sha256-JMM2+6dgReSP3MKSC0ZOYt0Pcmef8DRzIkC26e4dk+Y="; + } + else fetchTarball { name = "simplesim-3.0"; @@ -25,11 +36,17 @@ stdenv.mkDerivation { make config-pisa ''; - installPhase = '' - mkdir -p $out/bin - '' + (if isWattch then '' - cp sim-outorder $out/bin/wattch-outorder - '' else '' - cp {sim-{outorder,cache,profile,bpred,eio,safe,fast},sysprobe} $out/bin/ - ''); + installPhase = + '' + mkdir -p $out/bin + '' + + ( + if isWattch + then '' + cp sim-outorder $out/bin/wattch-outorder + '' + else '' + cp {sim-{outorder,cache,profile,bpred,eio,safe,fast},sysprobe} $out/bin/ + '' + ); } diff --git a/pkgs/smartthinq-sensors.nix b/pkgs/smartthinq-sensors.nix index 20a2cdc..864df52 100644 --- a/pkgs/smartthinq-sensors.nix +++ b/pkgs/smartthinq-sensors.nix @@ -1,31 +1,31 @@ -{ buildHomeAssistantComponent -, callPackage -, fetchFromGitHub -, charset-normalizer -, pycountry -, xmltodict -}: -let +{ + buildHomeAssistantComponent, + callPackage, + fetchFromGitHub, + charset-normalizer, + pycountry, + xmltodict, +}: let version = "0.39.2"; in -buildHomeAssistantComponent { - owner = "ollo69"; - domain = "smartthinq_sensors"; - inherit version; - - src = fetchFromGitHub { - repo = "ha-smartthinq-sensors"; + buildHomeAssistantComponent { owner = "ollo69"; + domain = "smartthinq_sensors"; + inherit version; + + src = fetchFromGitHub { + repo = "ha-smartthinq-sensors"; + owner = "ollo69"; - rev = "v${version}"; - hash = "sha256-tLq4sqeKmjEDDaowA8ouH/mI7jQfq49kkt/a8+40rhQ="; - }; + rev = "v${version}"; + hash = "sha256-tLq4sqeKmjEDDaowA8ouH/mI7jQfq49kkt/a8+40rhQ="; + }; - dontBuild = true; + dontBuild = true; - propagatedBuildInputs = [ - charset-normalizer - pycountry - xmltodict - ]; -} + propagatedBuildInputs = [ + charset-normalizer + pycountry + xmltodict + ]; + } diff --git a/pkgs/spliit/default.nix b/pkgs/spliit/default.nix index 3f05ad2..5ac56b1 100644 --- a/pkgs/spliit/default.nix +++ b/pkgs/spliit/default.nix @@ -1,8 +1,9 @@ -{ buildNpmPackage -, fetchFromGitHub -, nodePackages -, lib -, writeShellScriptBin +{ + buildNpmPackage, + fetchFromGitHub, + nodePackages, + lib, + writeShellScriptBin, }: buildNpmPackage { pname = "spliit2"; @@ -17,7 +18,7 @@ buildNpmPackage { }; npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU="; - npmRebuildFlags = [ "--ignore-scripts" ]; + npmRebuildFlags = ["--ignore-scripts"]; doCheck = false; @@ -35,29 +36,29 @@ buildNpmPackage { ''; postInstall = '' - install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" '' - set -euxo pipefail - - cd @out@/lib/node_modules/spliit2 + install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" '' + set -euxo pipefail - export PATH="$PWD/node_modules/.bin:$PATH" - export NEXT_TELEMETRY_DISABLED=1 + cd @out@/lib/node_modules/spliit2 - prisma migrate deploy - exec next start - '')} + export PATH="$PWD/node_modules/.bin:$PATH" + export NEXT_TELEMETRY_DISABLED=1 - #kk? - #${lib.getExe nodePackages.prisma} migrate deploy + prisma migrate deploy + exec next start + '')} - substituteInPlace $out/bin/spliit2 \ - --replace @out@ $out + #kk? + #${lib.getExe nodePackages.prisma} migrate deploy + + substituteInPlace $out/bin/spliit2 \ + --replace @out@ $out ''; meta = { description = "Free and Open Source Alternative to Splitwise. Share expenses with your friends and family."; homepage = "https://spliit.app"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ ]; + maintainers = with lib.maintainers; []; }; } diff --git a/pkgs/st.nix b/pkgs/st.nix index 117b94c..11ae230 100644 --- a/pkgs/st.nix +++ b/pkgs/st.nix @@ -1,5 +1,4 @@ -{}: -'' +{}: '' /* See LICENSE file for copyright and license details. */ /* diff --git a/pkgs/tmux-lift/default.nix b/pkgs/tmux-lift/default.nix index 3c86176..3a00f97 100644 --- a/pkgs/tmux-lift/default.nix +++ b/pkgs/tmux-lift/default.nix @@ -1,4 +1,4 @@ -{ stdenv, ... }: +{stdenv, ...}: stdenv.mkDerivation { name = "tmux-lift"; version = "1.0.0"; diff --git a/pkgs/tmux-open/default.nix b/pkgs/tmux-open/default.nix index e2c799c..1f882b4 100644 --- a/pkgs/tmux-open/default.nix +++ b/pkgs/tmux-open/default.nix @@ -1,11 +1,12 @@ -{ jq -, substituteAll -, sway -, tmux -, writeShellScriptBin -, ... +{ + jq, + substituteAll, + sway, + tmux, + writeShellScriptBin, + ... }: writeShellScriptBin "tmux-open" (builtins.readFile (substituteAll { src = ./tmux-open.sh; - env = { inherit jq sway tmux; }; + env = {inherit jq sway tmux;}; })) diff --git a/pkgs/tmux-pass.nix b/pkgs/tmux-pass.nix index 608ad95..0c079c2 100644 --- a/pkgs/tmux-pass.nix +++ b/pkgs/tmux-pass.nix @@ -1,7 +1,8 @@ -{ fetchFromGitHub -, fzf -, pass -, tmuxPlugins +{ + fetchFromGitHub, + fzf, + pass, + tmuxPlugins, }: tmuxPlugins.mkTmuxPlugin { pluginName = "tmux-pass"; diff --git a/pkgs/xandikos/default.nix b/pkgs/xandikos/default.nix index 0810efa..4c5d7d8 100644 --- a/pkgs/xandikos/default.nix +++ b/pkgs/xandikos/default.nix @@ -1,6 +1,7 @@ -{ xandikos -, systemd +{ + xandikos, + systemd, }: xandikos.overridePythonAttrs (super: { - dependencies = super.dependencies ++ [ systemd ]; + dependencies = super.dependencies ++ [systemd]; }) |
