about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-01-11 18:35:35 +0900
committersefidel <contact@sefidel.net>2022-01-11 18:35:35 +0900
commit4b38b0cba0f22b1e82908b57d30db61e10cc9c5d (patch)
tree2a414ba0938bbbfa30e3ffbd05f7e7145c75134a
parent2c6fe86cc5f17072bbf5437507ded970cfdd69b1 (diff)
downloadnixrc-4b38b0cba0f22b1e82908b57d30db61e10cc9c5d.tar.gz
nixrc-4b38b0cba0f22b1e82908b57d30db61e10cc9c5d.zip
home/development: add rust nightly
-rw-r--r--flake.lock37
-rw-r--r--flake.nix3
-rw-r--r--home/modules/profiles/development/default.nix5
-rw-r--r--packages/default.nix5
4 files changed, 48 insertions, 2 deletions
diff --git a/flake.lock b/flake.lock
index 4b5c736..924b2fc 100644
--- a/flake.lock
+++ b/flake.lock
@@ -46,6 +46,21 @@
         "type": "github"
       }
     },
+    "flake-utils_3": {
+      "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"
+      }
+    },
     "home-manager": {
       "inputs": {
         "nixpkgs": [
@@ -169,10 +184,32 @@
         "nixpkgs": "nixpkgs",
         "nixpkgs-extra": "nixpkgs-extra",
         "phocus": "phocus",
+        "rust-overlay": "rust-overlay",
         "sops-nix": "sops-nix",
         "wallpapers": "wallpapers"
       }
     },
+    "rust-overlay": {
+      "inputs": {
+        "flake-utils": "flake-utils_3",
+        "nixpkgs": [
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1641868896,
+        "narHash": "sha256-R2hG3EqLSASjdzJlhn1leRmBwmatrzIyKXRaBfwbAPg=",
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "rev": "84c58400556c1c5fa796cbc3215ba5bbd3bd848f",
+        "type": "github"
+      },
+      "original": {
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "type": "github"
+      }
+    },
     "sops-nix": {
       "inputs": {
         "nixpkgs": [
diff --git a/flake.nix b/flake.nix
index 217cbd8..eecd9ee 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,6 +16,9 @@
     neovim.url = "github:neovim/neovim?dir=contrib";
     neovim.inputs.nixpkgs.follows = "nixpkgs";
 
+    rust-overlay.url = "github:oxalica/rust-overlay";
+    rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
+
     # https://github.com/NixOS/nix/pull/5342
     nixpkgs-extra.url = "git+https://git.sr.ht/~boppy/nixpkgs-extra?ref=main";
     nixpkgs-extra.inputs.nixpkgs.follows = "nixpkgs";
diff --git a/home/modules/profiles/development/default.nix b/home/modules/profiles/development/default.nix
index 13e93f7..8060635 100644
--- a/home/modules/profiles/development/default.nix
+++ b/home/modules/profiles/development/default.nix
@@ -1,7 +1,9 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, self, ... }:
 
 let
   cfg = config.profiles.development;
+
+  inherit (self.packages.x86_64-linux) rust-nightly;
 in
 {
   options.profiles.development = {
@@ -70,6 +72,7 @@ in
       pkgs.foot.terminfo
       pkgs.ripgrep
       pkgs.rust-analyzer
+      rust-nightly
       pkgs.tig
       pkgs.silver-searcher
     ];
diff --git a/packages/default.nix b/packages/default.nix
index 134e685..1702c35 100644
--- a/packages/default.nix
+++ b/packages/default.nix
@@ -1,10 +1,13 @@
-{ self, neovim, ... } @ inputs:
+{ self, neovim, rust-overlay, ... } @ inputs:
 let
   pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
   extra = inputs.nixpkgs-extra.packages.x86_64-linux;
+
+  rustPkgs = import inputs.nixpkgs { system = "x86_64-linux"; overlays = [ rust-overlay.overlay ]; };
 in
 {
   "neovim" = neovim.packages.x86_64-linux.neovim;
   "iosevka-pure-bin" = extra.iosevka-pure-bin;
   "phocus" = pkgs.callPackage ./phocus { src = inputs.phocus; };
+  "rust-nightly" = rustPkgs.rust-bin.nightly.latest.default.override { extensions = [ "rust-src"]; };
 }