Compare commits

..

No commits in common. "e4161bfed9e631c57837f9c5573704b376e975ca" and "326d8fbae79880f42fc48e26448c123cef92ac6a" have entirely different histories.

15 changed files with 27 additions and 170 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, inputs, outputs, ... }: { pkgs, inputs, ... }:
{ {
imports = [ imports = [
inputs.nix-colors.homeManagerModules.default inputs.nix-colors.homeManagerModules.default
@ -7,11 +7,6 @@
./fonts.nix ./fonts.nix
]; ];
nixpkgs.overlays = [
inputs.nur.overlay
outputs.overlays.additions
];
# Global home packages without config go here (for all hosts and users) # Global home packages without config go here (for all hosts and users)
home.packages = builtins.attrValues { home.packages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)
@ -25,7 +20,7 @@
btop btop
htop htop
postgresql postgresql
bc hugo
; ;
}; };
home.stateVersion = "23.11"; home.stateVersion = "23.11";

View File

@ -1,10 +1,14 @@
{ pkgs, ... }: { { pkgs, inputs, ... }: {
imports = [ imports = [
./firefox.nix ./firefox.nix
./alacritty.nix ./alacritty.nix
./zotero.nix ./zotero.nix
]; ];
nixpkgs.overlays = [
inputs.nur.overlay
];
# Global packages for desktop environments # Global packages for desktop environments
home.packages = [ home.packages = [
pkgs.alacritty pkgs.alacritty

View File

@ -1,5 +1,6 @@
{ lib { lib
, config , config
, pkgs
, ... , ...
}: { }: {

View File

@ -1,13 +1,6 @@
{ pkgs, ... }:
{ {
imports = [ imports = [
../common ../common
../status-bar
];
home.packages = [
pkgs.dwmblocks
]; ];
# TODO configure x11 to look in .config/x11 # TODO configure x11 to look in .config/x11
@ -15,14 +8,6 @@
home.file.".xinitrc" = { home.file.".xinitrc" = {
recursive = true; recursive = true;
text = '' text = ''
autostart="dwmblocks"
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax) eval $(dbus-launch --exit-with-session --sh-syntax)
fi fi

View File

@ -1,10 +0,0 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellScriptBin "sb-cpu-pct" (builtins.readFile ./sb-cpu-pct.sh))
(pkgs.writeShellScriptBin "sb-mem-pct" (builtins.readFile ./sb-mem-pct.sh))
(pkgs.writeShellScriptBin "sb-volume" (builtins.readFile ./sb-volume.sh))
(pkgs.writeShellScriptBin "sb-network-status" (builtins.readFile ./sb-network-status.sh))
(pkgs.writeShellScriptBin "sb-updates" (builtins.readFile ./sb-updates.sh))
];
}

View File

@ -1 +0,0 @@
echo $(top -bn 1 |grep "Cpu(s)" | awk '{print $2+$6 "%"}' | sed "s/\..//g")

View File

@ -1,3 +0,0 @@
# Gets current ram percent utilisation
echo $(free | awk '/^Mem/ {print "100*" $3 " / " $2 }' | bc | awk '{print $1"%"}')

View File

@ -1,43 +0,0 @@
# Nerd Font Symbols
wifi_symbol=" "
lan_symbol="󰌗 "
disconnected_symbol="󰲜 "
vpn_symbol="󰖂 "
internet="󰞉 "
internet_disconnected="󰪎 "
# Get the network status
DEFAULT_INTERFACE=$(ip route | grep '^default' | awk '{print $5}' | uniq)
IP_ADDRESS=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p')
if [ -z "$DEFAULT_INTERFACE" ]; then
network_symbol="$disconnected_symbol"
else
# Check if it is a wireless interface (wlan*)
if [[ $DEFAULT_INTERFACE == wl* ]]; then
network_symbol="$wifi_symbol"
else
network_symbol="$lan_symbol"
fi
fi
# Check internet connectivity
if ! ping -c 1 8.8.8.8 &> /dev/null;
then
network_symbol="$network_symbol $internet_disconnected"
else
network_symbol="$network_symbol $internet"
fi
if ip addr show tun0 > /dev/null 2>&1; then
network_symbol="$network_symbol $vpn_symbol"
else
network_symbol="$network_symbol"
fi
if [ -z "$IP_ADDRESS" ];
then
printf "$network_symbol"
else
printf "$network_symbol|$IP_ADDRESS"
fi

View File

@ -1,6 +0,0 @@
# Gets number of flake inputs that are ready for update
# Checks every 60 minutes
inputs=$(cd /etc/nixos &&
nix flake update --output-lock-file <(cat flake.nix) 2> /tmp/update &&
cat /tmp/update | grep -c Update)
printf "$inputs"

View File

@ -1,41 +0,0 @@
# Prints the current volume or 婢 if muted.
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;;
2) pamixer -t && pkill -RTMIN+10 dwmblocks && exit 1 ;;
4) pamixer --set-limit 150 --allow-boost -i 1 && pkill -RTMIN+10 dwmblocks && exit 1 ;;
5) pamixer --set-limit 150 --allow-boost -d 1 && pkill -RTMIN+10 dwmblocks && exit 1 ;;
3) notify-send "Volume module" "\- Shows volume , 婢 if muted.
- Middle click to mute.
- Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
get_mic_status=$(pamixer --default-source --get-mute)
vol="$(pamixer --get-volume)"
if [ $get_mic_status == false ]; then
mic_status=""
else
mic_status=""
fi
if [ "$vol" -gt "90" ]; then
icon=""
elif [ "$vol" -gt "50" ]; then
icon="󰕾"
elif [ "$vol" -gt "30" ]; then
icon=""
elif [ "$vol" -gt "0" ]; then
icon="󰕿"
else
icon="󰝟"
fi
if [ $(pamixer --get-mute) = true ]; then
icon="󰸈"
vol="0"
fi
print_string="$mic_status $icon $vol%"
printf '%s' "${print_string}"

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, config, ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;

View File

@ -11,7 +11,7 @@
./common/optional/git.nix ./common/optional/git.nix
./common/optional/sops.nix ./common/optional/sops.nix
./common/optional/syncthing.nix ./common/optional/syncthing.nix
./common/optional/desktop/dwm ./common/optional/desktop/startx
]; ];

View File

@ -3,5 +3,4 @@
pkgs: { pkgs: {
sddm-theme = pkgs.callPackage ./sddm-theme { }; sddm-theme = pkgs.callPackage ./sddm-theme { };
st = pkgs.callPackage ./st { }; st = pkgs.callPackage ./st { };
dwmblocks = pkgs.callPackage ./dwmblocks { };
} }

View File

@ -1,37 +0,0 @@
{ pkgs ? import <nixpkgs> { }
, fetchFromGitea ? pkgs.fetchFromGitea
, pkg-config ? pkgs.pkg-config
, libX11 ? pkgs.xorg.libX11
, libXft ? pkgs.xorg.libXft
}:
pkgs.stdenv.mkDerivation {
pname = "dwmblocks";
name = "dwmblocks";
src = fetchFromGitea {
domain = "git.bitlab21.com";
owner = "sam";
repo = "dwmblocks";
rev = "c4e7a9b1eb98123e239ba76bc551934721fd18ca";
sha256 = "sha256-F1x8jOT+c2pPCF9qKq5boIWzegMBTCxwzKMVtmtMWGM=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
libX11
libXft
];
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/bin
mv dwmblocks $out/bin
'';
}

View File

@ -1,8 +1,13 @@
{ pkgs ? import <nixpkgs> { } { pkgs ? import <nixpkgs> { }
, fetchFromGitea ? pkgs.fetchFromGitea , fetchFromGitea ? pkgs.fetchFromGitea
, stdenv ? pkgs.stdenv
, pkg-config ? pkgs.pkg-config , pkg-config ? pkgs.pkg-config
, fontconfig ? pkgs.fontconfig
, freetype ? pkgs.freetype
, libX11 ? pkgs.xorg.libX11 , libX11 ? pkgs.xorg.libX11
, libXft ? pkgs.xorg.libXft , libXft ? pkgs.xorg.libXft
, ncurses ? pkgs.ncurses
, extraLibs ? [ ]
}: }:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
pname = "st"; pname = "st";
@ -16,22 +21,31 @@ pkgs.stdenv.mkDerivation {
sha256 = "sha256-4W9w/Efk+YCSP1VuUFr+jPXIyrlpktwxRPUOZHTAtx8="; sha256 = "sha256-4W9w/Efk+YCSP1VuUFr+jPXIyrlpktwxRPUOZHTAtx8=";
}; };
makeFlags = [
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
];
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
ncurses
fontconfig
freetype
]; ];
buildInputs = [ buildInputs = [
libX11 libX11
libXft libXft
]; ] ++ extraLibs;
installFlags = [ "PREFIX=$(out)" ];
buildPhase = '' buildPhase = ''
make make
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/usr/local/bin
mv st $out/bin mv st $out/usr/local/bin
''; '';
} }