aancw / nixpkgs

My Personal Configuration with Nix ƛ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rin's Home 🏚

Heavily inspired from (malob/nixpkgs).

This is my personal configuration with nix using flakes, home-manager, & nix-darwin for Darwin or MacOS System.

Structure

.
├── darwin.nix (Nix Darwin configuration)
├── default.nix (Support legacy nix)
├── flake.lock
├── flake.nix (Flake configuration)
├── flake.nix.simple (Example: currently NOT USED)
├── home (home-manager)
│   ├── activation.nix (Some script and configuration when activation the home manager)
│   ├── packages.nix (list packages per user)
│   └── shells.nix (shell configuration, default Fish shell with startship)
├── nixpkgs.nix (Support legacy nix)
├── pkgs (modules for overlay in flake.nix, mostly generated by related tools like node2nix)
│   └── node-packages
│       ├── README.md
│       ├── default.nix
│       ├── node-env.nix
│       ├── node-packages.json
│       └── node-packages.nix
└── result -> /nix/store/xxxxxxx (the result when completed run nix build)

4 directories, 15 files

Usage

Prerequisite

Nix

System Single User Multiple User Command
Linux Single UserMulti User
Darwin (MacOS) Multi User
More...
Linux Single User
sh <(curl -L https://nixos.org/nix/install) --daemon
Linux Multi User
sh <(curl -L https://nixos.org/nix/install) --no-daemon
Darwin Multi User
sh <(curl -L https://nixos.org/nix/install)

Enable experimental-features

In general installation of nix, the nix configuration is located in ~/.config/nix/nix.conf. You MUST be set the experimental-features before use this configuration.

experimental-features = nix-command flakes

// (optional) for distribution cache (DON'T COPY THIS COMMENT LINE)
substituters = https://cache.nixos.org https://cache.nixos.org/ https://r17.cachix.org

Setup

// with SSH

git clone git@github.com:r17x/nixpkgs ~/.config/nixpkgs

// OR with HTTP
git clone https://github.com/r17x/nixpkgs ~/.config/nixpkgs
  • Change directory to ~/.config/nixpkgs
cd ~/.config/nixpkgs
  • Run Build
    command for build: nix build .#darwinConfigurations.[NAME].system
    Available for [NAME]:
    • RG
nix build .#darwinConfigurations.RG.system
  • Apply from Result
    command for apply the result: ./result/sw/bin/darwin-rebuild switch --flake .#[NAME]
    Available for [NAME]:
    • RG
      After Run Build you can apply from ./result with this command
./result/sw/bin/darwin-rebuild switch --flake .#RG
  • Done 🚀🎉

Command List

  • drb - darwin rebuild aliases - rebuild this nixpkgs.
  • drs - darwin rebuild and switch the build version (make current build to current version of environment).
  • lenv - list of build version <VERSION>, that's usefull for switch aka rollback environment.
  • senv <VERSION> - switch spesific version (number).

Acknowledgement

About

My Personal Configuration with Nix ƛ


Languages

Language:Nix 77.6%Language:Lua 15.2%Language:Vim Script 6.7%Language:Shell 0.4%