Compare commits

..

7 Commits

Author SHA1 Message Date
Sebastian Moser
a78d55965c . 2026-10-05 02:01:03 +02:00
Sebastian Moser
2139920fbc changes 2026-10-02 22:09:50 +02:00
Sebastian Moser
28986507c9 all recent config changes 2026-09-16 21:34:44 +00:00
Sebastian Moser
8898b126cd remove misc folder, content was moved into mods folder 2026-07-31 00:51:25 +02:00
Sebastian Moser
180af16d35 many changes i made in the last weeks 2026-07-31 00:51:01 +02:00
Sebastian Moser
5b895c54dc .. 2026-05-18 18:22:45 +02:00
Sebastian Moser
4a62c235f1 screen capture no longer working 2026-04-14 19:10:25 +02:00
188 changed files with 14961 additions and 1457 deletions

1
.direnv/flake-profile Symbolic link
View File

@@ -0,0 +1 @@
flake-profile-22-link

View File

@@ -0,0 +1 @@
/nix/store/j6p36ni1qcnyj14ymix6x7744bbzxqpm-nix-shell-env

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake ./mize --impure

5
.gitignore vendored
View File

@@ -1,3 +1,8 @@
gitignore
result*
build
# Added by cargo
/target

24
.gitmodules vendored Normal file
View File

@@ -0,0 +1,24 @@
[submodule "mize"]
path = mize
url = git@git.ppc.social:ppc/ppc.git
[submodule "element"]
path = element
url = git@github.com:c2vi/element-web.git
[submodule "grid"]
path = grid
url = git@github.com:theCheeseboard/theGrid.git
[submodule "marts"]
path = marts
url = https://git.ppc.social/ppc/marts.git
[submodule "forked-zed"]
path = forked-zed
url = git@github.com:c2vi/zed.git
[submodule "src/zmk"]
path = src/zmk
url = https://github.com/zmkfirmware/zmk.git
[submodule "doom"]
path = doom
url = https://github.com/doomemacs/core
[submodule "src/doom"]
path = src/doom
url = https://github.com/doomemacs/core

24
.zed/settings.json Normal file
View File

@@ -0,0 +1,24 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"linkedProjects": [
"mize/Cargo.toml",
//"forked-zed/Cargo.toml",
],
"cargo": {
"features": [ "target-js", "target-obsidian" ]
//"features": "all"
},
"check": {
"features": [ "target-js", "target-obsidian" ]
//"features": "all"
},
}
}
}
}

View File

@@ -43,11 +43,6 @@
#zed="WAYLAND_DISPLAY= zeditor";
npm="pnpm";
md="~/work/modules/modules/dev/run";
mize="~/work/mize/mize";
m="~/work/mize/mize";
c2="~/work/c2-system/cli/target/debug/system-c2-cli";
ports = "${pkgs.lsof}/bin/lsof -i -P -n";
losetup = "${pkgs.util-linux}/bin/losetup";
@@ -60,7 +55,6 @@
#text = if system == "x86_64-linux" then ''${inputs.my-log.packages.${system}.pythonForLog}/bin/python ${workDir}/log/new/client.py "$@"'' else "echo system not x86_84-linux";
#};
#in "${log}/bin/log";
mi = "nix run ${workDir}/mize";
cdd = "/sdcard";
n = "${pkgs.python3} ${self}/scripts/nav/main.py";
shutdown = "echo try harder.... xD";
@@ -111,6 +105,7 @@
export nl="--log-format bar-with-logs"
export acern="ssh://acern x86_64-linux,aarch64-linux - 20 10 big-parallel - -"
export fe="ssh://fe x86_64-linux,aarch64-linux - 20 10 big-parallel - -"
export mac="ssh://mac x86_64-linux,aarch64-linux - 8 5 big-parallel - -"
export mosatop="ssh://mosatop x86_64-linux,aarch64-linux - 8 5 big-parallel - -"
export hpm="ssh://hpm x86_64-linux,aarch64-linux - 8 5 big-parallel - -"

View File

@@ -23,8 +23,10 @@
"github.com" = {
hostname = "github.com";
};
sepp = {
user = "seb";
hetzner2 = {
user = "c2vi";
port = 2222;
hostname = "hetzner2.ecbb.cc";
};
here = {
port = 8888;
@@ -35,6 +37,9 @@
port = 49388;
user = "files";
};
nico = {
user = "root";
};
rpis = {
hostname = "rpi";
port = 49388;
@@ -48,18 +53,23 @@
feh = {
user = "root";
hostname = "100.107.101.77";
port = 49001;
hostname = "100.88.93.24";
port = 9000;
};
ti = {
user = "root";
hostname = "localhost";
port = 2222;
};
ppc-hosting = {
user = "root";
hostname = "100.107.101.77";
port = 49002;
hostname = "100.88.46.87";
port = 9000;
};
pcmc = {
user = "root";
hostname = "100.107.101.77";
port = 49003;
hostname = "100.88.33.187";
port = 9000;
};

View File

@@ -2,7 +2,7 @@
## thunderbird settings
programs.thunderbird = {
enable = true;
enable = false;
profiles.me = {
isDefault = true;
@@ -33,4 +33,3 @@
*/
}

3
apps/wireshark Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec sudo -E /usr/sbin/wireshark -P "persconf:$CONFIG_DIR/apps/wireshark-config" -P "persdata:$DATA_DIR/wireshark" "$@"

View File

@@ -0,0 +1,10 @@
local config_dir = os.getenv("CONFIG_DIR")
critical("This is a critical issue message!")
print("hello world!")
global run_user_scripts_when_superuser=true
-- qmi plugin
dofile(config_dir .. "/apps/wireshark-config/qmi.lua")

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,155 @@
# Recent settings file for Wireshark 4.7.3.
#
# This file is regenerated each time Wireshark is quit
# and when changing configuration profile.
# So be careful, if you want to make manual changes here.
# Main Toolbar show (hide).
# true or false (case-insensitive).
gui.toolbar_main_show: true
# Filter Toolbar show (hide).
# true or false (case-insensitive).
gui.filter_toolbar_show: true
# Wireless Settings Toolbar show (hide).
# true or false (case-insensitive).
gui.wireless_toolbar_show: false
# Packet list show (hide).
# true or false (case-insensitive).
gui.packet_list_show: true
# Tree view show (hide).
# true or false (case-insensitive).
gui.tree_view_show: true
# Byte view show (hide).
# true or false (case-insensitive).
gui.byte_view_show: true
# Packet diagram show (hide).
# true or false (case-insensitive).
gui.packet_diagram_show: true
# Statusbar show (hide).
# true or false (case-insensitive).
gui.statusbar_show: true
# Packet list colorize (hide).
# true or false (case-insensitive).
gui.packet_list_colorize: true
# Auto scroll packet list when capturing.
# true or false (case-insensitive).
capture.auto_scroll: true
# use as aggregation view.
# true or false (case-insensitive).
capture.aggregation_view: false
# Timestamp display format.
# One of: RELATIVE, RELATIVE_CAP, ABSOLUTE, ABSOLUTE_WITH_YMD, ABSOLUTE_WITH_YDOY, ABSOLUTE_WITH_DATE, DELTA, DELTA_DIS, EPOCH, UTC, UTC_WITH_YMD, UTC_WITH_YDOY, UTC_WITH_DATE
gui.time_format: RELATIVE
# Timestamp display precision.
# One of: AUTO, SEC, DSEC, CSEC, MSEC, USEC, NSEC, or a number between 0 and 9
gui.time_precision: AUTO
# Seconds display format.
# One of: SECONDS, HOUR_MIN_SEC
gui.seconds_format: SECONDS
# Zoom level.
# A decimal number.
gui.zoom_level: 0
# Bytes view display type.
# One of: HEX, BITS, DEC, OCT
gui.bytes_view: HEX
# Bytes view text encoding.
# One of: FROM_PACKET, ASCII, EBCDIC
gui.bytes_encoding: FROM_PACKET
# Packet diagram field values show (hide).
# true or false (case-insensitive).
gui.packet_diagram_field_values: false
# Allow hover selection in byte view.
# true or false (case-insensitive).
gui.allow_hover_selection: true
# Follow stream show as.
# One of: ASCII, ASCII_CONTROL, C_ARRAYS, EBCDIC, HEX_DUMP, HTML, IMAGE, JSON, RAW, RUST_ARRAY, UTF-8, YAML
gui.follow_show: ASCII
# Follow stream delta times.
# One of: NONE, TURN, ALL
gui.follow_delta: NONE
# Show packet bytes decode as.
# One of: NONE, BASE64, COMPRESSED, HEX_DIGITS, PERCENT_ENCODING, QUOTED_PRINTABLE, ROT13
gui.show_bytes_decode: NONE
# Show packet bytes show as.
# One of: ASCII, ASCII_CONTROL, C_ARRAYS, EBCDIC, HEX_DUMP, HTML, IMAGE, JSON, RAW, RUST_ARRAY, UTF-8, YAML
gui.show_bytes_show: ASCII
# Main window upper (or leftmost) pane size.
# Decimal number.
# Main window middle pane size.
# Decimal number.
# Packet list column pixel widths.
# Each pair of strings consists of a column format and its pixel width.
column.width:
%m, -1,
%t, -1,
%Gt, -1,
%s, -1,
%d, -1,
%p, -1,
%L, -1,
%i, -1
# Open conversation dialog tabs.
# List of conversation names, e.g. "TCP", "IPv6".
gui.conversation_tabs:
# Conversation dialog tabs columns.
# List of conversation columns numbers.
gui.conversation_tabs_columns:
# Open endpoint dialog tabs.
# List of endpoint names, e.g. "TCP", "IPv6".
gui.endpoint_tabs:
# Endpoint dialog tabs columns.
# List of endpoint columns numbers.
gui.endpoint_tabs_columns:
# For RLC stats, whether to use RLC PDUs found inside MAC frames.
# true or false (case-insensitive).
gui.rlc_pdus_from_mac_frames: false
# Additional Toolbars shown
# List of additional toolbars to show.
gui.additional_toolbar_show:
# Interface Toolbars show.
# List of interface toolbars to show.
gui.interface_toolbar_show:
# TCP Stream Graphs Moving Average Window Size.
gui.tsd_ma_window_size: 1
# TCP Stream Graphs Dialog Throughput show (hide).
# true or false (case-insensitive).
gui.tsd_throughput_show: true
# TCP Stream Graphs Dialog Goodput show (hide).
# true or false (case-insensitive).
gui.tsd_goodput_show: false

View File

@@ -0,0 +1,141 @@
# Common recent settings file for Wireshark 4.7.3.
#
# This file is regenerated each time Wireshark is quit
# and when changing configuration profile.
# So be careful, if you want to make manual changes here.
######## Recent capture files (latest last), cannot be altered through command line ########
recent.capture_file: /home/me/hi.pcapng
recent.capture_file: /home/me/nm-connection-up.pcapng
recent.capture_file: /home/me/nm-connection-down.pcapng
recent.capture_file: /home/me/modemmanager-stop.pcapng
######## Recent capture filters (latest first), cannot be altered through command line ########
######## Recent display filters (latest last), cannot be altered through command line ########
recent.display_filter: qmi
recent.display_filter: qmi.message_id == 0x0020 && qmi.service_id == 0x01
recent.display_filter: qmi.service_id
recent.display_filter: qmi.message_id == 0x0020
recent.display_filter: qmi.message_id
recent.display_filter: qmi &&
recent.display_filter: usb.device_address == 18
recent.display_filter: usb.device_address
# Main window geometry.
# Decimal numbers.
gui.geometry_main_x: 1920
gui.geometry_main_y: 0
gui.geometry_main_width: 619
gui.geometry_main_height: 436
# Main window maximized.
# true or false (case-insensitive).
gui.geometry_main_maximized: true
# Leftalign Action Buttons.
# true or false (case-insensitive).
gui.geometry_leftalign_actions: false
# Last used Configuration Profile.
gui.last_used_profile: Default
# Number of packets or events to check for automatic profile switching.
# Decimal number. Zero disables switching.
#gui.profile_switch_check_count: 1000
# Warn if running with elevated permissions (e.g. as root).
# true or false (case-insensitive).
privs.warn_if_elevated: true
# Warn if Wireshark is unable to capture.
# true or false (case-insensitive).
sys.warn_if_no_capture: true
# Find packet search in.
# One of: PACKET_LIST, PACKET_DETAILS, PACKET_BYTES
gui.search_in: PACKET_LIST
# Find packet character set.
# One of: NARROW_AND_WIDE, NARROW, WIDE
gui.search_char_set: NARROW_AND_WIDE
# Find packet case sensitive search.
# true or false (case-insensitive).
gui.search_case_sensitive: false
# Find packet search reverse direction.
# true or false (case-insensitive).
gui.search_reverse_dir: false
# Find packet search multiple occurrences.
# true or false (case-insensitive).
gui.search_multiple_occurs: false
# Find packet search type.
# One of: DISPLAY_FILTER, HEX_VALUE, STRING, REGEX
gui.search_type: DISPLAY_FILTER
# Welcome page sidebar Learn section visible.
# true or false (case-insensitive).
gui.welcome_page.sidebar.learn_visible: true
# Welcome page sidebar Tips section visible.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_visible: true
# Welcome page sidebar Tips event slides.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_events: true
# Welcome page sidebar Tips sponsorship slides.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_sponsorship: true
# Welcome page sidebar Tips tip-of-the-day slides.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_tips: true
# Welcome page sidebar Tips auto advance slides.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_auto_advance: true
# Welcome page sidebar Tips slide auto-advance interval in seconds.
gui.welcome_page.sidebar.tips_interval: 8
# Active theme (directory name under resources/themes).
gui.theme_name: wireshark
# Appearance mode.
# One of: system, light, dark
gui.color_scheme: system
# Welcome page sidebar Tips slides test.
# true or false (case-insensitive).
gui.welcome_page.sidebar.tips_slides_test: false
# Geometry and maximized state of Lua Console window.
# Decimal integers.
gui.geom.Lua Console.x: 1920
gui.geom.Lua Console.y: 0
gui.geom.Lua Console.width: 523
gui.geom.Lua Console.height: 865
# true or false (case-insensitive).
gui.geom.Lua Console.maximized: false
# Qt Geometry State (hex byte string).
gui.geom.Lua Console.qt_geometry: 01d9d0cb0003000000000780000000000000098a0000036000000780000000000000098a000003600000000102000000078000000780000000000000098a00000360
# Custom colors.
# List of custom colors selected in Qt color picker.
gui.custom_colors:
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff",
"ffffffff", "ffffffff"

View File

@@ -1,4 +1,4 @@
{ lib, inputs, self, secretsDir, specialArgs, ... }:
{ lib, inputs, self, secretsDir, specialArgs, pkgsUnstable, config, ... }:
# config that i use on all my hosts
@@ -8,7 +8,7 @@
];
home-manager.extraSpecialArgs = specialArgs;
home-manager.extraSpecialArgs = specialArgs // { inherit pkgsUnstable; hostName = config.networking.hostName; };
programs.dconf.enable = true;

View File

@@ -8,10 +8,10 @@
# - win + D command
# - kernel output for luks pwd on all displays
{ lib, pkgs, nur, unstable, inputs, ... }:
{ lib, pkgs, nur, unstable, inputs, config, ... }:
let
newerUnstableSrc = builtins.getFlake "nixpkgs/d0fc30899600b9b3466ddb260fd83deb486c32f1";
newerUnstableSrc = builtins.getFlake "nixpkgs/d23e2536a100b5108d22367a9c28785f48e3e4c8";
newerUnstable = import newerUnstableSrc.outPath {};
mySway = newerUnstable.sway;
@@ -73,6 +73,7 @@ in {
};
};
systemd.user.services.xdg-desktop-portal-wlr.enable = true;
systemd.user.services.xdg-desktop-portal-wlr.serviceConfig.ExecStart = let
settingsFormat = pkgs.formats.ini { };
configFile = settingsFormat.generate "xdg-desktop-portal-wlr.ini" {
@@ -111,6 +112,17 @@ in {
};
};
xdg.portal = {
wlr.enable = true;
wlr.settings = {
screencast = {
output_name = "eDP-1";
# to make streaming of individual windows work
chooser_type = "dmenu";
chooser_cmd = "${lib.getExe pkgs.bemenu}";
};
};
enable = true;
config = {
common = {
@@ -257,6 +269,18 @@ in {
### Output configuration
output * scale 1 bg #121212 solid_color
### always open alacritty on super+f
exec_always --no-startup-id alacritty --class scratchterm
for_window [app_id="scratchterm"] move scratchpad
bindsym $mod+f [app_id="scratchterm"] scratchpad show
for_window [app_id="scratchterm"] {
floating enable
resize set width 2400 px height 1400 px
move position center
move scratchpad
}
#################### from nwg-display
# Generated by nwg-displays on 2025-10-20 at 18:16:29. Do not edit manually.
@@ -360,6 +384,12 @@ output "HDMI-A-1" {
### Key bindings
# ppc ne
bindsym F12 exec ppc ne
bindsym F11 exec ppc ne -b
bindsym XF86AudioRaiseVolume exec ppc ne
bindsym XF86AudioLowerVolume exec ppc ne -b
# QuickLaunch
bindsym $mod+i mode "QuickLaunch"
mode QuickLaunch {
@@ -605,29 +635,39 @@ output "HDMI-A-1" {
position = "top";
modules-left = [
"group/options"
"sway/workspaces"
"sway/window#protocol"
"sway/window#name"
#"group/options"
"custom/timetrack_current"
];
modules-center = [
"clock"
];
modules-right = [
"sway/window#protocol"
"sway/window#name"
"tray"
"pulseaudio"
"custom/gpu"
"memory"
"cpu"
"temperature"
"battery"
"disk"
"clock"
#"pulseaudio"
#"custom/gpu"
#"memory"
#"cpu"
#"temperature"
#"disk"
#"sway/workspaces"
];
"custom/timetrack_current" = {
"exec" =
if config.networking.hostName == "main" then "~/work/config/target/debug/timetrack-waybar"
else if config.networking.hostName == "mac" then "/data/external/config/target/debug/timetrack-waybar"
else "~/here/config/target/debug/timetrack-waybar";
"tail" = true;
};
"custom/separator" = {
format = " ";
tooltip = false;
};
"custom/options" = {
format = " ";
tooltip = false;

View File

@@ -1,4 +1,4 @@
{ lib, self, ... }:
{ lib, self, pkgsUnstable, pkgs, ... }:
# config that i use on all my hosts, that run native nixos
# excluding for example my phone phone
@@ -6,6 +6,22 @@
{
##system.stateVersion = "23.05"; # Did you read the comment?
##### Netbird Configuration
services.netbird.package = pkgsUnstable.netbird;
services.netbird.clients.ppc = {
#login = {
#enable = true;
#setupKeyFile = "${secretsDir}/netbird-setup-key";
#};
port = 51821;
ui.enable = false;
openFirewall = true;
#openInternalFirewall = true;
};
networking.firewall.trustedInterfaces = [
"nb-ppc"
];
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
@@ -21,10 +37,13 @@
ln -nsf /run/current-system/sw/bin/bash /bin/bash
'';
environment.systemPackages = with pkgs; [
waypipe
];
# the hosts file
networking.extraHosts = ''
${builtins.readFile "${self}/misc/my-hosts"}
${builtins.readFile "${self}/misc/my-hosts-t"}
${builtins.readFile "${self}/mods/my-hosts"}
${builtins.readFile "${self}/mods/my-hosts-t"}
'';
}

2
dev-part/Partfile Normal file
View File

@@ -0,0 +1,2 @@
name = "c2vi"

771
dev-part/dpart.rs Normal file
View File

@@ -0,0 +1,771 @@
#![feature(oneshot_channel)]
use std::fs;
use std::fs::OpenOptions;
use std::io::BufReader;
use std::io::Read;
use std::io::Write;
use std::sync::oneshot;
use std::thread;
use std::time::Duration;
use chrono::TimeDelta;
use clap::ArgAction;
use marts::generated::spacetime::RemoteProcedures;
use marts::generated::spacetime::export_timetrack;
use chrono::Local;
use marts::generated::spacetime::first_timetrack_date;
use marts::timetrack;
use marts::generated::spacetime::add_thought;
use tracing::info;
use ciborium::Value;
use clap::Arg;
use clap::ArgMatches;
use clap::Command;
use cmd_lib::run_cmd as sh;
use cmd_lib::run_fun as shc;
use dioxus::html::g::format;
use indoc::concatdoc as str;
use marts::CliPart;
use marts::ClientAuth;
use mize::Mize;
use mize::MizeError;
use mize::MizePart;
use mize::MizePartCreate;
use mize::MizeResult;
use mize::data;
use mize::item::{IntoItemData, ItemData};
use mize::mize_err;
use mize::mize_part;
use mize::prelude::*;
use mize::proto::MessageCmd;
use mize::proto::MizeMessage;
static MIZE_SRC: &str = "/home/me/work/config/mize";
static SRC: &str = "/home/me/work/config";
static RSYNC_EXCLUDES: &str = "--exclude=node_modules --exclude=target --exclude=mize_config.toml --exclude=rust_dist --exclude=deno_dist --exclude=dist --exclude=result --exclude=pkg";
pub fn lush_os_main() -> MizeResult<()> {
println!("main on lush...");
let mut config = ItemData::from_cbor(data! {
//spacetime.url = ""
});
config.set_path("store", "/home/me/host/mize")?;
config.set_path("data_dir", "/home/me/host/mize/misc")?;
config.set_path("log.level", "debug")?;
config.set_path("log.stderr.enable", true)?;
config.set_path("cli.daemonMode", true)?;
config.set_path("c2vi.dash.enable", true)?;
config.set_path("auth.client.refresh_thread", true)?;
let mut mize = mize::Mize::with_config(config)?;
marts::cli(&mut mize)?;
marts::part_client_auth(&mut mize)?;
marts::spacetime(&mut mize)?;
marts::timetrack::timetrack(&mut mize)?;
marts::part_c2vi(&mut mize)?;
mize.run()
}
pub fn remote_deploy(matches: &ArgMatches, _: Mize, hostname: &str) -> MizeResult<()> {
unsafe {
/*
std::env::set_var(
"PATH",
"/home/me/work/path-extra/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/me/.local/state/nix/profile/bin:/home/me/.nix-profile/bin",
);
*/
std::env::set_var("SRC", SRC);
std::env::set_var("HOSTNAME", hostname);
}
let mut do_mize_restart = false;
let bin = match matches.get_one::<String>("bin") {
Some(val) => val.to_owned(),
None => {
do_mize_restart = true;
format!("{}-os", hostname)
}
};
let remote_src_dir = match hostname {
"lush" => "/home/me/here/config",
"mac" => "/data/external/config",
"files" => "/home/files/here/config",
"nico" => "/root/work/config-c2vi",
"ppc-hosting" => "/root/host/c2vi-config",
_ => "main-idk",
};
let mize_store_dir = match hostname {
"lush" => "/home/me/host/mize",
"mac" => "/home/me/host/mize",
"files" => "/home/files/storage/files/mize",
"nico" => "/root/work/app-data/mize",
"ppc-hosting" => "/root/host/mize",
_ => "/tmp/idk",
};
let rclone_flag = match hostname {
"nico" => "--chown=root:root",
_ => "",
};
sh!(rsync -r -u -v -a --delete --perms $rclone_flag --include=".git/" --include=".git/**" --exclude="target" --mkpath $RSYNC_EXCLUDES $SRC/ $hostname:$remote_src_dir)?;
let ssh_cmd = format!(
r#"
if ! tmux has-session -t mize-deploy 2>/dev/null; then
echo "Created new tmux session...."
tmux new-session -d -s mize-deploy "nix develop git+file://{remote_src_dir}/mize#buildShell --max-jobs 1"
else
echo "using existing session..."
fi
tmux send-keys -t mize-deploy "DO_MIZE_RESTART={do_mize_restart}" Enter
tmux send-keys -t mize-deploy "cargo build --manifest-path {remote_src_dir}/Cargo.toml --bin {bin}" Enter
tmux send-keys -t mize-deploy 'BUILD_SUCCESS=$?' Enter
tmux send-keys -t mize-deploy '[[ "$BUILD_SUCCESS" == "0" ]] && echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > {mize_store_dir}/daemon.env' Enter
tmux send-keys -t mize-deploy '[[ "$BUILD_SUCCESS" == "0" ]] && echo "MIZE_CONFIG_FILES={mize_store_dir}/config.toml" >> {mize_store_dir}/daemon.env' Enter
tmux send-keys -t mize-deploy '[[ "$BUILD_SUCCESS" == "0" ]] && [[ "$HOSTNAME" == "nico" ]] && echo "PATH=/root/work/path-extra:$PATH" >> {mize_store_dir}/daemon.env' Enter
tmux send-keys -t mize-deploy '[[ "$BUILD_SUCCESS" == "0" ]] && [[ "$DO_MIZE_RESTART" == "true" ]] && systemctl --user restart mize' Enter
"#
);
sh!(ssh $hostname $ssh_cmd)?;
Ok(())
}
#[mize_part]
#[derive(Default)]
struct MizeDev {
mize: Mize,
}
impl MizePart for MizeDev {}
impl MizePartCreate for MizeDev {}
pub fn md(mize: &mut Mize) -> MizeResult<()> {
let mut cli = mize.get_part_native::<CliPart>("cli")?;
cli.set_command("md");
let bin_arg = Arg::new("bin").short('b');
cli.subcommand(
Command::new("deploy-lush").alias("dlu").arg(&bin_arg),
Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "lush")),
)?;
cli.subcommand(
Command::new("deploy-mac").alias("dmc").arg(&bin_arg),
Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "mac")),
)?;
cli.subcommand(
Command::new("deploy-files").alias("dfi").arg(&bin_arg),
Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "files")),
)?;
cli.subcommand(
Command::new("deploy-ppc").alias("dpp").arg(&bin_arg),
Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "ppc-hosting")),
)?;
cli.subcommand(
Command::new("deploy-nico").alias("dni").arg(&bin_arg),
Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "nico")),
)?;
cli.subcommand(
Command::new("deploy-main").alias("dma").arg(&bin_arg),
Box::new(main_deploy),
)?;
cli.subcommand(
Command::new("deploy-obsidian").alias("do").arg(&bin_arg),
Box::new(obsidian_deploy),
)?;
cli.subcommand(
Command::new("deploy-spacetime").alias("dsp").arg(&bin_arg),
Box::new(deploy_spacetime),
)?;
cli.subcommand(
Command::new("generate").alias("gen").arg(&bin_arg),
Box::new(md_generate),
)?;
mize.register_part(Box::new(MizeDev { mize: mize.clone() }))
}
pub fn gen_file(path: &str, content: &str) -> MizeResult<()> {
sh!(touch $SRC/generated/$path)?;
std::fs::write(format!("{}/generated/{}", SRC, path), content)?;
Ok(())
}
pub fn gen_file_absolute(path: &str, content: &str) -> MizeResult<()> {
sh!(touch $path)?;
std::fs::write(path, content)?;
Ok(())
}
pub fn gen_main_rs(name: &str) -> MizeResult<()> {
let fn_name = name.replace("-", "_");
let fn_name = format!("{}_main", fn_name);
gen_file(format!("{}.rs", name).as_str(), format!(r#"
fn main() {{
if let Err(err) = c2vi_part::{fn_name}() {{
err.log();
}}
}}
"#).as_str())?;
OpenOptions::new().append(true).open(format!("{}/generated/Cargo.toml", SRC))?.write(format!(r#"
[[bin]]
name = "{name}"
path = "{name}.rs"
"#).as_bytes())?;
Ok(())
}
pub fn md_generate(_: &ArgMatches, mize: Mize) -> MizeResult<()> {
sh!(touch $SRC/generated/Cargo.toml)?;
sh!(mkdir -p $SRC/generated/src)?;
fs::write(format!("{}/generated/Cargo.toml", SRC), format!(r#"
[package]
name = "generated-c2vi-dev-part"
version = "0.1.0"
edition = "2024"
[dependencies]
c2vi-dev-part.path = "../dev-part"
"#).as_bytes())?;
gen_main_rs("lush-os")?;
gen_main_rs("main-os")?;
gen_main_rs("mac-os")?;
gen_main_rs("nico-os")?;
gen_main_rs("mppc")?;
gen_main_rs("timetrack-waybar")?;
gen_main_rs("md")?;
gen_main_rs("dev")?;
gen_file_absolute(format!("{SRC}/mize/marts/generated/Cargo.toml").as_str(), str!(r#"
[package]
name = "generated"
version = "0.1.0"
edition = "2021"
[lib]
name = "generated"
path = "src/lib.rs"
[dependencies]
spacetimedb-sdk = "2.6.0"
[features]
target-js = [ "spacetimedb-sdk/browser" ]
"#))?;
gen_file_absolute(format!("{SRC}/mize/marts/generated/src/lib.rs").as_str(), str!(r#"
pub mod spacetime;
"#))?;
sh!(RUST_LOG=error RUST_BACKTRACE=0 spacetime generate --build-options="--lint-dir=" -p $SRC/mize/marts/spacetime -o $SRC/mize/marts/generated/src/spacetime --lang rust)?;
Ok(())
}
pub fn deploy_spacetime(_: &ArgMatches, _: Mize) -> MizeResult<()> {
unsafe {
/*
std::env::set_var(
"PATH",
"/home/me/work/path-extra/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/me/.local/state/nix/profile/bin:/home/me/.nix-profile/bin",
);
*/
std::env::set_var("SRC", SRC);
}
let cmd = format!(
r#"
if ! tmux has-session -t mize-deploy 2>/dev/null; then
echo "Created new tmux session...."
systemd-run --user --scope --description="mize deploy tmux session" tmux new-session -d -s mize-deploy "nix develop git+file://$SRC/mize --impure"
else
echo "using existing session..."
tmux send-keys -t mize-deploy "echo hoooooooooooooo" Enter
fi
tmux send-keys -t mize-deploy "spacetime publish -p $SRC/mize/packages/spacetime/ --yes mize" Enter
"#
);
sh!(/bin/sh -c "$cmd")?;
Ok(())
}
pub fn obsidian_deploy(_: &ArgMatches, _: Mize) -> MizeResult<()> {
unsafe {
std::env::set_var(
"PATH",
"/home/me/work/path-extra/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/me/.local/state/nix/profile/bin:/home/me/.nix-profile/bin",
);
std::env::set_var("SRC", SRC);
}
let cmd = format!(
r#"
if ! tmux has-session -t mize-deploy 2>/dev/null; then
echo "Created new tmux session...."
systemd-run --user --scope --description="mize deploy tmux session" tmux new-session -d -s mize-deploy "nix develop git+file://$SRC/mize --impure"
else
echo "using existing session..."
fi
tmux send-keys -t mize-deploy "deno run --config {SRC}/mize/apps/obsidian-plugin/deno.json build" Enter
tmux send-keys -t mize-deploy "cp -r {SRC}/mize/apps/obsidian-plugin/dist/* ~/work/things/.obsidian/plugins/mize/" Enter
"#
);
sh!(/bin/sh -c "$cmd")?;
Ok(())
}
pub fn main_deploy(_: &ArgMatches, _: Mize) -> MizeResult<()> {
unsafe {
std::env::set_var(
"PATH",
"/home/me/work/path-extra/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/me/.local/state/nix/profile/bin:/home/me/.nix-profile/bin",
);
std::env::set_var("SRC", SRC);
}
let cmd = str!(
r#"
if ! tmux has-session -t mize-deploy 2>/dev/null; then
systemd-run --user --scope --description="mize deploy tmux session" tmux new-session -d -s mize-deploy "nix develop git+file://$SRC/mize#buildShell"
tmux send-keys -t mize-deploy "set -e" Enter
tmux send-keys -t mize-deploy "cargo build --manifest-path $SRC/parts/Cargo.toml --bin main-os" Enter
tmux send-keys -t mize-deploy 'echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > /home/me/work/app-data/mize/daemon.env' Enter
tmux send-keys -t mize-deploy "systemctl --user restart mize" Enter
else
echo "using existing session..."
tmux send-keys -t mize-deploy "cargo build --manifest-path $SRC/parts/Cargo.toml --bin main-os" Enter
tmux send-keys -t mize-deploy 'echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > /home/me/work/app-data/mize/daemon.env' Enter
tmux send-keys -t mize-deploy "systemctl --user restart mize" Enter
fi
"#
);
sh!(/bin/sh -c "$cmd")?;
Ok(())
}
pub fn main_os_main() -> MizeResult<()> {
println!("os daemon on main...");
let mut config = ItemData::new();
config.set_path("store", "/home/me/work/app-data/mize")?;
config.set_path("log.level", "debug")?;
config.set_path("log.stderr.enable", true)?;
config.set_path("cli.daemonMode", true)?;
config.set_path("c2vi.dash.enable", false)?;
config.set_path("auth.client.refresh_thread", true)?;
unsafe {
std::env::set_var("RUST_BACKTRACE", "1");
}
let mut mize = mize::Mize::with_config(config)?;
marts::cli(&mut mize)?;
marts::part_client_auth(&mut mize)?;
let mut auth = mize.get_part_native::<marts::auth::client::ClientAuth>("client_auth")?;
if auth.secrets().is_none() {
auth.login()?;
}
drop(auth);
md(&mut mize)?;
marts::spacetime(&mut mize)?;
marts::timetrack::timetrack(&mut mize)?;
part_add_thought(&mut mize)?;
marts::part_c2vi(&mut mize)?;
//ppc::daemon(&mut mize)?;
// testing(&mut mize)?;
mize.run()?;
mize.wait();
Ok(())
}
pub fn testing(mize: &mut mize::Mize) -> MizeResult<()> {
let test = str! {r#"
a = "hello"
# a comment
b = true
"#};
//let a = mizelang::parse(test)?;
//println!("data: {}", a);
Ok(())
}
pub fn mize_thin_cli_client(bin_name: Option<&str>) -> MizeResult<()> {
use std::io::Write;
use std::os::unix::net::UnixStream;
let store_path =
std::env::var("MIZE_STORE").map_err(|_| mize_err!("MIZE_STORE not set in environment"))?;
let sock_path = store_path + "/sock";
println!("sock_path: {}", sock_path);
let mut cmd_line = std::env::args().collect::<Vec<_>>();
if let Some(bin_name) = bin_name {
cmd_line[0] = bin_name.to_owned();
}
let msg = MizeMessage::new_custom("cli", cmd_line, 0);
let mut stream = UnixStream::connect(sock_path)?;
stream.write_all(&msg.bytes())?;
// Optional: Ensure all buffered data is pushed to the socket
stream.flush()?;
let mut reader = BufReader::new(stream.try_clone()?);
loop {
let msg: Value = ciborium::from_reader(&mut reader)?;
let mut msg = MizeMessage::new(msg, 0);
match msg.cmd()? {
MessageCmd::Custom(kind) => {
if kind == "cli.done".into_item_data() {
break;
}
if kind == "cli.stdout".into_item_data() {
println!("{}", msg.data()?.value_string()?);
}
if kind == "cli.stderr".into_item_data() {
eprintln!("{}", msg.data()?.value_string()?);
}
if kind == "cli.spawn".into_item_data() {
let cmd = msg.data()?.value_string()?;
std::process::Command::new("/bin/sh")
.arg("-c")
.arg(&cmd)
.status()?;
let done_msg = MizeMessage::new_custom("cli.spawn_done", ItemData::new(), 0);
stream.write_all(&done_msg.bytes())?;
}
}
_ => {
continue;
}
}
}
Ok(())
}
pub fn dma_local() -> MizeResult<()> {
println!("running dma_local...");
unsafe {
std::env::set_var(
"PATH",
"/home/me/work/path-extra/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/me/.local/state/nix/profile/bin:/home/me/.nix-profile/bin",
);
std::env::set_var("SRC", SRC);
}
let cmd = str!(
r#"
if ! tmux has-session -t mize-deploy 2>/dev/null; then
echo "Created new tmux session...."
systemd-run --user --scope --description="mize deploy tmux session" tmux new-session -d -s mize-deploy "NIXPKGS_ALLOW_UNFREE=1 nix develop git+file://$SRC/mize --impure"
else
echo "using existing session..."
fi
tmux send-keys -t mize-deploy "cargo build --manifest-path $SRC/Cargo.toml --bin main-os" Enter
tmux send-keys -t mize-deploy 'echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > /home/me/work/app-data/mize/daemon.env' Enter
tmux send-keys -t mize-deploy 'echo "PATH=$PATH" >> /home/me/work/app-data/mize/daemon.env' Enter
tmux send-keys -t mize-deploy "systemctl --user restart mize" Enter
"#
);
sh!(/bin/sh -c "$cmd")?;
Ok(())
}
pub fn md_main() -> MizeResult<()> {
// run md dma locally
let args: Vec<String> = std::env::args().collect();
if args.get(1).map(|s| s.as_str()) == Some("dma") {
dma_local()?;
return Ok(());
}
if args.get(1).map(|s| s.as_str()) == Some("dev") {
sh!(dx serve --hot-reload true --bin dev)?;
return Ok(());
}
mize_thin_cli_client(None)
}
pub fn mppc_main() -> MizeResult<()> {
mize_thin_cli_client(Some("ppc"))
}
pub fn dev_main() -> MizeResult<()> {
use dioxus::desktop::{Config, WindowBuilder, muda::Menu};
use dioxus::prelude::*;
let mize = Mize::new();
let mize_clone = mize.clone();
LaunchBuilder::new()
.with_context_provider(move || Box::new(mize_clone.clone()))
.with_cfg(desktop! {
Config::new().with_window(WindowBuilder::new().with_decorations(false).with_title("PPC"))
})
.launch(marts::ppc::main_page);
Ok(())
}
pub fn timetrack_waybar_main() -> MizeResult<()> {
use std::io::Write;
use std::os::unix::net::UnixStream;
let store_path =
std::env::var("MIZE_STORE").map_err(|_| mize_err!("MIZE_STORE not set in environment"))?;
let sock_path = store_path + "/sock";
let out_msg = MizeMessage::new_custom("timetrack.sub_current", ItemData::new(), 0);
let mut stream = UnixStream::connect(&sock_path)?;
stream.write_all(&out_msg.bytes())?;
// Optional: Ensure all buffered data is pushed to the socket
stream.flush()?;
let mut reader = BufReader::new(stream.try_clone()?);
loop {
let msg: Value = match ciborium::from_reader(&mut reader) {
Ok(val) => val,
Err(_) => {
fn read_msg(out_msg: &MizeMessage, sock_path: &String) -> MizeResult<Value> {
thread::sleep(Duration::from_secs(12));
let mut stream = UnixStream::connect(sock_path)?;
stream.write_all(&out_msg.bytes())?;
stream.flush()?;
let mut reader = BufReader::new(stream.try_clone()?);
let val: Value = ciborium::from_reader(&mut reader)?;
Ok(val)
};
match read_msg(&out_msg, &sock_path) {
Ok(val) => val,
Err(_) => {
continue;
}
}
}
};
let mut msg = MizeMessage::new(msg, 0);
match msg.cmd()? {
MessageCmd::Custom(kind) => {
if kind == "timetrack.current".into_item_data() {
//println!("----> {} <----", msg.data()?.value_string()?);
println!("<b>{}</b>", msg.data()?.value_string()?);
}
}
_ => {
continue;
}
}
}
Ok(())
}
pub fn mac_os_main() -> MizeResult<()> {
println!("os daemon on mac...");
let mut config = ItemData::new();
config.set_path("store", "/home/me/host/mize")?;
config.set_path("data_dir", "/home/me/host/mize/misc")?;
config.set_path("log.level", "debug")?;
config.set_path("log.stderr.enable", true)?;
config.set_path("cli.daemonMode", true)?;
config.set_path("c2vi.dash.enable", false)?;
config.set_path("auth.client.refresh_thread", true)?;
//unsafe { std::env::set_var("RUST_BACKTRACE", "1"); }
let mut mize = mize::Mize::with_config(config)?;
marts::cli(&mut mize)?;
marts::part_client_auth(&mut mize)?;
let mut auth = mize.get_part_native::<ClientAuth>("client_auth")?;
if auth.secrets().is_none() {
tracing::info!("main: auth.secrets is none");
auth.login()?;
}
drop(auth);
md(&mut mize)?;
marts::spacetime(&mut mize)?;
marts::timetrack::timetrack(&mut mize)?;
part_add_thought(&mut mize)?;
marts::part_c2vi(&mut mize)?;
mize.run()?;
mize.wait();
Ok(())
}
pub fn nico_os_main() -> MizeResult<()> {
println!("os daemon on nico...");
let mut config = ItemData::new();
config.set_path("store", "/root/work/app-data/mize")?;
config.set_path("data_dir", "/root/work/app-data/mize/misc")?;
config.set_path("log.level", "debug")?;
config.set_path("log.stderr.enable", true)?;
config.set_path("cli.daemonMode", true)?;
config.set_path("c2vi.dash.enable", false)?;
config.set_path("auth.client.refresh_thread", true)?;
config.set_path("sc2.userNotesDir", "/root/work/nico/notes/c2vi")?;
let mut mize = mize::Mize::with_config(config)?;
marts::cli(&mut mize)?;
marts::part_client_auth(&mut mize)?;
let mut auth = mize.get_part_native::<ClientAuth>("client_auth")?;
if auth.secrets().is_none() {
tracing::info!("main: auth.secrets is none");
auth.login()?;
}
drop(auth);
marts::spacetime(&mut mize)?;
part_timetrack_export(&mut mize)?;
// notes sync
let mize_clone = mize.clone();
mize.spawn_background("nico_notes_sync", || nico_notes_sync_thread(mize_clone))?;
marts::part_c2vi(&mut mize)?;
mize.run()?;
mize.wait();
Ok(())
}
pub fn part_add_thought(mize: &mut Mize) -> MizeResult<()> {
use marts::generated::spacetime::add_thought;
let mut cli = mize.get_part_native::<marts::CliPart>("cli")?;
cli.set_command("ppc");
cli.subcommand(Command::new("inputThought").alias("ti"), |matches, mut mize| {
let tmp_file = std::env::temp_dir().join(format!(
"sc2-input-thought-{}.txt",
chrono::Utc::now().timestamp()
));
marts::cli_spawn(format!("nvim {}", tmp_file.display()))?;
let new_file_content = std::fs::read_to_string(&tmp_file)
.map_err(|e| mize_err!("Failed to read temp file: {}", e))?;
let _ = std::fs::remove_file(&tmp_file);
let spacetime = mize.get_part_native::<marts::SpacetimePart>("spacetime")?;
spacetime.con().reducers.add_thought(new_file_content)?;
Ok(())
})?;
Ok(())
}
pub fn part_timetrack_export(mize: &mut Mize) -> MizeResult<()> {
use std::path::Path;
let mut cli = mize.get_part_native::<marts::CliPart>("cli")?;
cli.set_command("ppc");
cli.subcommand(Command::new("exportTimetrack").alias("et").arg(Arg::new("date").short('d')).arg(Arg::new("all").short('a').action(ArgAction::SetTrue)), |matches , mut mize| {
let spacetime = mize.get_part_native::<marts::SpacetimePart>("spacetime")?;
let notes_dir = mize.get_config("sc2.userNotesDir").unwrap_or_default().value_string()?;
let today = Local::now().format("%Y-%m-%d").to_string();
let mut date = matches.get_one::<String>("date").unwrap_or(&today);
std::fs::create_dir_all(Path::new(&notes_dir).join("timetrack_exports"))?;
let all = matches.get_flag("all");
if all {
let (tx, rx) = oneshot::channel();
spacetime.con().procedures.first_timetrack_date_then("c2vi".to_string(), |_, res| {tx.send(res);});
let res = rx.recv()???;
let dates = dates_until_today(&res)?;
for date in dates {
out!("date: {}", date);
let (tx, rx) = oneshot::channel();
spacetime.con().procedures.export_timetrack_then("c2vi".to_string(), date.to_owned(), |_, res| {tx.send(res);});
let res = rx.recv()???;
let mut file = OpenOptions::new().create(true).write(true).open(Path::new(&notes_dir).join("timetrack_exports").join(format!("timetrack_export_{}.md", date)))?;
file.write_all(res.as_bytes())?;
}
return Ok(());
}
out!("date: {}", date);
let (tx, rx) = oneshot::channel();
spacetime.con().procedures.export_timetrack_then("c2vi".to_string(), date.to_owned(), |_, res| {tx.send(res);});
let res = rx.recv()???;
let mut file = OpenOptions::new().create(true).write(true).open(Path::new(&notes_dir).join("timetrack_exports").join(format!("timetrack_export_{}.md", date)))?;
file.write_all(res.as_bytes())?;
Ok(())
})?;
Ok(())
}
fn dates_until_today(start: &str) -> Result<Vec<String>, chrono::ParseError> {
use chrono::NaiveDate;
let mut current = NaiveDate::parse_from_str(start, "%Y-%m-%d")?;
let today = Local::now().date_naive();
let mut dates = Vec::new();
while current <= today {
dates.push(current.format("%Y-%m-%d").to_string());
current += TimeDelta::days(1);
}
Ok(dates)
}
pub fn nico_notes_sync_thread(mize: Mize) -> MizeResult<()> {
tracing::info!("starting nico_notes_sync_thread");
loop {
let res = sh!(/bin/bash -c r#"
cd /root/work/nico/notes/c2vi
git add .
git commit -m "nico notes sync"
git pull --rebase
git push
cd /root/work/nico/notes/nexus
git add .
git commit -m "nico nexus notes sync"
git pull --rebase
git push
cd /root/work/nico/notes/ppc-wiki
git add .
git commit -m "nico ppc-wiki notes sync"
git pull --rebase
git push
"#);
if let Err(e) = res {
tracing::error!("error in nico_notes_sync_thread: {}", e);
};
std::thread::sleep(std::time::Duration::from_mins(2));
}
}

3
dev-part/src/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View File

@@ -0,0 +1 @@
{"rustc_fingerprint":12679484821923032738,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.95.0-nightly (f60a0f1bc 2026-02-02)\nbinary: rustc\ncommit-hash: f60a0f1bcc5a2a6dd8eb2d2021da79b40f5fbae9\ncommit-date: 2026-02-02\nhost: x86_64-unknown-linux-gnu\nrelease: 1.95.0-nightly\nLLVM version: 22.1.0\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""},"11857020428658561806":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""}},"successes":{}}

View File

@@ -0,0 +1 @@
{"rustc_fingerprint":12679484821923032738,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.95.0-nightly (f60a0f1bc 2026-02-02)\nbinary: rustc\ncommit-hash: f60a0f1bcc5a2a6dd8eb2d2021da79b40f5fbae9\ncommit-date: 2026-02-02\nhost: x86_64-unknown-linux-gnu\nrelease: 1.95.0-nightly\nLLVM version: 22.1.0\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""}},"successes":{}}

View File

@@ -0,0 +1 @@
error: manifest path `/home/me/work/config/dev-part/Cargo.toml` does not exist

0
dev-part/type/Partfile Normal file
View File

View File

@@ -0,0 +1,108 @@
use axum::{Json, http::StatusCode};
use serde_json::{Value, json};
use std::str::FromStr;
use axum::{
Router,
error_handling::HandleErrorLayer,
http::Uri,
response::IntoResponse,
routing::{any, get},
};
use axum_oidc::handle_oidc_redirect;
use axum_oidc::{
EmptyAdditionalClaims, OidcAuthLayer, OidcClaims, OidcClient, OidcLoginLayer,
OidcRpInitiatedLogout, error::MiddlewareError,
};
use base64::{
Engine,
alphabet::STANDARD,
engine::{GeneralPurpose, GeneralPurposeConfig},
};
use clap::Command;
use dioxus::prelude::*;
use mize::Mize;
use mize::MizeResult;
use openidconnect::Scope;
use openidconnect::{ClientId, ClientSecret, IssuerUrl};
use tower::ServiceBuilder;
use tower_sessions::{
Expiry, MemoryStore, SessionManagerLayer,
cookie::{SameSite, time::Duration},
};
pub async fn server(mize: &mut Mize) -> MizeResult<()> {
dioxus::logger::initialize_default();
let listen_addr = mize.get_config("server.listen_addr")?.value_string()?;
let port = mize.get_config("server.port")?.value_string()?;
let issuer = mize.get_config("auth.issuer")?.value_string()?;
let client_id = mize.get_config("auth.client_id")?.value_string()?;
let client_secret = mize.get_config("auth.client_secret")?.value_string()?;
let url = mize.get_config("web.url")?.value_string()?;
let redirect_url = format!("{url}/oidc");
let session_store = MemoryStore::default();
let session_layer = SessionManagerLayer::new(session_store)
.with_secure(false)
.with_same_site(SameSite::Lax)
.with_expiry(Expiry::OnInactivity(Duration::seconds(120)));
let oidc_login_service = ServiceBuilder::new()
.layer(HandleErrorLayer::new(|e: MiddlewareError| async {
dbg!(&e);
e.into_response()
}))
.layer(OidcLoginLayer::<EmptyAdditionalClaims>::new());
let oidc_client = OidcClient::<EmptyAdditionalClaims>::builder()
.with_default_http_client()
.with_redirect_url(Uri::from_str(redirect_url.as_str())?)
.with_client_id(ClientId::new(client_id))
.add_scope(Scope::new("profile".into()))
.add_scope(Scope::new("email".into()))
// Optional: add untrusted audiences. If the `aud` claim contains any of these audiences, the token is rejected.
//.add_untrusted_audience(Audience::new("123456789".to_string()))
.with_client_secret(ClientSecret::new(client_secret))
.discover(IssuerUrl::new(issuer.into()).expect("Invalid IssuerUrl"))
.await
.unwrap()
.build();
let oidc_auth_service = ServiceBuilder::new()
.layer(HandleErrorLayer::new(|e: MiddlewareError| async {
dbg!(&e);
e.into_response()
}))
.layer(OidcAuthLayer::new(oidc_client));
let app = Router::new()
// private routes
.route("/foo", get(authenticated))
.route("/logout", get(logout))
.layer(oidc_login_service)
.route("/bar", get(maybe_authenticated))
.route("/oidc", any(handle_oidc_redirect::<EmptyAdditionalClaims>))
.layer(oidc_auth_service)
.layer(session_layer)
.layer(tower_http::trace::TraceLayer::new_for_http())
//
// not authenticated routes
.route("/", get(mize_main_page))
.route("/oidc_display_code_and_state", get(display_code_and_state))
tracing::info!("Running on http://{listen_addr}:{port}");
let listener = tokio::net::TcpListener::bind(format!("{listen_addr}:{port}"))
.await
.unwrap();
axum::serve(listener, app.into_make_service())
.await
.unwrap();
Ok(())
}
fn mize_main_page() -> impl IntoResponse {
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

165
doomdir/config.el Normal file
View File

@@ -0,0 +1,165 @@
;;; relative line numbers
(setq display-line-numbers 'relative)
;;; set my org directory
(setq org-directory "~/work/things/org")
;;; set my name and email
(setq user-full-name "Sebastian Moser"
user-mail-address "c2vi.dev@gmail.com")
;;; theme
(setq doom-theme 'doom-one)
;;; C-p to be M-x
(map! "C-p" #'execute-extended-command)
;;(map! :leader "a" #'execute-extended-command)
;;(map! :nv ":" #'execute-extended-command)
(after! evil
;;(map! :nv ":" #'execute-extended-command)
(map! :gnv "C-p" #'execute-extended-command)
)
;;; projectile find file - quick switcher
(after! evil
(map! :gnv "C-e" #'projectile-find-file)
)
(after! 'better-jumper
(map! :gnv "C-i" #'projectile-find-file)
)
(with-eval-after-load 'projectile
(add-to-list 'projectile-globally-ignored-directories "node_modules")
(add-to-list 'projectile-globally-ignored-directories ".obsidian")
(setq projectile-indexing-method 'native)
)
;;; obsidian
(after! obsidian
(setq obsidian-directory "~/work/things"
obsidian-inbox-directory "semi-public"
markdown-enable-wiki-links t
)
(global-obsidian-mode t)
)
;;; clipboard
(after! evil
(setq interprogram-cut-function nil
interprogram-paste-function nil)
)
(defun my/clipboard-copy (beg end)
"Copy region to the OS clipboard (bypassing the kill-ring)."
(interactive "r")
(let ((text (buffer-substring-no-properties beg end))
(inhibit-message t))
(gui-select-text text)
(deactivate-mark)
(when (called-interactively-p 'any)
(message "Copied to clipboard: %d chars" (length text)))))
(defun my/clipboard-paste ()
"Paste from the OS clipboard, replacing the region if active."
(interactive)
(let ((text (gui-get-selection 'CLIPBOARD)))
(unless text
(user-error "OS clipboard is empty"))
(when (use-region-p)
(delete-region (region-beginning) (region-end)))
(insert-for-yank text)))
(map! :v "C-c" #'my/clipboard-copy
:v "C-v" #'my/clipboard-paste
:i "C-v" #'my/clipboard-paste) ; insert-state paste, terminal-style
;;; in buffer completions
(setq tab-always-indent 'complete)
(after! corfu
; possible: basic, initials, orderless, partial-completion substring, flex
(setq completion-styles '(orderless flex partial-completion substring))
(setq corfu-cycle t
corfu-preview-current nil
corfu-min-width 20
corfu-on-exact-match 'insert
corfu-quit-no-match t
corfu-quit-at-boundary t
corfu-popupinfo-delay '(1.25 . 0.5))
(corfu-popupinfo-mode 1)
;; history-based sorting, persisted across restarts
(corfu-history-mode 1)
(after! savehist
(add-to-list 'savehist-additional-variables 'corfu-history)))
;;; C-i to pick first completion thing
(after! corfu
(defun my/corfu-insert-first ()
"Insert the first candidate immediately."
(interactive)
(corfu-next)
(corfu-insert)
)
(map! :map corfu-map
"<insert-state> C-i" #'my/corfu-insert-first
)
)
;;; better eval mappings
(map! :leader "m e" #'eval-last-sexp)
(map! :leader "m r" #'eval-print-last-sexp)
;;;; font/zoom
(setq doom-font (font-spec
;:family "Hack Mono"
:size 22 :weight 'regular))
;;; have authinfo file in my $SECRETS_DIR
(setq auth-sources '("~/secrets/authinfo"))
;;; empv
(after! empv
(customize-set-variable 'empv-subsonic-username "c2vi")
(customize-set-variable 'empv-subsonic-url "https://tunes.c2vi.dev")
(customize-set-variable 'empv-subsonic-password (f-read-text "~/secrets/tunes-password"))
)
;;; supersonic
(after! supersonic
;;(setq supersonic-host "https://tunes.c2vi.dev")
)
;;; scratch
(defun my/scratch ()
(lookup-key corfu-map (kbd "C-u"))
(lookup-key corfu-map (kbd "C-i"))
(define-key corfu-map (kbd "C-i") 'my/corfu-insert-first)
)

15
doomdir/custom.el Normal file
View File

@@ -0,0 +1,15 @@
;;; -*- lexical-binding: t -*-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("0325a6b5eea7e5febae709dab35ec8648908af12cf2d2b569bedc8da0a3a81c1"
"aec7b55f2a13307a55517fdf08438863d694550565dee23181d2ebd973ebd6b8" default)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

205
doomdir/init.el Normal file
View File

@@ -0,0 +1,205 @@
;;; $DOOMDIR/init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE: Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all of
;; our modules are listed, including what flags they support.
;; NOTE: Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on flags
;; as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
;;company ; the ultimate code completion backend
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;indent-guides ; highlighted indent columns
;;ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;smooth-scroll ; So smooth you won't believe it's not butter
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
(whitespace +guess +trim) ; a butler for your whitespace
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;eww ; the internet is gross
;;ibuffer ; interactive buffer management
tramp ; remote files at your arthritic fingertips
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; almost the best terminal emulation in Emacs
;;ghostel ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
lookup ; navigate your code and its documentation
;;llm ; when I said you needed friends, I didn't mean...
;;(lsp +eglot) ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;ada ; In strong typing we (blindly) trust
;;(agda +local) ; types of types of types of types...
;;beancount ; mind the GAAP
;;(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
;;json ; At least it ain't XML
;;janet ; Fun fact: Janet is me!
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
;;odin ; C, minus its footguns
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
;;purescript ; javascript, but functional
;;python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scad ; trust the preview, regret the render
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
;;yaml ; JSON, but readable
;;zig ; C, but simpler
:email
(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
:config
;;literate
(default +bindings +smartparens))
;; If you're a dark-mode user who suffers from the "flash of white Emacs" when
;; you first open Emacs, uncomment this (and adjust the color as you like).
;; (add-to-list 'initial-frame-alist '(background-color . "#000000"))

63
doomdir/packages.el Normal file
View File

@@ -0,0 +1,63 @@
;;; $DOOMDIR/packages.el -*- lexical-binding: t; no-byte-compile: t -*-
;; To install a package:
;;
;; 1. Declare them here in a `package!' statement,
;; 2. Run 'doom sync' in the shell,
;; 3. Restart Emacs.
;;
;; Use 'C-h f package\!' to look up documentation for the `package!' macro.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;; (package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;; (package! another-package
;; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;; (package! this-package
;; :recipe (:host github :repo "username/repo"
;; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;; (package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;; (package! builtin-package :recipe (:nonrecursive t))
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;; (package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;; (package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;; (unpin! pinned-package)
;; ...or multiple packages
;; (unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;; (unpin! t)
(package! tldr)
(package! obsidian)
(package! empv)
(package! f)
(package! supersonic
:recipe (:host github :repo "systemfreund/supersonic.el" )
:pin "8d422489ffc84cc3907232afb51349c576c26cba"
)

752
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
mize.url = "git+https://git.ppc.social/ppc/ppc";
zed.url = "github:zed-industries/zed";
#zed.inputs.nixpkgs.follows = "nixpkgs";
@@ -180,6 +182,13 @@
};
};
pkgsUnstableArm = import nixpkgs-unstable {
system = "aarch64-linux";
config = {
allowUnfree = true;
};
};
specialArgs = {
inherit inputs confDir workDir secretsDir persistentDir self tunepkgs unstable nur pkgsUnstable dataDir;
system = "x86_64-linux";
@@ -500,7 +509,7 @@
inherit specialArgs;
system = "x86_64-linux";
modules = [
./hosts/main.nix
./hosts/main/default.nix
./hardware/hpm-laptop.nix
];
};
@@ -616,7 +625,7 @@
# my raspberry to try out stuff with
"lush" = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self system; };
specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self system; pkgsUnstable = pkgsUnstableArm; };
modules = [
./hosts/lush.nix
];

1
forked-zed Submodule

Submodule forked-zed added at 790dcefb01

41
generated/Cargo.toml Normal file
View File

@@ -0,0 +1,41 @@
[package]
name = "generated-c2vi-dev-part"
version = "0.1.0"
edition = "2024"
[dependencies]
c2vi-dev-part.path = "../dev-part"
[[bin]]
name = "lush-os"
path = "lush-os.rs"
[[bin]]
name = "main-os"
path = "main-os.rs"
[[bin]]
name = "mac-os"
path = "mac-os.rs"
[[bin]]
name = "nico-os"
path = "nico-os.rs"
[[bin]]
name = "mppc"
path = "mppc.rs"
[[bin]]
name = "timetrack-waybar"
path = "timetrack-waybar.rs"
[[bin]]
name = "md"
path = "md.rs"
[[bin]]
name = "dev"
path = "dev.rs"

7
generated/dev.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::dev_main() {
err.log();
}
}

7
generated/lush-os.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::lush_os_main() {
err.log();
}
}

7
generated/mac-os.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::mac_os_main() {
err.log();
}
}

7
generated/main-os.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::main_os_main() {
err.log();
}
}

7
generated/md.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::md_main() {
err.log();
}
}

7
generated/mppc.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::mppc_main() {
err.log();
}
}

7
generated/nico-os.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::nico_os_main() {
err.log();
}
}

View File

@@ -0,0 +1 @@
{"rustc_fingerprint":12679484821923032738,"outputs":{"11857020428658561806":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.95.0-nightly (f60a0f1bc 2026-02-02)\nbinary: rustc\ncommit-hash: f60a0f1bcc5a2a6dd8eb2d2021da79b40f5fbae9\ncommit-date: 2026-02-02\nhost: x86_64-unknown-linux-gnu\nrelease: 1.95.0-nightly\nLLVM version: 22.1.0\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""}},"successes":{}}

View File

@@ -0,0 +1 @@
{"rustc_fingerprint":12679484821923032738,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.95.0-nightly (f60a0f1bc 2026-02-02)\nbinary: rustc\ncommit-hash: f60a0f1bcc5a2a6dd8eb2d2021da79b40f5fbae9\ncommit-date: 2026-02-02\nhost: x86_64-unknown-linux-gnu\nrelease: 1.95.0-nightly\nLLVM version: 22.1.0\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed\noff\npacked\nunpacked\n___\ndebug_assertions\nemscripten_wasm_eh\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"x87\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_has_reliable_f128\ntarget_has_reliable_f16\ntarget_has_reliable_f16_math\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nub_checks\nunix\n","stderr":""}},"successes":{}}

View File

@@ -0,0 +1 @@
error: the package 'generated-c2vi-dev-part' does not contain these features: target-js, target-obsidian

View File

@@ -0,0 +1,7 @@
fn main() {
if let Err(err) = c2vi_part::timetrack_waybar_main() {
err.log();
}
}

View File

@@ -34,26 +34,6 @@
};
};
/*
fileSystems."/" = {
device = "/dev/disk/by-uuid/6518e61e-7120-48ef-81a3-5eae0f67297e";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/0E6C-F209";
fsType = "vfat";
};
*/
fileSystems."/" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/MAIN-BOOT";
fsType = "vfat";
};
#swapDevices = [
#{ device = "/dev/disk/by-uuid/418bf0d8-e548-45d5-802a-53de72707ebc"; }

View File

@@ -10,12 +10,12 @@
inputs.home-manager.nixosModules.home-manager
../users/me/headless.nix
../users/root/default.nix
../users/server/headles.nix
../users/server/headless.nix
];
# allow acern to ssh into server
users.users.server.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTV1VoNAjMha5IP+qb8XABDo02pW3iN0yPBIbSqZA27 me@acern"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTV1VoNAjMha5IP+Do02pW3iN0yPBIbSqZA27 me@acern"
];
# allow server user to shutdown fusu
@@ -26,8 +26,8 @@
}
];
services.tailscale.enable = true;
virtualisation.docker.enable = true;
users.users.me.extraGroups = [ "docker" ];
#fileSystems."/boot" = {
# device = "/dev/disk/by-label/fusu-boot";
@@ -57,6 +57,8 @@
8888 # for general usage
9999 # for general usage
8080 # for mitm proxy
8001 # c2vi-navidrome
8002 # c2vi-lidarr
25565 # mc proxy
25580 # wmc lobby server

View File

@@ -25,8 +25,6 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNXOPxlnSxkhm050ui56D5SHrkhuFwUOU0Gf0C+Vmks melektron@goarnix"
];
services.tailscale.enable = true;
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
@@ -74,12 +72,6 @@
networking.firewall.allowPing = true;
networking.firewall.enable = true;
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
443 # couchdb for obsidian live sync https
44444 # resilio sync
9000 # resilio webui
];
services.samba.openFirewall = true;
networking.firewall.allowedTCPPorts = [

View File

@@ -37,6 +37,10 @@ in {
device = "/home/me/host/libvirt";
options = [ "bind" ];
};
swapDevices = [{
device = "/swapfile";
size = 20 * 1024;
}];
@@ -50,30 +54,14 @@ in {
services.tailscale.enable = true;
services.resilio = {
enable = true;
enableWebUI = true;
httpListenAddr = "100.70.54.18";
checkForUpdates = false;
listeningPort = 44444;
};
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
44444 # resilio sync
9000 # resilio webui
networking.firewall.interfaces."br0".allowedTCPPorts = [
9001 # fwin vnc
9002 # fwin rdp
9003 # fwin ssh
9003 # fwin ssh
];
networking.firewall.interfaces."br0".allowedTCPPorts = [
44444 # resilio sync
9000 # resilio webui
9001 # fwin vnc
9002 # fwin rdp
9003 # fwin ssh
networking.firewall.interfaces."br0".allowedTCPPortRanges = [
{from = 8000; to = 10000;}
];
@@ -82,9 +70,15 @@ in {
boot.zfs.forceImportRoot = false;
networking.hostId = "7552c83e";
fileSystems."/home/files/storage" = {
fileSystems."/data" = {
device = "storage";
fsType = "zfs";
options = [ "defaults" "nofail" ];
};
fileSystems."/home/files/storage" = {
device = "/data";
options = [ "bind" "defaults" "nofail" ];
};
# Use the GRUB 2 boot loader.
@@ -124,6 +118,7 @@ in {
services.samba.openFirewall = true;
networking.firewall.allowedTCPPorts = [
22
8888 # for general usage
9999 # for general usage
8080 # for mitm proxy
@@ -163,6 +158,7 @@ in {
];
environment.systemPackages = with pkgs; [
tcpdump
sshfs
ntfs3g
virtiofsd
@@ -223,8 +219,9 @@ in {
text = ''
ip=$(curl -4 my.ip.fi)
curl "http://dynv6.com/api/update?hostname=${builtins.readFile "${secretsDir}/dns-name-two"}&ipv4=$ip&token=${builtins.readFile "${secretsDir}/dns-name-two-token"}"
curl "https://dynamicdns.park-your-domain.com/update?host=home&domain=${builtins.readFile "${secretsDir}/dns-name"}&password=${builtins.readFile "${secretsDir}/dns-name-token"}&ip=$ip"
#curl "http://dynv6.com/api/update?hostname=${builtins.readFile "${secretsDir}/dns-name-two"}&ipv4=$ip&token=${builtins.readFile "${secretsDir}/dns-name-two-token"}"
curl "http://dynv6.com/api/update?hostname=${builtins.readFile "${secretsDir}/dns-name-mati"}&ipv4=$ip&token=${builtins.readFile "${secretsDir}/dns-name-mati-token"}"
# curl "https://dynamicdns.park-your-domain.com/update?host=home&domain=${builtins.readFile "${secretsDir}/dns-name"}&password=${builtins.readFile "${secretsDir}/dns-name-token"}&ip=$ip"
# https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-to-dynamically-update-the-hosts-ip-with-an-https-request/
'';

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, inputs, secretsDir, config, ... }:
{ lib, pkgs, inputs, secretsDir, config, system, ... }:
{
#system.stateVersion = "23.05"; # Did you read the comment?
@@ -9,6 +9,7 @@
inputs.networkmanager.nixosModules.networkmanager
../common/all.nix
../common/nixos.nix
inputs.home-manager.nixosModules.home-manager
../users/me/headless.nix
@@ -21,6 +22,8 @@
# labor nas project
# with this moduel it does not boot, it waits for /dev/disk/by-label/nas-storage
# "${workDir}/htl/labor/nas/nixos/lush-module.nix"
inputs.mize.nixosModules.default
];
# fix bluetooth
@@ -31,6 +34,7 @@
powerOnBoot = true;
};
};
swapDevices = [ { device = "/swapfile"; } ];
# get usbip working
boot.extraModulePackages = [
@@ -68,8 +72,6 @@
services.blueman.enable = true;
hardware.enableRedistributableFirmware = true;
services.tailscale.enable = true;
environment.systemPackages = with pkgs; [
linuxPackages.usbip
vim
@@ -104,10 +106,145 @@
settings.PermitRootLogin = "no";
settings.X11Forwarding = true;
extraConfig = ''
X11UseLocalhost no
X11UseLocalhost yes
'';
};
########################### kiosk ############################
boot.plymouth.enable = true;
services.dbus.enable = true;
fonts.enableDefaultPackages = true;
xdg.icons.enable = true;
gtk.iconCache.enable = true;
services.udisks2.enable = false;
hardware.opengl.enable = true;
services.greetd = {
enable = true;
settings = rec {
initial_session = {
#command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time -d --env WLR_RENDERER_ALLOW_SOFTWARE=1 --cmd sway";
command = "${pkgs.writeScriptBin "run-sway" ''
export WLR_RENDERER_ALLOW_SOFTWARE=1
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
exec ${pkgs.lib.getExe pkgs.sway}
''}/bin/run-sway";
user = "me";
};
default_session = initial_session;
};
};
####################### MIZE ###########################
mize.enable = true;
mize.enableConfigFile = false;
mize.debugBinary = "/home/me/here/config/target/debug/lush-os";
systemd.user.services.mize.environment.LOG= "trace";
systemd.user.services.mize.environment.MIZE_STORE= "/home/me/host/mize";
systemd.user.services.mize.serviceConfig.EnvironmentFile = "/home/me/host/mize/daemon.env";
#systemd.user.services.mize.environment.WAYLAND_DISPLAY= "wayland-1";
systemd.user.services.mize.environment.DISPLAY= ":0";
home-manager.users.me.home.file = {
".config/sway/config".text = ''
# Set modifier key (optional, useful for admin maintenance)
set $mod Mod4
# Disable all window borders and titles
default_border none
default_floating_border none
# Hide the status bar completely
bar {
mode invisible
}
# Remove gaps between windows
gaps inner 0
gaps outer 0
# hide mouse cursor
seat * hide_cursor 5000
'';
};
/*
services.cage = {
enable = true;
#program = "${pkgs.alacritty}/bin/alacritty";
program = "/home/me/host/start-ppc-dash";
#program = "/bin/sh -c 'echo hiiii > /home/me/p1 && /home/me/here/mize/target/debug/ppc c2vi-dash >/home/me/p1 2>/home/me/p1'";
user = "cage";
environment = {
MIZE_CONFIG_FILES = "/home/me/host/mize-config.toml";
};
};
users.users.cage = {
isNormalUser = true;
description = "FOOBAR";
extraGroups = [ "networkmanager" "wheel"];
password = "idk";
};
*/
/*
systemd.services."cage" = {
enable = true;
after = [ "systemd-user-sessions.service" "dbus.socket" "systemd-logind.service" "getty@%i.service" "plymouth-deactivate.service" "plymouth-quit.service" ];
before = [ "graphical.target" ];
wants = [ "dbus.socket" "systemd-logind.service" "plymouth-deactivate.service" ];
wantedBy = [ "graphical.target" ];
conflicts = [ "getty@%i.service" ]; # "plymouth-quit.service" "plymouth-quit-wait.service"
restartIfChanged = false;
serviceConfig = {
#ExecStart = "${pkgs.cage}/bin/cage -d -- /home/me/here/mize/target/debug/ppc c2vi-dash";
#ExecStart = "${pkgs.cage}/bin/cage -d -- ${inputs.ppc.packages.${system}.ppc}/bin/ppc c2vi-dash";
ExecStart = "${pkgs.cage}/bin/cage -d -- ${pkgs.alacritty}/bin/alacritty";
User = "root";
# ConditionPathExists = "/dev/tty0";
IgnoreSIGPIPE = "no";
# Log this user with utmp, letting it show up with commands 'w' and
# 'who'. This is needed since we replace (a)getty.
UtmpIdentifier = "%I";
UtmpMode = "user";
# A virtual terminal is needed.
TTYPath = "/dev/%I";
TTYReset = "yes";
TTYVHangup = "yes";
TTYVTDisallocate = "yes";
# Fail to start if not controlling the virtual terminal.
StandardInput = "tty-fail";
#StandardOutput = "syslog";
#StandardError = "syslog";
# Set up a full (custom) user session for the user, required by Cage.
PAMName = "cage";
};
};
security.pam.services.cage.text = ''
auth required pam_unix.so nullok
account required pam_unix.so
session required pam_unix.so
session required ${pkgs.systemd}/lib/security/pam_systemd.so
'';
systemd.targets.graphical.wants = [ "cage@tty1.service" ];
systemd.defaultUnit = "graphical.target";
*/
####################################### networking ##########################

View File

@@ -1,4 +1,4 @@
{ lib, secretsDir, pkgs, inputs, unstable, ... }: let
{ lib, secretsDir, pkgs, inputs, unstable, config, ... }: let
myobs = pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
@@ -21,10 +21,25 @@ in {
../users/me/gui.nix
../users/root/default.nix
../common/nixos-wayland.nix
inputs.mize.nixosModules.default
];
services.tailscale.enable = true;
mize.enable = true;
mize.debugBinary = "/data/external/config/target/debug/mac-os";
mize.debugConfigFile = "/home/me/host/mize-config.toml";
systemd.user.services.mize.environment.LOG= "trace";
systemd.user.services.mize.serviceConfig.EnvironmentFile = "/home/me/host/mize/daemon.env";
programs.nix-ld.enable = true;
# https://nixos.wiki/wiki/OBS_Studio
boot.extraModulePackages = with config.boot.kernelPackages; lib.mkForce [
v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 kvm_intel nested=1
'';
security.polkit.enable = true;
programs.obs-studio.enableVirtualCamera = true;
#services.pid-fan-controller.enable = true;
networking.hostName = "mac";
@@ -62,23 +77,9 @@ in {
4410 # lan-mouse
];
##### Netbird Configuration
services.netbird.clients.ppc = {
#login = {
#enable = true;
#setupKeyFile = "${secretsDir}/netbird-setup-key";
#};
port = 51821;
ui.enable = false;
openFirewall = true;
#openInternalFirewall = true;
};
swapDevices = [ { device = "/swapfile"; } ];
boot.kernelModules = [ "usbip_core" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
# to build rpi images
boot.binfmt.emulatedSystems = [
@@ -95,6 +96,9 @@ in {
firewall_backend = "nftables"
'';
};
networking.firewall.trustedInterfaces = [
"nb-ppc"
];
# Use the GRUB 2 boot loader.
boot.loader.grub = {
@@ -153,6 +157,12 @@ in {
fsType = "vfat";
};
fileSystems."/data/external" = {
device = "/dev/disk/by-uuid/62933892-a6b9-4a10-8b9d-f47dc1380e85";
fsType = "ext4";
options = [ "defaults" "nofail" ];
};
networking = {
nameservers = [ "1.1.1.1" "8.8.8.8" ];
};
@@ -188,8 +198,8 @@ in {
{
position = "left";
hostname = "main";
activate_on_startup = true;
ips = [ "192.168.4.2" "100.71.47.106" ];
activate_on_startup = false;
ips = [ "192.168.4.2" "100.88.218.34" ];
port = 4410;
}
];
@@ -211,7 +221,8 @@ in {
newerUnstableSrc = builtins.getFlake "nixpkgs/d0fc30899600b9b3466ddb260fd83deb486c32f1";
newerUnstable = import newerUnstableSrc.outPath {};
mySway = newerUnstable.sway.override {
mySway = newerUnstable.sway;
myOtherSway = newerUnstable.sway.override {
sway-unwrapped = (newerUnstable.sway-unwrapped.overrideAttrs (prev: {
/*
src = pkgs.fetchFromGitHub {
@@ -451,7 +462,8 @@ in {
uuid = "ab51de8a-9742-465a-928b-be54a83ab6a3";
type = "wifi";
interface-name = "wlp3s0";
autoconnect-priority = "100";
#autoconnect-priority = "100";
autoconnect = false;
};
wifi = {
mode = "ap";

108
hosts/main/alacritty.toml Normal file
View File

@@ -0,0 +1,108 @@
[colors.bright]
black = "#6272a4"
blue = "#d6acff"
cyan = "#a4ffff"
green = "#69ff94"
magenta = "#ff92df"
red = "#ff6e6e"
white = "#ffffff"
yellow = "#ffffa5"
[colors.cursor]
cursor = "CellForeground"
text = "CellBackground"
[colors.footer_bar]
background = "#282a36"
foreground = "#f8f8f2"
[colors.hints.end]
background = "#282a36"
foreground = "#f1fa8c"
[colors.hints.start]
background = "#f1fa8c"
foreground = "#282a36"
[colors.line_indicator]
background = "None"
foreground = "None"
[colors.normal]
black = "#21222c"
blue = "#bd93f9"
cyan = "#8be9fd"
green = "#50fa7b"
magenta = "#ff79c6"
red = "#ff5555"
white = "#f8f8f2"
yellow = "#f1fa8c"
[colors.primary]
background = "#282a36"
bright_foreground = "#ffffff"
foreground = "#f8f8f2"
[colors.search.focused_match]
background = "#ffb86c"
foreground = "#44475a"
[colors.search.matches]
background = "#50fa7b"
foreground = "#44475a"
[colors.selection]
background = "#44475a"
text = "CellForeground"
[colors.vi_mode_cursor]
cursor = "CellForeground"
text = "CellBackground"
[font]
size = 22
#[font.bold]
#family = "Hack"
#style = "Bold"
#[font.bold_italic]
#family = "Hack"
#style = "Bold Italic"
#[font.italic]
#family = "Hack"
#style = "Italic"
#[font.normal]
#family = "Hack"
#style = "Regular"
[[keyboard.bindings]]
action = "Paste"
key = "V"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "Copy"
key = "C"
mods = "Control|Shift"
[[keyboard.bindings]]
chars = "\u001b\u005b\u0042"
key = "J"
mods = "Control"
[[keyboard.bindings]]
chars = "\u001b\u005b\u0041"
key = "K"
mods = "Control"
[[keyboard.bindings]]
chars = "\u001b\u005b\u0044"
key = "H"
mods = "Control"
[[keyboard.bindings]]
chars = "\u001b\u005b\u0043"
key = "L"
mods = "Control"

101
hosts/main/bashrc Normal file
View File

@@ -0,0 +1,101 @@
export CONFIG_DIR=/home/me/work/config
export DATA_DIR=/home/me/work/app-data
export HERE_DIR=/home/me/here
export LOG_DIR=/tmp/mlog
export SVDIR=$CONFIG_DIR/hosts/main/services
export BASH_ENV=$CONFIG_DIR/hosts/main/bashrc
export HOSTNAME=main
export DOOMDIR="$CONFIG_DIR/doomdir"
mkdir -p $LOG_DIR
# arch path
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH=$PATH:$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin # nix path
# main stuff
export PATH=$CONFIG_DIR/hosts/main/bin:$PATH
export SECRETS_DIR=/home/me/secrets
# nix lock
export NIXPKGS_REV=04e1ec9c5dbf94ab78b6b755b5ec28c1d6dd5392 # nix eval ${CONFIG_DIR}#inputs.nixpkgs.rev
export NIXPKGS_UNSTABLE_REV=ac6b2166e7a9375683b8e98f860f273222337b16 # nix eval ${CONFIG_DIR}#inputs.nixpkgs.rev
export NIX_PATH=nixpkgs=/nix/store/jpf38g508p4njqzbfkvdfjj7v3s795k9-source # nix flake prefetch nixpkgs/$(nix eval $CONFIG_DIR#inputs.nixpkgs.rev --raw) --json | jq '.storePath' -r
# bin paths
if [ -d /run/current-system ]; then # in case of nixos
export BIN_ZED=~/work/path-extra/zed
else
export BIN_ZED=/usr/sbin/zeditor
fi
## #### detect distro
detect_distro() {
local -n reply_distro=$1
local line key value
reply_distro="unknown"
# Read file line by line without spawning external commands
if [[ -f /etc/os-release ]]; then
while IFS='=' read -r key value; do
# Clean up the key name
key="${key##*([[:space:]])}"
key="${key%%*([[:space:]])}"
if [[ "$key" == "ID" ]]; then
# Strip potential surrounding quotes from the value
value="${value#\"}"
value="${value%\"}"
value="${value#\'}"
value="${value%\'}"
reply_distro="$value"
return 0
fi
done < /etc/os-release
fi
}
# get_config
function get_config() {
if [[ "$2" == "" ]]; then
local -n reply_config=OUT
else
local -n reply_config=$2
fi
declare -A myconfig
detect_distro DISTRO
myconfig["hyprland.bin"]="~/work/src/hyprland/build/Hyprland"
myconfig["prismlauncher.bin"]="/usr/sbin/prismlauncher"
myconfig["hyprland.configFile"]="$CONFIG_DIR/hosts/main/hyprland.lua"
myconfig["steam.homeDir"]="$HERE_DIR/steam-home"
myconfig["steam.bin"]="/home/me/.nix-profile/bin/steam"
myconfig["git.bin"]="/bin/git"
myconfig["ssh.bin"]="/bin/ssh"
myconfig["mize.configFile"]="$CONFIG_DIR/hosts/main/"
myconfig["mize.secretsFile"]="~/secrets/mize-config.toml"
# nixos case
if [[ "$DISTRO" == "nixos" ]]; then
myconfig["zed.bin"]="~/work/path-extra/zed"
fi
# arch case
if [[ "$DISTRO" == "arch" ]]; then
myconfig["zed.bin"]="/usr/sbin/zeditor"
fi
reply_config=${myconfig["$1"]}
}
# auto start hyprland in tty
if [[ $TERM == "linux" ]]; then
sudo loadkeys de
fi
if [[ $- == *i* ]]; then
source $CONFIG_DIR/mods/bashrc-common
fi

3
hosts/main/bin/alacritty Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/sbin/alacritty --config-file $CONFIG_DIR/hosts/main/alacritty.toml

7
hosts/main/bin/config-zed Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
#export RA_LOG_FILE="/home/me/rust-analyzer.log"
export XDG_DATA_HOME=~/work/app-data/config-zed
export WAYLAND_DISPLAY=
sudo renice -n -5 -p $$
exec $BIN_ZED ~/work/config ~/work/things
#zed "$@"

3
hosts/main/bin/dms Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/dms -c /home/me/work/config/hosts/main/ "$@"

1
hosts/main/bin/doom Symbolic link
View File

@@ -0,0 +1 @@
../../../src/doom/bin/doom

8
hosts/main/bin/elephant Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/elephant
exec 1>$LOG_DIR/elephant
fi
exec /usr/sbin/elephant -c $CONFIG_DIR/hosts/main/elephant "$@"

3
hosts/main/bin/em Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec emacsclient "$@"

13
hosts/main/bin/emacs-server Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/emacs
exec 1>$LOG_DIR/emacs
unset IS_RUNIT
fi
export DOOMDIR="$CONFIG_DIR/doomdir"
echo $DOOMDIR
echo -------------
exec emacs --init-directory $CONFIG_DIR/src/doom --fg-daemon "$@"

5
hosts/main/bin/git Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
export GIT_CONFIG_GLOBAL=$CONFIG_DIR/hosts/main/git_config
get_config git.bin BIN
exec $BIN "$@"

20
hosts/main/bin/hyprland Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/hyprland
exec 1>$LOG_DIR/hyprland
sudo renice -n -10 -p $$
unset IS_RUNIT
fi
export XDG_CURRENT_DESKTOP=hyprland
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=hyprland
systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PATH
dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PATH
get_config hyprland.bin BIN
get_config hyprland.configFile CONFIG
exec $BIN --config $CONFIG "$@"

3
hosts/main/bin/lan-mouse Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec $HOME/.nix-profile/bin/lan-mouse --config $CONFIG_DIR/hosts/main/lan-mouse.toml "$@"

1
hosts/main/bin/m Symbolic link
View File

@@ -0,0 +1 @@
mize

12
hosts/main/bin/mize Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/mize
exec 1>$LOG_DIR/mize
exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml run
exit 0
fi
export LD_LIBRARY_PATH=/nix/store/992h4k1s2c0ma186wyc7a3080wrh1cc6-xdotool-4.20260303.1/lib:/nix/store/rsdvlq7wb59hdiwhhvkhx2xvxdkalkzc-webkitgtk-2.52.4+abi=4.1/lib:/nix/store/90ln3xz5m2x3r0ykad4mkg9gnwgrjpzg-pango-1.57.1/lib:/nix/store/l0vl4dali2mvbpi30a8da1f71jl85myg-openssl-3.6.2/lib:/nix/store/s2bjqqzdjs4ji71qm1wwnkiy7g3afdz6-at-spi2-core-2.60.4/lib:/nix/store/fzhjg6xris850npqr92g4m4pskj88brn-atkmm-2.28.5/lib:/nix/store/4zwifnznmqsg3zl8y5yyfafwp4sws6rs-cairo-1.18.4/lib:/nix/store/rgr3i966i5wnblv62fvkid3v3lxy1ivb-gdk-pixbuf-2.44.6/lib:/nix/store/7dl2py4dnp4ffj92r1lq0i54ik1v8kzn-glib-2.88.1/lib:/nix/store/7c73fgj9w0k8qrpq3j1h8h976bk7gqsp-gtk+3-3.24.52/lib:/nix/store/49i3fhgpfffwh3xm3j58ma4z7221sqbq-harfbuzz-13.2.1/lib:/nix/store/na21ka09652cgigpv9wlw904wpq8bnvz-librsvg-2.62.1/lib:/nix/store/jc4y9v7ci45vas65kyl00pzpam3dnbfk-libsoup-3.6.6/lib:/nix/store/3kncz3fkk7sv9xc61x096jnbxvxfnx1k-libxkbcommon-1.13.1/lib:/nix/store/a4h98420m9h8c84r2igrpdd94xsrc9b6-alsa-lib-1.2.15.3/lib:/nix/store/hngmi01i8wgi25a0byrxcn4ysz5j79mw-gcc-15.2.0-lib/lib:/nix/store/xpzd2xmvqpkv1la78qkfpybkfwak27xd-libxcb-1.17.0/lib:/nix/store/6y2b9qs1npwsvcsl9m66hjarzj0yagb4-pipewire-1.6.5/lib:/nix/store/clvzgv5kqq953s4azqhkg3ddgpvgl9wc-wayland-1.25.0/lib:/nix/store/8gyg3xn9i8xdz42yhbl0d3vmmz8phcs0-bzip2-1.0.8/lib
exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"

4
hosts/main/bin/msession Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
export IS_RUNIT=1
exec runsvdir $CONFIG_DIR/hosts/main/services

7
hosts/main/bin/msteam Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
get_config steam.homeDir HOME
export HOME
get_config steam.bin BIN
nixGL $BIN "$@"

3
hosts/main/bin/nix Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec /nix/var/nix/profiles/default/bin/nix --option experimental-features "nix-command flakes" "$@" --option flake-registry $CONFIG_DIR/hosts/main/flake-registry.json

3
hosts/main/bin/nwg-displays Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/sbin/nwg-displays -m $CONFIG_DIR/hosts/main/hypr-monitors.lua

3
hosts/main/bin/nyxt Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec nixGL /home/me/.nix-profile/bin/nyxt --config $CONFIG_DIR/nyxt "$@"

3
hosts/main/bin/pacman Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec sudo /usr/sbin/pacman "$@"

4
hosts/main/bin/prismlauncher Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
get_config prismlauncher.bin BIN
exec nixGL $BIN -d ~/work/app-data/prism-launcher "$@"

3
hosts/main/bin/scp Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec /bin/scp -F $CONFIG_DIR/hosts/main/ssh_config "$@"

13
hosts/main/bin/screenshot Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
geometry=$(slurp -c "#ff0000ff")
if [[ "$?" != "0" ]]
then
pkill wayfreeze || true
exit
fi
grim -g "$geometry" -t ppm - | nixGL satty --filename - --copy-command=wl-copy --early-exit &
pkill wayfreeze || true

4
hosts/main/bin/ssh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
get_config ssh.bin BIN
exec $BIN -F $CONFIG_DIR/hosts/main/ssh_config "$@"

1
hosts/main/bin/wireshark Symbolic link
View File

@@ -0,0 +1 @@
../../../apps/wireshark

24
hosts/main/bin/zmk Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
export ZMK_CLI_CONFIG=$CONFIG_DIR/hosts/main/zmk-config
if [[ "$1" == "docker" ]] || [[ "$1" == "d" ]];
then
if [ ! $(docker ps -a -q -f name=my-zmk-builder) ]; then
docker build -t my-zmk-builder $CONFIG_DIR/zmk-config
fi
docker run -v $CONFIG_DIR:/config -it --rm my-zmk-builder
# build cmd: west build -- -DBOARD=nice_nano_v2 -DSHIELD=charybdis_left -DZMK_CONFIG=/config/zmk-config/config/ -DZMK_EXTRA_MODULES=/config/zmk-config
exit 0
fi
if [[ "$1" == "flash" ]] || [[ "$1" == "f" ]];
then
if [ ! $(docker ps -a -q -f name=my-zmk-builder) ]; then
docker build -t my-zmk-builder $CONFIG_DIR/zmk-config
fi
docker run -v $CONFIG_DIR:/config --workdir /config/src/zmk/app -it --rm my-zmk-builder --entrypoint /bin/bash -c 'west build -- -DBOARD=nice_nano_v2 -DSHIELD=charybdis_left -DZMK_CONFIG=/config/zmk-config/config/ -DZMK_EXTRA_MODULES=/config/zmk-config'
exit 0
fi
exec /home/me/work/src/zmk-cli/.venv/bin/zmk "$@"

View File

@@ -0,0 +1 @@
[{"socket":"/path/to/bw.socket","contents":[],"aliases":["default"]}]

View File

@@ -33,7 +33,8 @@
};
*/
#services.openssh.enable = true;
services.openssh.enable = true;
boot.kernelModules = [ "vhci-hcd" ];
programs.obs-studio = {
enable = true;
@@ -44,6 +45,62 @@
obs-teleport
];
};
documentation.enable = true;
documentation.man.enable = true;
#fileSystems."/home/me/nico" = {
#device = "100.88.28.123:/data/incus/default-pool/containers/nico/rootfs/root/work/";
#fsType = "nfs";
#options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" "nofail" ];
#};
fileSystems."/" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=nixos" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/home/me/work" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=work" ];
};
fileSystems."/home/me/secrets" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=secrets" ];
};
fileSystems."/cachy" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=cachy" ];
};
fileSystems."/swap" = {
device = "/dev/disk/by-label/main-root";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/MAIN-BOOT";
fsType = "vfat";
};
boot.loader.grub = {
enable = true;
#default = "cachy";
extraEntries = ''
menuentry 'cachy' {
linux /vmlinuz-linux rootflags=subvol=cachy rw rd.luks.name=f93d0e0c-c620-4d39-bd6a-a7c0c90fb850=root root=/dev/mapper/root systemd.setenv=SYSTEMD_SULOGIN_FORCE=1
initrd /initramfs-linux.img
}
'';
};
# virtual display
/*
@@ -85,18 +142,6 @@
};
*/
##### Netbird Configuration
services.netbird.clients.ppc = {
#login = {
#enable = true;
#setupKeyFile = "${secretsDir}/netbird-setup-key";
#};
port = 51821;
ui.enable = false;
openFirewall = true;
#openInternalFirewall = true;
};
programs.fuse.userAllowOther = true;
@@ -179,6 +224,7 @@
/*
home-manager.users.me.programs.lan-mouse = {
enable = true;
settings = {
@@ -189,36 +235,20 @@
position = "right";
hostname = "mac";
activate_on_startup = true;
ips = [ "192.168.4.3" "100.100.55.117" ];
ips = [ "192.168.4.3" "100.88.112.181" ];
port = 4410;
}
];
};
};
home-manager.users.me.systemd.user.services.lan-mouse.Service.Environment = "PATH=/bin";
*/
virtualisation.vmVariant.services.timesyncd.enable = lib.mkForce false;
services.tailscale.enable = true;
services.resilio = {
enable = false;
enableWebUI = true;
httpListenAddr = "100.71.47.106";
checkForUpdates = false;
listeningPort = 44444;
};
users.users.me.homeMode = "770"; # important for resilio
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
44444 # resilio sync
9000 # resilio webui
];
virtualisation.waydroid.enable = true;
@@ -266,18 +296,18 @@
imports = [
../common/all.nix
../common/nixos-headless.nix
../../common/all.nix
../../common/nixos-headless.nix
#../common/nixos-graphical.nix
../common/nixos-wayland.nix
../common/building.nix
../common/nixos.nix
../mods/battery_monitor.nix
../../common/nixos-wayland.nix
../../common/building.nix
../../common/nixos.nix
../../mods/battery_monitor.nix
inputs.networkmanager.nixosModules.networkmanager
inputs.home-manager.nixosModules.home-manager
../users/me/gui.nix
../users/root/default.nix
../../users/me/gui.nix
../../users/root/default.nix
# see: https://github.com/NixOS/nixpkgs/issues/300081
#"${inputs.nixpkgs-unstable}/nixos/modules/virtualisation/incus.nix"
@@ -285,8 +315,16 @@
# add waveforms flake module
#inputs.waveforms.nixosModule
inputs.mize.nixosModules.default
];
####################### MIZE ###########################
mize.enable = true;
mize.debugConfigFile = "/home/me/secrets/mize-config.toml";
mize.debugBinary = "/home/me/work/config/target/debug/main-os";
systemd.user.services.mize.environment.LOG= "trace";
systemd.user.services.mize.serviceConfig.EnvironmentFile = "/home/me/work/app-data/mize/daemon.env";
#services.udev.packages = [ inputs.waveforms.packages.${system}.adept2-runtime ];
#users.users.rslsync.extraGroups = ["users"];
@@ -309,10 +347,15 @@
((builtins.getFlake "nixpkgs/96bc8fec15133d6056410ed3abae2fb9419fb545").legacyPackages.${system}.affine.overrideAttrs {
patches = [
../overlays/patches/affin-edgeless-right-click-drag.patch
../../overlays/patches/affin-edgeless-right-click-drag.patch
];
})
(inputs.nixpkgs-unstable.legacyPackages.${system}.factorio.override {
username = "c2vi";
token = builtins.readFile "${secretsDir}/factorio-token";
})
#inputs.waveforms.packages.${system}.waveforms
intel-compute-runtime-legacy1
ffmpeg-full
@@ -482,7 +525,7 @@
elif [[ "$host" == "phone" ]]
then
ssh phone "source ~/.bashrc && on" &
${pkgs.rustdesk}/bin/rustdesk --connect 100.77.80.77
${pkgs.rustdesk}/bin/rustdesk --connect 100.88.245.227
elif [[ "$host" == "vnc-fwin" ]]
then
@@ -558,12 +601,13 @@
networking.firewall.allowedTCPPorts = [
5357 # wsdd
1234 # for general use
12345 # for general use
8888 # for general usage
9999 # for general usage
8080 # for mitm proxy
51820 # wireguard
6000 # Xserver
10000 # tailscale tcp funnel
4405 # clipboard sync with imac
];
@@ -574,7 +618,6 @@
53 # allow dns
48899 # GoodWe inverter discovery
4410 # lan-mouse
41641 # tailscale
];
#networking.search = [ "c2vi.local" ];
@@ -590,11 +633,11 @@
uuid = "a02273d9-ad12-395e-8372-f61129635b6f";
type = "ethernet";
autoconnect-priority = "-999";
interface-name = "enp0s13f0u1u4u3";
interface-name = "enp0s20f0u4u4u3";
};
ipv4 = {
address2 = "192.168.4.2/24";
dns = "1.1.1.1;";
dns = "100.88.218.34;";
method = "manual";
};
};
@@ -666,7 +709,7 @@
ipv4 = {
#address1 = "192.168.20.11/24";
dns = "1.1.1.1;8.8.8.8;";
dns = "100.88.218.34;";
method = "auto";
};
};
@@ -693,7 +736,7 @@
ipv4 = {
#address1 = "192.168.20.11/24";
dns = "1.1.1.1;8.8.8.8;";
dns = "100.88.218.34;";
method = "auto";
};
};
@@ -918,6 +961,61 @@
'';
# */
############################## suspend and hibernate http server ###################################
networking.firewall.interfaces.nb-ppc.allowedTCPPorts = [ 46733 ];
systemd.services.power-http-control =
let
powerHttpServer = pkgs.writeTextFile {
name = "power-http-server";
destination = "/bin/power-http-server.py";
executable = true;
text = ''
#!${pkgs.python3}/bin/python3
from http.server import BaseHTTPRequestHandler, HTTPServer
import subprocess
HOST = "0.0.0.0"
PORT = 46733
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/suspend":
self.send_response(200)
self.end_headers()
self.wfile.write(b"Suspending")
subprocess.Popen(["systemctl", "suspend"])
elif self.path == "/shutdown":
self.send_response(200)
self.end_headers()
self.wfile.write(b"Shutting down")
subprocess.Popen(["systemctl", "hibernate"])
else:
self.send_response(404)
self.end_headers()
self.wfile.write(b"Not found")
def log_message(self, format, *args):
pass
HTTPServer((HOST, PORT), Handler).serve_forever()
'';
};
in
{
description = "Simple HTTP server for suspend/shutdown";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${powerHttpServer}/bin/power-http-server.py";
Restart = "always";
RestartSec = 5;
Type = "simple";
};
};
############################## swap and hibernate ###################################

Some files were not shown because too many files have changed in this diff Show More