Moved files

This commit is contained in:
fwastring 2025-06-03 22:51:15 +02:00
parent f0f251c814
commit d8f3613304
12 changed files with 191 additions and 741 deletions

View file

@ -9,8 +9,11 @@
}: }:
{ {
imports = [ imports = [
# ../shared/vial.nix ./dev.nix
# ../shared/st.nix ./lsp.nix
./network.nix
./programs.nix
./system.nix
]; ];
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
@ -27,16 +30,6 @@
users.defaultUserShell = pkgs.bash; users.defaultUserShell = pkgs.bash;
documentation.man.generateCaches = false; documentation.man.generateCaches = false;
programs.fish.enable = true; programs.fish.enable = true;
programs.slock = {
enable = true;
package = with pkgs; (slock.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/slock";
rev = "53ada91fefc22f6c9c76ef71b9741b385b6bedfb";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config xorg.libXrandr xorg.xrandr libxcrypt xorg.libXext xorg.xorgproto];
}));
};
programs.bash = { programs.bash = {
interactiveShellInit = '' interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
@ -61,7 +54,7 @@
liveRestore = false; liveRestore = false;
}; };
hardware.pulseaudio.enable = false; services.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services = { services = {
tailscale = { tailscale = {
@ -87,12 +80,6 @@
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# systemd.services.NetworkManager-wait-online.enable = false;
# networking.nameservers = [ "8.8.8.8" ];
# networking.resolvconf.enable = pkgs.lib.mkForce false;
# networking.dhcpcd.extraConfig = "nohook resolv.conf";
# networking.networkmanager.dns = "none";
environment.sessionVariables = { environment.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
@ -131,44 +118,8 @@
}; };
}; };
console.keyMap = "sv-latin1"; console.keyMap = "sv-latin1";
console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
lolcat
fortune
cowsay
pkg-config
xlsfonts
xorg.fontmiscmisc
xorg.mkfontdir
xclip
vim
git
openssh
dysk
rsync
procs
dust
(wrapHelm kubernetes-helm {
plugins = with pkgs.kubernetes-helmPlugins; [
helm-secrets
helm-diff
helm-s3
helm-git
];
})
k3sup
nixfmt-rfc-style
# LSPs
nixd
unstable.neovim
omnisharp-roslyn
nodePackages.vscode-json-languageserver
tailwindcss-language-server
dockerfile-language-server-nodejs
nodejs_22
bash-language-server
(st.overrideAttrs (oldAttrs: rec { (st.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit { src = builtins.fetchGit {
url = "https://github.com/fwastring/st"; url = "https://github.com/fwastring/st";
@ -185,6 +136,17 @@
})) }))
]; ];
programs.slock = {
enable = true;
package = with pkgs; (slock.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/slock";
rev = "53ada91fefc22f6c9c76ef71b9741b385b6bedfb";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config xorg.libXrandr xorg.xrandr libxcrypt xorg.libXext xorg.xorgproto];
}));
};
services = { services = {
picom.enable = true; picom.enable = true;

44
config/dev.nix Normal file
View file

@ -0,0 +1,44 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
argocd
gh
ngrok
tailwindcss
yarn
plantuml
go
templ
goa
prettierd
qrencode
air
unstable.k9s
git
lazydocker
kubectl
gcc
gnumake
cmake
jq
git
(wrapHelm kubernetes-helm {
plugins = with pkgs.kubernetes-helmPlugins; [
helm-secrets
helm-diff
helm-s3
helm-git
];
})
k3sup
];
}

View file

@ -1,135 +0,0 @@
From 95a444534c230de79000348b0e12f8644aac8b15 Mon Sep 17 00:00:00 2001
From: leliel <mail.leliel@proton.me>
Date: Mon, 7 Apr 2025 01:00:01 +0000
Subject: [PATCH] Increased speed for long files with emojis.
---
config.def.h | 3 +++
dmenu.1 | 3 +++
dmenu.c | 40 ++++++++++++++++++++++++++++++++++------
3 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/config.def.h b/config.def.h
index 1edb647..832896f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -2,6 +2,9 @@
/* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
+static int centered = 1; /* -c option; centers dmenu on screen */
+static int min_width = 500; /* minimum width when centered */
+static const float menu_height_ratio = 4.0f; /* This is the ratio used in the original calculation */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
"monospace:size=10"
diff --git a/dmenu.1 b/dmenu.1
index 323f93c..c036baa 100644
--- a/dmenu.1
+++ b/dmenu.1
@@ -40,6 +40,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
.B \-b
dmenu appears at the bottom of the screen.
.TP
+.B \-c
+dmenu appears centered on the screen.
+.TP
.B \-f
dmenu grabs the keyboard before reading stdin if not reading from a tty. This
is faster, but will lock up X until stdin reaches end\-of\-file.
diff --git a/dmenu.c b/dmenu.c
index fd49549..ceb52c7 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -29,6 +29,7 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
struct item {
char *text;
+ unsigned int width;
struct item *left, *right;
int out;
};
@@ -95,6 +96,15 @@ calcoffsets(void)
break;
}
+static int
+max_textw(void)
+{
+ int len = 0;
+ for (struct item *item = items; item && item->text; item++)
+ len = MAX(item->width, len);
+ return len;
+}
+
static void
cleanup(void)
{
@@ -563,6 +573,7 @@ readstdin(void)
line[len - 1] = '\0';
if (!(items[i].text = strdup(line)))
die("strdup:");
+ items[i].width = TEXTW(line);
items[i].out = 0;
}
@@ -636,6 +647,7 @@ setup(void)
bh = drw->fonts->h + 2;
lines = MAX(lines, 0);
mh = (lines + 1) * bh;
+ promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
#ifdef XINERAMA
i = 0;
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
@@ -662,9 +674,16 @@ setup(void)
if (INTERSECT(x, y, 1, 1, info[i]) != 0)
break;
- x = info[i].x_org;
- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
- mw = info[i].width;
+ if (centered) {
+ mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
+ x = info[i].x_org + ((info[i].width - mw) / 2);
+ y = info[i].y_org + ((info[i].height - mh) / menu_height_ratio);
+ } else {
+ x = info[i].x_org;
+ y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+ mw = info[i].width;
+ }
+
XFree(info);
} else
#endif
@@ -672,9 +691,16 @@ setup(void)
if (!XGetWindowAttributes(dpy, parentwin, &wa))
die("could not get embedding window attributes: 0x%lx",
parentwin);
- x = 0;
- y = topbar ? 0 : wa.height - mh;
- mw = wa.width;
+
+ if (centered) {
+ mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
+ x = (wa.width - mw) / 2;
+ y = (wa.height - mh) / 2;
+ } else {
+ x = 0;
+ y = topbar ? 0 : wa.height - mh;
+ mw = wa.width;
+ }
}
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
inputw = mw / 3; /* input width: ~33% of monitor width */
@@ -733,6 +759,8 @@ main(int argc, char *argv[])
topbar = 0;
else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */
fast = 1;
+ else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
+ centered = 1;
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
fstrncmp = strncasecmp;
fstrstr = cistrstr;
--
2.49.0

View file

@ -1,176 +0,0 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
imports = [
../shared/dwm.nix
../shared/vscode.nix
../shared/dmenu.nix
../shared/rofi.nix
../shared/kitty.nix
../shared/alacritty.nix
../shared/tmux.nix
../shared/vim.nix
../shared/fish.nix
../shared/git.nix
../shared/nixpkgs.nix
../shared/firefox.nix
../shared/zathura.nix
../shared/lazygit.nix
../shared/ssh.nix
../shared/aerc.nix
../shared/oh-my-posh.nix
];
nixpkgs = {
overlays = [];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
home.packages = with pkgs; [
# System
xsel
unzip
zip
wget
alsa-utils
upower
gcc
gnumake
cmake
arion
htop
pavucontrol
procps
openssh
networkmanager
fd
bat
bluez
bluez-tools
unstable.betterlockscreen
tmux
unstable.fzf
eza
btop
thttpd
xcolor
openssl
dig
jq
# Dev
unstable.deno
unstable.hugo
unstable.logstash
ngrok
tailwindcss
nodejs_22
gh-f
gh
yarn
plantuml
go
dotnetCorePackages.sdk_8_0_3xx
templ
#Tools
qrencode
air
k9s
git
lazydocker
kubectl
#LSP
roslyn
roslyn-ls
python312Packages.python-lsp-server
yaml-language-server
nil
jdt-language-server
texlab
marksman
nodePackages_latest.bash-language-server
typescript
nodePackages_latest.typescript-language-server
nodePackages_latest.vls
nodePackages_latest.volar
lua-language-server
tree-sitter
gopls
rust-analyzer
# UI
rofi-bluetooth
pastel
imagemagick
#VPN
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
# Display
scrot
xbanish
feh
brightnessctl
dunst
# Documents
ripgrep
grc
texliveFull
pandoc
poppler_utils
#Desktop
unstable.feishin
firefox
libreoffice
unstable.signal-desktop
pinta
zathura
vial
thunderbird
alacritty
unstable.neovim
fastfetch
lazygit
byzanz
remmina
obsidian
# Utils
speedcrunch
#Unfree
discord
slack
];
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.man.generateCaches = false;
xsession.enable = true;
xsession.windowManager.command = if myhostname == "laptop" then "/home/fw/nix/.xinitrc.laptop" else if myhostname == "jobb" then "/home/fw/nix/.xinitrc.jobb" else "/home/fw/nix/.xinitrc";
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "23.11"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

View file

@ -11,14 +11,7 @@
{ {
imports = [ imports = [
../shared/dwm.nix ../shared/dwm.nix
../shared/vscode.nix
# ../shared/dmenu.nix
# ../shared/rofi.nix
# ../shared/mpv.nix
../shared/kitty.nix
../shared/alacritty.nix
../shared/tmux.nix ../shared/tmux.nix
../shared/vim.nix
../shared/fish.nix ../shared/fish.nix
../shared/git.nix ../shared/git.nix
../shared/nixpkgs.nix ../shared/nixpkgs.nix
@ -38,108 +31,6 @@
}; };
}; };
home.packages = with pkgs; [
# System
xsel
unzip
zip
wget
alsa-utils
upower
gcc
gnumake
cmake
arion
htop
pavucontrol
procps
openssh
networkmanager
fd
bat
bluez
bluez-tools
# tmux
fzf
eza
btop
thttpd
xcolor
openssl
dig
jq
wireguard-tools
acpi
light
# dmenu-rs-enable-plugins
# Dev
argocd
gh
ngrok
tailwindcss
yarn
plantuml
go
templ
goa
prettierd
#Tools
qrencode
air
unstable.k9s
git
lazydocker
kubectl
# UI
pastel
imagemagick
#VPN
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
networkmanager_strongswan
# Display
scrot
xbanish
feh
brightnessctl
dunst
# Documents
ripgrep
grc
texliveFull
pandoc
poppler_utils
#Desktop
unstable.feishin
libreoffice
unstable.signal-desktop
pinta
zathura
vial
thunderbird
alacritty
fastfetch
lazygit
byzanz
remmina
obsidian
# Utils
speedcrunch
#Unfree
discord
slack
];
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.fish.enable = true; programs.fish.enable = true;
programs.man.generateCaches = false; programs.man.generateCaches = false;

View file

@ -1,152 +0,0 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
imports = [
../shared/dwm.nix
../shared/dmenu.nix
../shared/kitty.nix
../shared/alacritty.nix
../shared/tmux.nix
../shared/fish.nix
../shared/git.nix
../shared/nixpkgs.nix
../shared/firefox.nix
../shared/zathura.nix
../shared/lazygit.nix
../shared/ssh.nix
../shared/oh-my-posh.nix
];
nixpkgs = {
overlays = [];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
home.packages = with pkgs; [
# System
xsel
unzip
zip
wget
alsa-utils
acpi
gcc
gnumake
cmake
arion
htop
pavucontrol
procps
openssh
networkmanager
fd
bat
bluez
bluez-tools
unstable.betterlockscreen
tmux
unstable.fzf
eza
btop
xcolor
openssl
dig
jq
rockbox-utility
rhythmbox
libgpod
# Dev
unstable.hugo
tailwindcss
nodejs_22
go
#Tools
qrencode
air
git
lazydocker
kubectl
#LSP
python312Packages.python-lsp-server
yaml-language-server
nil
texlab
marksman
nodePackages_latest.bash-language-server
typescript
nodePackages_latest.typescript-language-server
nodePackages_latest.vls
nodePackages_latest.volar
lua-language-server
tree-sitter
gopls
rust-analyzer
# UI
pastel
imagemagick
#VPN
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
# Display
scrot
xbanish
feh
brightnessctl
dunst
# Documents
ripgrep
grc
# texliveFull
pandoc
poppler_utils
#Desktop
unstable.feishin
firefox
unstable.signal-desktop
pinta
zathura
thunderbird
alacritty
neovim
fastfetch
lazygit
byzanz
# Utils
speedcrunch
];
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.man.generateCaches = false;
xsession.enable = true;
xsession.windowManager.command = if myhostname == "laptop" then "/home/fw/nix/.xinitrc.laptop" else if myhostname == "jobb" then "/home/fw/nix/.xinitrc.jobb" else "/home/fw/nix/.xinitrc";
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "23.11"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

22
config/lsp.nix Normal file
View file

@ -0,0 +1,22 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
nixd
unstable.neovim
omnisharp-roslyn
nodePackages.vscode-json-languageserver
tailwindcss-language-server
dockerfile-language-server-nodejs
nodejs_22
bash-language-server
];
}

23
config/network.nix Normal file
View file

@ -0,0 +1,23 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
networkmanager_strongswan
wireguard-tools
networkmanager
openssh
dig
];
}

35
config/programs.nix Normal file
View file

@ -0,0 +1,35 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
unstable.feishin
pastel
libreoffice
unstable.signal-desktop
pinta
zathura
vial
thunderbird
alacritty
fastfetch
lazygit
byzanz
remmina
obsidian
speedcrunch
discord
slack
feh
imagemagick
pandoc
texliveFull
];
}

View file

@ -1,100 +0,0 @@
# This is your home-manager configuration fileserver
# Use this to configure your home environment (it replaces ~/.config/nixnix)
{
inputs,
lib,
config,
pkgs,
unstable,
myhostname,
...
}: {
imports = [
../shared/git.nix
../shared/tmux.nix
../shared/nixpkgs.nix
../shared/lazygit.nix
../shared/zsh-server.nix
];
nixpkgs = {
overlays = [];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
permittedInsecurePackages = [
"nix-2.16.2"
];
};
};
home.packages = with pkgs; [
# System
arion
wget
killall
gcc
gnumake
htop
openssh
xsel
unzip
nixops_unstable
cmake
networkmanager
fd
bat
#Terminal
git
yt-dlp
fzf
ripgrep
#Desktop
neovim
lazygit
#Dev
python3
python311Packages.pip
ranger
python311Packages.pynvim
ueberzugpp
#LSP
nil
python311Packages.python-lsp-server
marksman
clojure-lsp
omnisharp-roslyn
haskell-language-server
java-language-server
nodePackages_latest.bash-language-server
dockerfile-language-server-nodejs
yaml-language-server
ansible-language-server
lua-language-server
tree-sitter
nodejs_21
nodePackages_latest.vls
nodePackages_latest.volar
vscode-langservers-extracted
#VPN
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
ansible
];
programs.home-manager.enable = true;
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "23.11"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

50
config/system.nix Normal file
View file

@ -0,0 +1,50 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
# System
xsel
unzip
zip
wget
alsa-utils
upower
htop
pavucontrol
procps
fzf
eza
btop
acpi
xclip
dysk
rsync
procs
dust
scrot
xbanish
brightnessctl
lolcat
fortune
cowsay
ripgrep
poppler_utils
grc
pkg-config
vim
bat
fd
arion
bluez
bluez-tools
openssl
];
}

View file

@ -7,9 +7,6 @@
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed. # TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users = { users = {
defaultUserShell = pkgs.bash; defaultUserShell = pkgs.bash;
groups = {
ios = { };
};
users = { users = {
fw = { fw = {
initialPassword = "password"; initialPassword = "password";
@ -28,17 +25,6 @@
]; ];
}; };
}; };
ios = {
initialPassword = "password";
isNormalUser = true;
description = "iOS Integration";
group = "ios";
openssh.authorizedKeys = {
keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIQ9GkzI12xKZyZMmBusLw3UkxdkKEmifxTxSP74YnOXM7SknBUxkpAm0OY3wwbeF8Qht8O/mUM8x1ILpjIUPg2OZh2OslqU+slcoWAoeR8DE6hEwUIrozzlqLkL3JKIE1g2Sx7Gay7QheTJH4e51sXn15Gb3h3ByTa1LyQCWBXP4BPRs4hbVbGu0U1Qe3qav+ubnEthmLbaE+jS6SZb0TkQqKFJIq3skCRI59AkWTCOywhB3CpwP05y/to4EKUDYttf8r8pyfvJ7WMTYHFPCL3uVnutAuIVScHchMwt52kRHD8sZR2/vOM8tOeWB3zIo2XYyCIKlZjm318unqlLv8ol3sfzsSHcEvXLzXxF66/NmpTfjtlnze6hE/GxvjxC4zM7oCf/7o0UNq8VrQto0qUScjqgv5uP7GOitx2dVMGjFfGmXngeBPEIbN+WrPFPUrzylZP5tivrnyzamm7SlGUMlvtKm/G5vurxjtrvpvLKDPvKLAtueTii2xViOXTxZBQw6/mvLyhIrc3+jepgUvTVyKb88Home0WPzedCWPqzkHWgo7wvh4ybZ/JDJv2Gh1vKtKPNUwUbwl2ljJ8DagHK3qxyrfVFo9b+NmR+S21RBzF8CVhP3+MVGRNtsGMxLm4GjvODpcJrCPj/5R6NAWE7sBCP63SvHaLnlaHefsHQ== ios"
];
};
};
}; };
}; };
} }