add bin scripts
This commit is contained in:
parent
d37834a164
commit
211ba8a0b0
16 changed files with 349 additions and 53 deletions
91
bin/bar.sh
Executable file
91
bin/bar.sh
Executable file
|
|
@ -0,0 +1,91 @@
|
||||||
|
#!/bin/bash
|
||||||
|
trap \
|
||||||
|
"{ pkill -P $$ ; exit 255; }" \
|
||||||
|
SIGINT SIGTERM ERR EXIT
|
||||||
|
|
||||||
|
bat() {
|
||||||
|
battery=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||||
|
time=$(cat /tmp/.battime)
|
||||||
|
drain=$(cat /sys/class/power_supply/BAT0/power_now)
|
||||||
|
if [[ $(cat /sys/class/power_supply/BAT0/status) == "Charging" ]]; then
|
||||||
|
echo "$battery%+"
|
||||||
|
else
|
||||||
|
echo "$time, $battery%$charge, $(echo "scale=1; $drain / 1000000" | bc)mW"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
time_date() {
|
||||||
|
FORMAT="%a %m.%d.%y %T"
|
||||||
|
DATE=`date "+${FORMAT}"`
|
||||||
|
echo "${DATE}"
|
||||||
|
}
|
||||||
|
|
||||||
|
mem() {
|
||||||
|
echo "scale=2; $(free -m | sed -n 2p | awk '{print $3 + $5}') / 1000" | bc
|
||||||
|
}
|
||||||
|
|
||||||
|
vol() {
|
||||||
|
MUTED=$(amixer get Master | grep off)
|
||||||
|
amixer get Master | grep -m1 -Po "\d{1,3}%"
|
||||||
|
[[ $MUTED != '' ]] && echo " M";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
temp_update() {
|
||||||
|
TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||||
|
echo $((TEMP / 1000))
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu_update() {
|
||||||
|
read prevtotal previdle < /tmp/.cpulast
|
||||||
|
read cpu a b c idle rest < /proc/stat
|
||||||
|
total=$((a+b+c+idle))
|
||||||
|
[[ $prevtotal == 0 ]] && prevtotal=1
|
||||||
|
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
|
||||||
|
echo $total $idle > /tmp/.cpulast
|
||||||
|
echo "$cpu%"
|
||||||
|
}
|
||||||
|
|
||||||
|
calc(){ awk "BEGIN { print "$*" }"; }
|
||||||
|
mhz_update() {
|
||||||
|
mhz=$(cat /proc/cpuinfo | grep 'cpu MHz' | awk '{print $4}' | head -n1 | cut -d "." -f 1)
|
||||||
|
echo "$(calc $mhz/1000 | awk '{ printf "%1.2f\n", $0 }') GHz"
|
||||||
|
}
|
||||||
|
|
||||||
|
update_3() {
|
||||||
|
while true; do
|
||||||
|
cpu_update > /tmp/.cpu
|
||||||
|
temp_update > /tmp/.temp
|
||||||
|
mhz_update > /tmp/.mhz
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
}
|
||||||
|
update_30() {
|
||||||
|
while :; do
|
||||||
|
awk 'NR==3 {printf("%.0ddB",$4) > "/tmp/.wifi"}' /proc/net/wireless
|
||||||
|
acpi | awk '{print $5}' > /tmp/.battime
|
||||||
|
if ping -W 1 -c 1 8.8.8.8 > /dev/null; then
|
||||||
|
echo "@" > /tmp/.online
|
||||||
|
else
|
||||||
|
echo "?" > /tmp/.online
|
||||||
|
fi
|
||||||
|
sleep 30
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
update_300() {
|
||||||
|
while :; do
|
||||||
|
curl -s wttr.in/madison?format=%t | head -c 7 > /tmp/.wttr
|
||||||
|
sleep 300
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
SLEEP_SEC=1
|
||||||
|
PAD=" | "
|
||||||
|
update_300 &
|
||||||
|
update_30 &
|
||||||
|
update_3 &
|
||||||
|
while true; do
|
||||||
|
xsetroot -name "$(mem)G$PAD$(cat /tmp/.cpu)$PAD$(cat /tmp/.mhz)$PAD$(cat /tmp/.temp)°C$PAD$(cat /tmp/.wifi), $(cat /tmp/.online)$PAD$(vol)$PAD$(bat)$PAD$(cat /tmp/.wttr), $(time_date)"
|
||||||
|
sleep $SLEEP_SEC
|
||||||
|
done
|
||||||
26
bin/colors.sh
Executable file
26
bin/colors.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This file echoes a bunch of color codes to the
|
||||||
|
#terminal to demonstrate what's available. Each
|
||||||
|
# line is the color code of one forground color,
|
||||||
|
# out of 17 (default + 16 escapes), followed by a
|
||||||
|
# test use of that color on all nine background
|
||||||
|
# colors (default + 8 escapes).
|
||||||
|
#
|
||||||
|
|
||||||
|
T='gYw' # The test text
|
||||||
|
|
||||||
|
echo -e "\n 40m 41m 42m 43m\
|
||||||
|
44m 45m 46m 47m";
|
||||||
|
|
||||||
|
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \
|
||||||
|
'1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \
|
||||||
|
' 36m' '1;36m' ' 37m' '1;37m';
|
||||||
|
do FG=${FGs// /}
|
||||||
|
echo -en " $FGs \033[$FG $T "
|
||||||
|
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
|
||||||
|
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
|
||||||
|
done
|
||||||
|
echo;
|
||||||
|
done
|
||||||
|
echo
|
||||||
19
bin/extract
Executable file
19
bin/extract
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
if [ -f $1 ] ; then
|
||||||
|
case $1 in
|
||||||
|
*.tar.bz2) tar xjf $1 ;;
|
||||||
|
*.tar.xz) tar xf $1 ;;
|
||||||
|
*.tar.gz) tar xzf $1 ;;
|
||||||
|
*.bz2) bunzip2 $1 ;;
|
||||||
|
*.rar) unrar x $1 ;;
|
||||||
|
*.gz) gunzip $1 ;;
|
||||||
|
*.tar) tar xf $1 ;;
|
||||||
|
*.tbz2) tar xjf $1 ;;
|
||||||
|
*.tgz) tar xzf $1 ;;
|
||||||
|
*.zip) 7z x $1 ;;
|
||||||
|
*.Z) uncompress $1;;
|
||||||
|
*.7z) 7z x $1 ;;
|
||||||
|
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "'$1' is not a valid file"
|
||||||
|
fi
|
||||||
13
bin/kp
Executable file
13
bin/kp
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
### PROCESS
|
||||||
|
# mnemonic: [K]ill [P]rocess
|
||||||
|
# show output of "ps -ef", use [tab] to select one or multiple entries
|
||||||
|
# press [enter] to kill selected processes and go back to the process list.
|
||||||
|
# or press [escape] to go back to the process list. Press [escape] twice to exit completely.
|
||||||
|
|
||||||
|
pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[kill:process]'" | awk '{print $2}')
|
||||||
|
|
||||||
|
if [ "x$pid" != "x" ]
|
||||||
|
then
|
||||||
|
echo $pid | xargs kill -${1:-9}
|
||||||
|
kp
|
||||||
|
fi
|
||||||
9
bin/lc
Executable file
9
bin/lc
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Usage: lc [number_of_cpus_to_load [number_of_seconds] ]
|
||||||
|
pids=""
|
||||||
|
cpus=${1:-1}
|
||||||
|
seconds=${2:-60}
|
||||||
|
echo loading $cpus CPUs for $seconds seconds
|
||||||
|
trap 'for p in $pids; do kill $p; done' 0
|
||||||
|
for ((i=0;i<cpus;i++)); do while : ; do : ; done & pids="$pids $!"; done
|
||||||
|
sleep $seconds
|
||||||
71
bin/ufetch
Executable file
71
bin/ufetch
Executable file
|
|
@ -0,0 +1,71 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
## INFO
|
||||||
|
host="$(cat /etc/hostname)"
|
||||||
|
os='Debian 11'
|
||||||
|
kernel="$(uname -sr)"
|
||||||
|
uptime="69 days, 4 hours, 20 minutes"
|
||||||
|
packages="$(apt list --installed 2>/dev/null | wc -l)"
|
||||||
|
shell="$(basename "$SHELL")"
|
||||||
|
|
||||||
|
## UI DETECTION
|
||||||
|
if [ -n "${DE}" ]; then
|
||||||
|
ui="${DE}"
|
||||||
|
uitype='DE'
|
||||||
|
elif [ -n "${WM}" ]; then
|
||||||
|
ui="${WM}"
|
||||||
|
uitype='WM'
|
||||||
|
elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then
|
||||||
|
ui="${XDG_CURRENT_DESKTOP}"
|
||||||
|
uitype='DE'
|
||||||
|
elif [ -n "${DESKTOP_SESSION}" ]; then
|
||||||
|
ui="${DESKTOP_SESSION}"
|
||||||
|
uitype='DE'
|
||||||
|
elif [ -f "${HOME}/.xinitrc" ]; then
|
||||||
|
ui="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)"
|
||||||
|
uitype='WM'
|
||||||
|
elif [ -f "${HOME}/.xsession" ]; then
|
||||||
|
ui="$(tail -n 1 "${HOME}/.xsession" | cut -d ' ' -f 2)"
|
||||||
|
uitype='WM'
|
||||||
|
else
|
||||||
|
ui='unknown'
|
||||||
|
uitype='UI'
|
||||||
|
fi
|
||||||
|
|
||||||
|
##hardcode because our .xinitrc doesn't end like exec wm
|
||||||
|
ui="dwm"
|
||||||
|
|
||||||
|
## DEFINE COLORS
|
||||||
|
# probably don't change these
|
||||||
|
if [ -x "$(command -v tput)" ]; then
|
||||||
|
bold="$(tput bold)"
|
||||||
|
black="$(tput setaf 0)"
|
||||||
|
red="$(tput setaf 1)"
|
||||||
|
green="$(tput setaf 2)"
|
||||||
|
yellow="$(tput setaf 3)"
|
||||||
|
blue="$(tput setaf 4)"
|
||||||
|
magenta="$(tput setaf 5)"
|
||||||
|
cyan="$(tput setaf 6)"
|
||||||
|
white="$(tput setaf 7)"
|
||||||
|
reset="$(tput sgr0)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# you can change these
|
||||||
|
lc="${reset}${bold}${white}" # labels
|
||||||
|
nc="${reset}${bold}${white}" # user and hostname
|
||||||
|
ic="${reset}" # info
|
||||||
|
c0="${reset}${white}" # first color
|
||||||
|
|
||||||
|
## OUTPUT
|
||||||
|
clear
|
||||||
|
cat <<EOF
|
||||||
|
${c0}${nc}${USER}${ic}@${nc}${host}${reset}
|
||||||
|
------
|
||||||
|
${c0}${lc}OS: ${ic}${os}${reset}
|
||||||
|
${c0}${lc}KERNEL: ${ic}${kernel}${reset}
|
||||||
|
${c0}${lc}UPTIME: ${ic}${uptime}${reset}
|
||||||
|
${c0}${lc}PACKAGES: ${ic}${packages}${reset}
|
||||||
|
${c0}${lc}SHELL: ${ic}${shell}${reset}
|
||||||
|
${c0}${lc}${uitype}: ${ic}${ui}${reset}
|
||||||
|
|
||||||
|
EOF
|
||||||
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681202837,
|
"lastModified": 1701680307,
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701609479,
|
"lastModified": 1703808179,
|
||||||
"narHash": "sha256-mcEnMz7XB3K57ZX16VXoEkswljSNGXdMuUu5+g8a8R8=",
|
"narHash": "sha256-svlFDbozZlZJwnnSoeh5yE9jEnCmgmuRMRX866CL4J0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "e504e8d01f950776c3a3160ba38c5957a1b89e66",
|
"rev": "77c698fa4b3081b6019ad77d1bfedf06dbbde0db",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -40,11 +40,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701598471,
|
"lastModified": 1703545041,
|
||||||
"narHash": "sha256-kHdJ2qc4qKeMTzUIHEcP41ah/dBIhCgvWgrjllt2G78=",
|
"narHash": "sha256-nvQA+k1rSszrf4kA4eK2i/SGbzoXyoKHzzyzq/Jca1w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "a89745edd5f657e2e5be5ed1bea86725ca78d92e",
|
"rev": "a15b6e525f5737a47b4ce28445c836996fb2ea8c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -56,11 +56,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701253981,
|
"lastModified": 1703438236,
|
||||||
"narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=",
|
"narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58",
|
"rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -78,11 +78,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1695262048,
|
"lastModified": 1703231060,
|
||||||
"narHash": "sha256-gLJnpuxRhZjvAkHTPMHXi927lHcDrT8/Lx5xx7lhGt4=",
|
"narHash": "sha256-oAiG8DuK+zO9niSSb2qbA0YM6gBlpChM6qoXtuD6e4w=",
|
||||||
"owner": "iofq",
|
"owner": "iofq",
|
||||||
"repo": "nvim.nix",
|
"repo": "nvim.nix",
|
||||||
"rev": "dc80e6953dbad5ad78be591eb7536b1eeb404d79",
|
"rev": "0c397bd3c752daa6b5e5c27c029723a5ca00ffde",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = (
|
nixosConfigurations = (
|
||||||
import ./nixos { inherit inputs pkgs attrs; }
|
import ./nixos { inherit inputs pkgs attrs system; }
|
||||||
);
|
);
|
||||||
homeConfigurations = (
|
homeConfigurations = (
|
||||||
import ./home-manager { inherit inputs pkgs attrs; }
|
import ./home-manager { inherit inputs pkgs attrs; }
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ inputs, pkgs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
nix = {
|
nix = {
|
||||||
|
|
@ -6,6 +6,11 @@
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "22.11";
|
stateVersion = "22.11";
|
||||||
|
file = {
|
||||||
|
".local/bin" = {
|
||||||
|
source = ../bin;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
imports = [ ./shared/programs/min.nix ];
|
imports = [ ./shared/programs/min.nix ];
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, host, ...}:
|
{ host, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
sus = "systemctl suspend";
|
sus = "systemctl suspend";
|
||||||
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
|
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
|
||||||
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
|
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
|
||||||
|
update = "nix flake update $NIX_FLAKE && rbs && hms";
|
||||||
nvim-dev = "nix run ~/dev/nvim.nix";
|
nvim-dev = "nix run ~/dev/nvim.nix";
|
||||||
g = "git";
|
g = "git";
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,15 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
matchBlocks = {
|
||||||
|
"10110110.xyz" = {
|
||||||
|
hostname = "10110110.xyz";
|
||||||
|
identityFile = "/home/e/.ssh/racknerd";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,7 @@
|
||||||
{ packages, host, ... }:
|
{ packages, host, system, ... }:
|
||||||
{
|
{
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
|
|
||||||
users.groups.plugdev = {}; # Create plugdev group
|
users.groups.plugdev = {}; # Create plugdev group
|
||||||
|
|
||||||
networking.hostName = host.hostName;
|
networking.hostName = host.hostName;
|
||||||
networking.firewall = {
|
|
||||||
enable = true;
|
|
||||||
allowedTCPPorts = [11111];
|
|
||||||
allowedUDPPorts = [];
|
|
||||||
logRefusedConnections = true;
|
|
||||||
};
|
|
||||||
users.users.${host.username} = {
|
users.users.${host.username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
|
|
@ -22,7 +10,6 @@
|
||||||
"video"
|
"video"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
security.pam.services.swaylock = {};
|
|
||||||
time.timeZone = "America/Chicago";
|
time.timeZone = "America/Chicago";
|
||||||
|
|
||||||
# Enable flakes and unfree packages
|
# Enable flakes and unfree packages
|
||||||
|
|
@ -35,6 +22,4 @@
|
||||||
dates = "00:00";
|
dates = "00:00";
|
||||||
options = "--delete-older-than 14d";
|
options = "--delete-older-than 14d";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
{ inputs, ... }:
|
{ inputs, pkgs, attrs, system, ... }:
|
||||||
let
|
{
|
||||||
in
|
t14 = inputs.nixpkgs.lib.nixosSystem {
|
||||||
{ t14 = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs system pkgs;
|
||||||
system = "x86_64-linux";
|
|
||||||
host = {
|
host = {
|
||||||
hostName = "t14";
|
hostName = "t14";
|
||||||
username = "e";
|
username = attrs.username;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -16,6 +14,17 @@ in
|
||||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
rknrd = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs system pkgs;
|
||||||
|
host = {
|
||||||
|
hostName = "rknrd";
|
||||||
|
username = attrs.username;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
./racknerd/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
37
nixos/racknerd/configuration.nix
Normal file
37
nixos/racknerd/configuration.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{ inputs, pkgs, system, ... }: {
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nfs-utils
|
||||||
|
];
|
||||||
|
boot.tmp.cleanOnBoot = true;
|
||||||
|
zramSwap.enable = false;
|
||||||
|
networking.hostName = "rknrd";
|
||||||
|
networking.domain = "";
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [22];
|
||||||
|
allowedUDPPorts = [];
|
||||||
|
logRefusedConnections = true;
|
||||||
|
};
|
||||||
|
services.openssh.enable = true;
|
||||||
|
users.users = {
|
||||||
|
root = {
|
||||||
|
openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILU2TUxKyGKoZ68IG4hw23RmxVf72u5K9W0StkgTr0b2 e@t14'' ];
|
||||||
|
};
|
||||||
|
e = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
packages = with pkgs; [
|
||||||
|
vim
|
||||||
|
htop
|
||||||
|
tree
|
||||||
|
];
|
||||||
|
openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILU2TUxKyGKoZ68IG4hw23RmxVf72u5K9W0StkgTr0b2 e@t14'' ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
nix.settings.trusted-users = ["e"];
|
||||||
|
system.stateVersion = "22.11";
|
||||||
|
}
|
||||||
10
nixos/racknerd/hardware-configuration.nix
Executable file
10
nixos/racknerd/hardware-configuration.nix
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
boot.loader.grub.device = "/dev/vda";
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
|
boot.initrd.kernelModules = [ "nvme" ];
|
||||||
|
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
|
||||||
|
swapDevices = [ { device = "/dev/vda2"; } ];
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,16 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./nano.nix
|
./nano.nix
|
||||||
];
|
];
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [11111];
|
||||||
|
allowedUDPPorts = [];
|
||||||
|
logRefusedConnections = true;
|
||||||
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
cryptsetup
|
cryptsetup
|
||||||
nfs-utils
|
nfs-utils
|
||||||
|
|
@ -15,6 +25,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.light.enable = true;
|
programs.light.enable = true;
|
||||||
|
security.pam.services.swaylock = {};
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue