Fix aliases, nh, etc
This commit is contained in:
parent
471dfd605e
commit
660149f46b
16 changed files with 81 additions and 60 deletions
5
modules/common/bat.nix
Normal file
5
modules/common/bat.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {environment.shellAliases.cat = "${lib.getExe pkgs.bat} --theme Nord";}
|
|
@ -1 +1 @@
|
|||
{nix.settings.experimental-features = ["nix-command" "flakes"];}
|
||||
{nix.settings.experimental-features = ["nix-command" "flakes" "repl-flake"];}
|
||||
|
|
5
modules/common/eza.nix
Normal file
5
modules/common/eza.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {environment.shellAliases.ls = "${lib.getExe pkgs.eza} --all --icons --hyperlink --group-directories-first --color=always";}
|
|
@ -7,30 +7,6 @@
|
|||
'';
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = [pkgs.fish];
|
||||
shellAliases = {
|
||||
# Utility
|
||||
ls = "eza";
|
||||
cat = "bat";
|
||||
rm = "gio trash";
|
||||
free = "free -h";
|
||||
neofetch = "neowofetch";
|
||||
shutdown = "shutdown now";
|
||||
|
||||
# Git
|
||||
clone = "gh repo clone";
|
||||
create = "gh repo create";
|
||||
|
||||
push = "git push";
|
||||
commit = "git commit -am";
|
||||
|
||||
# NixOS
|
||||
clean = "nh clean all";
|
||||
rebuild = "nh os switch";
|
||||
rebuildServer = "nixos-rebuild switch --flake ~/.config/nixos#quadraticserver --target-host quadradical@192.168.0.132 --use-remote-sudo";
|
||||
update = "pushd ~/.config/nixos && nix flake update && popd && rebuild";
|
||||
};
|
||||
};
|
||||
environment.shells = [pkgs.fish];
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
}
|
||||
|
|
1
modules/common/free.nix
Normal file
1
modules/common/free.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{pkgs, ...}: {environment.shellAliases.free = "${pkgs.procps}/bin/free -h";}
|
|
@ -1,4 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config = {
|
||||
|
@ -17,5 +21,17 @@
|
|||
gpg.format = "ssh";
|
||||
};
|
||||
};
|
||||
environment.systemPackages = [pkgs.gh];
|
||||
environment = {
|
||||
systemPackages = [pkgs.gh];
|
||||
shellAliases = let
|
||||
gitExe = lib.meta.getExe pkgs.git;
|
||||
ghExe = lib.meta.getExe pkgs.gh;
|
||||
in {
|
||||
clone = "${ghExe} repo clone";
|
||||
create = "${ghExe} repo create";
|
||||
|
||||
push = "${gitExe} push";
|
||||
commit = "${gitExe} commit -am";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
3
modules/common/neowofetch/default.nix
Normal file
3
modules/common/neowofetch/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
environment.shellAliases.neofetch = "${pkgs.hyfetch}/bin/neowofetch --config ${./neofetch.conf}";
|
||||
}
|
56
modules/common/neowofetch/neofetch.conf
Normal file
56
modules/common/neowofetch/neofetch.conf
Normal file
|
@ -0,0 +1,56 @@
|
|||
print_info() {
|
||||
prin " ${cl7}┌─────────${cl0}\n Hardware Information \n${cl7}──────────"
|
||||
info "├" cpu
|
||||
info "├─" gpu
|
||||
info "├" memory
|
||||
prin " ${cl7}├─────────${cl0}\n Software Information \n${cl7}──────────"
|
||||
info "├" distro
|
||||
info "├" kernel
|
||||
info "├" de
|
||||
info "├" shell
|
||||
info "├" term
|
||||
info "├" theme
|
||||
info "├" packages
|
||||
prin " ${cl7}└────────────────────────────────────────"
|
||||
prin "\n \n \n \n \n ${cl3} \n \n ${cl5} \n \n ${cl2} \n \n ${cl6} \n \n ${cl4} \n \n ${cl1} \n \n ${cl7} \n \n ${cl0}"
|
||||
}
|
||||
|
||||
magenta="\033[1;35m"
|
||||
green="\033[1;32m"
|
||||
white="\033[1;37m"
|
||||
blue="\033[1;34m"
|
||||
red="\033[1;31m"
|
||||
black="\033[1;40;30m"
|
||||
yellow="\033[1;33m"
|
||||
cyan="\033[1;36m"
|
||||
reset="\033[0m"
|
||||
bgyellow="\033[1;43;33m"
|
||||
bgwhite="\033[1;47;37m"
|
||||
cl0="${reset}"
|
||||
cl1="${magenta}"
|
||||
cl2="${green}"
|
||||
cl3="${white}"
|
||||
cl4="${blue}"
|
||||
cl5="${red}"
|
||||
cl6="${yellow}"
|
||||
cl7="${cyan}"
|
||||
cl8="${black}"
|
||||
cl9="${bgyellow}"
|
||||
cl10="${bgwhite}"
|
||||
color_blocks="off"
|
||||
os_arch="off"
|
||||
memory_percent="on"
|
||||
package_managers="on"
|
||||
shell_version="off"
|
||||
speed_shorthand="on"
|
||||
cpu_brand="on"
|
||||
cpu_speed="off"
|
||||
cpu_cores="off"
|
||||
gtk_shorthand="on"
|
||||
de_version="off"
|
||||
separator=""
|
||||
memory_display="on"
|
||||
disk_display="on"
|
||||
colors=(0 0 0 6 6 7)
|
||||
ascii_colors=(6 6 6 6 6 6)
|
||||
image_size="250px"
|
|
@ -1,7 +1,23 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
pkg = inputs.nh.packages.${pkgs.system}.default;
|
||||
exe = lib.getExe pkg;
|
||||
in {
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
package = pkg;
|
||||
clean.enable = true;
|
||||
flake = "/home/quadradical/.config/nixos";
|
||||
};
|
||||
|
||||
environment.shellAliases = {
|
||||
clean = "${exe} clean all";
|
||||
update = "pushd ~/.config/nixos && nix flake update && popd && rebuild";
|
||||
rebuild = "${exe} os switch";
|
||||
rebuildServer = "${exe} os switch --hostname quadraticserver --target-host 192.168.0.132";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = [(pkgs.writeShellScriptBin "sudo" "run0 $@")];
|
||||
security = {
|
||||
sudo.enable = false;
|
||||
pam.services.systemd-run0 = {};
|
||||
};
|
||||
# environment.systemPackages = [(pkgs.writeShellScriptBin "sudo" "run0 $@")];
|
||||
# security = {
|
||||
# sudo.enable = false;
|
||||
# pam.services.systemd-run0 = {};
|
||||
# };
|
||||
}
|
||||
|
|
1
modules/common/trash.nix
Normal file
1
modules/common/trash.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{pkgs, ...}: {environment.shellAliases.rm = "${pkgs.glib}/bin/gio trash";}
|
Loading…
Add table
Add a link
Reference in a new issue