about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--flake.lock39
-rw-r--r--flake.nix5
-rw-r--r--home/default.nix1
-rw-r--r--home/rust/default.nix17
-rw-r--r--hosts/aptos/home.nix1
-rw-r--r--nix/mkSystem.nix1
6 files changed, 63 insertions, 1 deletions
diff --git a/flake.lock b/flake.lock
index e9791b2..3d07120 100644
--- a/flake.lock
+++ b/flake.lock
@@ -54,6 +54,21 @@
         "type": "github"
       }
     },
+    "flake-utils_2": {
+      "locked": {
+        "lastModified": 1656928814,
+        "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
     "futils": {
       "locked": {
         "lastModified": 1656065134,
@@ -182,7 +197,29 @@
         "nixpkgs": "nixpkgs_2",
         "nixpkgs-unstable": "nixpkgs-unstable",
         "nur": "nur",
-        "pre-commit-hooks": "pre-commit-hooks"
+        "pre-commit-hooks": "pre-commit-hooks",
+        "rust": "rust"
+      }
+    },
+    "rust": {
+      "inputs": {
+        "flake-utils": "flake-utils_2",
+        "nixpkgs": [
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1661136859,
+        "narHash": "sha256-o3y1elFGRs/9kqaIeziAnTy9lIWA6VHtQfq0ARRVO2A=",
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "rev": "6d1418192be90968acfa25e7d7b089e246eb15c4",
+        "type": "github"
+      },
+      "original": {
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "type": "github"
       }
     }
   },
diff --git a/flake.nix b/flake.nix
index d10c736..5d2d595 100644
--- a/flake.nix
+++ b/flake.nix
@@ -25,6 +25,11 @@
       inputs.nixpkgs.follows = "nixpkgs";
     };
 
+    rust = {
+      url = "github:oxalica/rust-overlay";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
+
     pre-commit-hooks = {
       type = "github";
       owner = "cachix";
diff --git a/home/default.nix b/home/default.nix
index 7972470..f7eca99 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -24,6 +24,7 @@
     ./pass
     ./pcmanfm
     ./python
+    ./rust
     ./scanner
     ./seahorse
     ./shell
diff --git a/home/rust/default.nix b/home/rust/default.nix
new file mode 100644
index 0000000..2fe5053
--- /dev/null
+++ b/home/rust/default.nix
@@ -0,0 +1,17 @@
+{ lib, config, pkgs, ... }:
+let cfg = config.my.home.rust;
+in
+{
+  options.my.home.rust = with lib; {
+    enable = mkEnableOption "rust configuration";
+  };
+
+  config = lib.mkIf cfg.enable {
+    home.packages = with pkgs; [
+      rust-bin.beta.latest.default
+      rust-analyzer
+    ];
+    home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
+    home.sessionPath = [ "$CARGO_HOME/bin" ];
+  };
+}
diff --git a/hosts/aptos/home.nix b/hosts/aptos/home.nix
index 7fedd9d..e390ac3 100644
--- a/hosts/aptos/home.nix
+++ b/hosts/aptos/home.nix
@@ -35,6 +35,7 @@
     git.enable = true;
     go.enable = true;
     python.enable = true;
+    rust.enable = true;
 
     # web
     firefox.enable = true;
diff --git a/nix/mkSystem.nix b/nix/mkSystem.nix
index a411a98..1f7ccaf 100644
--- a/nix/mkSystem.nix
+++ b/nix/mkSystem.nix
@@ -14,6 +14,7 @@ inputs.nixpkgs.lib.nixosSystem {
         overlays = [
           inputs.emacs-overlay.overlay
           inputs.nur.overlay
+          inputs.rust.overlay
           (final: prev: {
             tools = import "${self}/tools" { pkgs = prev; };
           })