1
0
mirror of https://github.com/kmein/niveum synced 2026-03-30 01:01:10 +02:00

4 Commits

6 changed files with 100 additions and 43 deletions

View File

@@ -1,8 +1,12 @@
{ {
pkgs, pkgs,
niveumPackages, niveumPackages,
lib,
system ? null,
... ...
}: { }: let
darwin = lib.strings.hasSuffix "-darwin" system;
in {
environment.systemPackages = [ environment.systemPackages = [
pkgs.htop pkgs.htop
pkgs.w3m pkgs.w3m
@@ -13,10 +17,8 @@
pkgs.p7zip pkgs.p7zip
pkgs.zip pkgs.zip
# MONITORS # MONITORS
pkgs.iotop # I/O load monitor
pkgs.iftop # interface bandwidth monitor pkgs.iftop # interface bandwidth monitor
pkgs.lsof # list open files pkgs.lsof # list open files
pkgs.psmisc # for killall, pstree
# SHELL # SHELL
pkgs.sqlite pkgs.sqlite
pkgs.fd # better find pkgs.fd # better find
@@ -41,9 +43,12 @@
niveumPackages.untilport niveumPackages.untilport
niveumPackages.kpaste niveumPackages.kpaste
# HARDWARE # HARDWARE
pkgs.usbutils # for lsusb
pkgs.pciutils # for lspci pkgs.pciutils # for lspci
] ++ lib.optionals (!darwin) [
pkgs.usbutils # for lsusb
pkgs.lshw # for lshw pkgs.lshw # for lshw
pkgs.iotop # I/O load monitor
pkgs.psmisc # for killall, pstree
]; ];
environment.shellAliases = let environment.shellAliases = let
@@ -61,30 +66,30 @@
readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname
''; '';
in { in {
"ß" = "${pkgs.util-linux}/bin/setsid";
nixi = "nix repl '<nixpkgs>'"; nixi = "nix repl '<nixpkgs>'";
take = "source ${take}"; take = "source ${take}";
wcd = "source ${wcd}"; wcd = "source ${wcd}";
where = "source ${where}"; where = "source ${where}";
# temporary files and directories # temporary files and directories
cdt = "source ${cdt}"; cdt = "source ${cdt}";
vit = "$EDITOR $(mktemp)"; vit = "$EDITOR $(mktemp)";
# file safety # file safety
mv = "mv --interactive"; mv = "${pkgs.coreutils}/bin/mv --interactive";
rm = "rm --interactive"; rm = "${pkgs.coreutils}/bin/rm --interactive";
cp = "cp --interactive"; cp = "${pkgs.coreutils}/bin/cp --interactive";
# colours # colours
cat = "${pkgs.bat}/bin/bat --theme=ansi --style=plain"; cat = "${pkgs.bat}/bin/bat --theme=ansi --style=plain";
l = "ls --color=auto --time-style=long-iso --almost-all"; l = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all";
ls = "ls --color=auto --time-style=long-iso"; ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
ll = "ls --color=auto --time-style=long-iso -l"; ll = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso -l";
la = "ls --color=auto --time-style=long-iso --almost-all -l"; la = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all -l";
} // (if darwin then {} else {
"ß" = "${pkgs.util-linux}/bin/setsid";
ip = "${pkgs.iproute2}/bin/ip -c"; ip = "${pkgs.iproute2}/bin/ip -c";
# systemd # systemd
s = "${pkgs.systemd}/bin/systemctl"; s = "${pkgs.systemd}/bin/systemctl";
us = "${pkgs.systemd}/bin/systemctl --user"; us = "${pkgs.systemd}/bin/systemctl --user";
j = "${pkgs.systemd}/bin/journalctl"; j = "${pkgs.systemd}/bin/journalctl";
uj = "${pkgs.systemd}/bin/journalctl --user"; uj = "${pkgs.systemd}/bin/journalctl --user";
}; });
} }

View File

@@ -1,25 +1,25 @@
{ {
pkgs, pkgs,
config,
lib, lib,
inputs, inputs,
system ? "x86_64-linux",
... ...
}: let }: let
inherit (import ../lib) kieran ignorePaths; inherit (import ../lib) kieran ignorePaths;
in { in {
environment.systemPackages = [ environment.systemPackages = [
pkgs.mr pkgs.mr
pkgs.git pkgs.gitFull
pkgs.git-crypt pkgs.git-crypt
pkgs.gitAndTools.gitflow pkgs.gitflow
pkgs.gitAndTools.gh pkgs.gh
pkgs.gitAndTools.git-extras pkgs.git-extras
pkgs.gitAndTools.git-trim # pkgs.git-trim
pkgs.gitAndTools.git-absorb pkgs.git-absorb
pkgs.gitstats pkgs.gitstats
pkgs.patch pkgs.patch
pkgs.patchutils pkgs.patchutils
inputs.self.packages.x86_64-linux.git-preview inputs.self.packages.${system}.git-preview
]; ];
environment.shellAliases = { environment.shellAliases = {
@@ -30,7 +30,7 @@ in {
home-manager.users.me = { home-manager.users.me = {
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitFull;
userName = kieran.name; userName = kieran.name;
userEmail = kieran.email; userEmail = kieran.email;
aliases = { aliases = {

View File

@@ -1,5 +1,4 @@
{ {
config,
pkgs, pkgs,
lib, lib,
inputs, inputs,

View File

@@ -56,6 +56,13 @@
autoload -U zmv run-help autoload -U zmv run-help
# atuin distributed shell history
export ATUIN_NOBIND="true" # disable all keybdinings of atuin
eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget # bind ctrl+r to atuin
# use zsh only session history
fc -p
fpath=(${zsh-completions}/src $fpath) fpath=(${zsh-completions}/src $fpath)
''; '';
promptInit = with config.niveum; '' promptInit = with config.niveum; ''
@@ -68,13 +75,6 @@
zstyle ':vcs_info:*' formats "%c%u%F{cyan}%b%f" zstyle ':vcs_info:*' formats "%c%u%F{cyan}%b%f"
zstyle ':vcs_info:*' actionformats "(%a) %c%u%F{cyan}%b%f" zstyle ':vcs_info:*' actionformats "(%a) %c%u%F{cyan}%b%f"
# atuin distributed shell history
export ATUIN_NOBIND="true" # disable all keybdinings of atuin
eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget # bind ctrl+r to atuin
# use zsh only session history
fc -p
precmd () { precmd () {
vcs_info vcs_info
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then

View File

@@ -22,6 +22,6 @@ stdenv.mkDerivation {
homepage = https://github.com/thameera/vimv; homepage = https://github.com/thameera/vimv;
description = "Batch-rename files using Vim"; description = "Batch-rename files using Vim";
license = licenses.mit; license = licenses.mit;
platforms = platforms.linux; platforms = platforms.all;
}; };
} }

View File

@@ -1,15 +1,24 @@
{ { config, pkgs, lib, inputs, niveumPackages, ... }:
config, let
pkgs, system = "x86_64-darwin";
inputs,
niveumPackages,
...
}: let
nextcloud = "${config.home.homeDirectory}/Nextcloud/ZODIAC"; nextcloud = "${config.home.homeDirectory}/Nextcloud/ZODIAC";
timeLedger = "${nextcloud}/hora.timeclock"; timeLedger = "${nextcloud}/hora.timeclock";
in {
adminEssentials = import ../../configs/admin-essentials.nix {
inherit pkgs niveumPackages lib system;
};
stardict = import ../../configs/stardict.nix {
inherit pkgs lib inputs;
};
git = import ../../configs/git.nix {
inherit pkgs lib inputs system;
};
in
{
home.packages = [ home.packages = [
pkgs.git
(pkgs.writers.writeDashBin "hora" '' (pkgs.writers.writeDashBin "hora" ''
${pkgs.hledger}/bin/hledger -f "${timeLedger}" "$@" ${pkgs.hledger}/bin/hledger -f "${timeLedger}" "$@"
'') '')
@@ -17,12 +26,56 @@ in {
nvim + "${timeLedger}" nvim + "${timeLedger}"
'') '')
niveumPackages.vim niveumPackages.vim
]; pkgs.ghc
pkgs.python3
] ++ adminEssentials.environment.systemPackages
++ git.environment.systemPackages;
#++ stardict.environment.systemPackages;
home.shellAliases =
adminEssentials.environment.shellAliases
// git.environment.shellAliases;
programs.git = git.home-manager.users.me.programs.git;
programs.zsh = let
promptColours = {
success = "green";
failure = "red";
};
in {
autocd = true;
defaultKeymap = "viins";
enableAutosuggestions = true;
enableCompletion = true;
enable = true;
historySubstringSearch.enable = true;
syntaxHighlighting.enable = true;
syntaxHighlighting.highlighters = ["main" "brackets" "pattern" "line"];
initExtra = ''
precmd () {
if [[ -n $IN_NIX_SHELL ]]; then
PROMPT='%B%~%b %(?.%F{${promptColours.success}}.%F{${promptColours.failure}})λ%f '
else
PROMPT='%B%~%b %(?.%F{${promptColours.success}}.%F{${promptColours.failure}})%#%f '
fi
print -Pn "\e]2;%n@%M:%~\a" # title bar prompt
}
zle-keymap-select zle-line-init () {
case $KEYMAP in
vicmd) print -n '\e]12;green\a';;
viins|main) print -n '\e]12;gray\a';;
esac
}
zle -N zle-line-init
zle -N zle-keymap-select
'';
};
home.sessionVariables.EDITOR = "${niveumPackages.vim}/bin/nvim"; home.sessionVariables.EDITOR = "${niveumPackages.vim}/bin/nvim";
home.file."Local Applications".source = pkgs.symlinkJoin { home.file."Local Applications".source = pkgs.symlinkJoin {
name = "local-applications"; name = "local-applications";
paths = [pkgs.anki-bin pkgs.dbeaver pkgs.vscode pkgs.mpv]; paths = [ pkgs.anki-bin pkgs.dbeaver pkgs.vscode pkgs.mpv pkgs.stellarium ];
}; };
home.stateVersion = "23.11"; home.stateVersion = "23.11";
home.username = "xm7234fu"; home.username = "xm7234fu";