diff --git a/darwin/configuration.nix b/darwin/configuration.nix new file mode 100644 index 0000000..2a999ca --- /dev/null +++ b/darwin/configuration.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: + +{ + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = [ pkgs.vim ]; + + # Use a custom configuration.nix location. + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix + # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + # nix.package = pkgs.nix; + + # Create /etc/bashrc that loads the nix-darwin environment. + programs.zsh.enable = true; # default shell on catalina + + # system-wide SSH configuration, used by nix-daemon for remote builders + + # show hidden files + system.defaults.NSGlobalDomain.AppleShowAllFiles = true; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/flake.lock b/flake.lock index cb653c2..3fed316 100644 --- a/flake.lock +++ b/flake.lock @@ -172,6 +172,26 @@ "url": "ssh://gitea@git.orlives.de:2342/schmittlauch/home-manager_secrets.git" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1710717205, + "narHash": "sha256-Wf3gHh5uV6W1TV/A8X8QJf99a5ypDSugY4sNtdJDe0A=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "bcc8afd06e237df060c85bad6af7128e05fd61a3", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1707211557, @@ -303,6 +323,7 @@ "home-manager": "home-manager", "lanzaboote": "lanzaboote", "mysecrets": "mysecrets", + "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixos-unstable": "nixos-unstable", "nixpkgs": "nixpkgs_2", diff --git a/flake.nix b/flake.nix index 6a2c5f7..23ed18a 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,10 @@ url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + nix-darwin = { + url = "github:LnL7/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nur.url = "github:nix-community/NUR"; # TODO: possible make this a flake as well @@ -36,6 +40,7 @@ utils, home-manager, treefmt-nix, + nix-darwin, ... }@inputs: let @@ -106,6 +111,9 @@ lanzaboote.nixosModules.lanzaboote ]; }; + darwinConfigurations."OS-MacBook-Pro" = nix-darwin.lib.darwinSystem { + modules = [ ./darwin/configuration.nix ]; + }; homeConfigurations = { spiollinux-desktop = mkHomeManager "desktop" "spiollinux" systems.x86_64-linux; os-workmac = mkHomeManager "workmac" "os" systems.aarch64-darwin; @@ -156,7 +164,7 @@ ["framenix"]="spiollinux-desktop" ["thinknix"]="spiollinux-desktop" # TODO: hostname workmac - ["os"]="workmac" + ["OS MacBook Pro"]="workmac" ) user=$(id -un) host=$(hostname)