Move xonsh customization to an overlay

This commit is contained in:
2022-05-17 10:49:11 -07:00
parent 0aba1a4fb2
commit 0a0887680d
2 changed files with 51 additions and 20 deletions

View File

@@ -1,29 +1,14 @@
{ config, pkgs, ... }: let
# Mach-nix is a toolkit for constructing custom Python environments
mach-nix = import (builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix/";
ref = "refs/tags/3.3.0";
}) {
pkgs = pkgs;
};
xonsh_pyenv = mach-nix.mkPython {
requirements = ''
xontrib-fzf-widgets
xonsh-direnv
'';
};
xonsh_with_plugins = pkgs.xonsh.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ xonsh_pyenv.python.pkgs.selectPkgs xonsh_pyenv.python.pkgs;
});
in
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "ttm";
home.homeDirectory = builtins.getEnv "HOME";
nixpkgs.overlays = [
(import ./overlays/xonsh.nix)
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
@@ -39,7 +24,9 @@ in
# Enable integration with generic Linux OSs
targets.genericLinux.enable = pkgs.stdenv.isLinux;
home.packages = with pkgs; [
# Defined in Xonsh overlay
xonsh_with_plugins
# Jump to directories
zoxide