lkjdsalkjdsalkjad
This commit is contained in:
12
flake.nix
12
flake.nix
@@ -229,6 +229,7 @@
|
|||||||
(mkModule extra-modules domain system inputs stateVersion modules hostname)
|
(mkModule extra-modules domain system inputs stateVersion modules hostname)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
# TODO: move this to a file or separate flake
|
||||||
mkReport = extra-modules: domain: system: inputs: stateVersion: modules: hostname: let
|
mkReport = extra-modules: domain: system: inputs: stateVersion: modules: hostname: let
|
||||||
nixos = mkConfig extra-modules domain system inputs stateVersion modules hostname;
|
nixos = mkConfig extra-modules domain system inputs stateVersion modules hostname;
|
||||||
cfg = nixos.config;
|
cfg = nixos.config;
|
||||||
@@ -247,14 +248,16 @@
|
|||||||
users = lib.pipe cfg.users.users [
|
users = lib.pipe cfg.users.users [
|
||||||
(lib.filterAttrs (uname: user: user.isNormalUser))
|
(lib.filterAttrs (uname: user: user.isNormalUser))
|
||||||
(builtins.mapAttrs (uname: user: {
|
(builtins.mapAttrs (uname: user: {
|
||||||
|
inherit (user) home;
|
||||||
authorizedKeys = lib.forEach user.openssh.authorizedKeys.keys (key: builtins.concatStringsSep " " (
|
authorizedKeys = lib.forEach user.openssh.authorizedKeys.keys (key: builtins.concatStringsSep " " (
|
||||||
lib.take
|
lib.take
|
||||||
(lib.length (lib.splitString " " key))
|
(lib.length (lib.splitString " " key))
|
||||||
[
|
[
|
||||||
(builtins.elemAt (lib.splitString " " key) 0)
|
(builtins.elemAt (lib.splitString " " key) 0)
|
||||||
"..."
|
"..."
|
||||||
(builtins.elemAt (lib.splitString " " key) 2)
|
(builtins.elemAt (lib.splitString " " key) 2)
|
||||||
]));
|
]
|
||||||
|
));
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
nix-system-features = cfg.nix.settings.system-features;
|
nix-system-features = cfg.nix.settings.system-features;
|
||||||
@@ -265,6 +268,7 @@
|
|||||||
(lib.filterAttrs (mount: fs: fs.fsType != "nfs"))
|
(lib.filterAttrs (mount: fs: fs.fsType != "nfs"))
|
||||||
(lib.mapAttrs (mount: fs: "${fs.fsType}://${fs.device}"))
|
(lib.mapAttrs (mount: fs: "${fs.fsType}://${fs.device}"))
|
||||||
];
|
];
|
||||||
|
} // lib.optionalAttrs cfg.services.nginx.enable {
|
||||||
nginx-vhosts = lib.pipe cfg.services.nginx.virtualHosts [
|
nginx-vhosts = lib.pipe cfg.services.nginx.virtualHosts [
|
||||||
#(lib.filterAttrs (domain: vhost: )
|
#(lib.filterAttrs (domain: vhost: )
|
||||||
(lib.mapAttrs (domain: vhost: vhost.serverAliases or []))
|
(lib.mapAttrs (domain: vhost: vhost.serverAliases or []))
|
||||||
|
|||||||
3
justfile
3
justfile
@@ -10,6 +10,9 @@ export GUM_FILTER_HEIGHT := "15"
|
|||||||
eval hostname=`just _a_host`:
|
eval hostname=`just _a_host`:
|
||||||
nix eval .#nixosConfigurations."{{hostname}}".config.system.build.toplevel.outPath --show-trace
|
nix eval .#nixosConfigurations."{{hostname}}".config.system.build.toplevel.outPath --show-trace
|
||||||
|
|
||||||
|
repl $hostname=`just _a_host`:
|
||||||
|
NIX_NO_NOM=1 nixos-rebuild --flake .#"$hostname" repl
|
||||||
|
|
||||||
report hostname=`just _a_host`:
|
report hostname=`just _a_host`:
|
||||||
nix eval .#nixosReports."{{hostname}}" --json | yq . --yaml-output | bat --language yaml --style plain --paging never
|
nix eval .#nixosReports."{{hostname}}" --json | yq . --yaml-output | bat --language yaml --style plain --paging never
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ in {
|
|||||||
#group = "code.server";
|
#group = "code.server";
|
||||||
|
|
||||||
# a nice tool if you don't care about security: https://argon2.online/
|
# a nice tool if you don't care about security: https://argon2.online/
|
||||||
|
# otherwise:
|
||||||
|
# echo -n 'password' | nix run nixpkgs#libargon2 -- "$(pwgen 20 -n1)" -e
|
||||||
hashedPassword = "$argon2i$v=19$m=16,t=2,p=1$MHh5UGNtU1lWR1UySnhIZw$ITg8U7Gq2CXByuOOnrKVUg"; # hunter2
|
hashedPassword = "$argon2i$v=19$m=16,t=2,p=1$MHh5UGNtU1lWR1UySnhIZw$ITg8U7Gq2CXByuOOnrKVUg"; # hunter2
|
||||||
|
|
||||||
extraArguments = [
|
extraArguments = [
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ zeditor-remote() {
|
|||||||
local -a hosts
|
local -a hosts
|
||||||
readarray -d $'\n' -t hosts < <(
|
readarray -d $'\n' -t hosts < <(
|
||||||
cut <"$HOME"/.ssh/known_hosts -d' ' -f1 | sort -u \
|
cut <"$HOME"/.ssh/known_hosts -d' ' -f1 | sort -u \
|
||||||
|
| grep -vE '^\[' \
|
||||||
|
| grep -v '[,@]' \
|
||||||
| grep -Ev '^([0-9]{0,3}\.){3}[0-9]{0,3}$' \
|
| grep -Ev '^([0-9]{0,3}\.){3}[0-9]{0,3}$' \
|
||||||
| grep -Ev '^([0-9a-fA-F]{0,4}:){0,7}:?([0-9a-fA-F]{0,4}:){0,6}[0-9a-fA-F]{0,4}$'
|
| grep -Ev '^([0-9a-fA-F]{0,4}:){0,7}:?([0-9a-fA-F]{0,4}:){0,6}[0-9a-fA-F]{0,4}$'
|
||||||
)
|
)
|
||||||
@@ -45,7 +47,7 @@ zeditor-remote() {
|
|||||||
)
|
)
|
||||||
printf '%s\n' "${hosts[@]}" \
|
printf '%s\n' "${hosts[@]}" \
|
||||||
| sed -E "s/\\.($(IFS='|'; printf "%s" "${domains[*]}"))\$//g" \
|
| sed -E "s/\\.($(IFS='|'; printf "%s" "${domains[*]}"))\$//g" \
|
||||||
| grep -v '\.'
|
| grep -v '[.:]'
|
||||||
fi
|
fi
|
||||||
} | grep -v '^localhost$' | sort -u
|
} | grep -v '^localhost$' | sort -u
|
||||||
} | fzf --multi --reverse --bind 'ctrl-a:toggle-all' --height=25 --cycle \
|
} | fzf --multi --reverse --bind 'ctrl-a:toggle-all' --height=25 --cycle \
|
||||||
@@ -100,6 +102,9 @@ zeditor-remote() {
|
|||||||
printf >&2 "%s\n" "+ ${ssh_cd_cmd}"
|
printf >&2 "%s\n" "+ ${ssh_cd_cmd}"
|
||||||
eval ${ssh_cd_cmd}
|
eval ${ssh_cd_cmd}
|
||||||
else
|
else
|
||||||
|
if [[ "$?" -eq 130 ]]; then
|
||||||
|
return 1 # ctrl-c
|
||||||
|
fi
|
||||||
# history -s "${zed_cmd}"
|
# history -s "${zed_cmd}"
|
||||||
eval ${zed_cmd}
|
eval ${zed_cmd}
|
||||||
printf >&2 "%s\n" "+$(printf " %q" cd "${choice}")"
|
printf >&2 "%s\n" "+$(printf " %q" cd "${choice}")"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs = let
|
programs = let
|
||||||
|
# TODO: a notification based variant
|
||||||
rcScript = ''
|
rcScript = ''
|
||||||
salert() {
|
salert() {
|
||||||
local retval=$?
|
local retval=$?
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
unstable.nixfmt-rfc-style # nix
|
unstable.nixfmt-rfc-style # nix
|
||||||
harper # harper
|
harper # harper
|
||||||
typos-lsp # typos
|
typos-lsp # typos
|
||||||
|
tinymist # typst
|
||||||
|
|
||||||
# I prefer these in shell.nix / virtual environments
|
# I prefer these in shell.nix / virtual environments
|
||||||
# python3Packages.python-lsp-server # pylsp
|
# python3Packages.python-lsp-server # pylsp
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
#".envrc"
|
#".envrc"
|
||||||
".remote.toml"
|
".remote.toml"
|
||||||
".remoteenv"
|
".remoteenv"
|
||||||
|
".zed"
|
||||||
"result"
|
"result"
|
||||||
"result-*"
|
"result-*"
|
||||||
"results"
|
"results"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
_tmp_func_name = "_tmp_func_Oaw5aifeeniezeiquonaipheNahthae9caik4Rai"; # pwgen ftw
|
_tmp_func_name = "_tmp_func_Oaw5aifeeniezeiquonaipheNahthae9caik4Rai"; # pwgen ftw
|
||||||
|
# TODO: trap the 'unset'?
|
||||||
mkArgsAlias = alias: ''${_tmp_func_name}() { ${alias}; unset -f ${_tmp_func_name}; }; ${_tmp_func_name}'';
|
mkArgsAlias = alias: ''${_tmp_func_name}() { ${alias}; unset -f ${_tmp_func_name}; }; ${_tmp_func_name}'';
|
||||||
|
|
||||||
in
|
in
|
||||||
@@ -115,7 +116,6 @@ in
|
|||||||
|
|
||||||
# old -> new
|
# old -> new
|
||||||
home.shellAliases.vimv = "edir";
|
home.shellAliases.vimv = "edir";
|
||||||
#home.shellAliases.atom = "pulsar";
|
|
||||||
|
|
||||||
# Be conservative with files
|
# Be conservative with files
|
||||||
# --preserver-root is for GNU versions, preventing changing perms on /
|
# --preserver-root is for GNU versions, preventing changing perms on /
|
||||||
@@ -131,6 +131,8 @@ in
|
|||||||
home.shellAliases.fda = "fd --no-ignore --hidden";
|
home.shellAliases.fda = "fd --no-ignore --hidden";
|
||||||
home.shellAliases.afd = "fd --no-ignore --hidden";
|
home.shellAliases.afd = "fd --no-ignore --hidden";
|
||||||
|
|
||||||
|
home.shellAliases.nlocate = "nix-locate --top-level --regex"; # via nix-index-with-full-db
|
||||||
|
|
||||||
home.shellAliases.inom = mkArgsAlias ''nom "$@" --system i686-linux -j0'';
|
home.shellAliases.inom = mkArgsAlias ''nom "$@" --system i686-linux -j0'';
|
||||||
home.shellAliases.inix = mkArgsAlias ''nix "$@" --system i686-linux -j0'';
|
home.shellAliases.inix = mkArgsAlias ''nix "$@" --system i686-linux -j0'';
|
||||||
home.shellAliases.rnom = mkArgsAlias ''nom "$@" --system riscv64-linux -j0'';
|
home.shellAliases.rnom = mkArgsAlias ''nom "$@" --system riscv64-linux -j0'';
|
||||||
@@ -172,6 +174,7 @@ in
|
|||||||
#tldr
|
#tldr
|
||||||
stress
|
stress
|
||||||
entr
|
entr
|
||||||
|
faketty
|
||||||
axel aria aria2
|
axel aria aria2
|
||||||
xe # xargs alternative
|
xe # xargs alternative
|
||||||
sd # sed alternative
|
sd # sed alternative
|
||||||
|
|||||||
Reference in New Issue
Block a user