Giter VIP home page Giter VIP logo

nix-config's Introduction

nix-dev-home

A home-manager template providing useful tools & settings for Nix-based development

Usage

asciicast

Either click the green "Use this template" button above (on Github) and clone it locally, or run the following:

mkdir ~/mynixconfig && cd ~/mynixconfig
nix flake init -t github:juspay/nix-dev-home

(If you do not already have it, install Nix first)

This will create a flake.nix file and a home.nix in the current directory.

  • Edit home.nix to your liking (see configuration example).
  • Also, you must change the user name in flake.nix from john to your actual user name.
  • You can then run nix run to activate this configuration in your $HOME.
    • After running this, restart your terminal. Expect to see the starship prompt. When you cd into a project containing .envrc configured for flakes (such as haskell-template), you should be automatically be put in the nix develop shell along with a change to the starship prompt indicating the same.

To browse the capabilities of home-manager (and to see what else can go in your home.nix -- such as shell aliases), consult https://nix-community.github.io/home-manager/options.html

Troubleshooting

  • Runningnix run (home-manager) complains "Existing file ... is in the way of ..."
    • Delete those existing dotfiles, and try again. In home-manager, you can configure your shell directly in Nix (for macOS zsh, this is programs.zsh.envExtra).
  • Cannot use cachix: Running nix run nixpkgs#cachix use nammayatri (for example) does not succeed.
    • Add yourself to the trusted-users list and restart your macOS machine.
      mkdir -p ~/.config/nix
      echo "trusted-users = root $USER" > $HOME/.config/nix/nix.conf

FAQ

But I use NixOS

You can embed this configuration inside your NixOS configuration, and thus share it with non-NixOS systems (like macOS and Ubuntu). See the "both" template of https://github.com/srid/nixos-flake for an example. If you don't want to share the configuration with macOS (ie., you use only Linux for development), see the "linux" template instead.

nix-config's People

Contributors

srid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.