From 2f90786d28115f95976adf635f2eb7877a4bc2f5 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Mon, 1 Feb 2021 19:54:45 +0300 Subject: [PATCH] Update zsh config --- machines/AMD-Workstation/default.nix | 1 + modules/devices.nix | 2 +- modules/servers/mailserver.nix | 1 + modules/workspace/zsh.nix | 17 +++++++---------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index 0e3584f..3ead021 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -17,6 +17,7 @@ bigScreen = true; ram = 32; }; + deviceSpecific.isHost = true; services.apcupsd.enable = true; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; } diff --git a/modules/devices.nix b/modules/devices.nix index 8d095b7..ba35cda 100644 --- a/modules/devices.nix +++ b/modules/devices.nix @@ -37,7 +37,7 @@ with types; { }; isHost = mkOption { type = bool; - default = with config.deviceSpecific; goodMachine; + default = false; }; bigScreen = mkOption { type = bool; diff --git a/modules/servers/mailserver.nix b/modules/servers/mailserver.nix index e6a41a7..fa4da46 100644 --- a/modules/servers/mailserver.nix +++ b/modules/servers/mailserver.nix @@ -66,6 +66,7 @@ in { dnsBlacklistOverrides = '' balsoft.ru OK 192.168.0.0/16 OK + ${lib.concatMapStringsSep "\n" (machine: "${machine}.lan OK") (builtins.attrNames inputs.self.nixosConfigurations)} ''; }; mailserver = { diff --git a/modules/workspace/zsh.nix b/modules/workspace/zsh.nix index 99eeb92..2529131 100755 --- a/modules/workspace/zsh.nix +++ b/modules/workspace/zsh.nix @@ -11,6 +11,7 @@ theme = "agnoster"; plugins = [ "git" "dirhistory" ]; }; + history = rec { size = 1000000; save = size; @@ -48,20 +49,17 @@ shellAliases = { "b" = ''nix-build "" --no-out-link -A''; "p" = "nix-shell --run zsh -p"; + "s" = "nix shell"; + "ss" = "nix shell self#"; + "d" = "nix develop"; + "ds" = "nix develop self#"; + "e" = "nix edit self#"; "o" = "xdg-open"; "post" = ''curl -F"file=@-" https://0x0.st''; "cat" = "${pkgs.bat}/bin/bat"; }; initExtra = '' - r(){nix run nixpkgs.$1 -c $@ } cmdignore=(htop tmux top vim) - function active_window_id () { - if [[ -n $DISPLAY ]] ; then - ${pkgs.xorg.xprop}/bin/xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}' - return - fi - echo nowindowid - } # end and compare timer, notify-send if needed function notifyosd-precmd() { @@ -75,7 +73,7 @@ else cmdstat="✘" fi - if [ ! -z "$cmd" -a ! $term_window = $(active_window_id) ]; then + if [ ! -z "$cmd" ]; then ${pkgs.libnotify}/bin/notify-send -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`" fi unset cmd @@ -87,7 +85,6 @@ # get command name and start the timer function notifyosd-preexec() { cmd=$1 - term_window=$(active_window_id) cmd_start=`date +%s` }