Giter Club home page Giter Club logo

Comments (3)

ShamrockLee avatar ShamrockLee commented on July 1, 2024

@yajo You can produce the upgraded nix-portable declaratively by overriding the flake inputs.

from nix-portable.

nomeata avatar nomeata commented on July 1, 2024

Can you elaborate for beginners like me? My build script (for netlify) looks like

wget -nv https://github.com/DavHau/nix-portable/releases/download/v009/nix-portable
chmod +x nix-portable
./nix-portable nix-build 

how would I change that to get a specific version of nix?

from nix-portable.

ShamrockLee avatar ShamrockLee commented on July 1, 2024

@nomeata Sorry for late reply.

As nix-portable enables the flake features by default, you can make use it to build and run the Nix Flakes. You can find a Flakes introduction on the NixOS Wiki:

https://nixos.wiki/wiki/Flakes

There are several ways to build nix-portable from flake.

The most reliable one is to write a flake.nix. This one will work if you simply want to get an updated nix-portable.

{
  description = "My custom overrided nix-portable flake";

  # The nixpkgs revision to use
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
  # The nix revision to use
  inputs.nix.url = "github:NixOS/nix/2.5.1";
  inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
  # We don't need to benchmark Nix here.
  # Let's opt out the additional nixpkgs
  # that causes constant changes of `flake.lock`.
  inputs.nix.inputs.nixpkgs-regression.follows = "nixpkgs";
  inputs.nix-portable-flake.url = "github:DavHau/nix-portable/v009";
  inputs.nix-portable-flake.inputs.nixpkgs.follows = "nixpkgs";
  inputs.nix-portable-flake.inputs.defaultChannel.follows = "nixpkgs";
  inputs.nix-portable-flake.inputs.nix.follows = "nix";

  outputs = { nix-portable-flake, ... }: nix-portable-flake.outputs;
}

If the file is inside a Git repo, you can then run

$ nix build my/directory#nix-portable

to build the executable with the specified Nixpkgs and Nix versions.

If the file is not inside a Git repo, change my/directory to path:my/directory.

from nix-portable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.