Skip to content

Commit

Permalink
Refactor flake.nix / Remove extraSpecialArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Nov 29, 2023
1 parent d58bb01 commit 3dc52d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 35 deletions.
51 changes: 23 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 ];
};
};
};
};
}
9 changes: 2 additions & 7 deletions home.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, devenv, vim-plugins-overlay, ... }:
{ config, pkgs, ... }:

{
# This value determines the Home Manager release that your configuration is
Expand All @@ -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
Expand Down Expand Up @@ -75,10 +75,5 @@

programs.starship.enable = true;

# nixpkgs.overlays = [
# vim-plugins-overlays.default
# ];
programs.home-manager.enable = true;

nixpkgs.overlays = [ vim-plugins-overlay ];
}

0 comments on commit 3dc52d2

Please sign in to comment.