Comments (5)
Finally got it working. I don't know if there is something wrong with my nix installation or there were simply some braces missing from your blog post, but the following works for me:
{ nixpkgs ? (import ( _nixpkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "...";
sha256 = "..."; }){})}:
Whereas the original solution does not:
{ nixpkgs ? (import _nixpkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = ...;
sha256 = ...; })}:
I don't know enough nix
, but wouldn't something like the following be great to have? Can't we add such behaviour to import
itself?
{nixpkgs ? import <nixpkgs> { rev = "..."; sha256 = "..."; } }:
...
from nixpkgs-mozilla.
Hm. The part where we set the nix path still does not work with this solution:
nix-shell --arg nixpkgs /absolute/path/to/nixpkgs.
from nixpkgs-mozilla.
Ok. Finally got something working:
{nixpkgs ? null}:
let
sysPkg = import <nixpkgs> { };
pinnedPkg = sysPkg.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "cf62a27a326a9cdbb01d627b1faaea3a0d5e886c";
sha256 = "1q74ciqq5r17vidw2025x8idsncz9k7w60warrij4q7piaffgvd7";
};
pkgs = if nixpkgs==null then
import pinnedPkg {}
else
import nixpkgs {};
in with pkgs; stdenv.mkDerivation rec {
name = "ProjectA-1.0.0";
src = ./.;
buildInputs = [ pkgs.python ];
installPhase= ''
sed -i -e "s|python|`which python`" bin/serve
mkdir -p $out/bin
cp bin/* $out/bin
'';
}
from nixpkgs-mozilla.
Looks right to me. I don't know if we can reduce this further.
My only suggestion would be to name it mozpkgs
or anything else than nixpkgs
since that term is already referencing the nixos/nixpkgs repo.
from nixpkgs-mozilla.
You guys may also be interested in my technique for fully deterministic bootstrapping of a nixpkgs pin. It makes no assumptions other than that your Nix interpreter implements a superset of the semantics implemented by Nix 1.11.8 (which seems likely to be true into the forseeable future). In the future, when Nix 1.12 comes out, fetchTarball
will support a sha256
argument, and this hack can be replaced with fetchTarball
(if you try to use fetchTarball
now, it will redownload every time the cache expires, which can be very annoying).
from nixpkgs-mozilla.
Related Issues (20)
- What changed regarding GPG keys for releases? HOT 3
- firefox-nightly double icon + firefox-beta -> Wrong icon
- stdenv.lib is depreciated! HOT 2
- Missing `rust-src` which is causing `rust-analyzer` to fatal in vscodium HOT 1
- How to install the latest ESR? HOT 3
- Add custom Rust targets HOT 4
- Derivations created using this repository are not reproducible HOT 2
- Firefox-nightly 96.0a1 fail to start on NixOS 21.05 HOT 7
- Should git-cinnabar be included into firefox development overlay? HOT 2
- Undefined variable 'phlay' HOT 1
- Firefox fails to compile because -fPIC is passed to `as` HOT 1
- firefox-nightly fails to use vaapi with mesa's radeon driver on NixOS HOT 1
- example in README.md doesn't work with rust-toolchain.toml file HOT 1
- `couldn't find remote ref refs/heads/master` when building `/nix/store/<hash>-channel-rust-1.55.0.toml.drv` HOT 2
- Suddenly can't rebuild anymore because "wrapper called with unexpected argument 'browserName'" HOT 2
- firefox-overlay, impurity, and a missing link in GPG verification? HOT 3
- How to get aarch64 Firefox Nightly builds?
- Install different versions of Firefox side by side. HOT 2
- rustChannelOf doesn't error on argument name typos
- rr fails to build when using this overlay with newer nixpkgs HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixpkgs-mozilla.