Comments (9)
Can you elaborate on your use case?
from lorri.
@Profpatsch I use the niv tool to keep my dependencies organized. It avoids downloading the entire git repository and instead just fetches the specified rev.
I prefer this approach to manually keeping several git repositories updated, because it is reproducible and requires much less maintenance.
from lorri.
Oh, you mean src = ./.
?
You can overwrite the source with an argument: nix-build …/lorri/default.nix --arg src /path/to/lorri
.
from lorri.
@Profpatsch this command unfortunately fails for me.
nix-build lorri/default.nix --arg src /full/path/to/lorri
these derivations will be built:
/nix/store/wy37hnd66xhxfd6sm9vw4p6hd95rrxpq-lorri.drv
building '/nix/store/wy37hnd66xhxfd6sm9vw4p6hd95rrxpq-lorri.drv'...
unpacking sources
unpacking source archive /nix/store/llk09dv6pvszl0gl3kzg9k96aj389615-lorri
do not know how to unpack source archive /nix/store/llk09dv6pvszl0gl3kzg9k96aj389615-lorri
builder for '/nix/store/wy37hnd66xhxfd6sm9vw4p6hd95rrxpq-lorri.drv' failed with exit code 1
error: build of '/nix/store/wy37hnd66xhxfd6sm9vw4p6hd95rrxpq-lorri.drv' failed
This is kind of my problem: There does not seem to be an obvious way to build/install lorri from a directory that isn't git version-controlled.
What does the fetchGit
function achieve in default.nix
?
from lorri.
You have to replace the paths by the paths you need of course.
$ wget https://github.com/target/lorri/archive/e943fa403234f1a5e403b6fdc112e79abc1e29ba.tar.gz
$ ls
default.nix e943fa403234f1a5e403b6fdc112e79abc1e29ba.tar.gz lorri-e943fa403234f1a5e403b6fdc112e79abc1e29ba
$ cp -r lorri-e943fa403234f1a5e403b6fdc112e79abc1e29ba/nix lorri-e943fa403234f1a5e403b6fdc112e79abc1e29ba/default.nix .
$ nix-build default.nix --arg src ./lorri-e943fa403234f1a5e403b6fdc112e79abc1e29ba --arg pkgs 'import ./nixpkgs.nix {}'
We don’t have a .git directory in the tarball, it works.
from lorri.
Interesting. Trying to build lorri seems to fail in ways that I don't fully comprehend. I suspect it might have to do with the files being stored in the nix store, or symlinking issues. (related to my personal setup)
Still, I am interested in why lorri chooses to have fetchGit
in its default.nix
as I have never seen that in any other nix project.
Maybe someone could explain this to me?
In any case, this is no longer relevant to the original issue.
@Profpatsch thank you for helping me, I will now close this issue.
from lorri.
Still, I am interested in why lorri chooses to have
fetchGit
in itsdefault.nix
as I have never seen that in any other nix project.
It’s a default argument.
let f = { a ? "foo" }: a
in f {}
will be "foo"
, while
let f = { a ? "foo" }: a
in f { a = "bar" }
will be "bar"
.
You can try it out in nix repl
.
from lorri.
@Profpatsch Yes I understand that. But why would you even try to fetchGit
a local directory? It doesn't make sense to me.
from lorri.
But why would you even try to
fetchGit
a local directory? It doesn't make sense to me.
You have to ask @grahamc ;). I agree with you that it’s not a great solution, because fetchGit
caches your source for up to an hour, meaning any changes are not picked up.
from lorri.
Related Issues (20)
- lorri clobbers nix-shell environment
- Show and update lorri daemon status in shell
- No documentation about runtime garbage collection
- Lorri does not use bashInteractive like nix-shell
- Lorri misbehaves when the shell has `disallowedReferences`
- `lorri direnv` extremely slow with a large number of env vars
- shellHook fails when sourcing bash completions HOT 1
- lorri Crash Report
- lorri Crash Report HOT 1
- Start lorry from Emacs HOT 1
- Bash completions fail because XDG_DATA_DIRS is reset HOT 1
- lorri Crash Report HOT 1
- lorri + direnv reloads environment after every command HOT 1
- Lorri doesn't build on unstable HOT 2
- lorri internal stream-events does nothing
- Lorri fails to setup FHS user environment HOT 3
- Lorri incorrectly prepend NODE_PATH instead of overwriting
- Breaks kde-open5/xdg-open HOT 2
- MAINTENANCE NOTICE HOT 1
- lorri Crash Report
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 lorri.