From 0189f517b77ebb1f30b4df066de10796c5457f13 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sun, 17 Apr 2022 17:11:03 -0400 Subject: [PATCH] Better neovim and rust configuration --- nix/darwin/darwin-configuration.nix | 54 +++++++++++++++-------------- nix/darwin/flake.lock | 39 ++++++++++++++++++++- nix/darwin/flake.nix | 18 +++++++--- 3 files changed, 80 insertions(+), 31 deletions(-) diff --git a/nix/darwin/darwin-configuration.nix b/nix/darwin/darwin-configuration.nix index 8ad89d3..1e5e0f3 100644 --- a/nix/darwin/darwin-configuration.nix +++ b/nix/darwin/darwin-configuration.nix @@ -14,6 +14,7 @@ vimAlias = true; }; }) + inputs.rust-overlay ]; environment.variables = { @@ -21,15 +22,25 @@ PAGER="less -R"; }; - # TODO(jwall): We need to do this some other way. programs = with pkgs; { neovim.enable = true; neovim.configure = { + customRC = '' + set noswapfile + set ts=4 + set expandtab + set autoindent + ''; packages.myVimPackage = with pkgs.vimPlugins; { start = [ + coc-nvim nerdtree vim-nix coc-rust-analyzer + coc-diagnostic + coc-markdownlint + coc-tslint + coc-explorer coc-git coc-vimlsp coc-python @@ -39,7 +50,6 @@ coc-css coc-yaml coc-json - coc-nvim vim-toml hoon-vim ]; @@ -52,37 +62,29 @@ # $ nix-env -qaP | grep wget environment.systemPackages = with pkgs; [ + nodejs tmux - inputs.runwhen + inputs.runwhen + inputs.durnitisp gnumake - clang - clang-tools - lld - libiconv # this is frequently needed when compiling something - rustup - 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 + # TODO find a version of the julia package that will install + # on darwin and add it as an overlay python emacs git mercurial bash - podman - qemu - curl - wget - jq - # TODO(jwall): Find a non broken sile package version and add it as an overlay - spacebar - coreutils - watch - vscode - iterm2 - # TODO add sonic-pi here if it supports the arch + # inputs.buildah + curl + wget + jq + # TODO(jwall): Find a non broken sile package version and add it as an overlay + spacebar + coreutils + watch + iterm2 + # sile # this is currently broken on darwin: https://github.com/NixOS/nixpkgs/issues/23018 + # TODO add sonic-pi here if it supports the arch ]; # Use a custom configuration.nix location. diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock index cfbb76d..30d784a 100644 --- a/nix/darwin/flake.lock +++ b/nix/darwin/flake.lock @@ -117,6 +117,21 @@ "type": "github" } }, + "flake-utils_4": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": "nixpkgs" @@ -216,7 +231,8 @@ "darwin": "darwin", "durnitisp": "durnitisp", "nixpkgs": "nixpkgs_2", - "runwhen": "runwhen" + "runwhen": "runwhen", + "rust-overlay": "rust-overlay_2" } }, "runwhen": { @@ -262,6 +278,27 @@ "repo": "rust-overlay", "type": "github" } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1650162887, + "narHash": "sha256-e23LlN7NQGxrsSWNNAjyvrWlZ3kwFSav9kXbayibKWc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "26b570500cdd7a359526524e9abad341891122a6", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } } }, "root": "root", diff --git a/nix/darwin/flake.nix b/nix/darwin/flake.nix index ca37c52..415c084 100644 --- a/nix/darwin/flake.nix +++ b/nix/darwin/flake.nix @@ -7,18 +7,28 @@ darwin.inputs.nixpkgs.follows = "nixpkgs"; runwhen.url = "github:zaphar/runwhen"; durnitisp.url = "github:zaphar/durnitisp"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = {self, nixpkgs, darwin, runwhen, durnitisp, ...}: + outputs = {self, nixpkgs, darwin, runwhen, durnitisp, rust-overlay, ...}: + let + system = "aarch64-darwin"; + pkgs = import nixpkgs { inherit system; }; + in { darwinConfigurations."jeremys-mbp" = darwin.lib.darwinSystem rec { - system = "aarch64-darwin"; + inherit system; modules = [ ./darwin-configuration.nix ]; inputs = { - runwhen = runwhen.defaultPackage."${system}"; - durnitisp = durnitisp.defaultPackage."${system}"; + runwhen = runwhen.defaultPackage."${system}"; + durnitisp = durnitisp.defaultPackage."${system}"; + rust-overlay = rust-overlay.overlay; + buildah = pkgs.buildah; }; }; };