Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This repository contains:

- **Dotfiles**: Configuration files for various tools and applications
- **Nix Configuration**: Declarative system configuration using nix-darwin
- **NUR Integration**: Access to Nix User Repository for community packages
- **Homebrew Integration**: Managed through nix-homebrew
- **Pre-commit Hooks**: Ensuring code quality and security
- **Command-line Tools**: Includes `jq` (JSON), `yq` (YAML), and other productivity tools
Expand Down Expand Up @@ -56,9 +57,10 @@ Edit `dotfiles/nix/environment.nix` and add your aliases to the `shellAliases` s
### Installing New Packages

- **Nix Packages**: Add to the `systemPackages` list in `dotfiles/nix/environment.nix`
- **NUR Packages**: Access community packages via `nur.repos.<maintainer>.<package>` (e.g., `nur.repos.goreleaser.goreleaser`)
- **Homebrew Packages**: Add to the appropriate section in `dotfiles/nix/homebrew.nix`

Note: Always prefer nix packages over Homebrew packages when possible.
Note: Always prefer nix packages over Homebrew packages when possible. NUR provides access to community-maintained packages that may not be available in the main nixpkgs repository.

### Applying Changes

Expand Down
6 changes: 5 additions & 1 deletion dotfiles/nix/core.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, ... }: {
{ lib, nur, ... }: {
# Set Git commit hash for darwin-version.
# system.configurationRevision = self.rev or self.dirtyRev or null;

Expand Down Expand Up @@ -31,6 +31,10 @@
nixpkgs = {
# The platform the configuration will be used on.
hostPlatform = "aarch64-darwin";
# Add NUR overlay to make packages available
overlays = [
nur.overlay
];
config = {
allowUnsupportedSystem = true;
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
Expand Down
4 changes: 3 additions & 1 deletion dotfiles/nix/environment.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ pkgs, lib, ... }:
{ pkgs, lib, nur, ... }:

let
homeDir = "/Users/larsartmann";
# NUR packages can be accessed via nur.repos.<maintainer>.<package>
# Example: nur.repos.goreleaser.goreleaser
in
{
environment = {
Expand Down
9 changes: 7 additions & 2 deletions dotfiles/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};

nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};

nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
# Optional: Declarative tap management
homebrew-core = {
Expand All @@ -36,7 +41,7 @@
colmena.url = "github:zhaofengli/colmena";
};

outputs = { self, nix-darwin, nixpkgs, nix-homebrew, nixpkgs-nh-dev, home-manager, ... }@inputs:
outputs = { self, nix-darwin, nixpkgs, nix-homebrew, nixpkgs-nh-dev, home-manager, nur, ... }@inputs:
let
base = {
system.configurationRevision = self.rev or self.dirtyRev or null;
Expand All @@ -46,7 +51,7 @@
# Build darwin flake using:
# $ darwin-rebuild build --flake .#Lars-MacBook-Air
darwinConfigurations."Lars-MacBook-Air" = nix-darwin.lib.darwinSystem {
specialArgs = { inherit nixpkgs-nh-dev; };
specialArgs = { inherit nixpkgs-nh-dev nur; };
modules = [
# Core system configuration
base
Expand Down