aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2021-09-14 13:37:00 +0530
committerAkshay Nair <phenax5@gmail.com>2021-09-14 13:37:00 +0530
commit69d464818c7a6e599771fe67d407c163c8a7a0c4 (patch)
treeb361000d0cbfa4609cc66a8a1c707e63d859990d
parent4d89e28f26075ecf3a8d132fe5177eecef99b565 (diff)
downloadnixos-config-69d464818c7a6e599771fe67d407c163c8a7a0c4.tar.gz
nixos-config-69d464818c7a6e599771fe67d407c163c8a7a0c4.zip
config changes sync
-rw-r--r--config/dunst/dunstrc2
-rw-r--r--config/picom.conf23
-rw-r--r--configuration.nix33
-rw-r--r--hardware-configuration.nix5
-rw-r--r--login.nix4
-rw-r--r--packages.nix22
-rwxr-xr-xpackages/dwm/autostart.sh9
-rwxr-xr-xscripts/commands/:weekly-review37
-rwxr-xr-xscripts/open-project.sh10
-rwxr-xr-xscripts/rate-sx.sh32
-rw-r--r--shell/rust.nix43
11 files changed, 189 insertions, 31 deletions
diff --git a/config/dunst/dunstrc b/config/dunst/dunstrc
index 0337ae9..a5bdeb4 100644
--- a/config/dunst/dunstrc
+++ b/config/dunst/dunstrc
@@ -1,5 +1,5 @@
[global]
- font = JetBrains Mono, Font Awesome 5 Free Solid, Font Awesome 5 Free Regular, Font Awesome 5 Brands 11
+ font = JetBrainsMono Nerd Font, Font Awesome 5 Free Solid, Font Awesome 5 Free Regular, Font Awesome 5 Brands 11
# Allow a small subset of html markup:
# <b>bold</b>
diff --git a/config/picom.conf b/config/picom.conf
new file mode 100644
index 0000000..f0115c3
--- /dev/null
+++ b/config/picom.conf
@@ -0,0 +1,23 @@
+backend = "glx";
+
+inactive-dim = 0.3;
+focus-exclude = [ "class_g = 'dwm'", "class_g = 'dmenu'"];
+
+#backend = "glx";
+#blur-method = "dual_kawase";
+#blur-strength = 2;
+
+fading = false;
+#fade-delta = 2;
+
+shadow = false;
+#shadow-opacity = 0.9;
+#shadow-radius = 20;
+
+opacity-rule = [
+ "99:class_g = 'St' && focused",
+ "90:class_g = 'St' && !focused",
+ "98:class_g = 'qutebrowser' && !focused",
+ "100:class_g = 'qutebrowser' && focused",
+ "100:class_g = 'dmenu'",
+];
diff --git a/configuration.nix b/configuration.nix
index b6c0c6e..e60fd23 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -26,6 +26,26 @@ in
enable = true;
};
+ hardware.bluetooth.enable = false;
+ #hardware.bluetooth.package = pkgs.bluezFull;
+
+ services.monero = {
+ enable = false;
+ dataDir = "/var/lib/monero";
+ # mining.enable = {
+ # enable = false;
+ # threads = 2;
+ # };
+ rpc = {
+ address = "127.0.0.1";
+ port = 18081;
+ # user = "hexyman";
+ # password = "";
+ };
+ };
+
+ # Enable sound.
+ sound.enable = true;
services.jack = {
jackd.enable = true;
alsa.enable = false;
@@ -86,19 +106,6 @@ in
cozette
noto-fonts-emoji
];
- # nix-shell -p actkbd --run "sudo actkbd -n -s -d /dev/input/event#"
- #services.actkbd = {
- #enable = true;
- #bindings = [
- #{ keys = [ 224 ]; events = [ "key" ]; command = "/run/current-system/sw/bin/light -A 10"; }
- #{ keys = [ 225 ]; events = [ "key" ]; command = "/run/current-system/sw/bin/light -U 10"; }
- #];
- #};
- # Enable CUPS to print documents.
- # services.printing.enable = true;
-
- # Enable sound.
- sound.enable = true;
nix.autoOptimiseStore = true;
nix.gc = {
diff --git a/hardware-configuration.nix b/hardware-configuration.nix
index b3723d5..d00ff1d 100644
--- a/hardware-configuration.nix
+++ b/hardware-configuration.nix
@@ -25,6 +25,11 @@
options snd slots=snd-hda-intel
'';
+ services.udev.extraRules = ''
+ # DualShock 4 over bluetooth hidraw
+ KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"
+ '';
+
hardware = {
enableAllFirmware = true;
cpu.intel.updateMicrocode = true;
diff --git a/login.nix b/login.nix
index 01cc816..5e3056d 100644
--- a/login.nix
+++ b/login.nix
@@ -2,12 +2,12 @@
let
sessions = [
[ "tty1" windowManagers.xmonad ]
- # [ "tty2" windowManagers.dwm ]
+ #[ "tty2" windowManagers.bspwm ]
];
windowManagers = {
dwm = looped "dwm";
xmonad = exec "~/.xmonad/bin/xmonad-wm";
- bspwm = exec "bspwm";
+ bspwm = "st; ${exec "bspwm"};";
};
exec = s: "exec ${s}";
looped = s: ''
diff --git a/packages.nix b/packages.nix
index b45ea80..9e6aaa9 100644
--- a/packages.nix
+++ b/packages.nix
@@ -11,6 +11,9 @@ let
dmenu
anypinentry
bslock
+
+ # Not local
+ #pkgs.bspwm
];
devPackages = with pkgs; [
@@ -34,7 +37,7 @@ let
rnix-lsp
# python-language-server
- haskell-language-server
+ #haskell-language-server # Broken on 8-Sept-2021
ghc
# cabal-install
] ++ (
@@ -58,10 +61,11 @@ let
imagemagick
ffmpeg-full
feh
+ #monero-gui
- # Remind
- # remind
- # wyrd
+ # Scheduling
+ remind
+ wyrd
# signal-cli
# signal-desktop
@@ -69,6 +73,7 @@ let
dunst
gotop
tremc
+ zathura
];
@@ -84,6 +89,7 @@ let
udiskie
file
at
+ bc
# Audio
alsaUtils
@@ -92,13 +98,12 @@ let
ardour
# X stuff
- bc
+ picom
brightnessctl
xorg.xinit
xorg.xrandr
xorg.xmodmap
- # xorg.xkill
- #xorg.xbacklight
+ xorg.xkill
xclip
xdo
xdotool
@@ -112,6 +117,9 @@ in
"ffmpeg-3.4.8"
];
+ programs.steam.enable = true;
+ hardware.steam-hardware.enable = true;
+
# Security wrappers
security.wrappers = {
bslock.source = "${localPkgs.bslock}/bin/bslock";
diff --git a/packages/dwm/autostart.sh b/packages/dwm/autostart.sh
index ac24586..5421000 100755
--- a/packages/dwm/autostart.sh
+++ b/packages/dwm/autostart.sh
@@ -17,7 +17,7 @@ on_startup() { is_kill || [[ "$(wmctrl -l | wc -l)" = "0" ]] && $@ & }
once() {
local name=$1; shift;
if (is_kill); then
- killall "$name";
+ pkill "$name";
else
pgrep $name || $@ &
fi;
@@ -26,7 +26,7 @@ once() {
# Kill previous instance and run again
run() {
local name=$1; shift;
- [[ ! -z "$name" ]] && killall -9 $name && sleep 0.05;
+ [[ ! -z "$name" ]] && pkill "$name" && sleep 0.05;
is_kill || $@ &
}
# }}}
@@ -48,11 +48,14 @@ run() {
run "dunst" dunst -config ~/.config/dunst/dunstrc;
# Compositor
- # run "picom" picom --experimental-backends --config ~/.config/compton.conf;
+ run "picom" picom --experimental-backends --config ~/.config/picom.conf;
# Cron jobs
#run "crond" crond -n -f ~/.config/crontab/crontab;
+ # Scheduler
+ run "remind" remind -k"notify-send -a reminder %s" -z10 $REMINDER_FILE;
+
# Battery watcher
run "" ~/scripts/battery-watch.sh start;
diff --git a/scripts/commands/:weekly-review b/scripts/commands/:weekly-review
new file mode 100755
index 0000000..9b16b12
--- /dev/null
+++ b/scripts/commands/:weekly-review
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+
+REVIEWS_DIR="$HOME/nixos/extras/notes/weekly-reviews";
+
+get_date() { date +"%Y-%m-%d"; }
+
+template() {
+ local date=$(get_date);
+echo "# $date
+
+### What did you achieve this week?
+ -
+
+### What do I want to achieve next week?
+ -
+
+### What are you grateful for?
+ -
+
+### What went wrong?
+ -
+
+### How are you feeling?
+
+
+";
+}
+
+
+review_file="$REVIEWS_DIR/$(get_date).md";
+
+if [[ ! -f "$review_file" ]]; then
+ template > $review_file;
+fi
+
+sensible-terminal -e sensible-editor $review_file;
+
diff --git a/scripts/open-project.sh b/scripts/open-project.sh
index f7a41ba..7fb9ca7 100755
--- a/scripts/open-project.sh
+++ b/scripts/open-project.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
PROJECTS_DIR="$HOME/dev/projects";
-SUCKLESS_DIR="$HOME/.config/suckless";
+GODOT_DIR="$HOME/dev/godot";
get_projects() {
ls -t "$PROJECTS_DIR" | sed 's/^/dev:/g';
- ls -t "$SUCKLESS_DIR" | sed 's/^/suckless:/g';
+ ls -t "$GODOT_DIR" | sed 's/^/godot:/g';
}
project=$(get_projects | dmenu -p "Project name :: ");
@@ -20,9 +20,9 @@ projdir=$(echo "$project" | cut -d: -f2-);
fulldir="";
case "$projtype" in
- dev) fulldir="$PROJECTS_DIR/$projdir" ;;
- suckless) fulldir="$SUCKLESS_DIR/$projdir" ;;
- *) fulldir="$PROJECTS_DIR/$projdir" ;;
+ dev) fulldir="$PROJECTS_DIR/$projdir" ;;
+ godot) fulldir="$GODOT_DIR/$projdir" ;;
+ *) fulldir="$PROJECTS_DIR/$projdir" ;;
esac
if [ ! -z "$fulldir" ]; then
diff --git a/scripts/rate-sx.sh b/scripts/rate-sx.sh
new file mode 100755
index 0000000..baec270
--- /dev/null
+++ b/scripts/rate-sx.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+rate_sx() {
+ [[ ! -z "$2" ]] \
+ && curl $2.rate.sx/$1 \
+ || curl rate.sx/$1;
+}
+
+get_1() { cut -d' ' -f1; }
+get_2() { cut -d' ' -f2; }
+
+help() {
+ echo "
+::: Rate.sx repl :::
+ btc: get graph for btc in usd
+ btc inr: get graph for btc in inr
+ 1btc inr: print the value of 1btc in inr
+ q: quit
+";
+}
+
+help;
+
+while true; do
+ while IFS="" read -r -e -d $'\n' -p 'rate.sx $ ' command; do
+ case "$(echo $command | get_1)" in
+ q) exit 0 ;;
+ *) rate_sx $command ;;
+ esac;
+ done;
+done;
+
diff --git a/shell/rust.nix b/shell/rust.nix
new file mode 100644
index 0000000..e36c70a
--- /dev/null
+++ b/shell/rust.nix
@@ -0,0 +1,43 @@
+# with import <nixpkgs> {};
+# let src = fetchFromGitHub {
+# owner = "mozilla";
+# repo = "nixpkgs-mozilla";
+# rev = "9f35c4b09fd44a77227e79ff0c1b4b6a69dff533";
+# sha256 = "18h0nvh55b5an4gmlgfbvwbyqj91bklf1zymis6lbdh75571qaz0";
+# };
+# in
+# with import "${src.out}/rust-overlay.nix" pkgs pkgs;
+# stdenv.mkDerivation {
+# name = "rust-env";
+# buildInputs = [
+# # Note: to use use stable, just replace `nightly` with `stable`
+# latest.rustChannels.nightly.rust
+#
+# # Add some extra dependencies from `pkgs`
+# pkgconfig openssl
+# ];
+#
+# # Set Environment Variables
+# RUST_BACKTRACE = 1;
+# }
+
+with import <nixpkgs> {};
+mkShell rec {
+ buildInputs = [
+ # Build tools
+ rustup
+ pkg-config
+
+ # Deps
+ libclang
+
+ # Dev
+ nodePackages.nodemon
+ rust-analyzer
+ ];
+ nativeBuildInputs = [ clang ];
+
+ LIBCLANG_PATH = "${libclang.lib}/lib";
+ RUST_SRC_PATH = rust.packages.stable.rustPlatform.rustLibSrc;
+ LD_LIBRARY_PATH = lib.makeLibraryPath (buildInputs ++ nativeBuildInputs);
+}