1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Fix various issues

This commit is contained in:
Stefan Ellmauthaler 2022-05-24 18:48:43 +02:00
parent 0793eaa1c3
commit 2a01d89740
3 changed files with 52 additions and 36 deletions

View File

@ -44,7 +44,7 @@ with lib; {
elss = { elss = {
locale.enable = mkDefault true; locale.enable = mkDefault true;
zsh.enable = mkdDefault true; zsh.enable = mkDefault true;
}; };
boot = { boot = {

View File

@ -37,8 +37,7 @@ with lib; {
description = "Email address of the user"; description = "Email address of the user";
}; };
git = mkOption { git = mkOption {
type = types.attrsOf type = types.submodule {
(types.submodule {
options = { options = {
key = mkOption { key = mkOption {
type = types.str; type = types.str;
@ -57,7 +56,7 @@ with lib; {
description = "Whether to force signing commits or not"; description = "Whether to force signing commits or not";
}; };
}; };
}); };
}; };
}; };
}); });
@ -163,11 +162,20 @@ with lib; {
(mapUsers mkUser) (mapUsers mkUser)
]; ];
}; };
home-manager.users = mapAllUsersAndRoot (login: home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
users =
mkMerge [ mkMerge [
{ config.home.stateVersion = mkDefault "21.11"; } (mapAllUsers mkX11User)
(if homeConfigurations ? "${login}" then homeConfigurations."${login}" else { }) (mapAllUsers mkGitUser)
] (mapAllUsersAndRoot (login:
); mkMerge [
{ config.home.stateVersion = mkDefault "21.11"; }
(if homeConfigurations ? "${login}" then homeConfigurations."${login}" else { })
]))
];
};
}; };
} }

View File

@ -1,34 +1,42 @@
{ config, pkgs, lib, ...}: { config, pkgs, lib, ... }:
with lib; { with lib; {
options.elss.zsh.enable = mkEnableOption "Setup systemwide zsh"; options.elss.zsh.enable = mkEnableOption "Setup systemwide zsh";
config = { config =
environment = { let
shells = [ pkgs.zsh ]; inherit (elss.withConfig config) mapAllUsers;
pathsToLink = [ "/share/zsh/" ]; in
sessionVariables = rec { mkIf config.elss.zsh.enable {
XDG_CACHE_HOME = "\${HOME}/.cache"; environment = {
XDG_CONFIG_HOME = "\${HOME}/.config"; shells = [ pkgs.zsh ];
XDG_BIN_HOME = "\${HOME}/.local/bin"; pathsToLink = [ "/share/zsh/" ];
XDG_DATA_HOME = "\${HOME}/.local/share"; sessionVariables = rec {
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
PATH = [ PATH = [
"\${XDG_BIN_HOME}" "\${XDG_BIN_HOME}"
]; ];
};
};
programs = {
zsh = {
enable = true;
enableCompletion = true;
enableGlobalCompInit = true;
autosuggestions.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [ "main" "brackets" "root" "line" ];
#styles = { cursor = "standout,underline"; };
}; };
setOptions = [ "auto_pushd" "correct" "nocaseglob" "rcexpandparam" "numericglobsort" "nobeep" "appendhistory" ];
}; };
programs = {
zsh = {
enable = true;
enableCompletion = true;
enableGlobalCompInit = true;
autosuggestions.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [ "main" "brackets" "root" "line" ];
#styles = { cursor = "standout,underline"; };
};
setOptions = [ "auto_pushd" "correct" "nocaseglob" "rcexpandparam" "numericglobsort" "nobeep" "appendhistory" ];
};
};
users.users = mapAllUsers (_: { shell = pkgs.zsh; }
);
}; };
};
} }