clean up
This commit is contained in:
1 parent
1bbbe129d8
commit
1abff11fdc
12 files changed
+367
-170
No files matched your search
@@ -0,0 +1,26 @@
|
||||
set shell := ["zsh", "-cu"]
|
||||
|
||||
default:
|
||||
just --list
|
||||
|
||||
build:
|
||||
nh os build
|
||||
|
||||
switch:
|
||||
nh os switch
|
||||
|
||||
rollback:
|
||||
sudo nixos-rebuild switch --rollback
|
||||
|
||||
update input_name="":
|
||||
if [ ! -z {{input_name}} ]; then \
|
||||
cmd="nix flake update {{input_name}}"; \
|
||||
else \
|
||||
cmd="nix flake update"; \
|
||||
fi
|
||||
echo $cmd
|
||||
# $cmd
|
||||
git diff flake.lock
|
||||
|
||||
remote cmd target:
|
||||
./bin/extra/build-remote-nixos {{target}} {{cmd}}
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
mkdir -p results
|
||||
|
||||
nix flake show --json | jq -r -c '.nixosConfigurations | keys[]' | while read i; do
|
||||
echo "[[SKYG]] Building current $i"
|
||||
sudo nixos-rebuild build --flake .#$i
|
||||
rm -f results/$i-result
|
||||
mv result results/$i-result
|
||||
done
|
||||
|
||||
nix flake update
|
||||
|
||||
rm -f diffs
|
||||
mkdir diffs
|
||||
nix flake show --json | jq -r -c '.nixosConfigurations | keys[]' | while read i; do
|
||||
echo "[[SKYG]] Building new $i"
|
||||
sudo nixos-rebuild build --flake .#$i
|
||||
rm -f results/$i-result-post
|
||||
mv result results/$i-result-post
|
||||
nvd diff results/$i-result results/$i-result-post > diffs/$i
|
||||
done
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
|
||||
# Bootstrap
|
||||
set -e
|
||||
ROOT_FOLDER=$(realpath $0 | xargs dirname | xargs dirname)
|
||||
. $ROOT_FOLDER/bin/extra/common.sh
|
||||
# Bootstrap
|
||||
|
||||
MENAME=$(basename $0)
|
||||
|
||||
function run-build() {
|
||||
: Run nixos build and emits difference
|
||||
:
|
||||
nh os build --flake . --show-trace --print-build-logs --verbose
|
||||
}
|
||||
|
||||
function run-switch() {
|
||||
: Runs nixos switch and ensures that we actually saw a build\'s difference
|
||||
:
|
||||
nh os switch --flake . --show-trace --print-build-logs --verbose
|
||||
|
||||
}
|
||||
|
||||
function run-rollback() {
|
||||
: Rolls back to last configuration
|
||||
:
|
||||
sudo nixos-rebuild switch --rollback
|
||||
}
|
||||
|
||||
function run-update() {
|
||||
: Updates a single flake and runs update
|
||||
: Usage: skyg update {name-of-input}
|
||||
input_name=${1}
|
||||
if [ ! -z $input_name ]; then
|
||||
cmd="nix flake update $input_name"
|
||||
else
|
||||
cmd="nix flake update"
|
||||
fi
|
||||
echo $cmd
|
||||
$cmd
|
||||
git diff flake.lock
|
||||
}
|
||||
|
||||
function run-diff() {
|
||||
: Diff results to current system
|
||||
:
|
||||
echo -e "Running ${YELLOW_BOLD}nvd${NC}"
|
||||
sudo nvd diff /run/current-system result | sed "s/^/\t│ /"
|
||||
echo "press any key to continue "
|
||||
read
|
||||
echo -e "\t└──${NC}DONE ${BLUE_BOLD}nvd${NC}"
|
||||
echo -e "Running ${YELLOW_BOLD}diff${NC}"
|
||||
diff --color=always -r /run/current-system result > result.diff
|
||||
cat result.diff | sed "s/^/\t│ /"
|
||||
echo -e "\t└──${NC}DONE ${BLUE_BOLD}diff${NC} @ ${pwd}/result.diff"
|
||||
}
|
||||
|
||||
function run-remote-deploy() {
|
||||
: Builds locally the system and deploys to an external system
|
||||
: Usage: skyg remote-deploy {target} {cmd}
|
||||
target=${1}
|
||||
cmd=${2}
|
||||
$ROOT_FOLDER/bin/extra/build-remote-nixos ${target} ${cmd}
|
||||
}
|
||||
|
||||
|
||||
function run-build-all() {
|
||||
: Builds all remote and local configurations
|
||||
: Usage: skyg build-all
|
||||
mkdir -p results
|
||||
|
||||
nix flake show --json | jq -r -c '.nixosConfigurations | keys[]' | while read i; do
|
||||
echo "[[SKYG]] Building current $i"
|
||||
sudo nixos-rebuild build --flake .#$i
|
||||
rm -f results/$i-result
|
||||
mv result results/$i-result
|
||||
done
|
||||
|
||||
nix flake update
|
||||
|
||||
rm -f diffs
|
||||
mkdir diffs
|
||||
nix flake show --json | jq -r -c '.nixosConfigurations | keys[]' | while read i; do
|
||||
echo "[[SKYG]] Building new $i"
|
||||
sudo nixos-rebuild build --flake .#$i
|
||||
rm -f results/$i-result-post
|
||||
mv result results/$i-result-post
|
||||
nvd diff results/$i-result results/$i-result-post > diffs/$i
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
function list_run_functions() {
|
||||
declare -F | awk '$3 ~ /^run-/{sub("run-", "", $3); print $3}'
|
||||
}
|
||||
|
||||
all_functions=$(list_run_functions)
|
||||
|
||||
for f in ${all_functions[@]}; do
|
||||
if [ "$1" == "$f" ]; then
|
||||
echo -e "Running ${BLUE_BOLD}$1${NC}"
|
||||
run-$1 ${@:2}
|
||||
ecode=$(echo $?)
|
||||
echo -e "\t└──${NC}DONE ${BLUE_BOLD}$1${NC}"
|
||||
exit $ecode
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "Invalid Command '$1' please select one of${NC}"
|
||||
|
||||
for function_name in $all_functions; do
|
||||
start_line=$(grep -n -m 1 "function run-$function_name" "${BASH_SOURCE[0]}" | cut -d: -f1)
|
||||
end_line=$(awk "NR > $start_line && /^}/ {print NR; exit}" "${BASH_SOURCE[0]}")
|
||||
function_body=$(sed -n "${start_line},${end_line}p" "${BASH_SOURCE[0]}")
|
||||
description=$(echo "$function_body" | sed -n '/^\s*:/,/^\s*[^:]/p' | sed 's/^\s*:\s*/ │ /')
|
||||
echo -e "$BOLD\r$MENAME \`${function_name}\`$NC\n${description}\n └──────────\n"
|
||||
done
|
||||
+35
-22
@@ -7,9 +7,6 @@ input {
|
||||
}
|
||||
|
||||
|
||||
spawn-at-startup "waypaper --restore"
|
||||
spawn-at-startup "blueman-tray"
|
||||
|
||||
environment {
|
||||
QT_QPA_PLATFORM "wayland"
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION "1"
|
||||
@@ -18,6 +15,33 @@ environment {
|
||||
ELECTRON_OZONE_PLATFORM_HINT "auto"
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Programs to start on startup
|
||||
// =========================
|
||||
|
||||
spawn-at-startup "waypaper --restore"
|
||||
spawn-at-startup "blueman-tray"
|
||||
|
||||
|
||||
/// Com Apps
|
||||
workspace "chat" {
|
||||
open-on-output "eDP-1"
|
||||
}
|
||||
window-rule {
|
||||
match app-id=r#"^Slack$"#
|
||||
match app-id=r#"^signal$"#
|
||||
open-on-workspace "chat"
|
||||
open-focused true
|
||||
}
|
||||
|
||||
// Nix Setup
|
||||
workspace "nix-setup" {
|
||||
open-on-output "eDP-1"
|
||||
}
|
||||
|
||||
workspace "homelab" {
|
||||
open-on-output "eDP-1"
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Outputs
|
||||
@@ -70,9 +94,7 @@ layout {
|
||||
position "top"
|
||||
place-within-column
|
||||
}
|
||||
shadow {
|
||||
on
|
||||
}
|
||||
shadow {}
|
||||
preset-column-widths {
|
||||
proportion 0.33333
|
||||
proportion 0.5
|
||||
@@ -95,12 +117,13 @@ window-rule {
|
||||
}
|
||||
animations {
|
||||
window-movement {
|
||||
duration-ms 500
|
||||
curve "ease-out-expo"
|
||||
duration-ms 250
|
||||
}
|
||||
workspace-switch {
|
||||
duration-ms 500
|
||||
curve "ease-out-expo"
|
||||
duration-ms 250
|
||||
}
|
||||
horizontal-view-movement {
|
||||
duration-ms 250
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +149,7 @@ window-rule {
|
||||
match app-id=r#"^chrome-.*"#
|
||||
match app-id="waypaper"
|
||||
match title="$Huddle:.*" app-id="Slack"
|
||||
match title="Visual Studio Code" app-id="code"
|
||||
// match title="Visual Studio Code" app-id="code"
|
||||
|
||||
open-focused true
|
||||
open-floating true
|
||||
@@ -146,6 +169,7 @@ window-rule {
|
||||
open-floating false
|
||||
open-maximized true
|
||||
open-focused true
|
||||
opacity 0.95
|
||||
}
|
||||
// =========================
|
||||
// General Stuff
|
||||
@@ -215,14 +239,3 @@ binds {
|
||||
Mod+Ctrl+B { spawn "waybar" "-c" "/home/ari/.config/waybar/bottom-config.jsonc"; }
|
||||
}
|
||||
|
||||
|
||||
/// Com Apps
|
||||
workspace "chat" {
|
||||
open-on-output "eDP-1"
|
||||
}
|
||||
window-rule {
|
||||
match app-id=r#"^Slack$"#
|
||||
match app-id=r#"^signal$"#
|
||||
open-on-workspace "chat"
|
||||
open-focused true
|
||||
}
|
||||
File renamed without changes.
@@ -16,8 +16,9 @@
|
||||
"niri/workspaces": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"code": "💻",
|
||||
"chat": "💬"
|
||||
"chat": "💬",
|
||||
"nix-setup": "🧠",
|
||||
"homelab": "🏠"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
* {
|
||||
font-family: "Fira Code";
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(30, 30, 46, 0.5);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
window#waybar.termite {
|
||||
background-color: #3F3F3F;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
button {
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
transition-property: none;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
button:hover {
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
border: none;
|
||||
-gtk-icon-effect: none;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #64727D;
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#keyboard-state,
|
||||
#scratchpad,
|
||||
#custom-logout,
|
||||
#mpd {
|
||||
padding: 0px 10px;
|
||||
margin-right: 1px;
|
||||
color: #f0f0ff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.modules-left>widget:first-child>#workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.modules-right>widget:last-child>#workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#battery {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged {
|
||||
color: #ffffff;
|
||||
background-color: rgba(38, 166, 91, 0.9);
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: rgba(245, 60, 60, 0.9);
|
||||
color: #fff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background-color: rgba(245, 60, 60, 0.9);
|
||||
}
|
||||
|
||||
|
||||
#taskbar {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
#taskbar button {
|
||||
color: #f0f0ff;
|
||||
background-color: rgba(30, 30, 46, 0.6);
|
||||
}
|
||||
|
||||
#taskbar button:first-child {
|
||||
border-radius: 99px 0 0 99px;
|
||||
}
|
||||
|
||||
#taskbar button:last-child {
|
||||
border-radius: 0 99px 99px 0;
|
||||
}
|
||||
|
||||
#taskbar button:first-child:last-child {
|
||||
border-radius: 99px;
|
||||
}
|
||||
|
||||
#taskbar button:hover {
|
||||
background-color: rgba(49, 50, 68, 0.6);
|
||||
}
|
||||
|
||||
#taskbar button.active {
|
||||
background-color: rgba(88, 91, 112, 0.6);
|
||||
}
|
||||
|
||||
#taskbar button.active:hover {
|
||||
background-color: rgba(108, 112, 134, 0.6);
|
||||
}
|
||||
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: rgba(46, 32, 30, 0.9);
|
||||
}
|
||||
|
||||
slider {
|
||||
min-height: 0px;
|
||||
min-width: 0px;
|
||||
opacity: 0;
|
||||
background-image: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
trough {
|
||||
min-height: 10px;
|
||||
min-width: 80px;
|
||||
border-radius: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
highlight {
|
||||
min-width: 10px;
|
||||
border-radius: 5px;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
#wireplumber {
|
||||
background-color: rgba(255, 240, 245, 0.8);
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#wireplumber.muted {
|
||||
background-color: rgba(245, 60, 60, 0.9);
|
||||
}
|
||||
|
||||
|
||||
#temperature.critical {
|
||||
background-color: rgba(235, 77, 75, 0.8);
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: rgba(41, 128, 185, 0.8);
|
||||
}
|
||||
|
||||
#tray>.passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray>.needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
background-color: #2d3436;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
|
||||
#language {
|
||||
background: #00b093;
|
||||
color: #740864;
|
||||
margin: 0 5px;
|
||||
min-width: 16px;
|
||||
}
|
||||
|
||||
#keyboard-state {
|
||||
background: rgba(151, 225, 173, 0.8);
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#keyboard-state>label {
|
||||
margin-left: 2.5px;
|
||||
margin-right: 2.5px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
#keyboard-state>label.locked {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
File renamed without changes.
@@ -49,6 +49,7 @@ in
|
||||
];
|
||||
};
|
||||
};
|
||||
users.users.ari.extraGroups = [ "input" "disk" ];
|
||||
|
||||
virtualisation.waydroid.enable = true;
|
||||
|
||||
@@ -138,6 +139,7 @@ in
|
||||
vscode
|
||||
devenv
|
||||
just
|
||||
rpi-imager
|
||||
|
||||
# Run macos apps
|
||||
darling-dmg
|
||||
|
||||
@@ -23,6 +23,20 @@
|
||||
# Services
|
||||
skyg.nixos.server.services = {
|
||||
scrypted.enable = true;
|
||||
dockge = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
volumes = {
|
||||
stacks = {
|
||||
nfsServer = "terra1.lab.internal";
|
||||
share = "/mnt/Data/apps/arrs/dockge/stacks";
|
||||
};
|
||||
data = {
|
||||
nfsServer = "terra1.lab.internal";
|
||||
share = "/mnt/Data/apps/arrs/dockge/data";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
def k8s-namespaces [] {
|
||||
kubectl get namespaces -o jsonpath='{.items}' | from json | select metadata.name | rename value
|
||||
}
|
||||
|
||||
def k8s-secrets [namespace: string@k8s-namespaces = ""] {
|
||||
if not ($namespace | is-empty) {
|
||||
kubectl -n $namespace get secrets -o jsonpath='{.items}' | from json | select metadata.name | rename value
|
||||
} else {
|
||||
kubectl get secrets -o jsonpath='{.items}' | from json | select metadata.name | rename value
|
||||
}
|
||||
}
|
||||
def decode-secret [name: string@k8s-secrets] {
|
||||
kubectl get secret $name -o jsonpath='{.data}' |
|
||||
from json |
|
||||
transpose key value |
|
||||
update value { |r| $r.value | decode base64 | decode}
|
||||
}
|
||||
@@ -42,11 +42,11 @@ in
|
||||
path = [ pkgs.nwg-bar pkgs.niri ];
|
||||
script = ''
|
||||
${pkgs.waybar}/bin/waybar \
|
||||
--config /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/top-config.jsonc \
|
||||
--style /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/style.css &
|
||||
--config /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/top-bar.jsonc \
|
||||
--style /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/top-bar.css &
|
||||
${pkgs.waybar}/bin/waybar \
|
||||
--config /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/bottom-config.jsonc \
|
||||
--style /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/style.css
|
||||
--config /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/bottom-bar.jsonc \
|
||||
--style /home/${config.skyg.user.name}/nixos-setup/configs/niri/waybar/bottom-bar.css
|
||||
'';
|
||||
};
|
||||
systemd.user.services.niri-xwayland = makeNiriSystemdService {
|
||||
|
||||
Reference in new issue
Block a user