Merge branch 'master' of ssh://git.joshuabell.xyz:3032/ringofstorms/dotfiles
This commit is contained in:
commit
fd3bb24e4a
10 changed files with 149 additions and 50 deletions
|
|
@ -30,6 +30,7 @@ with lib;
|
||||||
killall
|
killall
|
||||||
speedtest-cli
|
speedtest-cli
|
||||||
parted
|
parted
|
||||||
|
fio
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
|
|
@ -55,6 +56,8 @@ with lib;
|
||||||
# ripgrep
|
# ripgrep
|
||||||
rg = "rg --no-ignore";
|
rg = "rg --no-ignore";
|
||||||
rgf = "rg --files --glob '!/nix/store/**' 2>/dev/null | rg";
|
rgf = "rg --files --glob '!/nix/store/**' 2>/dev/null | rg";
|
||||||
|
|
||||||
|
speedtest_internet = "speedtest-cli";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.shellInit = lib.concatStringsSep "\n\n" [
|
environment.shellInit = lib.concatStringsSep "\n\n" [
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,77 @@ mail_clear() {
|
||||||
|
|
||||||
speedtest_fs () {
|
speedtest_fs () {
|
||||||
dir=$(pwd)
|
dir=$(pwd)
|
||||||
drive=$(df -h ${dir} | awk 'NR==2 {print $1}')
|
drive=$(df -h "${dir}" | awk 'NR==2 {print $1}')
|
||||||
echo Testing read speeds on drive ${drive}
|
echo "Testing filesystem on: ${dir}"
|
||||||
sudo hdparm -Tt ${drive}
|
echo "Underlying device: ${drive}"
|
||||||
test_file=$(date +%u%m%d)
|
|
||||||
test_file="${dir}/speedtest_fs_${test_file}"
|
|
||||||
echo
|
echo
|
||||||
echo Testing write speeds into test file: ${test_file}
|
|
||||||
dd if=/dev/zero of=${test_file} bs=8k count=10k; rm -f ${test_file}
|
|
||||||
}
|
|
||||||
|
|
||||||
speedtest_internet () {
|
test_file="${dir}/speedtest_fs_$(date +%u%m%d).fio"
|
||||||
speedtest-cli
|
file_size=1G # size of the test file
|
||||||
|
runtime=5 # seconds per test
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if [ -n "${test_file:-}" ] && [ -f "${test_file}" ]; then
|
||||||
|
echo
|
||||||
|
echo "Cleaning up test file: ${test_file}"
|
||||||
|
rm -f "${test_file}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ensure cleanup on normal exit, Ctrl+C, etc.
|
||||||
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
|
echo "Creating test file (${file_size}) at: ${test_file}"
|
||||||
|
fio --name=precreate \
|
||||||
|
--filename="${test_file}" \
|
||||||
|
--rw=write \
|
||||||
|
--bs=1M \
|
||||||
|
--size="${file_size}" \
|
||||||
|
--iodepth=16 \
|
||||||
|
--direct=1 \
|
||||||
|
--numjobs=1 \
|
||||||
|
--group_reporting >/dev/null 2>&1
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Sequential write test (${runtime}s) ==="
|
||||||
|
fio --name=seqwrite \
|
||||||
|
--filename="${test_file}" \
|
||||||
|
--rw=write \
|
||||||
|
--bs=1M \
|
||||||
|
--size="${file_size}" \
|
||||||
|
--iodepth=16 \
|
||||||
|
--direct=1 \
|
||||||
|
--numjobs=1 \
|
||||||
|
--time_based \
|
||||||
|
--runtime="${runtime}" \
|
||||||
|
--group_reporting
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Sequential read test (${runtime}s) ==="
|
||||||
|
fio --name=seqread \
|
||||||
|
--filename="${test_file}" \
|
||||||
|
--rw=read \
|
||||||
|
--bs=1M \
|
||||||
|
--size="${file_size}" \
|
||||||
|
--iodepth=16 \
|
||||||
|
--direct=1 \
|
||||||
|
--numjobs=1 \
|
||||||
|
--time_based \
|
||||||
|
--runtime="${runtime}" \
|
||||||
|
--group_reporting
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Random read/write test (${runtime}s, 70% reads, 4k blocks) ==="
|
||||||
|
fio --name=randrw \
|
||||||
|
--filename="${test_file}" \
|
||||||
|
--rw=randrw \
|
||||||
|
--rwmixread=70 \
|
||||||
|
--bs=4k \
|
||||||
|
--size="${file_size}" \
|
||||||
|
--iodepth=32 \
|
||||||
|
--direct=1 \
|
||||||
|
--numjobs=4 \
|
||||||
|
--time_based \
|
||||||
|
--runtime="${runtime}" \
|
||||||
|
--group_reporting
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
flakes/opencode/flake.lock
generated
12
flakes/opencode/flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766125104,
|
"lastModified": 1766870016,
|
||||||
"narHash": "sha256-l/YGrEpLromL4viUo5GmFH3K5M1j0Mb9O+LiaeCPWEM=",
|
"narHash": "sha256-fHmxAesa6XNqnIkcS6+nIHuEmgd/iZSP/VXxweiEuQw=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7d853e518814cca2a657b72eeba67ae20ebf7059",
|
"rev": "5c2bc52fb9f8c264ed6c93bd20afa2ff5e763dce",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -21,11 +21,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766426038,
|
"lastModified": 1767028968,
|
||||||
"narHash": "sha256-3TxsJjL5M83q9nOa4ls6rWfbECYUE6llzBAgqCYQml8=",
|
"narHash": "sha256-Z6Jk9Ee3+KHaQf7V/zbHHgotZ0gQA5Mtqpzs8PAQmBY=",
|
||||||
"owner": "sst",
|
"owner": "sst",
|
||||||
"repo": "opencode",
|
"repo": "opencode",
|
||||||
"rev": "6baee0791f48bcf32eef1e199d0cadca57772b9b",
|
"rev": "b7ce46f7a12e68283d6588c33aaf972426ddd65e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
8
hosts/h002/flake.lock
generated
8
hosts/h002/flake.lock
generated
|
|
@ -64,11 +64,11 @@
|
||||||
"common": {
|
"common": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "flakes/common",
|
"dir": "flakes/common",
|
||||||
"lastModified": 1766101431,
|
"lastModified": 1767040959,
|
||||||
"narHash": "sha256-96UMxqqZjI9L9SEBwL3yxbJBH5NC9Gq+kgAS4GQaWqE=",
|
"narHash": "sha256-YZyIBq1N0iRMN+R/LGNLmmkSmimer6MMysP032xC3C8=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "a5fa2f1e63efc1111940bf2c636e4043381886cd",
|
"rev": "d4f62bef186fd1a16510854754f5b328c3e4cab8",
|
||||||
"revCount": 959,
|
"revCount": 993,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
token = "11714da6-fd2e-436a-8b83-e0e07ba33a95";
|
token = "11714da6-fd2e-436a-8b83-e0e07ba33a95";
|
||||||
};
|
};
|
||||||
services.beszel.agent.environment = {
|
services.beszel.agent.environment = {
|
||||||
EXTRA_FILESYSTEMS = "sdb__Data";
|
EXTRA_FILESYSTEMS = "/data__Data";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,10 @@
|
||||||
fsType = "bcachefs";
|
fsType = "bcachefs";
|
||||||
options = [
|
options = [
|
||||||
"defaults"
|
"defaults"
|
||||||
"compression=zstd"
|
# "fsck"
|
||||||
"fsck"
|
# "fix_errors"
|
||||||
"fix_errors"
|
"x-systemd.device-timeout=600s"
|
||||||
|
"nofail"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,46 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkMerge [
|
||||||
|
({
|
||||||
services.nfs.server = {
|
services.nfs.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exports = ''
|
exports = ''
|
||||||
/data 100.64.0.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
|
/data 100.64.0.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
|
||||||
|
/data 10.12.14.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.nfs-utils
|
pkgs.nfs-utils
|
||||||
];
|
];
|
||||||
}
|
})
|
||||||
|
# Open ports and expose so local network works
|
||||||
|
(lib.mkIf config.networking.firewall.enable {
|
||||||
|
services.rpcbind.enable = true;
|
||||||
|
services.nfs.server.lockdPort = 32803;
|
||||||
|
services.nfs.server.mountdPort = 892;
|
||||||
|
services.nfs.server.statdPort = 662;
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
2049
|
||||||
|
111
|
||||||
|
892
|
||||||
|
32803
|
||||||
|
662
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
2049
|
||||||
|
111
|
||||||
|
892
|
||||||
|
32803
|
||||||
|
662
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
})
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
# Static DHCP reservations
|
# Static DHCP reservations
|
||||||
dhcp-host = [
|
dhcp-host = [
|
||||||
"00:be:43:b9:f4:e0,H001,10.12.14.10"
|
"00:be:43:b9:f4:e0,H001,10.12.14.10"
|
||||||
"54:04:a6:32:d1:71,H002,10.12.14.10"
|
"54:04:a6:32:d1:71,H002,10.12.14.183"
|
||||||
"c8:c9:a3:2b:7b:19,PRUSA-MK4,10.12.14.21"
|
"c8:c9:a3:2b:7b:19,PRUSA-MK4,10.12.14.21"
|
||||||
"24:e8:53:73:a3:c6,LGWEBOSTV,10.12.14.30"
|
"24:e8:53:73:a3:c6,LGWEBOSTV,10.12.14.30"
|
||||||
"2c:cf:67:6a:45:47,HOMEASSISTANT,10.12.14.22"
|
"2c:cf:67:6a:45:47,HOMEASSISTANT,10.12.14.22"
|
||||||
|
|
|
||||||
28
hosts/lio/flake.lock
generated
28
hosts/lio/flake.lock
generated
|
|
@ -64,11 +64,11 @@
|
||||||
"common": {
|
"common": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "flakes/common",
|
"dir": "flakes/common",
|
||||||
"lastModified": 1766961967,
|
"lastModified": 1767040810,
|
||||||
"narHash": "sha256-ccLRTjpQ3tqvNMMhCn02+WS74KE0i8bYLI/Jh4GdoiQ=",
|
"narHash": "sha256-7ylVqMemlv1lAT05ymJIrQRhDxwC84ncDheJWbdMkGw=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "6b023457ec9053e748bc49ac3e28ea82e2f998d4",
|
"rev": "677c5a2c4eb222cca9b740f10463c638fca3ada6",
|
||||||
"revCount": 975,
|
"revCount": 992,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
},
|
},
|
||||||
|
|
@ -321,11 +321,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766125104,
|
"lastModified": 1766870016,
|
||||||
"narHash": "sha256-l/YGrEpLromL4viUo5GmFH3K5M1j0Mb9O+LiaeCPWEM=",
|
"narHash": "sha256-fHmxAesa6XNqnIkcS6+nIHuEmgd/iZSP/VXxweiEuQw=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7d853e518814cca2a657b72eeba67ae20ebf7059",
|
"rev": "5c2bc52fb9f8c264ed6c93bd20afa2ff5e763dce",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -1237,11 +1237,11 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "flakes/opencode",
|
"dir": "flakes/opencode",
|
||||||
"lastModified": 1766961967,
|
"lastModified": 1767029710,
|
||||||
"narHash": "sha256-ccLRTjpQ3tqvNMMhCn02+WS74KE0i8bYLI/Jh4GdoiQ=",
|
"narHash": "sha256-MqilsCw9R5Rnq6qFBVctn/WtYO6vA8Rlt14tgKiIC/s=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "6b023457ec9053e748bc49ac3e28ea82e2f998d4",
|
"rev": "3f8232e8f98713bc74c8f4ace0694cdc19ae2d3d",
|
||||||
"revCount": 975,
|
"revCount": 988,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
|
||||||
},
|
},
|
||||||
|
|
@ -1256,11 +1256,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766426038,
|
"lastModified": 1767028968,
|
||||||
"narHash": "sha256-3TxsJjL5M83q9nOa4ls6rWfbECYUE6llzBAgqCYQml8=",
|
"narHash": "sha256-Z6Jk9Ee3+KHaQf7V/zbHHgotZ0gQA5Mtqpzs8PAQmBY=",
|
||||||
"owner": "sst",
|
"owner": "sst",
|
||||||
"repo": "opencode",
|
"repo": "opencode",
|
||||||
"rev": "6baee0791f48bcf32eef1e199d0cadca57772b9b",
|
"rev": "b7ce46f7a12e68283d6588c33aaf972426ddd65e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@
|
||||||
vlang
|
vlang
|
||||||
ttyd
|
ttyd
|
||||||
pavucontrol
|
pavucontrol
|
||||||
|
nfs-utils
|
||||||
];
|
];
|
||||||
|
|
||||||
services.flatpak.packages = [
|
services.flatpak.packages = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue