Comments (9)
What is the output of the following commands?
printenv NIX_PATH
nix-instantiate --eval --expr '<nixpkgs>'
from nix-init.
# printenv NIX_PATH
/root/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
# nix-instantiate --eval --expr '<nixpkgs>'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
… while calling the 'findFile' builtin
at «string»:1:1:
1| <nixpkgs>
| ^
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
Looking at this, it feels more like a newbie (me) getting stuck in between channels and flakes rather than a nix-init
problem.
from nix-init.
Why do you think that's the problem? Did you remove any channels?
EDIT: Also why running the commands as root (#) ?
from nix-init.
Why do you think that's the problem? Did you remove any channels?
My channels were empty at some stage. The system is setup via flake.
But I re-added unstable to give it a try.
nix-channel --list
unstable https://nixos.org/channels/nixpkgs-unstable
# nix-channel --update
But that didn't help
EDIT: Also why running the commands as root (#) ?
No particular reason. It's just a throw-away vm for now.
But I am getting the same error as user
[tcurdt@nixos:~]$ nix-instantiate --eval --expr '<nixpkgs>'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
… while calling the 'findFile' builtin
at «string»:1:1:
1| <nixpkgs>
| ^
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
TBH I don't understand the per-user/root
when I am user tcurdt
from nix-init.
Root's channels are propagated to regular users
from nix-init.
This helped
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --update nixpkgs
$ nix-instantiate --eval --expr '<nixpkgs>'
/root/.nix-defexpr/channels/nixpkgs
Can't say I understand the problem/fix yet, but I now have a default.nix
🥳
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "release-go";
version = "1.0.3";
src = fetchFromGitHub {
owner = "tcurdt";
repo = "release-go";
rev = "v${version}";
hash = "sha256-Ai4uvLkl4e4Z6x1wZb5BzpLvWhxHhg4D1QpCdSjwQ5I=";
};
vendorHash = null;
ldflags = [
"-s"
"-w"
"-X=main.version=${version}"
"-X=main.commit=${src.rev}"
"-X=main.date=1970-01-01T00:00:00Z"
"-X=main.treeState=false"
"-X=main.builtBy=goreleaser"
];
meta = with lib; {
description = "";
homepage = "https://github.com/tcurdt/release-go";
license = licenses.unfree; # FIXME: nix-init did not find a license
maintainers = with maintainers; [ ];
mainProgram = "release-go";
};
}
from nix-init.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/making-packages-projects-available-to-nixos/38462/4
from nix-init.
Should the issue be closed?
from nix-init.
I am still stuck actually getting the build to work - but that's probably another more unrelated matter. Let's close it.
from nix-init.
Related Issues (20)
- Dependency inference for buildGoModule HOT 1
- Automatically find and install man pages and shell completions HOT 2
- Selection does not work under zsh. HOT 13
- SourceHut support
- Document how to use the -n attribute HOT 2
- Generate `pytestCheckHook` input and usage in `nativeCheckInputs` if you detect a `pytest` dependency.
- Automatically set meta.mainProgram
- zon2nix integration
- Error during building HOT 10
- Unable to compile v0.2.4 on Arch HOT 5
- php.buildComposerProject integration
- Incorrect package homepage when using SSH git URL
- setuptools runtime dependencies not extracted
- Detect URLs referring to subdirectories HOT 1
- Prefix unstable packages with 0-
- Nixpkgs style HOT 1
- Why write out meta.platforms? HOT 1
- Support for kali-linux's gitlab
- allow to choose `stdenvNoCC.mkDerivation` as builder
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 nix-init.