From 87ff6f0290a1a4490f0e70ab82c898b7d772ab55 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sat, 16 Apr 2022 21:35:23 -0400 Subject: [PATCH] darwin-configuration with flake support --- bootstrap_nix_darwin.sh | 7 +++ .../darwin/darwin-configuration.nix | 48 +++++++++++++------ nix/darwin/flake.lock | 47 ++++++++++++++++++ nix/darwin/flake.nix | 21 ++++++++ 4 files changed, 109 insertions(+), 14 deletions(-) create mode 100644 bootstrap_nix_darwin.sh rename darwin-configuration.nix => nix/darwin/darwin-configuration.nix (53%) create mode 100644 nix/darwin/flake.lock create mode 100644 nix/darwin/flake.nix diff --git a/bootstrap_nix_darwin.sh b/bootstrap_nix_darwin.sh new file mode 100644 index 0000000..a3cff67 --- /dev/null +++ b/bootstrap_nix_darwin.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# AUTHOR: Jeremy Wall (jw), jeremy@marzhillstudios.com + +sh <(curl -L https://nixos.org/nix/install) + +nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer +./result/bin/darwin-installer diff --git a/darwin-configuration.nix b/nix/darwin/darwin-configuration.nix similarity index 53% rename from darwin-configuration.nix rename to nix/darwin/darwin-configuration.nix index 31a3dff..07a744b 100644 --- a/darwin-configuration.nix +++ b/nix/darwin/darwin-configuration.nix @@ -8,7 +8,26 @@ # $ nix-env -qaP | grep wget environment.systemPackages = with pkgs; [ - vim + neovim + vimPlugins.nerdtree + vimPlugins.vim-nix + vimPlugins.coc-rust-analyzer + vimPlugins.coc-git + vimPlugins.coc-vimlsp + vimPlugins.coc-python + vimPlugins.coc-clangd + vimPlugins.coc-go + vimPlugins.coc-html + vimPlugins.coc-css + vimPlugins.coc-yaml + vimPlugins.coc-json + vimPlugins.coc-nvim + vimPlugins.vim-toml + vimPlugins.hoon-vim + rust-analyzer + rustc + cargo + cargo-deps # TODO find a version of the julia package that will install # on darwin and add it as an overlay python @@ -16,16 +35,16 @@ git mercurial bash - podman - curl - wget - jq - # TODO(jwall): Find a non broken sile package version and add it as an overlay - spacebar - coreutils - watch - tlaplus - #tlaplusToolbox + podman + curl + wget + jq + # TODO(jwall): Find a non broken sile package version and add it as an overlay + spacebar + coreutils + watch + vscode + iterm2 ]; # Use a custom configuration.nix location. @@ -33,14 +52,15 @@ # 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; + services.nix-daemon.enable = true; + nix.package = pkgs.nix; #services.spacebar.enable = true; #services.spacebar.package = "${pkgs.spacebar}"; # Create /etc/bashrc that loads the nix-darwin environment. - programs.bash.enable = true; # default shell on catalina + # programs.bash.enable = true; # default shell on catalina + programs.zsh.enable = true; # default shell on catalina # programs.fish.enable = true; # Used for backwards compatibility, please read the changelog before changing. diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock new file mode 100644 index 0000000..e41e75b --- /dev/null +++ b/nix/darwin/flake.lock @@ -0,0 +1,47 @@ +{ + "nodes": { + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1648278671, + "narHash": "sha256-1WrR9ex+rKTjZtODNUZQhkWYUprtfOkjOyo9YWL2NMs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4fdbb8168f61d31d3f90bb0d07f48de709c4fe79", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1650155902, + "narHash": "sha256-UFqkwGceA/CGNbWSleACF/KTTosDzk/8ESjRV3Y70S0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "03cec787b418eafe42dd061fe6d972fd97b17fb3", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "darwin": "darwin", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/darwin/flake.nix b/nix/darwin/flake.nix new file mode 100644 index 0000000..267de71 --- /dev/null +++ b/nix/darwin/flake.nix @@ -0,0 +1,21 @@ +{ + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + darwin.url = "github:lnl7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = {self, nixpkgs, darwin, ...}: + { + darwinConfigurations."jeremys-mbp" = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + ./darwin-configuration.nix + ]; + inputs = { + pkgs = nixpkgs; + }; + }; + }; +}