mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 16:27:03 +00:00
51 lines
1.6 KiB
Nix
51 lines
1.6 KiB
Nix
{
|
|
description = "Example Darwin system flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs@{ self, nix-darwin, nixpkgs }:
|
|
let
|
|
configuration = { pkgs, ... }: {
|
|
# List packages installed in system profile. To search by name, run:
|
|
# $ nix-env -qaP | grep wget
|
|
environment.systemPackages =
|
|
[ pkgs.vim
|
|
];
|
|
|
|
# Auto upgrade nix package and the daemon service.
|
|
services.nix-daemon.enable = true;
|
|
# nix.package = pkgs.nix;
|
|
|
|
# Necessary for using flakes on this system.
|
|
nix.settings.experimental-features = "nix-command flakes";
|
|
|
|
# Create /etc/zshrc that loads the nix-darwin environment.
|
|
programs.zsh.enable = true; # default shell on catalina
|
|
# programs.fish.enable = true;
|
|
|
|
# Set Git commit hash for darwin-version.
|
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
|
|
# Used for backwards compatibility, please read the changelog before changing.
|
|
# $ darwin-rebuild changelog
|
|
system.stateVersion = 5;
|
|
|
|
# The platform the configuration will be used on.
|
|
nixpkgs.hostPlatform = "x86_64-darwin";
|
|
};
|
|
in
|
|
{
|
|
# Build darwin flake using:
|
|
# $ darwin-rebuild build --flake .#simple
|
|
darwinConfigurations."simple" = nix-darwin.lib.darwinSystem {
|
|
modules = [ configuration ];
|
|
};
|
|
|
|
# Expose the package set, including overlays, for convenience.
|
|
darwinPackages = self.darwinConfigurations."simple".pkgs;
|
|
};
|
|
}
|