From ce81e666522cec16117bb44ae8e74f0dabe67056 Mon Sep 17 00:00:00 2001 From: Laurent Gueret Date: Tue, 17 Feb 2026 15:22:31 +0100 Subject: [PATCH] Add env file --- flake.lock | 23 ++++++++++++++++- flake.nix | 20 ++++++++------- hosts/darwin/home/alistreaza.nix | 1 + hosts/nixos/home/users/alistreaza.nix | 4 +-- modules/home/darwin/env/jdk.nix | 23 +++++++++++++++++ .../shell.nix => darwin/env/python.nix} | 9 ++++--- modules/home/darwin/env/rust.nix | 25 +++++++++++++++++++ overlays/darwin/rust.nix | 6 +++++ 8 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 modules/home/darwin/env/jdk.nix rename modules/home/{common/shell.nix => darwin/env/python.nix} (50%) create mode 100644 modules/home/darwin/env/rust.nix create mode 100644 overlays/darwin/rust.nix diff --git a/flake.lock b/flake.lock index 4f6372a..5547996 100644 --- a/flake.lock +++ b/flake.lock @@ -199,7 +199,28 @@ "nix-darwin": "nix-darwin", "nix-homebrew": "nix-homebrew", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771297684, + "narHash": "sha256-wieWskQxZLPlNXX06JEB0bMoS/ZYQ89xBzF0RL9lyLs=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "755d3669699a7c62aef35af187d75dc2728cfd85", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index cf23241..aaa6626 100755 --- a/flake.nix +++ b/flake.nix @@ -19,14 +19,14 @@ # Nix Homebrew nix-homebrew.url = "github:zhaofengli/nix-homebrew"; - homebrew-core = { - url = "github:homebrew/homebrew-core"; - flake = false; - }; - homebrew-cask = { - url = "github:homebrew/homebrew-cask"; - flake = false; - }; + homebrew-core.url = "github:homebrew/homebrew-core"; + homebrew-core.flake = false; + homebrew-cask.url = "github:homebrew/homebrew-cask"; + homebrew-cask.flake = false; + + # Rust Overlay + rust-overlay.url = "github:oxalica/rust-overlay"; + rust-overlay.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = @@ -38,6 +38,7 @@ import-tree, home-manager, nix-homebrew, + rust-overlay, homebrew-core, homebrew-cask, nixpkgs-unstable, @@ -68,7 +69,7 @@ (import-tree ./hosts/nixos/system) ] ++ [ - ./hosts/nixos/overlays.nix + (import-tree ./overlays/nixos) home-manager.nixosModules.home-manager (import-tree ./hosts/common) @@ -81,6 +82,7 @@ specialArgs = { self = self; import-tree = import-tree; + rust-overlay = rust-overlay; home-manager = home-manager; homebrew-core = homebrew-core; homebrew-cask = homebrew-cask; diff --git a/hosts/darwin/home/alistreaza.nix b/hosts/darwin/home/alistreaza.nix index 4a78f3e..9963e1c 100644 --- a/hosts/darwin/home/alistreaza.nix +++ b/hosts/darwin/home/alistreaza.nix @@ -19,6 +19,7 @@ # Nix & languages env deps home.env.nix.enable = true; + home.env.rust.enable = true; # No Home Application Folders targets.darwin.linkApps.enable = false; diff --git a/hosts/nixos/home/users/alistreaza.nix b/hosts/nixos/home/users/alistreaza.nix index 273b8f2..059d853 100644 --- a/hosts/nixos/home/users/alistreaza.nix +++ b/hosts/nixos/home/users/alistreaza.nix @@ -13,13 +13,11 @@ }; # Shell apps + home.shell.nh.enable = true; home.shell.zsh.enable = true; home.shell.git.enable = true; home.shell.neovim.enable = true; - home.shell.nh.enable = true; - home.shell.env.enable = true; - # Code editor home.ide.zed.enable = true; diff --git a/modules/home/darwin/env/jdk.nix b/modules/home/darwin/env/jdk.nix new file mode 100644 index 0000000..3b18cf7 --- /dev/null +++ b/modules/home/darwin/env/jdk.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; +let + cfg = config.home.env.jdk; +in +{ + options.home.env.jdk = { + enable = mkEnableOption "System nh service"; + }; + config = mkIf cfg.enable { + + home.packages = with pkgs; [ + jdk25_headless + maven + ]; + + }; +} diff --git a/modules/home/common/shell.nix b/modules/home/darwin/env/python.nix similarity index 50% rename from modules/home/common/shell.nix rename to modules/home/darwin/env/python.nix index cadc426..d8ec70c 100644 --- a/modules/home/common/shell.nix +++ b/modules/home/darwin/env/python.nix @@ -6,16 +6,17 @@ }: with lib; let - cfg = config.home.env.shell; + cfg = config.home.env.python; in { - options.home.env.shell = { - enable = mkEnableOption "Zen Editor options"; + options.home.env.python = { + enable = mkEnableOption "System nh service"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ - devenv + python315 + uv ]; }; diff --git a/modules/home/darwin/env/rust.nix b/modules/home/darwin/env/rust.nix new file mode 100644 index 0000000..ef61b7b --- /dev/null +++ b/modules/home/darwin/env/rust.nix @@ -0,0 +1,25 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; +let + cfg = config.home.env.rust; +in +{ + options.home.env.rust = { + enable = mkEnableOption "System nh service"; + }; + config = mkIf cfg.enable { + + home.packages = with pkgs; [ + rust-bin.stable.latest.default.override + { + extensions = [ "rust-src" ]; + } + ]; + + }; +} diff --git a/overlays/darwin/rust.nix b/overlays/darwin/rust.nix new file mode 100644 index 0000000..918f8fc --- /dev/null +++ b/overlays/darwin/rust.nix @@ -0,0 +1,6 @@ +{ rust-overlay, ... }: +{ + nixpkgs.overlays = [ + rust-overlay.overlays.default + ]; +}