Better neovim and rust configuration

This commit is contained in:
Jeremy Wall 2022-04-17 17:11:03 -04:00
parent 8e5ac5bd2f
commit 0189f517b7
3 changed files with 80 additions and 31 deletions

View File

@ -14,6 +14,7 @@
vimAlias = true; vimAlias = true;
}; };
}) })
inputs.rust-overlay
]; ];
environment.variables = { environment.variables = {
@ -21,15 +22,25 @@
PAGER="less -R"; PAGER="less -R";
}; };
# TODO(jwall): We need to do this some other way.
programs = with pkgs; { programs = with pkgs; {
neovim.enable = true; neovim.enable = true;
neovim.configure = { neovim.configure = {
customRC = ''
set noswapfile
set ts=4
set expandtab
set autoindent
'';
packages.myVimPackage = with pkgs.vimPlugins; { packages.myVimPackage = with pkgs.vimPlugins; {
start = [ start = [
coc-nvim
nerdtree nerdtree
vim-nix vim-nix
coc-rust-analyzer coc-rust-analyzer
coc-diagnostic
coc-markdownlint
coc-tslint
coc-explorer
coc-git coc-git
coc-vimlsp coc-vimlsp
coc-python coc-python
@ -39,7 +50,6 @@
coc-css coc-css
coc-yaml coc-yaml
coc-json coc-json
coc-nvim
vim-toml vim-toml
hoon-vim hoon-vim
]; ];
@ -52,18 +62,11 @@
# $ nix-env -qaP | grep wget # $ nix-env -qaP | grep wget
environment.systemPackages = environment.systemPackages =
with pkgs; [ with pkgs; [
nodejs
tmux tmux
inputs.runwhen inputs.runwhen
inputs.durnitisp
gnumake 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 # TODO find a version of the julia package that will install
# on darwin and add it as an overlay # on darwin and add it as an overlay
python python
@ -71,8 +74,7 @@
git git
mercurial mercurial
bash bash
podman # inputs.buildah
qemu
curl curl
wget wget
jq jq
@ -80,8 +82,8 @@
spacebar spacebar
coreutils coreutils
watch watch
vscode
iterm2 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 # TODO add sonic-pi here if it supports the arch
]; ];

39
nix/darwin/flake.lock generated
View File

@ -117,6 +117,21 @@
"type": "github" "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": { "naersk": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
@ -216,7 +231,8 @@
"darwin": "darwin", "darwin": "darwin",
"durnitisp": "durnitisp", "durnitisp": "durnitisp",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"runwhen": "runwhen" "runwhen": "runwhen",
"rust-overlay": "rust-overlay_2"
} }
}, },
"runwhen": { "runwhen": {
@ -262,6 +278,27 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "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", "root": "root",

View File

@ -7,18 +7,28 @@
darwin.inputs.nixpkgs.follows = "nixpkgs"; darwin.inputs.nixpkgs.follows = "nixpkgs";
runwhen.url = "github:zaphar/runwhen"; runwhen.url = "github:zaphar/runwhen";
durnitisp.url = "github:zaphar/durnitisp"; 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 { darwinConfigurations."jeremys-mbp" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin"; inherit system;
modules = [ modules = [
./darwin-configuration.nix ./darwin-configuration.nix
]; ];
inputs = { inputs = {
runwhen = runwhen.defaultPackage."${system}"; runwhen = runwhen.defaultPackage."${system}";
durnitisp = durnitisp.defaultPackage."${system}"; durnitisp = durnitisp.defaultPackage."${system}";
rust-overlay = rust-overlay.overlay;
buildah = pkgs.buildah;
}; };
}; };
}; };