mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(mac): Define system settings with nix-darwin
This commit is contained in:
parent
a7dfb2272c
commit
d93d153827
2 changed files with 165 additions and 0 deletions
52
platforms/mac/etc/nix-darwin/flake.nix
Normal file
52
platforms/mac/etc/nix-darwin/flake.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
description = "Example nix-darwin system flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
nix-darwin.url = "github:LnL7/nix-darwin/master";
|
||||
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
|
||||
];
|
||||
|
||||
environment.etc."zshenv".text = ''
|
||||
if [ -d $HOME/.config/zsh ]; then
|
||||
export ZDOTDIR=$HOME/.config/zsh
|
||||
fi
|
||||
'';
|
||||
|
||||
# Necessary for using flakes on this system.
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
|
||||
# Enable alternative shell support in nix-darwin.
|
||||
# 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 = 6;
|
||||
|
||||
# The platform the configuration will be used on.
|
||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||
};
|
||||
in
|
||||
{
|
||||
# Build darwin flake using:
|
||||
# $ darwin-rebuild build --flake .#Zen
|
||||
darwinConfigurations."Zen" = nix-darwin.lib.darwinSystem {
|
||||
modules = [
|
||||
configuration
|
||||
./default-system.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue