mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-12-05 02:38:44 +01:00
Compare commits
8 commits
ac3df09b6b
...
867514362a
Author | SHA1 | Date | |
---|---|---|---|
867514362a | |||
37a4235e5c | |||
a9525ec467 | |||
089740ffaf | |||
c01c5da7c4 | |||
e920f9c206 | |||
47ba1e5796 | |||
6aab08ec9b |
63
Cargo.lock
generated
63
Cargo.lock
generated
|
@ -109,6 +109,15 @@ version = "1.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
|
||||
|
||||
[[package]]
|
||||
name = "bar-ws-monitor"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"swayipc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
|
@ -782,6 +791,38 @@ version = "1.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.209"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.209"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.127"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook"
|
||||
version = "0.3.17"
|
||||
|
@ -862,6 +903,28 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "swayipc"
|
||||
version = "3.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "daa5d19f881f372e225095e297072e2e3ee1c4e9e3a46cafe5f5cf70f1313f29"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"swayipc-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "swayipc-types"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e487a656336f74341c70a73a289f68d9ba3cab579ba776352ea0c6cdf603fcda"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.60"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
members = [ "programs/bar-ws-monitor",
|
||||
"programs/jrnl"
|
||||
]
|
||||
|
|
13
common.nix
13
common.nix
|
@ -42,8 +42,6 @@ with builtins; {
|
|||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
veracrypt
|
||||
|
||||
htmlq
|
||||
|
||||
prusa-slicer
|
||||
|
@ -62,21 +60,14 @@ with builtins; {
|
|||
jdk11
|
||||
jdk
|
||||
libsecret
|
||||
gh
|
||||
nix-prefetch-scripts
|
||||
fzf
|
||||
glab
|
||||
ripgrep
|
||||
sl
|
||||
lolcat
|
||||
appimage-run
|
||||
git-crypt
|
||||
file
|
||||
whois
|
||||
p7zip
|
||||
file
|
||||
nmap
|
||||
cmatrix
|
||||
tree
|
||||
socat
|
||||
smartmontools
|
||||
|
@ -90,6 +81,10 @@ with builtins; {
|
|||
libjxl
|
||||
|
||||
s10e-jrnl
|
||||
|
||||
ungoogled-chromium
|
||||
scc
|
||||
speedtest-rs
|
||||
];
|
||||
};
|
||||
|
||||
|
|
47
flake.lock
47
flake.lock
|
@ -1,17 +1,12 @@
|
|||
{
|
||||
"nodes": {
|
||||
"crane": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724537630,
|
||||
"narHash": "sha256-gpqINM71zp3kw5XYwUXa84ZtPnCmLLnByuFoYesT1bY=",
|
||||
"lastModified": 1725125250,
|
||||
"narHash": "sha256-CB20rDD5eHikF6mMTTJdwPP1qvyoiyyw1RDUzwIaIF8=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "3e08f4b1fc9aaede5dd511d8f5f4ef27501e49b0",
|
||||
"rev": "96fd12c7100e9e05fa1a0a5bd108525600ce282f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -28,11 +23,11 @@
|
|||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724567349,
|
||||
"narHash": "sha256-w2G1EJlGvgRSC1OAm2147mCzlt6ZOWIiqX/TSJUgrGE=",
|
||||
"lastModified": 1725258763,
|
||||
"narHash": "sha256-7s5RfYlTljWnKGkK4hOMJCJ0sNQoLYjMxezX3Vijy/0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"rev": "71fe264f6e208831aa0e7e54ad557a283c375014",
|
||||
"rev": "0774f58cf1025bbb713971deecc7f07c856be6ed",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -104,11 +99,11 @@
|
|||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724401716,
|
||||
"narHash": "sha256-LXTYUVhv6Kz9Iy9DxXSI0J+2/hunUj2fj0Kvw2eDarQ=",
|
||||
"lastModified": 1724856988,
|
||||
"narHash": "sha256-JBLe2CxAhG+J8+x8qmbzkGHNYmGcSiuY2QO4Zhb72lI=",
|
||||
"owner": "helix-editor",
|
||||
"repo": "helix",
|
||||
"rev": "620dfceb849d6b68d41d4f7678bb4675009fef4d",
|
||||
"rev": "1b5295a3f3d7cccd96eed5bfd394807a4dae87fc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -124,11 +119,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724435763,
|
||||
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
|
||||
"lastModified": 1725180166,
|
||||
"narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
|
||||
"rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -205,11 +200,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"lastModified": 1725103162,
|
||||
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -235,11 +230,11 @@
|
|||
},
|
||||
"nixpkgs-unstable-small": {
|
||||
"locked": {
|
||||
"lastModified": 1724558323,
|
||||
"narHash": "sha256-uPXidysk1BXSayGzpxDW8JUgGvLWS+L1CTlBV3xcQB4=",
|
||||
"lastModified": 1725274606,
|
||||
"narHash": "sha256-xXINAjCR8eTmp3AxZTk/PIH9nNoFNN0OM7MUw6eB7oQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ba0c72cea47a45556ccd5bc566433bd1242a0f93",
|
||||
"rev": "66a352a3f27a2eb2f27e42a13c6fe245d3be2b98",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -265,11 +260,11 @@
|
|||
"rust-analyzer-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1724480527,
|
||||
"narHash": "sha256-C+roFDGk6Bn/C58NGpyt7cneLCetdRMUfFTkm3O4zWM=",
|
||||
"lastModified": 1725191098,
|
||||
"narHash": "sha256-YH0kH5CSOnAuPUB1BUzUqvnKiv5SgDhfMNjrkki9Ahk=",
|
||||
"owner": "rust-lang",
|
||||
"repo": "rust-analyzer",
|
||||
"rev": "74a6427861eb8d1e3b7c6090b2c2890ff4c53e0e",
|
||||
"rev": "779d9eee2ea403da447278a7007c9627c8878856",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
};
|
||||
crane = {
|
||||
url = "github:ipetkov/crane";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
|
@ -55,7 +52,7 @@
|
|||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
|
||||
pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages.${system};
|
||||
crane-lib = crane.lib.${system};
|
||||
crane-lib = crane.mkLib nixpkgs.legacyPackages.${system};
|
||||
rs-toolchain = with fenix.packages.${system};
|
||||
combine [
|
||||
complete.toolchain
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
systemd.services."ModemManager".wantedBy = ["multi-user.target"];
|
||||
|
||||
environment.variables = {
|
||||
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
|
||||
VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl");
|
||||
S10E_JRNL_FILE_LOC = "/home/jade/Docs/jrnl.md";
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
(defwindow bottomBar
|
||||
:monitor 0
|
||||
:stacking "fg"
|
||||
:wm-ignore true
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
:width "100%"
|
||||
:height "32px"
|
||||
:anchor "bottom center")
|
||||
(bottomBar))
|
||||
|
||||
(defwidget bottomBar []
|
||||
(overlay
|
||||
:class "bottomBar"
|
||||
(centerbox
|
||||
(box
|
||||
:halign "start"
|
||||
(workspaceWidget)
|
||||
)
|
||||
(box
|
||||
:halign "center"
|
||||
(label :text "mid")
|
||||
)
|
||||
(box
|
||||
:halign "end"
|
||||
(label :text "right")
|
||||
)
|
||||
)
|
||||
(box
|
||||
:class "lesbianFlag"
|
||||
:height 1
|
||||
( flagEl :flipped true :color "#D52D00")
|
||||
( flagEl :flipped true :color "#EF7627")
|
||||
( flagEl :flipped true :color "#FF9A56")
|
||||
( flagEl :flipped true :color "#FFFFFF")
|
||||
( flagEl :flipped true :color "#D162A4")
|
||||
( flagEl :flipped true :color "#B55690")
|
||||
( flagEl :flipped true :color "#A30262")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget workspaceWidget []
|
||||
(box
|
||||
:class "workspaces"
|
||||
(for workspace in workspaces
|
||||
(button
|
||||
:class "${workspace.urgent ? "urgent" : ""} ${workspace.focused ? "focused" : 0}"
|
||||
:onclick "swaymsg workspace ${workspace.name}"
|
||||
(label :text "${workspace.name}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deflisten workspaces
|
||||
:initial "[]"
|
||||
"bar-ws-monitor"
|
||||
)
|
|
@ -1,7 +1,20 @@
|
|||
.topbar {
|
||||
.topBar {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
label {
|
||||
font: 14pt "FiraCode Nerd Font";
|
||||
}
|
||||
|
||||
.workspaces button {
|
||||
border: 0px;
|
||||
background-color: #282828;
|
||||
}
|
||||
|
||||
.workspaces button.urgent {
|
||||
background-color: #cc241d;
|
||||
}
|
||||
|
||||
.workspaces button.focused {
|
||||
background-color: #504935;
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
(include "topBar/topBar.yuck")
|
||||
(include "bottomBar/bottomBar.yuck")
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
(defwindow topBar
|
||||
:monitor 0
|
||||
:stacking "fg"
|
||||
:windowtype "normal"
|
||||
:wm-ignore true
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
|
@ -46,11 +45,11 @@
|
|||
(box
|
||||
:class "transFlag"
|
||||
:height 1
|
||||
( flagEl :color "#5BCEFA")
|
||||
( flagEl :color "#F5A9B8")
|
||||
( flagEl :color "#FFFFFF")
|
||||
( flagEl :color "#F5A9B8")
|
||||
( flagEl :color "#5BCEFA")
|
||||
( flagEl :flipped false :color "#5BCEFA")
|
||||
( flagEl :flipped false :color "#F5A9B8")
|
||||
( flagEl :flipped false :color "#FFFFFF")
|
||||
( flagEl :flipped false :color "#F5A9B8")
|
||||
( flagEl :flipped false :color "#5BCEFA")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(defwidget flagEl [color]
|
||||
(defwidget flagEl [color ?flipped]
|
||||
(box
|
||||
:style "border-bottom: 3px solid ${color}"
|
||||
:style "border-${flipped ? "top" : "bottom"}: 3px solid ${color}"
|
||||
:halign "fill"
|
||||
)
|
||||
)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# sway = {
|
||||
# default = ["wlr"];
|
||||
# };
|
||||
config.common.default = "*";
|
||||
};
|
||||
|
||||
services.swayidle = {
|
||||
|
@ -25,22 +26,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "sway-session.target";
|
||||
};
|
||||
settings = {
|
||||
interactiveBar = {
|
||||
layer = "top";
|
||||
position = "bottom";
|
||||
modules-left = ["sway/workspaces" "sway/mode"];
|
||||
modules-right = ["wlr/taskbar"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
|
@ -79,7 +64,7 @@
|
|||
};
|
||||
startup = [
|
||||
{
|
||||
command = "eww open topBar";
|
||||
command = "eww open topBar; eww open bottomBar";
|
||||
}
|
||||
{
|
||||
command = "pkill nm-applet; sleep 1 && nm-applet";
|
||||
|
|
|
@ -30,14 +30,6 @@ in
|
|||
./x.nix
|
||||
];
|
||||
|
||||
i18n.inputMethod = {
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-mozc
|
||||
fcitx5-gtk
|
||||
];
|
||||
};
|
||||
|
||||
programs.seahorse.enable = true;
|
||||
security.pam.services.jade.enableGnomeKeyring = true;
|
||||
|
||||
|
@ -124,11 +116,7 @@ in
|
|||
jellyfin-media-player
|
||||
|
||||
# from environment.systemPackages cleanup
|
||||
xdotool
|
||||
xorg.xwininfo
|
||||
gparted
|
||||
# uhk-agent
|
||||
cool-retro-term
|
||||
xdg-desktop-portal-gtk
|
||||
virt-manager
|
||||
ddccontrol-db
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
libertine
|
||||
inter
|
||||
b612
|
||||
departure-mono
|
||||
];
|
||||
fonts.fontDir.enable = true;
|
||||
}
|
||||
|
|
|
@ -20,8 +20,6 @@ in
|
|||
signal-desktop
|
||||
mumble
|
||||
element-desktop
|
||||
# nheko
|
||||
# iamb
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
9
programs/bar-ws-monitor/Cargo.toml
Normal file
9
programs/bar-ws-monitor/Cargo.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "bar-ws-monitor"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.209", features = [ "derive" ] }
|
||||
serde_json = "1.0.127"
|
||||
swayipc = "3.0.2"
|
53
programs/bar-ws-monitor/src/main.rs
Normal file
53
programs/bar-ws-monitor/src/main.rs
Normal file
|
@ -0,0 +1,53 @@
|
|||
use core::panic;
|
||||
|
||||
use serde::Serialize;
|
||||
use swayipc::{Connection, Event, EventType, Fallible, Workspace, WorkspaceChange};
|
||||
|
||||
fn main() -> Fallible<()> {
|
||||
let mut con = Connection::new()?;
|
||||
let mut workspaces: Vec<WsData> = con
|
||||
.get_workspaces()?
|
||||
.into_iter()
|
||||
.map(|ws| ws.into())
|
||||
.collect();
|
||||
println!("{}", serde_json::ser::to_string(&workspaces).unwrap());
|
||||
|
||||
for ev in con.subscribe([EventType::Workspace])? {
|
||||
// the lazy/ugly solution!
|
||||
// we create a new connection and request workspaces again and again and again
|
||||
// TODO: properly handle events one by one
|
||||
let mut con = Connection::new()?;
|
||||
workspaces = con
|
||||
.get_workspaces()?
|
||||
.into_iter()
|
||||
.map(|ws| ws.into())
|
||||
.collect();
|
||||
println!("{}", serde_json::ser::to_string(&workspaces).unwrap());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct WsData {
|
||||
name: String,
|
||||
focused: bool,
|
||||
urgent: bool,
|
||||
}
|
||||
|
||||
impl From<Workspace> for WsData {
|
||||
fn from(
|
||||
Workspace {
|
||||
name,
|
||||
focused,
|
||||
urgent,
|
||||
..
|
||||
}: Workspace,
|
||||
) -> Self {
|
||||
WsData {
|
||||
name,
|
||||
focused,
|
||||
urgent,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue