Spacc BBS Spacc BBS
    • Categorie
    • Recenti
    • Tag
    • Popolare
    • Mondo
    • Utenti
    • Gruppi
    • Registrati
    • Accedi
    La nuova BBS è in fase Alpha. I post precedenti al 22 luglio 2024 potrebbero non essere trasferibili, ma rimarranno disponibili per la lettura su /old/.

    Learned a neat #Nix trick: You can easily cross-compile all programs in Nixpkgs (as long as they support the target platform)!

    Pianificato Fissato Bloccato Spostato Uncategorized
    nix
    2 Post 1 Autori 4 Visualizzazioni
    Caricamento altri post
    • Da Vecchi a Nuovi
    • Da Nuovi a Vecchi
    • Più Voti
    Rispondi
    • Topic risposta
    Effettua l'accesso per rispondere
    Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
    • blinry@chaos.socialB Questo utente è esterno a questo forum
      blinry@chaos.social
      ultima modifica di

      Learned a neat #Nix trick: You can easily cross-compile all programs in Nixpkgs (as long as they support the target platform)!

      So instead of `nix build nixpkgs#ripgrep`, to build ripgrep for Windows, you can use:

      nix build nixpkgs#pkgsCross.mingwW64.ripgrep

      Other example targets are:

      - "aarch64-multiplatform" (AMD64)
      - "gnu32" (i686)
      - "riscv64" (64-bit RISC-V)
      - "musl64" (x86_64, using musl instead of glibc)

      Many more are defined in this file: https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix

      blinry@chaos.socialB 1 Risposta Ultima Risposta Rispondi Cita 1 0
      • gustavinobevilacqua@mastodon.cisti.orgG gustavinobevilacqua@mastodon.cisti.org shared this topic on
      • blinry@chaos.socialB Questo utente è esterno a questo forum
        blinry@chaos.social @blinry@chaos.social
        ultima modifica di

        You can also build 32-bit programs more directly:

        nix build nixpkgs#pkgsi686Linux.ripgrep

        You can also produce a static executable for your current platform:

        nix build nixpkgs#pkgsStatic.ripgrep

        And best of all – you can combine those! Here's a 32-bit static binary (which happened to be the thing I need right now for my tiny Linux in the browser project):

        nix build nixpkgs#pkgsi686Linux.pkgsStatic.ripgrep

        1 Risposta Ultima Risposta Rispondi Cita 1 0
        • Primo post
          Ultimo post