From c5b1c207532dd29b14d3f1a7b6b25a01a2e4824b Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 11 Sep 2023 16:55:36 -0700 Subject: add configuration for the M2 macbook air --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 14 +++++++++++++- hosts/mba/default.nix | 23 +++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 hosts/mba/default.nix diff --git a/flake.lock b/flake.lock index 568d419..11ff499 100644 --- a/flake.lock +++ b/flake.lock @@ -44,6 +44,26 @@ "type": "github" } }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692248770, + "narHash": "sha256-tZeFpETKQGbgnaSIO1AGWD27IyTcBm4D+A9d7ulQ4NM=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "511177ffe8226c78c9cf6a92a7b5f2df3684956b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", @@ -344,6 +364,7 @@ "root": { "inputs": { "agenix": "agenix", + "darwin": "darwin_2", "emacs-overlay": "emacs-overlay", "futils": "futils", "home-manager": "home-manager_2", diff --git a/flake.nix b/flake.nix index 9ede1aa..6a2cfa5 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + darwin.url = "github:lnl7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + pre-commit-hooks = { type = "github"; owner = "cachix"; @@ -56,7 +59,7 @@ }; # Output config, or config for NixOS system - outputs = inputs@{ self, ... }: + outputs = inputs@{ self, darwin, home-manager, ... }: let myLib = import ./nix inputs; lib = inputs.nixpkgs.lib // builtins; @@ -158,6 +161,15 @@ tahoe = myLib.mkSystem { hostname = "tahoe"; }; }; + darwinConfigurations = { + "mba-fcuny" = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + ./hosts/mba + ]; + }; + }; + homeConfigurations = { useGlobalPkgs = true; useUserPackages = true; diff --git a/hosts/mba/default.nix b/hosts/mba/default.nix new file mode 100644 index 0000000..89e703e --- /dev/null +++ b/hosts/mba/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + services.nix-daemon.enable = true; + + programs.zsh.enable = true; + + homebrew = { + enable = true; + onActivation.autoUpdate = true; + + taps = [ + "homebrew/cask-fonts" + ]; + + casks = [ + "docker" + "emacs" + "font-source-code-pro" + "iterm2" + "wireshark" + ]; + }; +} -- cgit 1.4.1