Compare commits
9 Commits
fb98f0e01a
...
cb059e5f58
| Author | SHA1 | Date | |
|---|---|---|---|
| cb059e5f58 | |||
| 4eae53c82a | |||
| 8aa3987c1b | |||
| c0caaeb234 | |||
| 35f493aa9c | |||
| 8d298829b4 | |||
| dbeedcb647 | |||
| f99b4d5368 | |||
| fc352f3d29 |
@@ -53,7 +53,7 @@ in {
|
|||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
SHELL = "zsh";
|
SHELL = "/etc/profiles/per-user/synchronous/bin/zsh"; # just zsh no longer works?
|
||||||
HOME = "/home/synchronous";
|
HOME = "/home/synchronous";
|
||||||
# XDG_CACHE_HOME = "$HOME/.cache";
|
# XDG_CACHE_HOME = "$HOME/.cache";
|
||||||
DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus";
|
DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus";
|
||||||
@@ -120,6 +120,9 @@ in {
|
|||||||
yq
|
yq
|
||||||
semgrep
|
semgrep
|
||||||
tectonic
|
tectonic
|
||||||
|
electrum
|
||||||
|
feather
|
||||||
|
gnupg
|
||||||
# texlive.combined.scheme-full
|
# texlive.combined.scheme-full
|
||||||
|
|
||||||
# security
|
# security
|
||||||
|
|||||||
@@ -210,6 +210,10 @@ in {
|
|||||||
name = "verus github";
|
name = "verus github";
|
||||||
url = "https://github.com/verus-lang/verus";
|
url = "https://github.com/verus-lang/verus";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "secure foundations";
|
||||||
|
url = "https://github.com/secure-foundations";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -186,6 +186,12 @@ super + bracket{left,right}
|
|||||||
super + {o}
|
super + {o}
|
||||||
sh nf daily
|
sh nf daily
|
||||||
|
|
||||||
|
super + semicolon
|
||||||
|
sh nf idk
|
||||||
|
|
||||||
|
super + {m}
|
||||||
|
sh nf misc
|
||||||
|
|
||||||
# open my notes without goyo and with nvimteee
|
# open my notes without goyo and with nvimteee
|
||||||
super + {shift} + {o}
|
super + {shift} + {o}
|
||||||
sh nf daily
|
sh nf daily
|
||||||
|
|||||||
@@ -220,11 +220,20 @@ alias dnsblock-add="nvim /home/synchronous/nix-cfg/system/networking/blockers.sh
|
|||||||
alias focus-wifi="nvim /home/synchronous/nix-cfg/system/networking/blockers.sh"
|
alias focus-wifi="nvim /home/synchronous/nix-cfg/system/networking/blockers.sh"
|
||||||
alias verus-dir="cd /home/synchronous/code/verus"
|
alias verus-dir="cd /home/synchronous/code/verus"
|
||||||
alias cure="cd /home/synchronous/code/cure53"
|
alias cure="cd /home/synchronous/code/cure53"
|
||||||
|
alias scripts="cd /home/synchronous/nix-cfg/home/scripts"
|
||||||
|
alias bookmarks="vim -c '80' /home/synchronous/nix-cfg/home/programs/firefox/default.nix"
|
||||||
|
|
||||||
stack() {
|
stack() {
|
||||||
find . -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \;
|
find . -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stack-fast() {
|
||||||
|
rg -l . | while read -r file; do
|
||||||
|
echo -e "\n--- $file ---\n"
|
||||||
|
cat "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
stack-b() {
|
stack-b() {
|
||||||
(
|
(
|
||||||
while IFS= read -r -d '' file; do
|
while IFS= read -r -d '' file; do
|
||||||
|
|||||||
59
home/scripts/daily.sh
Normal file
59
home/scripts/daily.sh
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# get today's date
|
||||||
|
curr=$(date +%y-%m-%d)
|
||||||
|
curr_bigyear=$(date +%Y-%m-%d)
|
||||||
|
# echo "$curr"
|
||||||
|
curr_pretty=$(date "+%A, %B %d %G")
|
||||||
|
curr_onenumber=$(date +%Y%m%d)
|
||||||
|
echo "Today: $curr_pretty"
|
||||||
|
|
||||||
|
# get written journal lines
|
||||||
|
journal_len=$(wc /home/synchronous/journal/daily.md | awk '{print $1}')
|
||||||
|
journal_date_area=$(rg 25-12-03 /home/synchronous/journal/daily.md -n -o | sed 's/:/ /' | awk '{print $1}')
|
||||||
|
journal=""
|
||||||
|
if [[ $journal_date_area == "" ]]; then
|
||||||
|
journal="No writing in the journal yet today.."
|
||||||
|
else
|
||||||
|
jd_diff=$(echo "$journal_len - $journal_date_area" | bc)
|
||||||
|
journal="You've written $jd_diff journal line(s)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get todos for today
|
||||||
|
todo_len=$(awk '!NF { print NR; exit }' /home/synchronous/journal/todo.md)
|
||||||
|
todo_len_1=$(echo "$todo_len" - 1 | bc)
|
||||||
|
todo_len_2=$(echo "$todo_len" - 2 | bc)
|
||||||
|
todos=$(head /home/synchronous/journal/todo.md -n "$todo_len_1" | tail -n "$todo_len_2")
|
||||||
|
|
||||||
|
# choose idk based on psuedorandom seeded with date
|
||||||
|
idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1'})
|
||||||
|
idk_date=$(date +%Y%m%d)
|
||||||
|
idk_pseudo=$(python3 -c "import math; import random; random.seed($idk_date); print( math.floor(random.random() * 10000) % $idk_len)")
|
||||||
|
idk=$(sed -n '7 p' /home/synchronous/journal/rest/idk.md | cut -c3-)
|
||||||
|
|
||||||
|
# check if there exists a .daily in home for this day
|
||||||
|
daily_date=$(stat -c "%y" /home/synchronous/.daily | awk '{print $1}')
|
||||||
|
if [[ $daily_date != $curr_bigyear ]]; then
|
||||||
|
rm /home/synchronous/.daily
|
||||||
|
touch /home/synchronous/.daily
|
||||||
|
|
||||||
|
# set idk
|
||||||
|
echo "- idk: $idk" >> /home/synchronous/.daily
|
||||||
|
else
|
||||||
|
idk_prev=$(rg idk /home/synchronous/.daily | cut -c8-) # take existing idk
|
||||||
|
if [[ $idk_prev != $idk ]]; then
|
||||||
|
idk="$idk_prev [done!]"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
# echo $idk
|
||||||
|
|
||||||
|
echo "Lore for today:"
|
||||||
|
echo "- idk: $idk"
|
||||||
|
echo "- $journal"
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
# TODOS SETUP
|
||||||
|
echo "Todos for today ($todo_len_2 items):"
|
||||||
|
echo "$todos"
|
||||||
25
home/scripts/idk.sh
Normal file
25
home/scripts/idk.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
add_idk() {
|
||||||
|
if [[ "$1" == "" ]]; then
|
||||||
|
echo "Empty entry"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fq=$(rg "$1" /home/synchronous/journal/rest/idk.md 2> /dev/null)
|
||||||
|
if [[ "$fq" != "" ]]; then
|
||||||
|
echo "Entry already present"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "- $1" >> /home/synchronous/journal/rest/idk.md
|
||||||
|
echo "Added entry: '$1'"
|
||||||
|
idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1}')
|
||||||
|
echo "You do not know $idk_len things!"
|
||||||
|
}
|
||||||
|
|
||||||
|
run_command() {
|
||||||
|
case $1 in
|
||||||
|
"add") add_idk "$2" ;;
|
||||||
|
"del") remove_idk "$2" ;;
|
||||||
|
*)
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
run_command "$1" "$2"
|
||||||
@@ -44,6 +44,13 @@ open_daily() {
|
|||||||
-c "lua vim.g.goyo_if = 1" &!
|
-c "lua vim.g.goyo_if = 1" &!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open_idk() {
|
||||||
|
alacritty -t "idk.md" -e nvim "$main/rest/idk.md" \
|
||||||
|
-c "Goyo | set wrap | set path+=$main_dir" \
|
||||||
|
-c "execute 'normal G'" \
|
||||||
|
-c "lua vim.g.goyo_if = 1" &!
|
||||||
|
}
|
||||||
|
|
||||||
open_todo() {
|
open_todo() {
|
||||||
alacritty -t "todo.md" -e nvim "$main/todo.md" \
|
alacritty -t "todo.md" -e nvim "$main/todo.md" \
|
||||||
-c "execute 'lua vim.g.goyo_if = 1' | set wrap | Goyo | set path+=$main_dir" &!
|
-c "execute 'lua vim.g.goyo_if = 1' | set wrap | Goyo | set path+=$main_dir" &!
|
||||||
@@ -152,14 +159,24 @@ search_by_title() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open_misc() {
|
||||||
|
tf=$(mktemp --suffix=.md)
|
||||||
|
# sh -c keeps window open for nvim, then deletes file immediately on exit
|
||||||
|
alacritty -t "scratch" -e sh -c "nvim '$tf' \
|
||||||
|
-c 'execute \"lua vim.g.goyo_if = 1\" | Goyo | set wrap | autocmd BufEnter * let b:coc_suggest_disable=1'; \
|
||||||
|
rm '$tf'" &!
|
||||||
|
}
|
||||||
|
|
||||||
run_command() {
|
run_command() {
|
||||||
case $1 in
|
case $1 in
|
||||||
"search") search ;;
|
"search") search ;;
|
||||||
"daily") open_daily ;;
|
"daily") open_daily ;;
|
||||||
"todo") open_todo ;;
|
"todo") open_todo ;;
|
||||||
|
"idk") open_idk ;;
|
||||||
"find") notes_find ;;
|
"find") notes_find ;;
|
||||||
"tags") search_by_tags ;;
|
"tags") search_by_tags ;;
|
||||||
"title") search_by_title ;;
|
"title") search_by_title ;;
|
||||||
|
"misc") open_misc ;;
|
||||||
*)
|
*)
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
newmac=$1
|
newmac=$1
|
||||||
suod ip link set wlan0 down
|
sudo ip link set wlan0 down
|
||||||
sudo macchanger wlan0 --mac "$1"
|
sudo macchanger wlan0 --mac "$1"
|
||||||
sudo ip link set wlan0 up
|
sudo ip link set wlan0 up
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root."
|
echo "This script must be run as root."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
config,
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["uhci_hcd" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
|
boot.initrd.availableKernelModules = ["uhci_hcd" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
|
||||||
@@ -13,13 +17,13 @@
|
|||||||
boot.kernelModules = ["kvm-intel"];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/bb36a123-4dc9-4583-8571-1aa180efb00b";
|
device = "/dev/disk/by-uuid/bb36a123-4dc9-4583-8571-1aa180efb00b";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [
|
||||||
[ { device = "/dev/disk/by-uuid/78565ab8-d7b8-476d-a6e7-46ceda4ee761"; }
|
{device = "/dev/disk/by-uuid/78565ab8-d7b8-476d-a6e7-46ceda4ee761";}
|
||||||
{device = "/dev/disk/by-uuid/c735b357-c35c-4249-bb0b-23321fe50c3d";}
|
{device = "/dev/disk/by-uuid/c735b357-c35c-4249-bb0b-23321fe50c3d";}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -48,6 +48,11 @@
|
|||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
services.pcscd.enable = true;
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
xdg.mime.defaultApplications = {
|
xdg.mime.defaultApplications = {
|
||||||
"application/pdf" = "firefox.desktop";
|
"application/pdf" = "firefox.desktop";
|
||||||
|
|||||||
Reference in New Issue
Block a user