Compare commits

...

4 Commits

Author SHA1 Message Date
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
77 changed files with 20541 additions and 1310 deletions

1
.direnv/flake-profile Symbolic link
View File

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

View File

@@ -0,0 +1 @@
/nix/store/3yjs9x851rdcql4lrlhb77075l1a8zn4-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

15
.gitmodules vendored Normal file
View File

@@ -0,0 +1,15 @@
[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

8683
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

10
Cargo.toml Normal file
View File

@@ -0,0 +1,10 @@
[workspace]
members = [
"mize/mize",
"mize/marts",
"mize/macros",
"generated",
"dev-part",
"mize/marts/spacetime",
]
resolver = "2"

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,7 +8,7 @@
# - 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";
@@ -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"}
'';
}

8167
dev-part/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

24
dev-part/Cargo.toml Normal file
View File

@@ -0,0 +1,24 @@
[package]
name = "c2vi-dev-part"
version = "0.1.0"
edition = "2024"
[lib]
name = "c2vi_part"
path = "dpart.rs"
[dependencies]
mize = { path = "../mize/mize" }
marts = { path = "../mize/marts" }
cmd_lib = "2.0.0"
indoc = "2.0.7"
clap = "4.6.1"
ciborium = "0.2.2"
dioxus = { version = "0.7.9", features = ["desktop"] }
tracing = "0.1.44"
chrono = "0.4.45"
[features]
target-os = []
target-js = []
target-obsidian = []

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::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/packages/ppc/platform/obsidian/deno.json build" Enter
tmux send-keys -t mize-deploy "cp -r {SRC}/mize/packages/ppc/platform/obsidian/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::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::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::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,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 {
}

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";
@@ -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,7 @@
fn main() {
if let Err(err) = c2vi_part::timetrack_waybar_main() {
err.log();
}
}

View File

@@ -10,7 +10,7 @@
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
@@ -26,9 +26,6 @@
}
];
services.tailscale.enable = true;
#fileSystems."/boot" = {
# device = "/dev/disk/by-label/fusu-boot";
# fsType = "fat32";

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

@@ -50,30 +50,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 +66,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 +114,7 @@ in {
services.samba.openFirewall = true;
networking.firewall.allowedTCPPorts = [
22
8888 # for general usage
9999 # for general usage
8080 # for mitm proxy
@@ -163,6 +154,7 @@ in {
];
environment.systemPackages = with pkgs; [
tcpdump
sshfs
ntfs3g
virtiofsd
@@ -223,8 +215,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,24 @@ 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;
#services.pid-fan-controller.enable = true;
networking.hostName = "mac";
@@ -62,23 +76,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 +95,9 @@ in {
firewall_backend = "nftables"
'';
};
networking.firewall.trustedInterfaces = [
"nb-ppc"
];
# Use the GRUB 2 boot loader.
boot.loader.grub = {
@@ -153,6 +156,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 +197,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;
}
];
@@ -451,7 +460,8 @@ in {
uuid = "ab51de8a-9742-465a-928b-be54a83ab6a3";
type = "wifi";
interface-name = "wlp3s0";
autoconnect-priority = "100";
#autoconnect-priority = "100";
autoconnect = false;
};
wifi = {
mode = "ap";

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,15 @@
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" ];
};
# virtual display
/*
@@ -85,18 +95,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;
@@ -189,7 +187,7 @@
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;
}
];
@@ -202,23 +200,6 @@
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;
@@ -285,8 +266,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"];
@@ -313,6 +302,11 @@
];
})
(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 +476,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 +552,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 +569,6 @@
53 # allow dns
48899 # GoodWe inverter discovery
4410 # lan-mouse
41641 # tailscale
];
#networking.search = [ "c2vi.local" ];
@@ -590,11 +584,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 +660,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 +687,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 +912,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 ###################################

8
hosts/nico/setup.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
SRC=root//work/config-c2vi
# ~/.hermes link
ln -fs ~/work/nico/hermes ~/.hermes
# ssh config
ln -fs $SRC/hosts/nico/ssh_config ~/.ssh/config

2
hosts/nico/ssh_config Normal file
View File

@@ -0,0 +1,2 @@
Host *
IdentityFile /root/work/nico/private-key

View File

@@ -18,7 +18,6 @@ in {
../common/nixos-wayland.nix
];
services.tailscale.enable = true;
programs.nix-ld.enable = true;
networking.hostName = "te";
@@ -62,6 +61,26 @@ in {
}
];
services.keyd = {
enable = true;
/*
keyboards.bluetooth-3-0-keyboard = {
ids = [ "05ac:0255:f22563e9" ];
settings.main = {
leftalt = "meta";
leftcontrol = "leftalt";
};
};
*/
#keyboards.default.ids = [ "-05ac:0255" ]; completely disables my rebinding...... hmmmm
keyboards.default.settings = {
main = {
leftalt = "leftcontrol";
leftcontrol = "leftalt";
};
};
};
boot.kernelModules = [ "usbip_core" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
@@ -308,7 +327,10 @@ in {
############### disk config
# the flash drive in use for te
#disko.devices.disk.root.device = "/dev/disk/by-id/usb-Generic_Flash_Disk_FF830E8F-0:0";
disko.devices.disk.root.device = "/dev/disk/by-id/ata-KBG40ZNV512G_KIOXIA_70GPGA85QBV1";
#disko.devices.disk.root.device = "/dev/disk/by-id/ata-KBG40ZNV512G_KIOXIA_70GPGA85QBV1";
# the 500G ssd previously in fusu
disko.devices.disk.root.device = "/dev/disk/by-id/ata-WDC_PC_SN520_SDAPNUW-256G-1006_190399802515";
disko.devices = {
disk = {
root = {
@@ -334,7 +356,7 @@ in {
};
root = {
size = "240G";
size = "100G";
content = {
# LUKS passphrase will be prompted interactively only
type = "luks";

821
log
View File

@@ -1,821 +0,0 @@
warning: Git tree '/home/me/work/config' is dirty
evaluation warning: You have set specialArgs.pkgs, which means that options like nixpkgs.config
and nixpkgs.overlays will be ignored. If you wish to reuse an already created
pkgs, which you know is configured correctly for this NixOS configuration,
please import the `nixosModules.readOnlyPkgs` module from the nixpkgs flake or
`(modulesPath + "/misc/nixpkgs/read-only.nix"), and set `{ nixpkgs.pkgs = <your pkgs>; }`.
This properly disables the ignored options to prevent future surprises.
evaluation warning: nix-index-database: flake output `hmModules` has been renamed to `homeModules`
evaluation warning: In order to support declarative extension configuration,
extension installation has been moved from
programs.firefox.profiles.<profile>.extensions
to
programs.firefox.profiles.<profile>.extensions.packages
evaluation warning: 'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'
error:
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1691:14:
1690| zipAttrsWith (
1691| n: values:
| ^
1692| let
… while calling the 'head' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1696:13:
1695| if length values == 1 || pred here (elemAt values 1) (head values) then
1696| head values
| ^
1697| else
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1188:17:
1187| mapAttrs (
1188| name: value:
| ^
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1189:85:
1188| name: value:
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
| ^
1190| );
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:275:71:
274| # For definitions that have an associated option
275| declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
| ^
276|
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1118:7:
1117| // {
1118| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1119| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating the attribute 'mergedValue'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1192:5:
1191| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
1192| mergedValue =
| ^
1193| if isDefined then
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1193:7:
1192| mergedValue =
1193| if isDefined then
| ^
1194| if type.merge ? v2 then
… while evaluating the attribute 'values'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1186:9:
1185| {
1186| values = defsSorted;
| ^
1187| inherit (defsFiltered) highestPrio;
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1180:11:
1179| # Avoid sorting if we don't have to.
1180| if any (def: def.value._type or "" == "order") defsFiltered.values then
| ^
1181| sortProperties defsFiltered.values
… while calling the 'any' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1180:14:
1179| # Avoid sorting if we don't have to.
1180| if any (def: def.value._type or "" == "order") defsFiltered.values then
| ^
1181| sortProperties defsFiltered.values
… while evaluating the attribute 'values'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1360:7:
1359| {
1360| values = concatMap (def: if getPrio def == highestPrio then [ (strip def) ] else [ ]) defs;
| ^
1361| inherit highestPrio;
… while calling the 'concatMap' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1360:16:
1359| {
1360| values = concatMap (def: if getPrio def == highestPrio then [ (strip def) ] else [ ]) defs;
| ^
1361| inherit highestPrio;
… while calling the 'concatMap' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1160:26:
1159| # Process mkMerge and mkIf properties.
1160| defsNormalized = concatMap (
| ^
1161| m:
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1161:11:
1160| defsNormalized = concatMap (
1161| m:
| ^
1162| map (
… while calling the 'map' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1162:11:
1161| m:
1162| map (
| ^
1163| value:
… while evaluating definitions from `/nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/activation/top-level.nix':
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1171:80:
1170| }
1171| ) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
1172| ) defs;
… while calling 'dischargeProperties'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1311:5:
1310| dischargeProperties =
1311| def:
| ^
1312| if def._type or "" == "merge" then
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1312:5:
1311| def:
1312| if def._type or "" == "merge" then
| ^
1313| concatMap dischargeProperties def.contents
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:805:21:
804| inherit (module) file;
805| inherit value;
| ^
806| }) module.config
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/activation/top-level.nix:81:26:
80| # Handle assertions and warnings
81| baseSystemAssertWarn = lib.asserts.checkAssertWarn config.assertions config.warnings baseSystem;
| ^
82|
… while calling 'checkAssertWarn'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/asserts.nix:193:27:
192| checkAssertWarn =
193| assertions: warnings: val:
| ^
194| let
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/asserts.nix:200:7:
199| else
200| showWarnings warnings val;
| ^
201|
… while calling 'showWarnings'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/trivial.nix:982:28:
981|
982| showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
| ^
983|
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/trivial.nix:982:33:
981|
982| showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
| ^
983|
… while calling 'foldr'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:139:14:
138| foldr =
139| op: nul: list:
| ^
140| let
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:144:5:
143| in
144| fold' 0;
| ^
145|
… while calling 'fold''
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:142:15:
141| len = length list;
142| fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
| ^
143| in
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:142:18:
141| len = length list;
142| fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
| ^
143| in
… while calling the 'length' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:141:13:
140| let
141| len = length list;
| ^
142| fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/activation/top-level.nix:81:72:
80| # Handle assertions and warnings
81| baseSystemAssertWarn = lib.asserts.checkAssertWarn config.assertions config.warnings baseSystem;
| ^
82|
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1188:17:
1187| mapAttrs (
1188| name: value:
| ^
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1189:85:
1188| name: value:
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
| ^
1190| );
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:275:71:
274| # For definitions that have an associated option
275| declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
| ^
276|
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1118:7:
1117| // {
1118| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1119| inherit (res.defsFinal') highestPrio;
… while evaluating the option `warnings':
(10 duplicate frames omitted)
… while evaluating definitions from `/nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix':
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1171:80:
1170| }
1171| ) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
1172| ) defs;
… while calling 'dischargeProperties'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1311:5:
1310| dischargeProperties =
1311| def:
| ^
1312| if def._type or "" == "merge" then
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1312:5:
1311| def:
1312| if def._type or "" == "merge" then
| ^
1313| concatMap dischargeProperties def.contents
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:805:21:
804| inherit (module) file;
805| inherit value;
| ^
806| }) module.config
… while calling the 'concatLists' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:494:7:
493| in
494| concatLists (
| ^
495| mapAttrsToList (
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:496:17:
495| mapAttrsToList (
496| name: service:
| ^
497| let
… while calling the 'concatLists' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:502:11:
501| in
502| concatLists [
| ^
503| (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:503:14:
502| concatLists [
503| (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
| ^
504| "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"
… while calling 'optional'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:777:20:
776| */
777| optional = cond: elem: if cond then [ elem ] else [ ];
| ^
778|
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:777:26:
776| */
777| optional = cond: elem: if cond then [ elem ] else [ ];
| ^
778|
… in the left operand of the AND (&&) operator
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:503:42:
502| concatLists [
503| (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
| ^
504| "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/nixos/modules/system/boot/systemd.nix:498:20:
497| let
498| type = service.serviceConfig.Type or "";
| ^
499| restart = service.serviceConfig.Restart or "no";
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1188:17:
1187| mapAttrs (
1188| name: value:
| ^
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1189:85:
1188| name: value:
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
| ^
1190| );
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:275:71:
274| # For definitions that have an associated option
275| declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
| ^
276|
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1118:7:
1117| // {
1118| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1119| inherit (res.defsFinal') highestPrio;
… while evaluating the option `systemd.services.home-manager-me.serviceConfig':
… while evaluating the attribute 'mergedValue'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1192:5:
1191| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
1192| mergedValue =
| ^
1193| if isDefined then
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/types.nix:878:17:
877| headError = checkDefsForError check loc defs;
878| value = mapAttrs (
| ^
879| n: v:
… while calling the 'mapAttrs' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/types.nix:878:25:
877| headError = checkDefsForError check loc defs;
878| value = mapAttrs (
| ^
879| n: v:
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/types.nix:872:21:
871| # Meaning it is less lazy
872| filterAttrs (n: v: v.optionalValue ? value) (
| ^
873| zipAttrsWith (name: defs: mergeDefinitions (loc ++ [ name ]) elemType defs) (pushPositions defs)
… while calling 'filterAttrs'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:23:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… while calling the 'removeAttrs' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:28:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… while calling the 'filter' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:45:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:53:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… in the argument of the not operator
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:60:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:663:60:
662| */
663| filterAttrs = pred: set: removeAttrs set (filter (name: !pred name set.${name}) (attrNames set));
| ^
664|
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/types.nix:872:37:
871| # Meaning it is less lazy
872| filterAttrs (n: v: v.optionalValue ? value) (
| ^
873| zipAttrsWith (name: defs: mergeDefinitions (loc ++ [ name ]) elemType defs) (pushPositions defs)
… while evaluating the attribute 'optionalValue'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1256:5:
1255|
1256| optionalValue = if isDefined then { value = mergedValue; } else { };
| ^
1257| };
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1256:21:
1255|
1256| optionalValue = if isDefined then { value = mergedValue; } else { };
| ^
1257| };
(8 duplicate frames omitted)
… while evaluating definitions from `/nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/nixos':
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1171:80:
1170| }
1171| ) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
1172| ) defs;
… while calling 'dischargeProperties'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1311:5:
1310| dischargeProperties =
1311| def:
| ^
1312| if def._type or "" == "merge" then
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1312:5:
1311| def:
1312| if def._type or "" == "merge" then
| ^
1313| concatMap dischargeProperties def.contents
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/types.nix:819:15:
818| inherit (def) file;
819| value = v;
| ^
820| }) def.value
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'home-manager-generation'
whose name attribute is located at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/trivial-builders/default.nix:80:17:
79| enableParallelBuilding = true;
80| inherit buildCommand name;
| ^
81| passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'activation-script'
whose name attribute is located at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'text' of derivation 'activation-script'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/trivial-builders/default.nix:129:13:
128| inherit
129| text
| ^
130| executable
… while calling the 'concatStringsSep' builtin
at /nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/home-environment.nix:756:13:
755| if sortedCommands ? result then
756| lib.concatStringsSep "\n" (map mkCmd sortedCommands.result)
| ^
757| else
… while calling 'mkCmd'
at /nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/home-environment.nix:749:17:
748| let
749| mkCmd = res: ''
| ^
750| _iNote "Activating %s" "${res.name}"
… while evaluating the attribute 'data'
at /nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/lib/dag.nix:100:45:
99| {
100| result = map (v: { inherit (v) name data; }) sorted.result;
| ^
101| }
… while evaluating the attribute 'data'
at /nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/lib/dag.nix:92:9:
91| name = n;
92| data = v.data;
| ^
93| after = v.after ++ dagBefore dag n;
… from call site
at /nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/lib/dag.nix:92:16:
91| name = n;
92| data = v.data;
| ^
93| after = v.after ++ dagBefore dag n;
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1188:17:
1187| mapAttrs (
1188| name: value:
| ^
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/attrsets.nix:1189:85:
1188| name: value:
1189| if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
| ^
1190| );
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:275:71:
274| # For definitions that have an associated option
275| declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
| ^
276|
… while evaluating the attribute 'value'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/modules.nix:1118:7:
1117| // {
1118| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1119| inherit (res.defsFinal') highestPrio;
… while evaluating the option `home-manager.users.me.home.activation.installPackages.data':
(10 duplicate frames omitted)
… while evaluating definitions from `/nix/store/s7l9ap273g9f7jkci4i2m6mi87lax03b-source/modules/home-environment.nix':
(6 duplicate frames omitted)
… while evaluating derivation 'home-manager-path'
whose name attribute is located at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'passAsFile' of derivation 'home-manager-path'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/trivial-builders/default.nix:81:9:
80| inherit buildCommand name;
81| passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);
| ^
82| }
… while evaluating the attribute 'passAsFile'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:114:9:
113| # XXX: The size is somewhat arbitrary
114| passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
| ^
115| }
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:114:22:
113| # XXX: The size is somewhat arbitrary
114| passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
| ^
115| }
… in the argument of the not operator
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:114:52:
113| # XXX: The size is somewhat arbitrary
114| passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
| ^
115| }
… while calling the 'lessThan' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:114:52:
113| # XXX: The size is somewhat arbitrary
114| passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
| ^
115| }
… while calling the 'stringLength' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:114:25:
113| # XXX: The size is somewhat arbitrary
114| passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
| ^
115| }
… while calling the 'toJSON' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:109:16:
108| pathsToLinkJSON = builtins.toJSON pathsToLink;
109| pkgs = builtins.toJSON chosenOutputs;
| ^
110| extraPathsFrom = lib.optional includeClosures (writeClosure pathsForClosure);
… while evaluating list element at index 34
… while evaluating attribute 'paths'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:68:7:
67| chosenOutputs = map (drv: {
68| paths =
| ^
69| # First add the usual output(s): respect if user has chosen explicitly,
… while evaluating list element at index 0
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:68:7:
67| chosenOutputs = map (drv: {
68| paths =
| ^
69| # First add the usual output(s): respect if user has chosen explicitly,
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'python3-3.10.19-env'
whose name attribute is located at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'passAsFile' of derivation 'python3-3.10.19-env'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/trivial-builders/default.nix:81:9:
80| inherit buildCommand name;
81| passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);
| ^
82| }
(6 duplicate frames omitted)
… while calling the 'map' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/build-support/buildenv/default.nix:67:21:
66| let
67| chosenOutputs = map (drv: {
| ^
68| paths =
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/wrapper.nix:26:15:
25| let
26| paths = requiredPythonModules (extraLibs ++ [ python ]) ++ [
| ^
27| (runCommand "bin" { } ''
… while calling 'requiredPythonModules'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:94:5:
93| requiredPythonModules =
94| drvs:
| ^
95| let
… while calling the 'foldl'' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:98:5:
97| in
98| lib.unique (
| ^
99| [ python ] ++ modules ++ lib.concatLists (lib.catAttrs "requiredPythonModules" modules)
… while calling the 'concatLists' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:99:32:
98| lib.unique (
99| [ python ] ++ modules ++ lib.concatLists (lib.catAttrs "requiredPythonModules" modules)
| ^
100| );
… while calculating requiredPythonModules for python3.10-pandas-2.3.1:
… from call site
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:121:11:
120| requiredPythonModules = builtins.addErrorContext "while calculating requiredPythonModules for ${drv.name or drv.pname}:" (
121| requiredPythonModules drv.propagatedBuildInputs
| ^
122| );
… while calling 'requiredPythonModules'
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:94:5:
93| requiredPythonModules =
94| drvs:
| ^
95| let
… while calling the 'foldl'' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/python-packages-base.nix:98:5:
97| in
98| lib.unique (
| ^
99| [ python ] ++ modules ++ lib.concatLists (lib.catAttrs "requiredPythonModules" modules)
… while calling anonymous lambda
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:1857:25:
1856| */
1857| unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [ ];
| ^
1858|
… while evaluating a branch condition
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:1857:28:
1856| */
1857| unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [ ];
| ^
1858|
… while calling the 'elem' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/lists.nix:1857:31:
1856| */
1857| unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [ ];
| ^
1858|
… in the condition of the assert statement
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/lib/customisation.nix:412:15:
411| outPath =
412| assert condition;
| ^
413| drv.${outputName}.outPath;
… in the right operand of the IMPL (->) operator
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/mk-python-derivation.nix:464:11:
463| drv.disabled
464| -> throw "${removePrefix namePrefix drv.name} not supported for interpreter ${python.executable}"
| ^
465| ) { } drv
… while calling the 'throw' builtin
at /nix/store/ql735ybqjzwjdsjhywplx17cfvq9s1fm-source/pkgs/development/interpreters/python/mk-python-derivation.nix:464:14:
463| drv.disabled
464| -> throw "${removePrefix namePrefix drv.name} not supported for interpreter ${python.executable}"
| ^
465| ) { } drv
error: numpy-2.3.4 not supported for interpreter python3.10

View File

@@ -1,14 +0,0 @@
100.71.47.106 main
100.77.80.77 phone
100.70.54.18 fusu
100.70.54.18 files
100.81.207.107 lush
100.76.146.119 tab
100.70.39.65 waydroid
100.107.67.76 te
100.100.55.117 mac
100.96.201.42 ki
100.107.101.77 fe
100.107.101.77 fesu
100.93.225.52 fasu
100.91.200.82 fwin

1
mize Submodule

Submodule mize added at b2ed9efff2

View File

@@ -34,6 +34,7 @@
];
services.openssh = {
enable = true;
ports = [ 9000 ];
# require public key authentication for better security
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
@@ -46,6 +47,21 @@
'';
};
##### Netbird Configuration
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"
];
/*
system.activationScripts.addDefaultRoute = {
text = ''

View File

@@ -1,8 +1,9 @@
{ pkgs, dataDir, config, inputs, system, lib, secretsDir, ... }:
{ pkgs, dataDir, config, inputs, system, lib, secretsDir, pkgsUnstable, ... }:
/*
## ports
## forwarded ports
- 49001 ssh me-hosting
- 49002 ssh ppc-hosting
- 49003 ssh pcmc
@@ -22,22 +23,30 @@
- 49112 mc second voice
- 49113 mc second bedrock
- 49114 mc lobby bedrock
- 49115 mc nilla
- 49116 mc nilla voice
- me hosting ports
## non forwarded ports
- 5000 compass-site
- 5001 ppc-site
## me hosting ports
- 8000 wiki site
- 8001 lage0 site
- 8002 plausible site
- 8003 ppc-site
- 8004 instant db
- 8005 instant webui
- ppc hosting ports
## ppc hosting ports
- 8000 dav
- 8001 affine
- 8002 git
- 8003 git ssh
- 8004 matrix http
- 8005 ppc spacetime instance
- 8006 atproto pds http
## hosting container ips (on the interface br-proxy
## hosting container ips (on the interface br-proxy)
- fusu 192.168.1.2
- me-hosting 192.168.1.20
- ppc-hosting 192.168.1.21
@@ -71,7 +80,7 @@
services = lib.attrsets.mergeAttrsList (serviceList ++ extraServices);
in { inherit routers services; };
basicTraefikSetting = { name, domain, host, port }: let
basicTraefikSetting = { name, domain, host, port, extraRouterConfig ? {}, extraServiceConfig ? {}, middlewares ? [] }: let
host_ip =
if host == "me-hosting" then "192.168.1.20"
else if host == "pcmc" then "192.168.1.23"
@@ -80,12 +89,8 @@
else host;
in {
impotrs = [
"${inputs.hetzner_ddns}/release/nixos_module.nix"
];
routers.${name} = {
inherit middlewares;
rule = "Host(`${domain}`)";
service = name;
tls = {
@@ -93,13 +98,14 @@
domains = [
{ main = domain; }
];
};
} // extraRouterConfig;
};
services.${name}.loadBalancer.servers = [
{ url = "http://${host_ip}:${builtins.toString port}"; }
];
services.${name} = {
loadBalancer.servers = [
{ url = "http://${host_ip}:${builtins.toString port}"; }
];
} // extraServiceConfig;
};
@@ -230,6 +236,7 @@ in {
imports = [
./fesu-hosting-base.nix
];
services.netbird.package = pkgsUnstable.netbird;
};
};
@@ -276,11 +283,25 @@ in {
imports = [
./fesu-hosting-base.nix
];
services.netbird.package = pkgsUnstable.netbird;
users.users.root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICuH2ilZeIQrr9wYtBtQyRD5oaVkuLImjm9EIGfn+wqw" # Mr3DAlien
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDU8OZxpeEuwVYFQC1ZYOECfU8fVg0BhNIYk5tK6aNeUe4JBJezwBWIQLsxuo1YgUX1CwbP5IAAj0JyoYUzWT5H4Qyev6rj3JWvBl+kVTnJyiipRccasXD/3IuRK2GBpMcK67sUoHtgiq1kS8myuAtGh2dVeukCp196pCZC9VI0NiEmk2M6/pCiuKmaeaeyKEpkzd2wcdvqyXu3OKtq/qZyw+N8eLk8hC8wQK5lq/Syg8aZh7OV2jqe7CnRLnybybrVy3wRNI4DdoP51YEv+Q3eMlOpOdc7SGTyDPUMnTDNbBFL8u7o7xeLs/+v3neWOz/+rNkQbAoqEvN741lCozTcAxSTT8gnTOdrf+ClMFRpFMUkl3Z6JNymw0Zx2JFibhxQJWIKJq6Wh1YuDJXenIZka0sN5ut5W0KJMmCfzeyAXHy3qruYktbmUFz8iUm1ywbURZZNCmRlzESL2lE7iuTM06SxSYw4YxQHYIC4P6leMyN3hfrr4RUPtO8wJ1lALUs= kilix@epimetheus"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDrQUmZtpxDx669VjACdtLSLcIFZ5uJl4xsj49yJW6A39IglJ4S9ViPtp/kQhGZ3jJMCCFzwDLNNJBf8XfcAtio57cucUQxtRMnY57pKH284eucCanpCq8z9KgBYtrIdzYwRVQZo2tjxdAwKS5mHSOstUnqH8CzcG0kbq7k3s31MKQhzKWXx7lZEn3osQx/aIpt0eWB/SNAS4DWhx+mdGSqO2ryBqbZKaJuH90MEWyd5MKu25+h0ELbHrkkPYOwq0EnpGqvr0mps8AjEV4iExb28E+GGtS+R7yg2tw0QWM1m4PI4XF5JRAuLqt187YvgQe9DIKTuhu2BT/EN2Os7jx9r14Pq2P/IhrR0hVloSTn2/r3geUuFYNvYiL64dkZIRxBOlC3SKut/lB3cir0FPdDkxoIuRHICrsvdSC5wFfYJfhrf0ivkEk5Jgj+lS1QlC40Xw7e0ixKILo6uiriQor02bFY4ngQHTnBLKgjNsB3K23MN80vd8V6DVZdFB+XWr8= kilia@nomos"
];
};
systemd.services.ppc = {
environment = {
MIZE_CONFIG_FILES = "/root/host/ppc-website-config.toml";
};
description = "PPC Website";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "/root/host/ppc-src/target/release/ppc server";
Restart = "always";
};
};
};
};
@@ -342,11 +363,27 @@ in {
imports = [
./fesu-hosting-base.nix
];
services.netbird.package = pkgsUnstable.netbird;
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM82mBUZqo7nfU8XJQDoEcOa+DfQyJE7T7ddFjQVhg93 me@main"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNXOPxlnSxkhm050ui56D5SHrkhuFwUOU0Gf0C+Vmks melektron@goarnix"
];
};
};
############################ nico nfs share #########################
services.nfs.server = {
enable = true;
exports = ''
/data/incus/default-pool/containers/nico/rootfs/root/work/ 100.88.0.0/16(rw,sync,no_subtree_check,all_squash,anonuid=0,anongid=0)
'';
};
# Open necessary firewall ports
networking.firewall.allowedTCPPorts = [ 111 2049 20048 ];
networking.firewall.allowedUDPPorts = [ 111 2049 20048 ];
@@ -371,12 +408,21 @@ in {
############################ traefik #########################
# without this traefik will try to put downloaded plugins into "/plugins-storate/ which fails with permission denied"
systemd.services.traefik.serviceConfig.WorkingDirectory = config.services.traefik.dataDir;
services.traefik = {
enable = true;
#dataDir = "${dataDir}/traefik";
staticConfigOptions = {
experimental.plugins = {
traefikoidc = {
moduleName = "github.com/lukaszraczylo/traefikoidc";
version = "v0.7.10";
};
};
entryPoints = {
web = {
@@ -418,14 +464,21 @@ in {
{ name = "wiki-site"; domain = "wiki.ppc.social"; host = "me-hosting"; port = 8000; }
{ name = "lage0-site"; domain = "lage0.c2vi.dev"; host = "me-hosting"; port = 8001; }
{ name = "plausible"; domain = "plausible.c2vi.dev"; host = "me-hosting"; port = 8002; }
{ name = "ppc-site"; domain = "ppc.social"; host = "me-hosting"; port = 8003; }
{ name = "compass-site"; domain = "compass.ppc.social"; host = "fesu"; port = 3000; }
{ name = "ppc-site"; domain = "ppc.social"; host = "fesu"; port = 5001; }
{ name = "compass-site"; domain = "compass.ppc.social"; host = "fesu"; port = 5000; }
{ name = "dav"; domain = "dav.ppc.social"; host = "ppc-hosting"; port = 8000; }
{ name = "instant"; domain = "instant.ppc.social"; host = "me-hosting"; port = 8004; }
{ name = "instant-backend"; domain = "instant-backend.ppc.social"; host = "me-hosting"; port = 8005; }
{ name = "isotoke-website"; domain = "isotoke.ppc.social"; host = "192.168.1.26"; port = 80; }
{ name = "affine"; domain = "affine.ppc.social"; host = "ppc-hosting"; port = 8001; }
{ name = "gitea"; domain = "git.ppc.social"; host = "ppc-hosting"; port = 8002; }
{ name = "nico"; domain = "nico.ppc.social"; host = "192.168.1.14"; port = 18789; middlewares = [ "oidc-nico" ]; }
{ name = "ppc-matrix"; domain = "matrix.ppc.social"; host = "ppc-hosting"; port = 8004; }
{ name = "ppc-pds"; domain = "pds.ppc.social"; host = "ppc-hosting"; port = 8006; }
#{ name = "spacetime"; domain = "spacetime.ppc.social"; host = "ppc-hosting"; port = 8005; extraRouterConfig = {
# rule = "Host(`spacetime.ppc.social`) && PathPrefix(`/v1/database`)";
# };
#}
]
# extraRouters (full configs)
@@ -434,7 +487,17 @@ in {
# extraServices (full configs)
[
]);
])
// {
middlewares.oidc-nico.plugin.traefikoidc = {
providerURL = "https://auth.ppc.social";
callbackURL = "/oauth2/callback";
clientSecret = builtins.readFile "${secretsDir}/nico-oidc-secret";
clientID = "361779269791186947";
sessionEncryptionKey = builtins.readFile "${secretsDir}/nico-session-encryption-key";
logLevel = "debug";
};
};
};
};

View File

@@ -1,4 +1,15 @@
{ pkgs, dataDir, config, inputs, system, ... }: let
{ pkgs, dataDir, config, inputs, system, secretsDir, ... }: let
#################################### ports ##############################
# 49388 ssh
# 8001 backup-c2vi
# 8002 backup-mom
# 8003 backup-dad
# 8004 backup-brother
# 9001 fwin vnc
# 9002 fwin rdp
# 9003 fwin ssh
# 61333 c2vi private matrix
/**
thanks: @melektron
@@ -17,9 +28,25 @@
''
);
backupContainers = configs: builtins.listToAttrs (map (config: {
name = config.name;
# virtualisation.arion.projects.backup.services.settings =
value.service = {
image = "restic/rest-server";
volumes = [ "/data/backups/${config.name}:/data" ];
ports = [ "${builtins.toString config.port}:8000" ];
environment.OPTIONS = "--debug";
};
}) configs);
in {
imports = [
inputs.arion.nixosModules.arion
];
environment.systemPackages = [
(createArionServiceManager "backup" "")
pkgs.arion
# Do install the docker CLI to talk to podman.
@@ -34,15 +61,28 @@ in {
virtualisation.docker.enable = false;
virtualisation.podman.enable = true;
virtualisation.podman.dockerSocket.enable = true;
# https://github.com/containers/netavark/issues/274#issuecomment-4215665765
virtualisation.containers.containersConf.settings = {
network = {
network_backend = "netavark";
firewall_driver = "none";
};
};
users.extraUsers.me.extraGroups = ["podman"];
users.extraUsers.server.extraGroups = ["podman"];
virtualisation.arion = {
backend = "podman-socket";
};
virtualisation.arion.projects.backup.serviceName = "backup";
virtualisation.arion.projects.backup.settings.services = backupContainers [
{ name = "c2vi"; port = 8001; }
{ name = "mom"; port = 8002; }
{ name = "dad"; port = 8003; }
{ name = "brother"; port = 8004; }
];
}

0
mods/hello.md Normal file
View File

0
mods/my-hosts-pw Normal file
View File

11
mods/my-hosts-t Normal file
View File

@@ -0,0 +1,11 @@
100.107.67.76 te
100.93.225.52 fasu
100.88.42.194 fwin
100.88.28.123 fe
100.88.79.207 fusu
100.88.79.207 files
100.88.164.39 lush
100.88.112.181 mac
100.88.116.225 nico
100.88.245.227 phone
100.88.69.32 ti

25
mods/nurPkgs/mcping.nix Normal file
View File

@@ -0,0 +1,25 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
pname = "mcping";
version = "1.2.0";
src = pkgs.fetchFromGitHub {
owner = "theodik";
repo = "mcping";
rev = "v${version}";
sha256 = "sha256-miCRVDyyNM9MITnHdYZYpYpvKWx5n8ZvzNF9zvpZt9k=";
};
buildPhase = ''
gcc mcping.c -o mcping
mkdir -p $out/bin
cp mcping $out/bin/
'';
meta = with pkgs.lib; {
description = "A simple C program to ping Minecraft servers";
license = licenses.mit;
platforms = platforms.all;
};
}

View File

@@ -50,6 +50,16 @@ fi
if [ "$1" == "up" ]
then
echo "-----------------------------------------------------------------"
svn st | grep ^? | cut -c 9- | sed 's/^/"/' | sed 's/$/"@/' | xargs svn add
svn st | grep ^! | cut -c 9- | sed 's/^/"/' | sed 's/$/"@/' | xargs svn rm
echo "-----------------------------------------------------------------"
svn ci -m "$2"
fi
if [ "$1" == "fix" ]
then
echo "-----------------------------------------------------------------"
svn st | grep ^? | cut -c 9- | sed 's/^/"/' | sed 's/$/"@/' | xargs svn add

View File

@@ -42,7 +42,9 @@ build_from_local(){
build_remote () {
rsync -r -v $HOME/work/config/* $host:my-nixos-config --exclude=.git --exclude=gitignore
rsync -r -v $HOME/work/config/* $host:my-nixos-config --exclude=.git --exclude=target --exclude=gitignore
return 0;
out_path=$(ssh $host nix build "\$HOME/my-nixos-config#nixosConfigurations.$host.config.system.build.toplevel" --impure --no-link --print-out-paths -v -L "${args_to_pass[@]}")
@@ -129,6 +131,3 @@ else
echo "rebuild from local (~/work/config/)"
build_from_local && do_switch
fi

View File

@@ -8,9 +8,14 @@ elif [ "$1" == "rm-last-char" ]
then
truncate -s-1 $2
# total rubish
# cat $1 | xxd -ps | sed '$ s/.$//' $2 | xxd -r -ps > /tmp/1234; mv /tmp/1234 $2
elif [ "$1" == "rnd" ]
then
xxd -ps /dev/random | head -c $2
elif [ "$1" == "ns" ]
then
sudo netbird-ppc status -d | less
elif [ "$1" == "rm-tab-cur" ]
then

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 @@
*/
}

View File

@@ -3,7 +3,7 @@
# Settings
battery_percent_MODULUS=5 # How many percent difference are required for another update
INTERVAL=20 # The interval at which to check the battery percentage
ALERT_SCRIPT="sudo /home/mia/Scripts/keyboard_alert.sh"
#ALERT_SCRIPT="sudo /home/mia/Scripts/keyboard_alert.sh"
# Battery Levels
BAT_RECOMMENDED_UPPER_LIMIT=80
@@ -53,7 +53,7 @@ do
if [[ $(cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT?/status) = "Charging" ]]; then
if [[ $battery_percent -ge $BAT_RECOMMENDED_UPPER_LIMIT ]]; then
notify-send "Im full!" -u low
$ALERT_SCRIPT
#$ALERT_SCRIPT
fi
# Is battery discharging?
@@ -63,13 +63,13 @@ do
countdown
elif [[ $battery_percent -le $BAT_VERY_LOW ]]; then
notify-send "I beg you, I'm about to die!" -u critical &&
$ALERT_SCRIPT 5
#$ALERT_SCRIPT 5
elif [[ $battery_percent -le $BAT_LOW ]]; then
notify-send "Can you please plug me in aleady? I'm dying!" -u normal &&
$ALERT_SCRIPT 2
#$ALERT_SCRIPT 2
elif [[ $battery_percent -le $BAT_SLIGHTLY_LOW ]]; then
notify-send "I'd need a recharge about now pwp" -u normal &&
$ALERT_SCRIPT 1
#$ALERT_SCRIPT 1
elif [[ $battery_percent -le $BAT_RECOMMENDED_LOWER_LIMIT ]]; then
notify-send "Please plug me in pwp" -u low
fi

View File

@@ -1,4 +1,4 @@
{ config, pkgs, self, secretsDir, inputs, hostname, ... }:
{ config, pkgs, self, secretsDir, inputs, hostName, ... }:
{
# The home.stateVersion option does not have a default and must be set
home.stateVersion = "23.05";
@@ -20,12 +20,20 @@
home.sessionVariables = {
EDITOR = "nvim";
MIZE_STORE =
if hostName == "main" then "/home/me/work/app-data/mize"
else if hostName == "nico" then "/root/work/app-data/mize"
else if hostName == "fusu" && config.home.username == "files" then "/home/files/storage/files/mize"
else "/home/me/host/mize";
};
home.sessionPath = [
"/home/me/work/path-extra"
"/home/me/host/path-extra"
"${self}/mybin"
];
programs.direnv.enable = true;
home.file = {
".subversion/config".text = ''
@@ -34,7 +42,7 @@
''; # documentation for this config file: https://svnbook.red-bean.com/en/1.7/svn.advanced.confarea.html
# rclone.conf only on main
} // (if hostname == "main" then { ".rclone.conf".source = config.lib.file.mkOutOfStoreSymlink "${secretsDir}/rclone-conf"; } else {});
} // (if hostName == "main" then { ".rclone.conf".source = config.lib.file.mkOutOfStoreSymlink "${secretsDir}/rclone-conf"; } else {});
home.packages = with pkgs; [
unar

View File

@@ -26,6 +26,9 @@
package = inputs.zed.packages.x86_64-linux.default;
};
programs.direnv.enable = true;
programs.walker = {
enable = false;
runAsService = true;
@@ -74,6 +77,7 @@
home.file = {
".config/zed".source = config.lib.file.mkOutOfStoreSymlink "${workDir}/config/zed";
".davfs2/secrets".source = config.lib.file.mkOutOfStoreSymlink "${secretsDir}/davfs2-secrets";
#".mozilla/firefox".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/firefox";

View File

@@ -4,7 +4,7 @@
isNormalUser = true;
#passwordFile = "${secretsDir}/me-pwd";
password = "changeme";
extraGroups = [ "networkmanager" "wheel" "libvirtd" ]; # Enable ‘sudo’ for the user.
extraGroups = [ "networkmanager" "wheel" "libvirtd" "plugdev" "video" "render" ];
};
home-manager.extraSpecialArgs = {

View File

@@ -4,7 +4,7 @@
isNormalUser = true;
#passwordFile = "${secretsDir}/me-pwd";
password = "changeme";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "plugdev" ]; # Enable ‘sudo’ for the user.
extraGroups = [ "networkmanager" "wheel" "libvirtd" "plugdev" "video" "render" ];
};
home-manager.extraSpecialArgs = {

View File

@@ -1,10 +1,10 @@
{ self, config, inputs, pkgs, ... }:
{ self, config, inputs, pkgs, secretsDir, ... }:
{
users.users.server = {
isNormalUser = true;
#passwordFile = "${secretsDir}/me-pwd";
passwordFile = "${secretsDir}/fusu-server-pwd";
group = "server";
password = "changeme";
#password = "changeme";
};
users.groups.server = {};
@@ -29,11 +29,6 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/mCDzCBE2J1jGnEhhtttIRMKkXMi1pKCAEkxu+FAim me@main"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGw5kYmBQl8oolNg2VUlptvvSrFSESfeuWpsXRovny0x me@phone"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKF/79W6y/g26xGGPHQJwLtrmaDUb24Hd5D+WD59nzE borgs@fusu"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDU8OZxpeEuwVYFQC1ZYOECfU8fVg0BhNIYk5tK6aNeUe4JBJezwBWIQLsxuo1YgUX1CwbP5IAAj0JyoYUzWT5H4Qyev6rj3JWvBl+kVTnJyiipRccasXD/3IuRK2GBpMcK67sUoHtgiq1kS8myuAtGh2dVeukCp196pCZC9VI0NiEmk2M6/pCiuKmaeaeyKEpkzd2wcdvqyXu3OKtq/qZyw+N8eLk8hC8wQK5lq/Syg8aZh7OV2jqe7CnRLnybybrVy3wRNI4DdoP51YEv+Q3eMlOpOdc7SGTyDPUMnTDNbBFL8u7o7xeLs/+v3neWOz/+rNkQbAoqEvN741lCozTcAxSTT8gnTOdrf+ClMFRpFMUkl3Z6JNymw0Zx2JFibhxQJWIKJq6Wh1YuDJXenIZka0sN5ut5W0KJMmCfzeyAXHy3qruYktbmUFz8iUm1ywbURZZNCmRlzESL2lE7iuTM06SxSYw4YxQHYIC4P6leMyN3hfrr4RUPtO8wJ1lALUs= kilix@epimetheus"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDrQUmZtpxDx669VjACdtLSLcIFZ5uJl4xsj49yJW6A39IglJ4S9ViPtp/kQhGZ3jJMCCFzwDLNNJBf8XfcAtio57cucUQxtRMnY57pKH284eucCanpCq8z9KgBYtrIdzYwRVQZo2tjxdAwKS5mHSOstUnqH8CzcG0kbq7k3s31MKQhzKWXx7lZEn3osQx/aIpt0eWB/SNAS4DWhx+mdGSqO2ryBqbZKaJuH90MEWyd5MKu25+h0ELbHrkkPYOwq0EnpGqvr0mps8AjEV4iExb28E+GGtS+R7yg2tw0QWM1m4PI4XF5JRAuLqt187YvgQe9DIKTuhu2BT/EN2Os7jx9r14Pq2P/IhrR0hVloSTn2/r3geUuFYNvYiL64dkZIRxBOlC3SKut/lB3cir0FPdDkxoIuRHICrsvdSC5wFfYJfhrf0ivkEk5Jgj+lS1QlC40Xw7e0ixKILo6uiriQor02bFY4ngQHTnBLKgjNsB3K23MN80vd8V6DVZdFB+XWr8= kilia@nomos"
];

29
zed/debug.json Normal file
View File

@@ -0,0 +1,29 @@
// Some example tasks for common languages.
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
{
"label": "Debug active Python file",
"adapter": "Debugpy",
"program": "$ZED_FILE",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
},
{
"label": "Debug active JavaScript file",
"adapter": "JavaScript",
"program": "$ZED_FILE",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"type": "pwa-node",
},
{
"label": "JavaScript debug terminal",
"adapter": "JavaScript",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"console": "integratedTerminal",
"type": "pwa-node",
},
]

221
zed/keymap.json Normal file
View File

@@ -0,0 +1,221 @@
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"bindings": {
"ctrl-f": "diagnostics::ToggleDiagnosticsRefresh",
"ctrl-e": "file_finder::Toggle",
"ctrl-p": "command_palette::Toggle",
"ctrl-k": "menu::SelectPrevious",
"ctrl-j": "menu::SelectNext",
"ctrl-tab": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivatePreviousItem",
"ctrl-w": "pane::CloseActiveItem",
"ctrl-shift-w": "pane::ReopenClosedItem",
"ctrl-v": "editor::Paste",
"ctrl-c": "editor::Copy",
"ctrl-t": ["workspace::SendKeystrokes", "ctrl-# ctrl-e"],
"ctrl-shift-p": "pane::RevealInProjectPanel",
"ctrl-shift-a": "workspace::ToggleRightDock",
"ctrl-shift-t": "terminal_panel::Toggle",
// for send keystrokes
"ctrl-#": "pane::ActivateLastItem",
"ctrl-shift-#": "project_panel::Open",
"ctrl-shift-?": "workspace::ToggleLeftDock",
},
},
{
"context": "Editor",
"bindings": {
"ctrl-h": "outline::Toggle",
},
},
{
"context": "KeymapEditor",
"bindings": {
"ctrl-f": "keymap_editor::ToggleKeystrokeSearch",
},
},
{
"context": "ProjectPanel",
"bindings": {
//"l": "project_panel::Open",
"enter": ["workspace::SendKeystrokes", "ctrl-shift-# ctrl-shift-?"],
"ctrl-shift-p": "workspace::ToggleLeftDock",
//"a": "project_panel::UnfoldDirectory",
//"b": "project_panel:entry"
},
},
{
"context": "Editor && showing_completions",
"bindings": {
"ctrl-j": "editor::ContextMenuNext",
"ctrl-k": "editor::ContextMenuPrevious",
},
},
{
"context": "Workspace",
"bindings": {
//"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }]
//"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }]
},
},
{
"context": "Editor && vim_mode == insert",
"bindings": {
// "j k": "vim::NormalBefore"
},
},
{
"context": "vim_mode == insert",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::InsertFromBelow",
},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::LineDown",
},
},
{
"context": "showing_completions",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::LineDown",
},
},
{
"context": "vim_mode == literal",
"bindings": {
"ctrl-dead_acute ctrl-acute": ["vim::Literal", ["ctrl-e", "\u0005"]],
},
},
{
"context": "Terminal",
"bindings": {
"ctrl-dead_acute ctrl-acute": ["terminal::SendKeystroke", "ctrl-e"],
"ctrl-j": ["terminal::SendKeystroke", "down"],
"ctrl-k": ["terminal::SendKeystroke", "up"],
"ctrl-h": ["terminal::SendKeystroke", "left"],
"ctrl-l": ["terminal::SendKeystroke", "right"],
"ctrl-t": "terminal_panel::ToggleFocus",
},
},
{
"context": "((os != macos && Editor) && edit_prediction_conflict)",
"bindings": {
//"ctrl-l": "editor::AcceptEditPrediction"
},
},
{
"context": "((os != macos && Editor) && edit_prediction_conflict)",
"bindings": {
"ctrl-i": "editor::AcceptEditPrediction",
},
},
{
"context": "(Editor && edit_prediction)",
"bindings": {
"ctrl-i": "editor::AcceptEditPrediction",
},
},
{
"context": "Editor",
"bindings": {
"ctrl-shift-b": "editor::ToggleBreakpoint",
},
},
{
"context": "vim_mode == visual",
"bindings": {
"#": [
"vim::MoveToNext",
{
"partial_word": true,
},
],
},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"#": [
"vim::MoveToNext",
{
"partial_word": true,
},
],
},
},
{
"context": "(Diagnostics && Editor)",
"bindings": {},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"g a": "editor::Hover"
}
},
{
"bindings": {
"ctrl-m ctrl-t": "pane::TogglePreviewTab"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-m ctrl-r": "task::Spawn"
}
},
{
"context": "(VimControl && !menu)",
"bindings": {
"j": [
"vim::Down",
{
"display_lines": true
}
]
}
},
{
"context": "(VimControl && !menu)",
"bindings": {
"k": [
"vim::Up",
{
"display_lines": true
}
]
}
},
{
"bindings": {
"ctrl-m ctrl-h": "editor::SwitchSourceHeader"
}
},
{
"bindings": {
"ctrl-m ctrl-s": "workspace::NewSearch"
}
},
{
"context": "vim_mode == visual",
"bindings": {
"m c": "vim::ToggleComments"
}
},
{
"context": "vim_mode == visual",
"unbind": {
"g c": "vim::ToggleComments"
}
}
]

316
zed/settings.json Normal file
View File

@@ -0,0 +1,316 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"icon_theme": "Zed (Default)",
"format_on_save": "off",
"search": {
"include_ignored": true
},
"diff_view_style": "split",
"cli_default_open_behavior": "new_window",
"project_panel": {
"dock": "left"
},
"collaboration_panel": {
"dock": "left"
},
"git_panel": {
"dock": "left"
},
"ssh_connections": [
{
"host": "nico",
"args": [],
"projects": [
{
"paths": [
"/root/work/c2vi/a1-vibe"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/./"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/edk-app/./"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/efi-app/./"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/linux/./"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/linux/linux-6.18.16/./"
]
},
{
"paths": [
"/root/work/c2vi/acern-fixing/nix-linux/./"
]
},
{
"paths": [
"/root/work/c2vi/zed"
]
},
{
"paths": [
"/root/work/mize"
]
}
]
},
{
"host": "nico",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": [
{
"paths": [
"/home/me/host/zed"
]
}
]
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"username": "me",
"args": [],
"projects": []
},
{
"host": "fusu",
"username": "me",
"port": 49388,
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "nico",
"args": [],
"projects": []
}
],
"vim": {
"use_system_clipboard": "never"
},
"ui_font_weight": 250.0,
"agent_ui_font_size": 14.0,
"outline_panel": {
"dock": "left",
"button": true,
},
"file_scan_exclusions": ["/gitignore/**", "**/node_modules/**"],
"tab_size": 2,
"agent": {
"dock": "right",
"default_profile": "minimal",
"default_model": {
"provider": "perplexity",
"model": "sonar",
},
},
"language_models": {
"openai_compatible": {
"perplexity": {
"api_url": "https://api.perplexity.ai",
"available_models": [
{
"name": "sonar",
"display_name": null,
"max_tokens": 200000,
"max_output_tokens": 32000,
"max_completion_tokens": 200000,
"capabilities": {
"tools": false,
"images": false,
"parallel_tool_calls": false,
"prompt_cache_key": false,
},
},
],
},
},
},
"agent_servers": {
"your_agent": {
"type": "custom",
"command": "path_to_executable",
"args": [],
"env": {},
},
},
"vim_mode": true,
"ui_font_size": 16.0,
"buffer_font_size": 19.0,
"theme": {
"mode": "dark",
"light": "One Light",
"dark": "Gruvbox Dark",
},
"toolbar": {
"breadcrumbs": false,
"code_actions": false,
"quick_actions": false,
"agent_review": false,
"selections_menu": false,
},
"title_bar": {
"show_user_menu": false,
"show_branch_name": false,
"show_onboarding_banner": false,
"show_project_items": false,
"show_sign_in": false,
"show_user_picture": false,
"show_menus": false,
},
"languages": {
"Nix": {
"enable_language_server": false,
"language_servers": ["nixd", "!nil"],
},
"C": {
"language_servers": ["clangd"],
},
},
"file_finder": {
"include_ignored": "all",
"modal_max_width": "large",
},
"preview_tabs": {
"enable_preview_from_file_finder": true,
"enable_keep_preview_on_code_navigation": true,
},
"relative_line_numbers": "enabled",
"remove_trailing_whitespace_on_save": false,
"lsp": {
"rust-analyzer": {
"initialization_options": {
"rust": {
"analyzerTargetDir": true
}
}
},
"clangd": {
"binary": {
//"path": "/home/me/work/path-extra/clangd",
"path": "/root/work/path-extra/clangd",
"arguments": [],
},
},
// https://github.com/zed-extensions/nix/tree/main?tab=readme-ov-file
"nixd": {
"settings": {
// see https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md
// for what configuration is possible
"formatting": {
//"command": [ "nixpkgs-fmt" ],
//"command": [ "alejandra" ],
"command": ["nixfmt"],
},
"nixpkgs": {
"expr": "import <nixpkgs> { }",
},
"options": {
// If this is omitted, default search path (<nixpkgs>) will be used.
"nixos": {
// This name "nixos" could be arbitrary.
// The expression to eval, interpret it as option declarations.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options",
},
// for home manager as nixos module we must get the suboptions
// https://discourse.nixos.org/t/nixd-home-manager-completion-and-standalone-home-manager-outputs/55610/2
"home-manager": {
// This name could be arbitrary.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options.home-manager.users.type.getSubOptions []",
},
// By default there is no home-manager options completion, thus you can add this entry.
//"home-manager": {
// "expr": "(builtins.getFlake \"/home/melektron/goarnix\").homeConfigurations.\"lsp_dummy\".options"
//}
},
},
},
},
}

182
zed/settings_backup.json Normal file
View File

@@ -0,0 +1,182 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"cli_default_open_behavior": "new_window",
"project_panel": {
"dock": "left"
},
"collaboration_panel": {
"dock": "left"
},
"git_panel": {
"dock": "left"
},
"ssh_connections": [
{
"host": "nico",
"args": [],
"projects": [
{
"paths": [
"/root/work/c2vi/a1-vibe"
]
},
{
"paths": [
"/root/work/mize"
]
}
]
},
{
"host": "nico",
"args": [],
"projects": []
},
{
"host": "nico",
"args": [],
"projects": []
}
],
"vim": {
"use_system_clipboard": "never"
},
"ui_font_weight": 250.0,
"agent_ui_font_size": 14.0,
"outline_panel": {
"dock": "left",
"button": true,
},
"file_scan_exclusions": ["/gitignore/**", "**/node_modules/**"],
"tab_size": 2,
"agent": {
"dock": "right",
"default_profile": "minimal",
"default_model": {
"provider": "perplexity",
"model": "sonar",
},
},
"language_models": {
"openai_compatible": {
"perplexity": {
"api_url": "https://api.perplexity.ai",
"available_models": [
{
"name": "sonar",
"display_name": null,
"max_tokens": 200000,
"max_output_tokens": 32000,
"max_completion_tokens": 200000,
"capabilities": {
"tools": false,
"images": false,
"parallel_tool_calls": false,
"prompt_cache_key": false,
},
},
],
},
},
},
"agent_servers": {
"your_agent": {
"type": "custom",
"command": "path_to_executable",
"args": [],
"env": {},
},
},
"vim_mode": true,
"ui_font_size": 16.0,
"buffer_font_size": 19.0,
"theme": {
"mode": "system",
"light": "Gruvbox Dark Hard",
"dark": "One Dark",
},
"toolbar": {
"breadcrumbs": false,
"code_actions": false,
"quick_actions": false,
"agent_review": false,
"selections_menu": false,
},
"title_bar": {
"show_user_menu": false,
"show_branch_name": false,
"show_onboarding_banner": false,
"show_project_items": false,
"show_sign_in": false,
"show_user_picture": false,
"show_branch_icon": false,
"show_menus": false,
},
"languages": {
"Nix": {
"language_servers": ["nixd", "!nil"],
},
"C": {
"language_servers": ["clangd"],
},
},
"file_finder": {
"modal_max_width": "large",
},
"preview_tabs": {
"enable_preview_from_file_finder": true,
"enable_keep_preview_on_code_navigation": true,
},
"relative_line_numbers": "enabled",
"remove_trailing_whitespace_on_save": false,
"lsp": {
"clangd": {
"binary": {
"path": "/home/me/work/path-extra/clangd",
"arguments": [],
},
},
// https://github.com/zed-extensions/nix/tree/main?tab=readme-ov-file
"nixd": {
"settings": {
// see https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md
// for what configuration is possible
"formatting": {
//"command": [ "nixpkgs-fmt" ],
//"command": [ "alejandra" ],
"command": ["nixfmt"],
},
"nixpkgs": {
"expr": "import <nixpkgs> { }",
},
"options": {
// If this is omitted, default search path (<nixpkgs>) will be used.
"nixos": {
// This name "nixos" could be arbitrary.
// The expression to eval, interpret it as option declarations.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options",
},
// for home manager as nixos module we must get the suboptions
// https://discourse.nixos.org/t/nixd-home-manager-completion-and-standalone-home-manager-outputs/55610/2
"home-manager": {
// This name could be arbitrary.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options.home-manager.users.type.getSubOptions []",
},
// By default there is no home-manager options completion, thus you can add this entry.
//"home-manager": {
// "expr": "(builtins.getFlake \"/home/melektron/goarnix\").homeConfigurations.\"lsp_dummy\".options"
//}
},
},
},
},
}

54
zed/tasks.json Normal file
View File

@@ -0,0 +1,54 @@
// Project tasks configuration. See https://zed.dev/docs/tasks for documentation.
//
// Example:
[
{
"label": "Example task",
"command": "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done",
//"args": [],
// Env overrides for the command, will be appended to the terminal's environment from the settings.
"env": { "foo": "bar" },
// Current working directory to spawn the command into, defaults to current project root.
//"cwd": "/path/to/working/directory",
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
"use_new_terminal": false,
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` — always show the task's pane, and focus the corresponding tab in it (default)
// * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it
// * `never` — do not alter focus, but still add/reuse the task's tab in its pane
"reveal": "always",
// Where to place the task's terminal item after starting the task:
// * `dock` — in the terminal dock, "regular" terminal items' place (default)
// * `center` — in the central pane group, "main" editor area
"reveal_target": "dock",
// What to do with the terminal pane and tab, after the command had finished:
// * `never` — Do nothing when the command finishes (default)
// * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it
// * `on_success` — hide the terminal tab on task success only, otherwise behaves similar to `always`
"hide": "never",
// Which shell to use when running a task inside the terminal.
// May take 3 values:
// 1. (default) Use the system's default terminal configuration in /etc/passwd
// "shell": "system"
// 2. A program:
// "shell": {
// "program": "sh"
// }
// 3. A program with arguments:
// "shell": {
// "with_arguments": {
// "program": "/bin/bash",
// "args": ["--login"]
// }
// }
"shell": "system",
// Whether to show the task line in the output of the spawned task, defaults to `true`.
"show_summary": true,
// Whether to show the command line in the output of the spawned task, defaults to `true`.
"show_command": true,
// Represents the tags for inline runnable indicators, or spawning multiple tasks at once.
// "tags": []
},
]

29
zed/themes/debug.json Normal file
View File

@@ -0,0 +1,29 @@
// Some example tasks for common languages.
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
{
"label": "Debug active Python file",
"adapter": "Debugpy",
"program": "$ZED_FILE",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
},
{
"label": "Debug active JavaScript file",
"adapter": "JavaScript",
"program": "$ZED_FILE",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"type": "pwa-node",
},
{
"label": "JavaScript debug terminal",
"adapter": "JavaScript",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"console": "integratedTerminal",
"type": "pwa-node",
},
]

209
zed/themes/keymap.json Normal file
View File

@@ -0,0 +1,209 @@
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"bindings": {
"ctrl-f": "diagnostics::ToggleDiagnosticsRefresh",
"ctrl-e": "file_finder::Toggle",
"ctrl-p": "command_palette::Toggle",
"ctrl-k": "menu::SelectPrevious",
"ctrl-j": "menu::SelectNext",
"ctrl-tab": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivatePreviousItem",
"ctrl-w": "pane::CloseActiveItem",
"ctrl-shift-w": "pane::ReopenClosedItem",
"ctrl-v": "editor::Paste",
"ctrl-c": "editor::Copy",
"ctrl-t": ["workspace::SendKeystrokes", "ctrl-# ctrl-e"],
"ctrl-shift-p": "pane::RevealInProjectPanel",
"ctrl-shift-a": "workspace::ToggleRightDock",
"ctrl-shift-t": "terminal_panel::Toggle",
// for send keystrokes
"ctrl-#": "pane::ActivateLastItem",
"ctrl-shift-#": "project_panel::Open",
"ctrl-shift-?": "workspace::ToggleLeftDock",
},
},
{
"context": "Editor",
"bindings": {
"ctrl-h": "outline::Toggle",
},
},
{
"context": "KeymapEditor",
"bindings": {
"ctrl-f": "keymap_editor::ToggleKeystrokeSearch",
},
},
{
"context": "ProjectPanel",
"bindings": {
//"l": "project_panel::Open",
"enter": ["workspace::SendKeystrokes", "ctrl-shift-# ctrl-shift-?"],
"ctrl-shift-p": "workspace::ToggleLeftDock",
//"a": "project_panel::UnfoldDirectory",
//"b": "project_panel:entry"
},
},
{
"context": "Editor && showing_completions",
"bindings": {
"ctrl-j": "editor::ContextMenuNext",
"ctrl-k": "editor::ContextMenuPrevious",
},
},
{
"context": "Workspace",
"bindings": {
//"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }]
//"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }]
},
},
{
"context": "Editor && vim_mode == insert",
"bindings": {
// "j k": "vim::NormalBefore"
},
},
{
"context": "vim_mode == insert",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::InsertFromBelow",
},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::LineDown",
},
},
{
"context": "showing_completions",
"bindings": {
"ctrl-dead_acute ctrl-acute": "vim::LineDown",
},
},
{
"context": "vim_mode == literal",
"bindings": {
"ctrl-dead_acute ctrl-acute": ["vim::Literal", ["ctrl-e", "\u0005"]],
},
},
{
"context": "Terminal",
"bindings": {
"ctrl-dead_acute ctrl-acute": ["terminal::SendKeystroke", "ctrl-e"],
"ctrl-j": ["terminal::SendKeystroke", "down"],
"ctrl-k": ["terminal::SendKeystroke", "up"],
"ctrl-h": ["terminal::SendKeystroke", "left"],
"ctrl-l": ["terminal::SendKeystroke", "right"],
"ctrl-t": "terminal_panel::ToggleFocus",
},
},
{
"context": "((os != macos && Editor) && edit_prediction_conflict)",
"bindings": {
//"ctrl-l": "editor::AcceptEditPrediction"
},
},
{
"context": "((os != macos && Editor) && edit_prediction_conflict)",
"bindings": {
"ctrl-i": "editor::AcceptEditPrediction",
},
},
{
"context": "(Editor && edit_prediction)",
"bindings": {
"ctrl-i": "editor::AcceptEditPrediction",
},
},
{
"context": "Editor",
"bindings": {
"ctrl-shift-b": "editor::ToggleBreakpoint",
},
},
{
"context": "vim_mode == visual",
"bindings": {
"#": [
"vim::MoveToNext",
{
"partial_word": true,
},
],
},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"#": [
"vim::MoveToNext",
{
"partial_word": true,
},
],
},
},
{
"context": "(Diagnostics && Editor)",
"bindings": {},
},
{
"context": "(VimControl && !menu)",
"bindings": {
"g a": "editor::Hover"
}
},
{
"bindings": {
"ctrl-m ctrl-t": "pane::TogglePreviewTab"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-m ctrl-r": "task::Spawn"
}
},
{
"context": "(VimControl && !menu)",
"bindings": {
"j": [
"vim::Down",
{
"display_lines": true
}
]
}
},
{
"context": "(VimControl && !menu)",
"bindings": {
"k": [
"vim::Up",
{
"display_lines": true
}
]
}
},
{
"bindings": {
"ctrl-m ctrl-h": "editor::SwitchSourceHeader"
}
},
{
"bindings": {
"ctrl-m ctrl-s": "workspace::NewSearch"
}
}
]

278
zed/themes/settings.json Normal file
View File

@@ -0,0 +1,278 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"icon_theme": "Zed (Default)",
"format_on_save": "off",
"search": {
"include_ignored": true
},
"diff_view_style": "split",
"cli_default_open_behavior": "new_window",
"project_panel": {
"dock": "left"
},
"collaboration_panel": {
"dock": "left"
},
"git_panel": {
"dock": "left"
},
"ssh_connections": [
{
"host": "nico",
"args": [],
"projects": [
{
"paths": [
"/root/work/c2vi/a1-vibe"
]
},
{
"paths": [
"/root/work/c2vi/zed"
]
},
{
"paths": [
"/root/work/mize"
]
}
]
},
{
"host": "nico",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": [
{
"paths": [
"/home/me/host/zed"
]
}
]
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"username": "me",
"args": [],
"projects": []
},
{
"host": "fusu",
"username": "me",
"port": 49388,
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "fusu",
"args": [],
"projects": []
},
{
"host": "nico",
"args": [],
"projects": []
}
],
"vim": {
"use_system_clipboard": "never"
},
"ui_font_weight": 250.0,
"agent_ui_font_size": 14.0,
"outline_panel": {
"dock": "left",
"button": true,
},
"file_scan_exclusions": ["/gitignore/**", "**/node_modules/**"],
"tab_size": 2,
"agent": {
"dock": "right",
"default_profile": "minimal",
"default_model": {
"provider": "perplexity",
"model": "sonar",
},
},
"language_models": {
"openai_compatible": {
"perplexity": {
"api_url": "https://api.perplexity.ai",
"available_models": [
{
"name": "sonar",
"display_name": null,
"max_tokens": 200000,
"max_output_tokens": 32000,
"max_completion_tokens": 200000,
"capabilities": {
"tools": false,
"images": false,
"parallel_tool_calls": false,
"prompt_cache_key": false,
},
},
],
},
},
},
"agent_servers": {
"your_agent": {
"type": "custom",
"command": "path_to_executable",
"args": [],
"env": {},
},
},
"vim_mode": true,
"ui_font_size": 16.0,
"buffer_font_size": 19.0,
"theme": {
"mode": "dark",
"light": "One Light",
"dark": "Gruvbox Dark",
},
"toolbar": {
"breadcrumbs": false,
"code_actions": false,
"quick_actions": false,
"agent_review": false,
"selections_menu": false,
},
"title_bar": {
"show_user_menu": false,
"show_branch_name": false,
"show_onboarding_banner": false,
"show_project_items": false,
"show_sign_in": false,
"show_user_picture": false,
"show_menus": false,
},
"languages": {
"Nix": {
"enable_language_server": false,
"language_servers": ["nixd", "!nil"],
},
"C": {
"language_servers": ["clangd"],
},
},
"file_finder": {
"include_ignored": "all",
"modal_max_width": "large",
},
"preview_tabs": {
"enable_preview_from_file_finder": true,
"enable_keep_preview_on_code_navigation": true,
},
"relative_line_numbers": "enabled",
"remove_trailing_whitespace_on_save": false,
"lsp": {
"clangd": {
"binary": {
"path": "/home/me/work/path-extra/clangd",
"arguments": [],
},
},
// https://github.com/zed-extensions/nix/tree/main?tab=readme-ov-file
"nixd": {
"settings": {
// see https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md
// for what configuration is possible
"formatting": {
//"command": [ "nixpkgs-fmt" ],
//"command": [ "alejandra" ],
"command": ["nixfmt"],
},
"nixpkgs": {
"expr": "import <nixpkgs> { }",
},
"options": {
// If this is omitted, default search path (<nixpkgs>) will be used.
"nixos": {
// This name "nixos" could be arbitrary.
// The expression to eval, interpret it as option declarations.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options",
},
// for home manager as nixos module we must get the suboptions
// https://discourse.nixos.org/t/nixd-home-manager-completion-and-standalone-home-manager-outputs/55610/2
"home-manager": {
// This name could be arbitrary.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options.home-manager.users.type.getSubOptions []",
},
// By default there is no home-manager options completion, thus you can add this entry.
//"home-manager": {
// "expr": "(builtins.getFlake \"/home/melektron/goarnix\").homeConfigurations.\"lsp_dummy\".options"
//}
},
},
},
},
}

View File

@@ -0,0 +1,182 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"cli_default_open_behavior": "new_window",
"project_panel": {
"dock": "left"
},
"collaboration_panel": {
"dock": "left"
},
"git_panel": {
"dock": "left"
},
"ssh_connections": [
{
"host": "nico",
"args": [],
"projects": [
{
"paths": [
"/root/work/c2vi/a1-vibe"
]
},
{
"paths": [
"/root/work/mize"
]
}
]
},
{
"host": "nico",
"args": [],
"projects": []
},
{
"host": "nico",
"args": [],
"projects": []
}
],
"vim": {
"use_system_clipboard": "never"
},
"ui_font_weight": 250.0,
"agent_ui_font_size": 14.0,
"outline_panel": {
"dock": "left",
"button": true,
},
"file_scan_exclusions": ["/gitignore/**", "**/node_modules/**"],
"tab_size": 2,
"agent": {
"dock": "right",
"default_profile": "minimal",
"default_model": {
"provider": "perplexity",
"model": "sonar",
},
},
"language_models": {
"openai_compatible": {
"perplexity": {
"api_url": "https://api.perplexity.ai",
"available_models": [
{
"name": "sonar",
"display_name": null,
"max_tokens": 200000,
"max_output_tokens": 32000,
"max_completion_tokens": 200000,
"capabilities": {
"tools": false,
"images": false,
"parallel_tool_calls": false,
"prompt_cache_key": false,
},
},
],
},
},
},
"agent_servers": {
"your_agent": {
"type": "custom",
"command": "path_to_executable",
"args": [],
"env": {},
},
},
"vim_mode": true,
"ui_font_size": 16.0,
"buffer_font_size": 19.0,
"theme": {
"mode": "system",
"light": "Gruvbox Dark Hard",
"dark": "One Dark",
},
"toolbar": {
"breadcrumbs": false,
"code_actions": false,
"quick_actions": false,
"agent_review": false,
"selections_menu": false,
},
"title_bar": {
"show_user_menu": false,
"show_branch_name": false,
"show_onboarding_banner": false,
"show_project_items": false,
"show_sign_in": false,
"show_user_picture": false,
"show_branch_icon": false,
"show_menus": false,
},
"languages": {
"Nix": {
"language_servers": ["nixd", "!nil"],
},
"C": {
"language_servers": ["clangd"],
},
},
"file_finder": {
"modal_max_width": "large",
},
"preview_tabs": {
"enable_preview_from_file_finder": true,
"enable_keep_preview_on_code_navigation": true,
},
"relative_line_numbers": "enabled",
"remove_trailing_whitespace_on_save": false,
"lsp": {
"clangd": {
"binary": {
"path": "/home/me/work/path-extra/clangd",
"arguments": [],
},
},
// https://github.com/zed-extensions/nix/tree/main?tab=readme-ov-file
"nixd": {
"settings": {
// see https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md
// for what configuration is possible
"formatting": {
//"command": [ "nixpkgs-fmt" ],
//"command": [ "alejandra" ],
"command": ["nixfmt"],
},
"nixpkgs": {
"expr": "import <nixpkgs> { }",
},
"options": {
// If this is omitted, default search path (<nixpkgs>) will be used.
"nixos": {
// This name "nixos" could be arbitrary.
// The expression to eval, interpret it as option declarations.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options",
},
// for home manager as nixos module we must get the suboptions
// https://discourse.nixos.org/t/nixd-home-manager-completion-and-standalone-home-manager-outputs/55610/2
"home-manager": {
// This name could be arbitrary.
"expr": "(builtins.getFlake \"/home/me/work/config\").nixosConfigurations._lsp_dummy.options.home-manager.users.type.getSubOptions []",
},
// By default there is no home-manager options completion, thus you can add this entry.
//"home-manager": {
// "expr": "(builtins.getFlake \"/home/melektron/goarnix\").homeConfigurations.\"lsp_dummy\".options"
//}
},
},
},
},
}

54
zed/themes/tasks.json Normal file
View File

@@ -0,0 +1,54 @@
// Project tasks configuration. See https://zed.dev/docs/tasks for documentation.
//
// Example:
[
{
"label": "Example task",
"command": "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done",
//"args": [],
// Env overrides for the command, will be appended to the terminal's environment from the settings.
"env": { "foo": "bar" },
// Current working directory to spawn the command into, defaults to current project root.
//"cwd": "/path/to/working/directory",
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
"use_new_terminal": false,
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` — always show the task's pane, and focus the corresponding tab in it (default)
// * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it
// * `never` — do not alter focus, but still add/reuse the task's tab in its pane
"reveal": "always",
// Where to place the task's terminal item after starting the task:
// * `dock` — in the terminal dock, "regular" terminal items' place (default)
// * `center` — in the central pane group, "main" editor area
"reveal_target": "dock",
// What to do with the terminal pane and tab, after the command had finished:
// * `never` — Do nothing when the command finishes (default)
// * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it
// * `on_success` — hide the terminal tab on task success only, otherwise behaves similar to `always`
"hide": "never",
// Which shell to use when running a task inside the terminal.
// May take 3 values:
// 1. (default) Use the system's default terminal configuration in /etc/passwd
// "shell": "system"
// 2. A program:
// "shell": {
// "program": "sh"
// }
// 3. A program with arguments:
// "shell": {
// "with_arguments": {
// "program": "/bin/bash",
// "args": ["--login"]
// }
// }
"shell": "system",
// Whether to show the task line in the output of the spawned task, defaults to `true`.
"show_summary": true,
// Whether to show the command line in the output of the spawned task, defaults to `true`.
"show_command": true,
// Represents the tags for inline runnable indicators, or spawning multiple tasks at once.
// "tags": []
},
]