From 3dc52d2bca9107f248ab2403bc6040db64117673 Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:03:23 -0500 Subject: [PATCH] Refactor flake.nix / Remove extraSpecialArgs --- flake.nix | 51 +++++++++++++++++++++++---------------------------- home.nix | 9 ++------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/flake.nix b/flake.nix index 382ec05..fac7557 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,6 @@ inputs = { devenv.url = "github:cachix/devenv"; - # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -12,35 +11,31 @@ }; outputs = { devenv, nixpkgs, home-manager, vim-plugins, ... }: { - homeConfigurations = { - runner = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. - modules = [ ./runner.nix ]; - - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - extraSpecialArgs = { - devenv = devenv.packages.x86_64-linux.default; - vim-plugins-overlay = vim-plugins.overlays.x86_64-linux.default; + homeConfigurations = + let + mkHomeManagerConfig = { system, modules }: + home-manager.lib.homeManagerConfiguration { + inherit modules; + pkgs = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + devenv = devenv.packages.${system}.default; + }) + vim-plugins.overlays.${system}.default + ]; + }; + }; + in + { + runner = mkHomeManagerConfig { + system = "x86_64-linux"; + modules = [ ./runner.nix ]; }; - }; - sestrella = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.aarch64-darwin; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. - modules = [ ./sestrella.nix ]; - - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - extraSpecialArgs = { - devenv = devenv.packages.aarch64-darwin.default; - vim-plugins-overlay = vim-plugins.overlays.aarch64-darwin.default; + sestrella = mkHomeManagerConfig { + system = "aarch64-darwin"; + modules = [ ./sestrella.nix ]; }; }; - }; }; } diff --git a/home.nix b/home.nix index 849933f..8f2ddd4 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, devenv, vim-plugins-overlay, ... }: +{ config, pkgs, ... }: { # This value determines the Home Manager release that your configuration is @@ -21,12 +21,12 @@ # https://github.com/unpluggedcoder/awesome-rust-tools home.packages = [ - devenv pkgs.aws-vault pkgs.awscli2 pkgs.bottom pkgs.btop pkgs.cachix + pkgs.devenv pkgs.jq pkgs.nix-prefetch pkgs.nix-prefetch-git @@ -75,10 +75,5 @@ programs.starship.enable = true; - # nixpkgs.overlays = [ - # vim-plugins-overlays.default - # ]; programs.home-manager.enable = true; - - nixpkgs.overlays = [ vim-plugins-overlay ]; }