Comments (10)
Could you please be more specific? Under which circumstances would nix-build
assume git
to be installed and ready to use? Could you please provide a command that you'd expect to succeed but that fails?
from docker.
Under which circumstances would nix-build assume git to be installed and ready to use?
builtins.fetchGit
(as well as git flake inputs) calls the “ambiant” git binary
$ env -u PATH $(which nix-instantiate) --eval -E 'builtins.fetchGit "https://github.com/nixos/nixpkgs"'
error: error: executing 'git': No such file or directory
error: program 'git' failed with exit code 1
(use '--show-trace' to show detailed location information)
from docker.
{ stdenv, cmake, gcc, gcc-arm-embedded-8, which, git }:
stdenv.mkDerivation rec
{
src = ./.;
cmakefiles = builtins.fetchGit {
url = "http://.../libs/cmakefiles";
ref = "master";
};
We have pkg.nix
like this and they need git around to work.
from docker.
I made #37 that adds git. I think it's reasonable. A work-around is to use apk
to install git
manually.
I was also surprised by lack of bash
which is kind of inconvenient but if we have git
and sh
, we can at least use nix to get bash.
from docker.
I am not particularly fond of catering to undeclared, implicit dependencies. Also, adding git
increases the size of the image for everyone, and I'm not sure whether many people need it in the boot image. I reckon that those who need it will simply install it via nix
inside of the image. I dunno, I think it would be better to use fetchgit
from Nixpkgs instead of the impure builtin.
from docker.
You can't use fetchgit from nixpkgs if you don't have nixpkgs. If you get your pinned nixpkgs via git such as in a flake, you're stuck in a catch 22.
If you tried to install git via nix in the image itself, you'll notice how much time and space it takes to do so. It's also not any better to use "git from whatever version of nixpkgs the container happens to point at" vs "git at whatever version the container has".
Making the image a pain to use in name of few compressed MBs just seems anti-user: any start-up time you may save is going to be ruined by having to install git yourself. It's all outweighed by any trivial eval anyway.
It's an impure dependency of commonly used built-in function commonly used to bootstrap nixpkgs itself: it doesn't seem that reasonable to include.
I'll keep using forked image from #37 or invoke apk
myself at start but it's going to waste more time (machine and human) to keep updated than it will probably ever save...
from docker.
adding git increases the size of the image for everyone, and I'm not sure whether many people need it in the boot image. I reckon that those who need it will simply install it via nix inside of the image
I think it would be fair to consider git as a dependency of Nix (as indeed some Nix features rely on it). In which case having it in the image is totally warranted (regardless the ~10MB that it adds)
from docker.
You can't use fetchgit from nixpkgs if you don't have nixpkgs.
You have nixpkgs, though. It's in the docker image.
from docker.
You have nixpkgs, though. It's in the docker image.
I already mentioned this:
If you tried to install git via nix in the image itself, you'll notice how much time and space it takes to do so. It's also not any better to use "git from whatever version of nixpkgs the container happens to point at" vs "git at whatever version the container has".
62a906fe6539:/# time nix-env -iA nixpkgs.gitMinimal
installing 'git-minimal-2.30.1'
these paths will be fetched (37.36 MiB download, 199.74 MiB unpacked):
<snip>
created 51 symlinks in user environment
real 0m 27.06s
user 0m 5.68s
sys 0m 1.02s
30 seconds extra for every run in CI is pretty annoying.
If you want to save space, why not delete nixpkgs from the image? nix-unstable images do this.
Anyway if we're not going to put git in the image, please close as won't fix along with the MR and I'll just use a fork.
from docker.
I am not particularly fond of catering to undeclared, implicit dependencies.
I'm not sure it is - it's a hard runtime dependency of Nix. Unless you build Nix without Git support (I'm not sure it's possible), this is just an incomplete image imo.
from docker.
Related Issues (20)
- nixpkgs-unstable included in the image HOT 8
- SSL error in 2.3.6 HOT 17
- bash not installed HOT 1
- cannot execute nix-shell with pinned nixpkgs in CI environment HOT 3
- nix-build works locally, but not in docker HOT 2
- Arm64 images on Docker Hub HOT 6
- Please push tagged nixos/nix:2.3.10 to Docker Hub HOT 1
- error: could not set permissions on '/nix/var/nix/profiles/per-user' to 755 HOT 1
- Possibly non-optimal default order of lookups in nsswitch.conf HOT 1
- unable to install jdk from nix-env HOT 1
- Docker HUB is dysfunctional for free accounts HOT 5
- error: opening file '/default.nix': No such file or directory HOT 1
- Where is configuration.nix ? HOT 1
- NixOS 21.11 image HOT 1
- Update nix to 2.4 HOT 2
- Sources of the 2.5.0 image HOT 2
- Docker hub image unexpectedly uses Nix 2.5 HOT 1
- Channel update fails with latest nixos/nix image HOT 2
- Missing Dockerfile for nixos/nix:2.5.0 HOT 2
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 docker.