From b8c7f28ecb3f2ca017823092a5dadd98fcef97e2 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 26 Mar 2023 22:07:46 +0200 Subject: [PATCH] Add zsh module And move script to alias --- nixos/apply-system.sh | 4 -- nixos/apply-users.sh | 5 -- nixos/modules/shells/zsh/default.nix | 70 ++++++++++++++++++++++++++++ nixos/update.sh | 4 -- 4 files changed, 70 insertions(+), 13 deletions(-) delete mode 100755 nixos/apply-system.sh delete mode 100755 nixos/apply-users.sh create mode 100644 nixos/modules/shells/zsh/default.nix delete mode 100755 nixos/update.sh diff --git a/nixos/apply-system.sh b/nixos/apply-system.sh deleted file mode 100755 index eb46d83..0000000 --- a/nixos/apply-system.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -pushd ~/projects/sisyphus/nixos -sudo nixos-rebuild switch --flake .# --show-trace -popd diff --git a/nixos/apply-users.sh b/nixos/apply-users.sh deleted file mode 100755 index 5a37b49..0000000 --- a/nixos/apply-users.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -pushd ~/projects/sisyphus/nixos -nix build .#homeManagerConfigurations.tdpeuter.activationPackage -./result/activate -popd diff --git a/nixos/modules/shells/zsh/default.nix b/nixos/modules/shells/zsh/default.nix new file mode 100644 index 0000000..9615374 --- /dev/null +++ b/nixos/modules/shells/zsh/default.nix @@ -0,0 +1,70 @@ +{ config, lib, pkgs, ... }: + +{ + home = { + packages = with pkgs; [ + font-awesome + ]; + + file = { + ".oh-my-zsh".source = ../../../../stow/zsh/.oh-my-zsh; + }; + }; + + programs.zsh = { + enable = true; + enableSyntaxHighlighting = true; + history = { + expireDuplicatesFirst = true; + extended = true; + }; + initExtra = '' + eval "$(direnv hook zsh)" + ''; + oh-my-zsh = { + enable = true; + custom = "$HOME/.oh-my-zsh"; + plugins = [ + "dirhistory" + "git" + "screen" + ]; + theme = "mrfortem"; + }; + plugins = [ + { + name = "cmdtime"; + src = pkgs.fetchFromGitHub { + owner = "tom-auger"; + repo = "cmdtime"; + rev = "ffc72641dcfa0ee6666ceb1dc712b61be30a1e8b"; + hash = "sha256-v6wCfNoPXDD3sS6yUYE6lre8Ir1yJcLGoAW3O8sUOCg="; + }; + } + ]; + shellAliases = { + cp = "cp -i"; # Confirm before overwriting something + df = "df -h"; + free = "free -m"; + np = "nano -w PKGBUILD"; + more = "less"; + hgrep = "history | grep"; + + gs = "git status"; + + update = '' + pushd ~/projects/sisyphus/nixos + nix flake update + sudo nixos-rebuild switch --flake .# --show-trace + popd + ''; + uu = "update-user"; + update-user = '' + pushd ~/projects/sisyphus/nixos + nix build .#homeManagerConfigurations.tdpeuter.activationPackage + ./result/activate + popd + ''; + }; + }; +} diff --git a/nixos/update.sh b/nixos/update.sh deleted file mode 100755 index 7efc587..0000000 --- a/nixos/update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -pushd ~/projects/sisyphus/nixos/ -nix flake update -popd