My dotfiles, this time with nix.
Find a file
2023-08-07 15:46:03 -07:00
.github/workflows cachix action, emacsGit 2023-04-05 09:22:57 -07:00
apps nixos fix, remove cachix and mac gui apps 2023-06-19 07:51:10 -07:00
flake-parts simplify home manage dir tree, split linux config off 2023-06-19 20:00:09 -07:00
home-manager emacs terminal zsh pwd 2023-08-07 15:46:03 -07:00
nixos simplify home manage dir tree, split linux config off 2023-06-19 20:00:09 -07:00
packages iaito and radare 2023-04-24 10:06:28 -07:00
.envrc nix direnv 2023-03-20 09:30:18 -07:00
.gitignore use emacs-overlay, move emacs config to .el files 2023-04-06 10:49:15 -07:00
flake.lock nixos fix, remove cachix and mac gui apps 2023-06-19 07:51:10 -07:00
flake.nix emacs config update 2023-04-11 00:40:29 -07:00
LICENSE add MIT license 2023-03-16 12:28:17 -07:00
README.org add tasks to readme 2023-03-20 15:02:50 -07:00

dotfiles.nix

My dotfiles using Nix. System configuration done using nix-darwin and NixOS. User configuration using home-manager. This repo is put together as a flake using flake-parts.

Much of the structure of dotfiles.nix is taken from terlar/nix-config with other ideas taken from ~rycee/configurations. Another notable info source is hlissner/dotfiles.

All Nix code in this repo is formatted using alejandra.

Usage

Show what this flake provides:

nix flake show

Switch both system (NixOS) and home:

nix run .#nixos-switch

Switch both system (nix-darwin) and home:

nix run .#darwin-switch

Switch home only:

nix run .#home-switch

Build home without switching:

nix run .#home-switch

Update all inputs:

nix flake update --commit-lock-file

Update a single input:

nix flake lock --update-input nixpkgs --commit-lock-file

Format all nix files:

nix fmt

Enter the dev shell (if not using nix-direnv):

nix develop

Outputs

Home Configurations

Due to the way the homeConfigurations output is structured (each user configuration is generated for each system,) the home-manager switch --flake command cannot be used as per usual, instead the FLAKE_CONFIG_URI variable needs to be set. See /willemml/dotfiles.nix/src/commit/92f00895aae1f8e7c22ac4396649edbac3b12b30/apps/home-switch.nix for an example.

All home configurations are exposed under both packages.SYSTEM.home-USER and homeConfiguration.SYSTEM.USER.

Apps

These packages make some operations simpler or more intuitive, to use an app, run the following command from within the flake directory: nix run .#APPNAME.

darwin-switch

Build and switch to the nix-darwin configuration for the current host (only on Darwin.) The configuration is defined under darwinConfigurations.HOSTNAME.

nixos-switch

Build and switch to the nixos configuration for the current host (only on NixOS.) The configurations are defined under nixosConfigurations.HOSTNAME.

home-switch & home-build

Build and or switch to the home-manager configuration for the current user. Home configurations are defined under homeConfigurations.SYSTEM.USER.

Packages

This flake exposes several package definitions I have created, most of them are binary sourced applications for macOS, most importantly Firefox.

Darwin Configurations

System configurations for macOS.

zeus

My primary computer.

NixOS Configurations

System configurations for NixOS.

zeusvm

Linux VM for my macOS machine (darwinConfigurations.zeus).

zeusasahi

NixOS configuration for my M1 MacBook Pro, uses tpwrules/nixos-apple-silicon. Currently untested, WIP.

NixOS Modules

Modules for NixOS configurations, most of these should also work for Darwin.

custom-linkNixInputs

Adds the inputs of this flake to the nix registry and NIX_PATH.

Taken from LnL7/nix-darwin #277.

Tasks

TODO Packages for different systems

Packages are in the flake outputs for systems they are not compatible with.

TODO Break out emacs config

Emacs configuration should be in it's own repository. Lisp code should be extracted into separate files or an org-babel setup.

TODO Test zeusasahi

TODO Services as modules

Services should be converted to modules. These should ideally support both linux and darwin hosts (launchd and systemd).