refactor(nixos): use Home Manager session variables #127
@@ -9,10 +9,6 @@ let
|
|||||||
cfg = config.modules.shell.fish; # NOLINT(let_order)
|
cfg = config.modules.shell.fish; # NOLINT(let_order)
|
||||||
commandsOf = shortcuts: lib.mapAttrs (_name: shortcut: shortcut.command) shortcuts;
|
commandsOf = shortcuts: lib.mapAttrs (_name: shortcut: shortcut.command) shortcuts;
|
||||||
shortcuts = lib.attrByPath [ config.networking.hostName ] { } config.registry.shell-shortcut;
|
shortcuts = lib.attrByPath [ config.networking.hostName ] { } config.registry.shell-shortcut;
|
||||||
exportEnvVar = name: value: ''
|
|
||||||
set -gx ${name} ${lib.escapeShellArg value}
|
|
||||||
'';
|
|
||||||
envVars = lib.attrByPath [ config.networking.hostName ] { } config.registry.env-var;
|
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -106,9 +102,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Rendered by home-manager into ~/.config/fish/config.fish.
|
# Rendered by home-manager into ~/.config/fish/config.fish.
|
||||||
interactiveShellInit = lib.concatStringsSep "\n" (
|
interactiveShellInit = builtins.readFile ./config.fish;
|
||||||
(lib.mapAttrsToList exportEnvVar envVars) ++ [ (builtins.readFile ./config.fish) ]
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ in
|
|||||||
lib.mkEnableOption "Python tools for the primary user's shell environment";
|
lib.mkEnableOption "Python tools for the primary user's shell environment";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
registry.env-var.${config.networking.hostName}.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}";
|
home-manager.users.${user}.home = {
|
||||||
|
sessionVariables.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}";
|
||||||
home-manager.users.${user}.home.packages = [ pkgs.python3 ];
|
packages = [ pkgs.python3 ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ in
|
|||||||
lib.mkEnableOption "Rust tools for the primary user's shell environment";
|
lib.mkEnableOption "Rust tools for the primary user's shell environment";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
registry.env-var.${config.networking.hostName}.RUST_TOOLCHAIN_ROOT = "${toolchain}";
|
|
||||||
|
|
||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
|
home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}";
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
toolchain
|
toolchain
|
||||||
pkgs.rust-analyzer
|
pkgs.rust-analyzer
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
type = lib.types.str;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user