First pass at a Nix flake for my laptop

Heavily inspired by these:
- https://github.com/zmre/mac-nix-simple-example
- https://github.com/dustinlyons/nixos-config
This commit is contained in:
Gene Liverman 2023-09-08 16:49:45 -04:00 committed by Gene Liverman
parent 1fb4bf12c8
commit 6430f175b2
6 changed files with 584 additions and 0 deletions

57
flake.nix Normal file
View file

@ -0,0 +1,57 @@
{
description = "A flake for all my stuff";
inputs = {
# Where we get most of our software. Giant mono repo with recipes
# called derivations that say how to build software.
nixpkgs.url = "github:nixos/nixpkgs";
# Controls system level software and settings including fonts
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Manages things in home directory
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Manage Homebrew itself
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
}; # end inputs
outputs = { self, nixpkgs, darwin, home-manager, nix-homebrew, ... }: {
# This is only set to work with x86 macOS right now... that will need to be updated
darwinConfigurations.Blue-Rock = darwin.lib.darwinSystem {
system = "x86_64-darwin";
pkgs = import nixpkgs { system = "x86_64-darwin"; };
modules = [
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# User owning the Homebrew prefix
user = "gene.liverman";
# Automatically migrate existing Homebrew installations
autoMigrate = true;
};
}
./modules/darwin
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users."gene.liverman".imports = [ ./modules/home-manager ];
};
}
]; # end modules
}; # end of darwinConfigurations.Blue-Rock
};
}