Giter VIP home page Giter VIP logo

user-env-nix's Introduction

Nix User Environment Flake

Reproducible development environment powered by Nix Flakes

Initial Setup

Use nix version 2.4 or newer.

See https://nixos.wiki/wiki/Flakes

For NixOS, add the following to /etc/nixos/configuration.nix:

{
  nix = {
    package = pkgs.nixUnstable;
    extraOptions = ''
      experimental-features = nix-command flakes
    '';
  };
}

For non-NixOS systems:

mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf

Installation

Install flake into profile:

nix profile install github:svend/user-env-nix#userEnv

Update to the latest version of the flake.

nix profile upgrade --refresh --verbose '.*\.userEnv'

Systemd

On NixOS, refresh user systemd unit files.

systemctl --user daemon-reload

NixOS adds ~/.nix-profile/etc/xdg/systemd/user to the user unit search path.

systemd-path systemd-search-user-unit

To start from scratch:

rm -rf ~/.config/systemd/user
systemctl --user enable backup-laptop.timer
systemctl --user enable mbsync.timer
systemctl --user add-wants mbsync.service [email protected]
systemctl --user add-wants mbsync.service [email protected]
systemctl --user daemon-reload
systemctl --user --failed

Updating

Update lock file.

nix flake update

Update a single input:

nix flake metadata
nix flake lock --update-input nixpkgs-unstable

Development

Running nix build will create result/ which is a link to the build.

To print build logs, run nix build --print-build-logs or nix build -L. (These flags do not show up in --help.)

To run Emacs from the build, run:

EMACSLOADPATH= result/bin/emacs

REPL

NixOS/nix#8059

nix repl --file repl.nix
nix repl --extra-experimental-features repl-flake .#
nix repl (followed by ":lf .")
$ nix repl --file repl.nix
nix-repl> :b outputs.packages.x86_64-linux.gitWithConfig
this derivation produced the following outputs:
  out -> /nix/store/1s5d89anqhq1f6a1bgyagvri4q82918j-gitWithConfig

user-env-nix's People

Contributors

svend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

trialanderrror

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.