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

Add zsh completion options, Add base config for sops

This commit is contained in:
Stefan Ellmauthaler 2022-05-26 20:48:51 +02:00
parent 689f327894
commit 9881e6d35e
Signed by: ellmau
GPG Key ID: C804A9C1B7AF8256
6 changed files with 42 additions and 5 deletions

View File

@ -85,6 +85,7 @@
channelName = "nixpkgs"; channelName = "nixpkgs";
modules = [ modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
inputs.dwarffs.nixosModules.dwarffs inputs.dwarffs.nixosModules.dwarffs
] ++ (map (name: ./modules + "/${name}") (moduleNames ./modules)); ] ++ (map (name: ./modules + "/${name}") (moduleNames ./modules));
specialArgs = { specialArgs = {

View File

@ -20,6 +20,11 @@
enable = true; enable = true;
dpi = 180; dpi = 180;
}; };
# enable sops
sops = {
enable = true;
};
# user setup # user setup
users = { users = {

View File

@ -0,0 +1,12 @@
{ config, pkgs, lib, ... }:
with lib; {
options.elss.sops.enable = mkEnableOption "Use sops config";
config =
let
cfg = config.elss.sops;
in
mkIf cfg.enable {
sops.defaultSopsFile = ./secrets.yaml;
};
}

View File

@ -4,8 +4,9 @@ with lib; {
config = config =
let let
inherit (elss.withConfig config) mapAllUsers; inherit (elss.withConfig config) mapAllUsers;
cfg = config.elss.zsh;
in in
mkIf config.elss.zsh.enable { mkIf cfg.enable {
environment = { environment = {
shells = [ pkgs.zsh ]; shells = [ pkgs.zsh ];
pathsToLink = [ "/share/zsh/" ]; pathsToLink = [ "/share/zsh/" ];
@ -32,6 +33,28 @@ with lib; {
#styles = { cursor = "standout,underline"; }; #styles = { cursor = "standout,underline"; };
}; };
setOptions = [ "auto_pushd" "correct" "nocaseglob" "rcexpandparam" "numericglobsort" "nobeep" "appendhistory" ]; setOptions = [ "auto_pushd" "correct" "nocaseglob" "rcexpandparam" "numericglobsort" "nobeep" "appendhistory" ];
shellInit = ''
if [[ $TERM == "dumb" ]]; then
INSIDE_EMACS=1
fi;
'';
interactiveShellInit = ''
source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:descriptions' format "- %d -"
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
'';
}; };
}; };

View File

@ -1,4 +0,0 @@
{ config, pkgs, ... }:
{
sops.defaultSopsFile = ./secrets.yaml;
}