Comments (8)
Fixed by #50
from nix-darwin.
All of the Nix environment setup scripts I've seen (in the nix.sh
script of GNU+Linux, the environment on NixOS, the nix-daemon.sh
script on macOS, and in nix-darwin) set PATH this way. I think it makes sense on initial startup, but we have to make sure it runs as early as possible and never twice. Take a look at the NixOS module for Fish and the fish package in nixpkgs for an example.
I think if we change the Fish package to source /etc/static/preinit-whatever.fish instead of in plain /etc, then nix-darwin can put the file in place and NixOS should be unaffected. Right now nix-darwin can't put the file where Fish expects because it doesn't (and shouldn't) own /etc
.
from nix-darwin.
@therealpxc That makes sense to me, I think. I understand what the NixOS things in the Fish package are doing, at any rate.
How do you suggest managing the tickets for this?
from nix-darwin.
I think we should make the changes we want on the Nixpkgs side on a local checkout while we work out the nix-darwin stuff, then submit the PRs for both pieces. That way the PR for Nixpkgs can say 'this makes the following achievable in nix-darwin' instead of 'we hope this will enable us to do xyz for nix-darwin'.
from nix-darwin.
@therealpxc Sounds good to me.
What the fish package does looks reasonable to me. I'm assuming we don't export the _fish_nixos*_sourced variables because the idea is that we reset things anew in subshells anyway?
from nix-darwin.
The other shell modules do something similar, but how is this related to setting PATH
?
from nix-darwin.
@cbarrett that's right.
@LnL7 The way that PATH is set is neither by appending nor pre-pending but straight-up setting PATH, so that if the Nix configuration stuff gets sourced after other things (like nix-shell
, for example) try to set the PATH, it will be erased.
Since EDITOR also gets set this way, for example, it overrides the ~/.config/fish/conf.d/env.fish
snippet I have which sets it to vim
, so I have to re-override it at the end ~/.config/fish/config.fish
, which gets sourced later, as a workaround.
from nix-darwin.
And to make Nix-installed CLI programs available to snippets in ~/.config/fish/conf.d
and directories like it, the Nix stuff has to be sourced prior to shell initialization proper, which is what the preinit
stuff in the Fish package and NixOS module take care of. This is because the conf.d stuff is sourced before config.fish and in alphanumeric order, so adding a Fish snippet for Nix init doesn't guarantee that it will execute first either.
from nix-darwin.
Related Issues (20)
- Manage Spotlight indexing exclusions
- FR: nixpkgs.flake.{source,setNixPath,setFlakeRegistry} settings
- Is it possible to use sketchybar lua? HOT 2
- How to disable Nix channels? HOT 3
- Option to add `vscode` entries in Brewfile
- Make `nushell` default shell (`programs.nushell.enable`)?
- Build failure: python312Packages.pyuv HOT 3
- Google Chrome Canary cask installed via Nix will not auto-update HOT 1
- `homebrew.onActivation.cleanup`: option to fail activation as part of checks
- ```darwin-rebuild switch --flake ~/.config/nix``` is trying to create a system link in the store
- hash mismatch after flake update HOT 5
- Option to configure /etc/hosts file HOT 2
- finder option to enable search in only in current folder HOT 2
- options for mission control
- services.karabiner-elements is broken after Karabiner-Elements v15.0
- Waiting for the nix store to mount before attempting to run launchd daemons that depend on nix derivations HOT 4
- Nixpkgs config (e.g. allowUnfree) not being picked up properly? HOT 5
- Night Shift schedule
- Cannot use system.defaults when running darwin-rebuild switch as non-root user
- Could not write domain com.apple.universalaccess during fresh nix-darwin install on a flake HOT 1
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-darwin.