8000 GitHub - wolffaxn/nixos-config: Configuration files for MacOS and NixOS · GitHub
[go: up one dir, main page]

Skip to content

About

Configuration files for MacOS and NixOS

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

nixos-config

Built with Nix NixOS Stable MIT licensed GitHub last commit (branch)

Configuration files for MacOS and NixOS.

Getting started

Install Nix

I recommend installing Nix using the Determinate Nix installer.

To run the installer:

$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Open a new login shell and show nix version:

$ nix --version
nix (Nix) 2.18.1

Install Home Manager

To install Home manager you can use standalone home-manager on non-nixos system.

$ nix run home-manager/master -- init --switch

This will generate a flake.nix and a home.nix file in ~/.config/home/manager (creating the directory if it does not exist).

Install dotfiles

Run new shell with Git and OpenSSH installed (bundled version of OpenSSH with macOS Monterey doesn't support ed25519-sk keys):

$ nix shell nixpkgs#git nixpkgs#openssh

Clone dotfiles:

$ git clone git@github.com:wolffaxn/nixos-config.git ~/.nixos-config
Cloning into '/Users/alex/.nixos-config'...
Confirm user presence for key ED25519-SK SHA256:qnkGlZ1hUW3Ub7j3l440jE/8fA+z7hHzMc8U6RYKcfI
...

Run Home Manager:

$ cd ~/.nixos-config

$ home-manager build
$ home-manager switch --flake .#$(hostname)

On macOS you may also run nix-darwin:

$ nix build ./#darwinConfigurations.$(hostname).system
$ ./result/sw/bin/darwin-rebuild switch --flake .

Update & Garbage collect

This will update all input channels to the latest version. After that you need to run home-manager or nix-darwin to apply the changes.

$ nix flake update
$ home-manager switch --flake .#$(hostname)
$ nix flake update
$ nix build ./#darwinConfigurations.$(hostname).system
$ ./result/sw/bin/darwin-rebuild switch --flake .

Run garbage collector

$ nix store gc

Rerun nix-index

$ export NIX_PATH=nixpkgs=flake:nixpkgs
$ nix run github:nix-community/nix-index#nix-index

Uninstall

Uninstall Home Manager

To run the uninstaller:

$ home-manager uninstall

Uninstall Nix

To run the uninstaller:

$ /nix/nix-installer uninstall

Bugs

After installing Nix I'm getting "SSL peer certificate or SSH remote key was not OK (60)" when I try to hit the cache. This fixes the problem: #3261

$ sudo rm /etc/ssl/certs/ca-certificates.crt
$ sudo ln -s /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt

License

This project is licensed under the terms of the MIT license.

About

Configuration files for MacOS and NixOS

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0