lolcathost specific changes

This commit is contained in:
Emile Clark-Boman 2025-02-11 18:17:17 +10:00
parent 1d4189b040
commit 40864af04f
18 changed files with 580 additions and 1167 deletions

View file

@ -39,8 +39,9 @@ const AppLauncher = ({ width = 500, height = 500, spacing = 12 }) => {
}
const entry = Widget.Entry({
placeholder_text: "Search",
hexpand: true,
css: `margin-bottom: ${spacing}px;`,
css: "min-height: 50px;",
// launch first item when Enter is pressed
on_accept: () => {
@ -48,7 +49,7 @@ const AppLauncher = ({ width = 500, height = 500, spacing = 12 }) => {
const results = applications.filter((item) => item.visible);
if (results[0]) {
App.toggleWindow(WINDOW_NAME);
results[0].attribute.app.launcher()
results[0].attribute.app.launch()
}
},
@ -59,29 +60,52 @@ const AppLauncher = ({ width = 500, height = 500, spacing = 12 }) => {
})
return Widget.Box({
vertical: true,
css: `margin: ${spacing * 2}px;`,
vertical: false,
children: [
entry,
// LEFT
Widget.Box({
vertical: true,
css: `min-width: ${width}px;`
+ `min-height: ${height}px;`
+ "background-color: #947BF5;",
//+ "background-image: url('../../../wallpaper/kill-my-firstborn/astronaut-pink-blue.png');",
//+ "background-size: cover;"
//+ "background-position: center;"
//+ "background-repeat: no-repeat;",
children: [
// align the entry field with the app list
Widget.Box({
css: `margin: ${spacing * 2}px;`,
child: entry,
}),
],
}),
// make scrollable
Widget.Scrollable({
hscroll: "never",
css: `min-width: ${width}px; min-height: ${height}px;`,
child: list,
// RIGHT
Widget.Box({
vertical: true,
css: `margin: ${spacing * 2}px;`,
child:
// make scrollable
Widget.Scrollable({
hscroll: "never",
css: `min-width: ${width}px; min-height: ${height}px;`,
child: list,
}),
setup: self => self.hook(App, (_, windowName, visible) => {
if (windowName !== WINDOW_NAME)
return
// when the launcher becomes visible
if (visible) {
refresh()
entry.text = ""
entry.grab_focus()
}
}),
}),
],
setup: self => self.hook(App, (_, windowName, visible) => {
if (windowName !== WINDOW_NAME)
return
// when the launcher becomes visible
if (visible) {
repopulate()
entry.text = ""
entry.grab_focus()
}
}),
})
}

View file

@ -15,7 +15,7 @@ App.config({
style: "./style.css",
// icons: "./assets",
windows: [
Bar(),
//Bar(),
applauncher,
]
// gtkTheme: "Adwaita-dark",

View file

@ -0,0 +1,23 @@
const WINDOW_NAME = "fullscreen";
const Fullscreen = (children) => Widget.Box({
vertical: true,
css: "background-image: url('https://images2.alphacoders.com/135/1351579.png');"
+ "background-size: cover;"
+ "background-position: center;"
+ "background-repeat: no-repeat;",
children: children,
})
export const fullscreen = Widget.Window({
name: WINDOW_NAME,
setup: self => self.keybind("Escape", () => {
App.closeWindow(WINDOW_NAME)
}),
anchor: ["top", "bottom", "left", "right"],
visible: false,
keymode: "exclusive",
child: Fullscreen(
Widget.Label({"Hello World"});
)
})

View file

@ -18,7 +18,7 @@
../modules/rio.nix
../modules/firefox.nix
../modules/nixcord.nix
#../modules/nixcord.nix
../modules/hypr/hypridle.nix
../modules/hypr/hyprlock.nix

View file

@ -8,7 +8,7 @@
settings = {
background = {
monitor = "";
path = "$HOME/downloads/wallpaper/kill-my-first/astronaut-pink-blue.png"; # only png supported for now
path = "$HOME/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png"; # only png supported for now
# color = $color1
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
@ -81,7 +81,7 @@
# Degrees
monitor = "";
# get temperature in Brisbane
text = ''cmd[update:18000000] echo "<b>Feels like<big> $(curl -s 'wttr.in/bne?format=%t' | tr -d '+') </big></b>"'';
text = ''cmd[update:18000000] echo "<b>Feels like $(curl -s 'wttr.in/bne?format=%t' | tr -d '+')</b>"'';
color = "rgb(255, 255, 255, 1)";
font_size = 18;
font_family = "Geist Mono 10";
@ -103,11 +103,11 @@
dots_rouding = -1;
rounding = 22;
outer_color = "rgb(255, 0, 0, 1)";
inner_color = "rgb(0, 255, 0, 1)";
font_color = "rgb(0, 0, 255, 1)";
outer_color = "rgb(0, 0, 0, 0)";
inner_color = "rgb(100, 114, 125, 0.1)";
font_color = "rgb(200, 200, 200)";
fade_on_empty = true;
placeholder_text = "!!Super Secret!!"; # Text rendered in the input box when it's empty.
placeholder_text = "<i>Password...</i>"; # Text rendered in the input box when it's empty.
position = "0, 120";
halign = "center";

View file

@ -4,7 +4,6 @@
...
}: {
# The terminal I use
# TODO: this is dependent on nvim being installed
# TODO: make this into a module with a configurable editor option
programs.rio = {
enable = true;
@ -18,6 +17,11 @@
padding-x = 10;
padding-y = [15 10]; # top, left
window = {
width = 600;
height = 400;
};
# lines = (accumulated scroll * multiplier / divider)
scroll = {
multiplier = 3.0;
@ -60,7 +64,7 @@
};
renderer = {
performance = "High";
performance = "Low"; # High: for my PC, Low: for integrated GPUs
backend = "Automatic"; # Vulkan
};
};

View file

@ -0,0 +1,17 @@
{...}: {
# simple fail2ban config (not production ready or anything though)
# refer to: https://nixos.wiki/wiki/Fail2Ban
services.fail2ban = {
enable = true;
maxretry = 5;
bantime = "10m"; # 10 minute ban
bantime-increment = {
enable = true;
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
multipliers = "1 2 4 8 16 32 64";
maxtime = "168h"; # dont ban for more than 1 week
overalljails = true;
};
};
}

View file

@ -0,0 +1,35 @@
{...}: {
services = {
# use nginx as the reverse proxy
# (also will use certbot and Let's Encrypt)
# refer to: https://nixos.wiki/wiki/Nginx
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
# https://imbored.dev
virtualHosts = {
"imbored.dev" = {
forceSSL = true;
enableACME = true;
# config reverse proxy paths
locations = {
"/" = {
# TODO
proxyPass = "http://127.0.0.1:12345";
};
};
};
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "eclarkboman@gmail.com";
};
}

View file

@ -0,0 +1,13 @@
{...}: {
services.openssh = {
enable = true;
ports = [22];
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
AllowUsers = null; # allow all users by default
UseDns = true;
X11Forwarding = false;
};
};
}