Compare commits

...

4 Commits

Author SHA1 Message Date
33702f4552 added docker and tor 2026-07-28 19:21:53 +01:00
4d9e050344 added user01 as a nix trusted user for devenv 2026-07-28 19:21:43 +01:00
a938343f87 devenv support (zsh feature) 2026-07-28 19:21:28 +01:00
637e665581 weylus feature 2026-07-22 13:35:09 +01:00
7 changed files with 221 additions and 30 deletions

120
flake.lock generated
View File

@@ -194,7 +194,25 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_8"
"systems": "systems_7"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_9"
},
"locked": {
"lastModified": 1731533236,
@@ -373,11 +391,11 @@
"wshowkeys": "wshowkeys"
},
"locked": {
"lastModified": 1783943095,
"narHash": "sha256-yolDQ38XW+EpTKMLli8BOcHKnIbR53iM03K9T6wkc9I=",
"lastModified": 1784471205,
"narHash": "sha256-u/m4ToCCm0kI1npq+wj+aIEJtuvv2LaER2DywD9TD6U=",
"ref": "refs/heads/main",
"rev": "84edd88834b645751babc02f44408ccb703e421f",
"revCount": 48,
"rev": "782cd6884b28f91f2af4274b99adcdb9c146fa79",
"revCount": 49,
"type": "git",
"url": "https://git.voidarc.co.uk/voidarc/hypr"
},
@@ -389,11 +407,11 @@
"hyprland-config": {
"flake": false,
"locked": {
"lastModified": 1783943095,
"narHash": "sha256-yolDQ38XW+EpTKMLli8BOcHKnIbR53iM03K9T6wkc9I=",
"lastModified": 1784471205,
"narHash": "sha256-u/m4ToCCm0kI1npq+wj+aIEJtuvv2LaER2DywD9TD6U=",
"ref": "refs/heads/main",
"rev": "84edd88834b645751babc02f44408ccb703e421f",
"revCount": 48,
"rev": "782cd6884b28f91f2af4274b99adcdb9c146fa79",
"revCount": 49,
"type": "git",
"url": "https://git.voidarc.co.uk/voidarc/hypr"
},
@@ -781,6 +799,22 @@
"type": "github"
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1780336545,
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1782467914,
@@ -895,11 +929,11 @@
},
"nixpkgs_9": {
"locked": {
"lastModified": 1780336545,
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
"lastModified": 1744536153,
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github"
},
"original": {
@@ -1050,11 +1084,30 @@
"otter-launcher": "otter-launcher_2",
"quickshell": "quickshell",
"sls-steam": "sls-steam",
"weylus": "weylus",
"woomer": "woomer_2",
"wrappers": "wrappers_3",
"wshowkeys": "wshowkeys_2"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_9"
},
"locked": {
"lastModified": 1784438913,
"narHash": "sha256-NYF7ZM5ip0u+w1pBFDpIGEbrbgN/wpnLFAmBkWkYMXw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "afacd6819d3765a05814ee8e3de74c77d42ac799",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sls-steam": {
"inputs": {
"nixpkgs": "nixpkgs_8"
@@ -1193,6 +1246,21 @@
"type": "github"
}
},
"systems_9": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
@@ -1211,6 +1279,28 @@
"type": "github"
}
},
"weylus": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1784471251,
"narHash": "sha256-07//RRO1xhgR4lKyq460+iOEDHUw21rJRi59fMUhLfM=",
"owner": "voidarclabs",
"repo": "WeylusCommunityEdition",
"rev": "bcf34c2a2c9d3cbac00ca0d3e6ede5b3bbc6a18c",
"type": "github"
},
"original": {
"owner": "voidarclabs",
"repo": "WeylusCommunityEdition",
"type": "github"
}
},
"woomer": {
"inputs": {
"crane": "crane",
@@ -1237,7 +1327,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_7"
"systems": "systems_8"
},
"locked": {
"lastModified": 1782685056,
@@ -1291,7 +1381,7 @@
},
"wrappers_3": {
"inputs": {
"nixpkgs": "nixpkgs_9"
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1782135443,
@@ -1331,7 +1421,7 @@
},
"wshowkeys_2": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]

View File

@@ -41,6 +41,10 @@
url = "github:voidarclabs/wshowkeys";
inputs.nixpkgs.follows = "nixpkgs";
};
weylus = {
url = "github:voidarclabs/WeylusCommunityEdition";
inputs.nixpkgs.follows = "nixpkgs";
};
# Flake parts
flake-parts.url = "github:hercules-ci/flake-parts";

View File

@@ -1,7 +1,8 @@
{moduleWithSystem, ...}: {
flake.nixosModules.weylus = moduleWithSystem ({...}: {
flake.nixosModules.weylus = moduleWithSystem ({inputs', ...}: {
programs.weylus = {
enable = true;
package = inputs'.weylus.packages.default;
users = ["user01"];
};
});

View File

@@ -36,26 +36,27 @@
assert flakeLocation != "";
inputs.wrappers.wrappers.zsh.wrap {
inherit pkgs;
runtimePkgs = [pkgs.carapace pkgs.fzf];
runtimePkgs = [pkgs.carapace pkgs.devenv pkgs.fzf];
zshAliases = {
ls = "${lib.getExe pkgs.lsd} -l";
v = lib.getExe self'.packages.nvim;
cat = lib.getExe pkgs.bat;
lg = lib.getExe pkgs.lazygit;
devenv = lib.getExe pkgs.devenv;
carapace = lib.getExe pkgs.carapace;
man = "man -P \"${lib.getExe pkgs.bat} -p\"";
nsh = "nix-shell -p";
nrs = "( cd ${flakeLocation} && sudo nixos-rebuild switch --impure --flake . )";
vinix = "nvim --cmd 'cd ${flakeLocation}'";
vinix = "nvim --cmd 'cd ${flakeLocation}'";
};
zshrc.content = ''
if (( ''${+terminfo[smkx]} )) && (( ''${+terminfo[rmkx]} )); then
function zle-line-init() { echoti smkx }
source ${./devenv.zsh}
if (( ''${+terminfo[smkx]} )) && (( ''${+terminfo[rmkx]} )); then
function zle-line-init() { echoti smkx }
function zle-line-finish() { echoti rmkx }
zle -N zle-line-init
zle -N zle-line-finish
fi
autoload -U compinit && compinit
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
@@ -80,12 +81,21 @@
setopt NO_CASE_GLOB
${lib.getExe pkgs.any-nix-shell} zsh --info-right | source /dev/stdin
export EDITOR=nvim
eval "$(${lib.getExe pkgs.devenv} hook zsh)"
eval "$(${lib.getExe self'.packages.ohMyPosh} init zsh)"
${lib.getExe pkgs.any-nix-shell} zsh --info-right | source /dev/stdin
eval "$(${lib.getExe pkgs.devenv} hook zsh)"
typeset -ag precmd_functions
if (( ! ''${precmd_functions[(I)__devenv_reload_apply]} )); then
precmd_functions+=(__devenv_reload_apply)
fi
if (( ! ''${precmd_functions[(I)__devenv_restore_path]} )); then
precmd_functions+=(__devenv_restore_path)
fi
'';
};
ohMyPosh = inputs.wrappers.wrappers.oh-my-posh.wrap {

View File

@@ -0,0 +1,82 @@
__devenv_reload_apply() {
if [ -n "$DEVENV_RELOAD_FILE" ] && [ -f "$DEVENV_RELOAD_FILE" ]; then
local output
output=$(DEVENV_RELOAD_FILE="$DEVENV_RELOAD_FILE" bash <<'RELOAD_BASH' 2>/dev/null
__devenv_ignored_var() {
case "$1" in
_*|PWD|OLDPWD|SHLVL|SHELL|SHELLOPTS|BASHOPTS|BASH_*|HISTCMD|HISTFILE)
return 0 ;;
PS1|PS2|PS3|PS4|PROMPT|PROMPT_COMMAND|PROMPT_DIRTRIM)
return 0 ;;
COMP_*|READLINE_*|MAILCHECK|COLUMNS|LINES|RANDOM|SECONDS|LINENO|EPOCHSECONDS|EPOCHREALTIME|SRANDOM)
return 0 ;;
STARSHIP_*|__fish*|DIRENV_*|nix_saved_*)
return 0 ;;
*) return 1 ;;
esac
}
__devenv_capture_env() { declare -p -x 2>/dev/null | LC_ALL=C sort; }
__devenv_serialize_diff() { gzip -c | base64 -w0; }
__devenv_deserialize_diff() { echo "$1" | base64 -d | gzip -d 2>/dev/null; }
__devenv_compute_diff() {
local before_file="$1" after_file diff_content
after_file=$(mktemp); diff_content=$(mktemp)
__devenv_capture_env > "$after_file"
local -A before_vars after_vars
while IFS= read -r line; do
[[ "$line" != declare\ -x\ * ]] && continue
local vardef="${line#declare -x }" var="${vardef%%=*}"
[[ -z "$var" ]] && continue
__devenv_ignored_var "$var" && continue
before_vars["$var"]="$line"
done < "$before_file"
while IFS= read -r line; do
[[ "$line" != declare\ -x\ * ]] && continue
local vardef="${line#declare -x }" var="${vardef%%=*}"
[[ -z "$var" ]] && continue
__devenv_ignored_var "$var" && continue
after_vars["$var"]="$line"
done < "$after_file"
for var in "${!before_vars[@]}"; do
[[ "${after_vars[$var]}" != "${before_vars[$var]}" ]] && echo "P:${before_vars[$var]}" >> "$diff_content"
done
for var in "${!after_vars[@]}"; do
if [[ -z "${before_vars[$var]+x}" ]]; then echo "N:$var" >> "$diff_content"
elif [[ "${after_vars[$var]}" != "${before_vars[$var]}" ]]; then echo "N:$var" >> "$diff_content"; fi
done
_DEVENV_DIFF=$(__devenv_serialize_diff < "$diff_content"); export _DEVENV_DIFF
rm -f "$after_file" "$diff_content"
}
__devenv_apply_reverse_diff() {
[[ -z "$_DEVENV_DIFF" ]] && return
local -A prev_vars
local diff_content; diff_content=$(__devenv_deserialize_diff "$_DEVENV_DIFF")
while IFS= read -r line; do
if [[ "$line" == P:declare\ * ]]; then
local decl="${line#P:}" var="${decl#declare -x }"; var="${var%%=*}"
prev_vars["$var"]=1; eval "export ${decl#declare -x }" 2>/dev/null
fi
done <<< "$diff_content"
while IFS= read -r line; do
if [[ "$line" == N:* ]]; then
local var="${line#N:}"
[[ -z "${prev_vars[$var]+x}" ]] && unset "$var"
fi
done <<< "$diff_content"
}
__devenv_apply_reverse_diff
_before=$(mktemp); __devenv_capture_env > "$_before"
if { : >/dev/tty; } 2>/dev/null; then _devenv_reload_out=/dev/tty; else _devenv_reload_out=/dev/null; fi
source "$DEVENV_RELOAD_FILE" >"$_devenv_reload_out" 2>"$_devenv_reload_out"
rm -f "$DEVENV_RELOAD_FILE"; unset _devenv_reload_out
__devenv_compute_diff "$_before"; rm -f "$_before"
export -p
RELOAD_BASH
)
if [ -n "$output" ]; then eval "$output"; fi
_DEVENV_PATH="$PATH"
fi
}
__devenv_restore_path() {
[ -n "$_DEVENV_PATH" ] && export PATH="$_DEVENV_PATH"
}

View File

@@ -1,12 +1,15 @@
{
self,
inputs,
...
}: {
flake.nixosModules.hackstationConfiguration = {...}: {
{...}: {
flake.nixosModules.hackstationConfiguration = {pkgs, ...}: {
virtualisation.docker = {
enable = true;
};
networking = {
interfaces.enp5s0.wakeOnLan.enable = true;
hostName = "HACKSTATION";
};
environment.systemPackages = with pkgs; [
tor-browser
tor
];
};
}

View File

@@ -21,6 +21,7 @@
};
settings = {
cores = 6;
trusted-users = ["root" "user01"];
download-buffer-size = 524288000;
experimental-features = [
"nix-command"