Compare commits

..

11 commits

Author SHA1 Message Date
caandt 2a4316b08a pkgs 2024-12-11 04:20:13 -06:00
caandt 69abb3c54a wm config 2024-12-11 04:19:34 -06:00
caandt 33375a30f6 libxcursor fix 2024-12-11 04:18:17 -06:00
caandt 32506837ad shell functions 2024-12-11 04:17:37 -06:00
caandt 9584c63aa2 file picker settings 2024-11-29 01:58:06 -06:00
caandt 693af2e90a autostart 2024-11-29 00:48:44 -06:00
caandt 09a3669b57 use qt6 breeze 2024-11-26 15:28:52 -06:00
caandt 7a1d47172b version bump 2024-11-26 02:15:16 -06:00
caandt e3d3ab6bf6 nit 2024-11-26 02:14:51 -06:00
caandt 046f061657 wireguard firewall settings 2024-11-25 01:50:23 -06:00
caandt 55903a2242 ssh config 2024-11-25 01:38:43 -06:00
22 changed files with 216 additions and 99 deletions

View file

@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
@ -26,11 +26,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1729776962,
"narHash": "sha256-+aVNtTBq61XMr5fmRluwfbv624axzV5Y6DxLaww71ZI=",
"lastModified": 1732539262,
"narHash": "sha256-FdVYqG37TYGC/oiXpFt8VVHTv7lCyjc3UxPaZIxvWCI=",
"owner": "wamserma",
"repo": "flake-programs-sqlite",
"rev": "34923154bf9ab189bd24499c265c0c90a41327ab",
"rev": "9355bb57fbc60103e933e081e36f9712e3b3bc66",
"type": "github"
},
"original": {
@ -46,11 +46,11 @@
]
},
"locked": {
"lastModified": 1729716953,
"narHash": "sha256-FbRKGRRd0amsk/WS/UV9ukJ8jT1dZ2pJBISxkX+uq6A=",
"lastModified": 1732482255,
"narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a4353cc43d1b4dd6bdeacea90eb92a8b7b78a9d7",
"rev": "a9953635d7f34e7358d5189751110f87e3ac17da",
"type": "github"
},
"original": {
@ -68,11 +68,11 @@
"umu": "umu"
},
"locked": {
"lastModified": 1730425644,
"narHash": "sha256-dfxO6mkn1KkotGQXV93m/2MoS9ayLUwaIIbR3mReLd0=",
"lastModified": 1732543374,
"narHash": "sha256-suhk41NhdsnN3aa7gpsr8KnYJtbaLeZBJMB2vqWbkzA=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "bcc7c896b56ccd644ca2daea74dac05c1731f59d",
"rev": "18b8f0796f3e9dd8b9d9f262a56f2914a0586a22",
"type": "github"
},
"original": {
@ -83,11 +83,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1729665710,
"narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=",
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {
@ -99,23 +99,23 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1727825735,
"narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=",
"lastModified": 1730504152,
"narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729691686,
"narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=",
"lastModified": 1731797254,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"type": "github"
},
"original": {
@ -143,11 +143,11 @@
},
"locked": {
"dir": "packaging/nix",
"lastModified": 1729978972,
"narHash": "sha256-Zox0iAi4CRPn4rxrhOetFFZ2jcSipe8tGD8nMTgcjhE=",
"lastModified": 1732337089,
"narHash": "sha256-dwFza03ETqrcmVGSCdgDDKTWKRgckpQ3vXkZRCYtM9g=",
"ref": "refs/heads/main",
"rev": "72499f349ca81cb2838eced9d7c465b2cf71c4a2",
"revCount": 825,
"rev": "f6a6af3191f5497d95d8f8aaa08826a45da199c4",
"revCount": 842,
"submodules": true,
"type": "git",
"url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix"

View file

@ -36,4 +36,15 @@
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c547", ATTR{power/wakeup}="disabled"
'';
networking.firewall = {
logReversePathDrops = true;
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
}

View file

@ -1,7 +1,24 @@
{config, ...}: {
{
config,
pkgs,
lib,
...
}: {
imports = [
../../../../user
];
home.username = "ahnwuoa";
services.activitywatch = {
enable = true;
watchers = {
aw-watcher-afk.package = pkgs.activitywatch;
aw-watcher-window.package = pkgs.activitywatch;
};
};
systemd.user.targets.activitywatch = {
Unit.Requires = lib.mkForce ["autostart.target"];
Unit.After = lib.mkForce ["autostart.target"];
Install.WantedBy = lib.mkForce ["autostart.target"];
};
}

View file

@ -12,6 +12,7 @@
environment.pathsToLink = ["/libexec"];
environment.localBinInPath = true;
services.globalprotect.enable = true;
boot.tmp.useTmpfs = true;
@ -36,6 +37,8 @@
settings.default = ["Alacritty.desktop"];
};
environment.etc."ssh/ssh_config".text = lib.mkAfter "Include /home/*/.local/ssh/config";
programs.command-not-found.dbPath = flake-programs-sqlite.packages.${pkgs.system}.programs-sqlite;
programs.ssh.enableAskPassword = false;

View file

@ -1,9 +1,12 @@
{...}: {
{pkgs, ...}: {
services.xserver = {
enable = true;
autorun = false;
displayManager.sx.enable = true;
windowManager.awesome.enable = true;
windowManager.awesome = {
enable = true;
luaModules = [pkgs.luaPackages.vicious];
};
desktopManager.plasma5.enable = true;
autoRepeatDelay = 200;
autoRepeatInterval = 30;

View file

@ -4,8 +4,4 @@
package = pkgs.libsForQt5.partitionmanager;
};
services.udisks2.enable = true;
systemd.user.services = {
plasma-kactivitymanagerd.enable = false;
plasma-xdg-desktop-portal-kde.enable = false;
};
}

22
user/autostart.nix Normal file
View file

@ -0,0 +1,22 @@
{pkgs, pkgs-stable, ...}: {
systemd.user.targets.autostart = {
Unit = {
Wants = [
"plasma-polkit-agent.service"
"plasma-xdg-desktop-portal-kde.service"
"plasma-dolphin.service"
"xdg-desktop-portal.service"
"copyq.service"
"fcitx5.service"
"picom.service"
"safeeyes.service"
];
};
};
systemd.user.services = {
copyq.Service.ExecStart = ["${pkgs.copyq}/bin/copyq"];
fcitx5.Service.ExecStart = ["/run/current-system/sw/bin/fcitx5"];
picom.Service.ExecStart = ["${pkgs.picom}/bin/picom"];
safeeyes.Service.ExecStart = ["${pkgs-stable.safeeyes}/bin/safeeyes"];
};
}

View file

@ -5,8 +5,8 @@
}: let
deps = {
bell = [pkgs.pipewire pkgs.libnotify];
nsxiv-rifle = [pkgs.nsxiv];
screenshot = [pkgs.maim pkgs.xclip];
#nsxiv-rifle = [pkgs.nsxiv];
#screenshot = [pkgs.maim pkgs.xclip];
};
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/bin/${x}";
in {

View file

@ -1,6 +1,6 @@
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "usage: $0 <file>"
echo "usage: ${0##*/} <file>"
exit 1
fi

View file

@ -8,6 +8,7 @@ local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
local vicious = require("vicious")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
@ -110,11 +111,33 @@ menubar.menu_gen.all_categories = {}
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
cal_style = {
bg_color = "#dddddd",
fg_color = "#222222",
border_width = 0,
}
cal = awful.widget.calendar_popup.month {
margin = 10,
bg = "#ff0000",
start_sunday = true,
style_normal = cal_style,
style_header = cal_style,
style_weekday = cal_style,
style_month = cal_style,
style_focus = { border_width = 0 },
}
cal:attach(mytextclock, "tr", {on_hover=false})
memw = wibox.widget.textbox()
cpuw = wibox.widget.textbox()
vicious.cache(vicious.widgets.mem)
vicious.cache(vicious.widgets.cpu)
vicious.register(memw, vicious.widgets.mem, " $1% ($2M)", 13)
vicious.register(cpuw, vicious.widgets.cpu, " $1%", 17)
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
@ -204,7 +227,7 @@ awful.screen.connect_for_each_screen(function(s)
}
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s })
s.mywibox = awful.wibar({ position = "top", screen = s, margins = 10 })
-- Add widgets to the wibox
s.mywibox:setup {
@ -218,7 +241,9 @@ awful.screen.connect_for_each_screen(function(s)
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
spacing = 10,
cpuw,
memw,
wibox.widget.systray(),
mytextclock,
s.mylayoutbox,
@ -618,11 +643,13 @@ client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("property::floating", function(c)
if c.floating then
awful.titlebar(c, {bg = "#7d92c6"})
else
awful.titlebar(c, {bg = beautiful.titlebar_bg_normal})
end
if c.titlebars_enabled then
if c.floating then
awful.titlebar(c, {bg = "#7d92c6"})
else
awful.titlebar(c, {bg = beautiful.titlebar_bg_normal})
end
end
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)

View file

@ -30,6 +30,10 @@ theme.border_normal = "#000000"
theme.border_focus = "#4949ff"
theme.border_marked = "#91231c"
theme.snap_bg = "#ddeedd"
local gears = require("gears")
theme.snap_shape = gears.shape.rectangle
-- There are other variable sets
-- overriding the default one when
-- defined, the sets are:

View file

@ -22,13 +22,6 @@ alias ll='ls -la'
alias la='ls -la'
alias l='ls'
if [[ -e ~/.local/ssh/config ]]; then
alias ssh="ssh -F ~/.local/ssh/config"
alias sftp="sftp -F ~/.local/ssh/config"
alias scp="scp -F ~/.local/ssh/config"
alias rsync="rsync -e 'ssh -F $HOME/.local/ssh/config'"
fi
# replace cat with bat
_exists bat && alias cat='bat'

View file

@ -24,6 +24,7 @@ _load history
_load aliases
# set xdg env vars to keep home directory clean
_load xdg
_load show
if _exists fzf; then
export FZF_DEFAULT_OPTS="--bind=ctrl-u:page-up,ctrl-d:page-down"

32
user/config/bash/show Normal file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
function show() {
if [[ "$#" -ne 1 ]]; then
echo "usage: show <prog>" >&2
return 1
fi
case "$(type -t "$1")" in
alias)
alias "$1" | bat -pl sh ;;
keyword|builtin)
help "$1" ;;
function)
declare -f "$1" | bat -l sh ;;
file)
local path="$(which "$1")"
local real="$(realpath "$path")"
[[ "$path" != "$real" ]] && echo "$path"
bat "$real" ;;
"")
echo "$1 doesn't exist" ;;
esac
}
function goto() {
if [[ "$#" -ne 1 ]]; then
echo "usage: goto <prog>" >&2
return 1
fi
local path="$(which "$1")"
[[ -z "$path" ]] && return 2
local real="$(realpath "$path")"
cd "${real%/*}"
}

View file

@ -6,6 +6,7 @@
xdg.configFile.kiorc.source = ./kiorc;
xdg.configFile.kservicemenurc.source = ./kservicemenurc;
xdg.configFile.lightlyrc.source = ./lightlyrc;
xdg.configFile.xdg-desktop-portal-kderc.source = ./xdg-desktop-portal-kderc;
xdg.dataFile."ark/ark_recentfiles" = {
text = "";
force = true;

View file

@ -0,0 +1,24 @@
[FileDialogSize]
2 screens: Height=788
2 screens: Width=1286
[KFileDialog Settings]
detailViewIconSize=48
Allow Expansion=false
Automatically select filename extension=true
Breadcrumb Navigation=true
Decoration position=2
LocationCombo Completionmode=5
PathCombo Completionmode=5
Show Bookmarks=false
Show Full Path=false
Show Inline Previews=true
Show Preview=false
Show Speedbar=true
Show hidden files=true
Sort by=Name
Sort directories first=true
Sort hidden files last=false
Sort reversed=false
Speedbar Width=170
View Style=Detail

View file

@ -1,47 +1,21 @@
#!/bin/sh
# set keyboard repeat rate
xset r rate 200 30
# monitor settings
xrandr --output DisplayPort-1 --mode 1920x1080 --rate 144
# tablet settings
xsetwacom set "Wacom One by Wacom S Pen stylus" MapToOutput DisplayPort-0
# set color temperature
sct 4500
# compositor
picom &
LIBEXEC=/run/current-system/sw/libexec
[ -d "$LIBEXEC" ] || LIBEXEC=/usr/lib
# session manager
"$LIBEXEC"/polkit-kde-authentication-agent-1 &
# desktop portal
"$LIBEXEC"/xdg-desktop-portal-kde &
"$LIBEXEC"/xdg-desktop-portal &
kded5 &
# ime
export QT_QPA_PLATFORMTHEME="qt6ct"
export GTK_IM_MODULE=fctix
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
fcitx5 &
# file manager daemon
dolphin --daemon &
# qt setting
export QT_QPA_PLATFORMTHEME="qt6ct"
# same dpi for multi monitor
export WINIT_X11_SCALE_FACTOR=1
safeeyes &
copyq &
_vars="DBUS_SESSION_BUS_ADDRESS DISPLAY SSH_AUTH_SOCK XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID QT_PLUGIN_PATH QML2_IMPORT_PATH QT_QPA_PLATFORMTHEME QT_STYLE_OVERRIDE NIX_XDG_DESKTOP_PORTAL_DIR"
systemctl --user import-environment $_vars
dbus-update-activation-environment $_vars
xrdb -merge ~/.config/Xresources
xset r rate 200 30
xrandr --output DisplayPort-1 --mode 1920x1080 --rate 144
xsetwacom set "Wacom One by Wacom S Pen stylus" MapToOutput DisplayPort-0
sct 4500
exec "${1:-awesome}"
systemctl --user start autostart.target
exec ${@:-awesome}

View file

@ -92,16 +92,15 @@ bind -T copy-mode-vi y send -X copy-selection
unbind -T copy-mode-vi MouseDragEnd1Pane
# use arrow keys when scrolling on certain commands
tmux_commands_with_legacy_scroll="nano less more man git"
bind -T root WheelUpPane \
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
'if-shell -t= "#{?alternate_on,true,false} || echo \"nano less more man git journalctl\" | grep -q \"#{pane_current_command}\"" \
"send -t= Up Up Up" "copy-mode -et="'
bind -T root WheelDownPane \
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
'if-shell -t= "#{?alternate_on,true,false} || echo \"nano less more man git journalctl\" | grep -q \"#{pane_current_command}\"" \
"send -t= Down Down Down" "send -Mt="'
### plugins

View file

@ -1,5 +1,6 @@
{...}: {
imports = [
./autostart.nix
./bin
./config
./home.nix

View file

@ -9,7 +9,7 @@
home.packages = with pkgs; [
(pkgs.symlinkJoin {
name = "firefox";
paths = [pkgs-stable.firefox];
paths = [pkgs.firefox-bin];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/firefox \
@ -18,10 +18,16 @@
})
alacritty
mpv
nsxiv
(nsxiv.overrideAttrs {
buildInputs = pkgs.nsxiv.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
rofi
sct
maim
(maim.overrideAttrs {
buildInputs = pkgs.maim.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
})
xclip
copyq
picom
@ -54,6 +60,8 @@
file
nix-tree
alejandra
ffmpeg
ffsubsync
(python312.withPackages (python-pkgs: [
python-pkgs.pwntools
@ -68,6 +76,7 @@
coqPackages.coqide
gcc
sqlitebrowser
globalprotect-openconnect
tmuxPlugins.vim-tmux-navigator
tmuxPlugins.sessionist

View file

@ -7,7 +7,7 @@
enable = true;
platformTheme.name = "qtct";
style.name = "breeze";
style.package = pkgs.libsForQt5.breeze-qt5;
style.package = pkgs.kdePackages.breeze;
};
gtk = {
enable = true;
@ -15,12 +15,12 @@
gtk3.extraConfig = {gtk-recent-files-limit = 0;};
theme = {
name = "Breeze";
package = pkgs.libsForQt5.breeze-gtk;
package = pkgs.kdePackages.breeze-gtk;
};
};
home.pointerCursor = {
name = "breeze_cursors";
package = pkgs.libsForQt5.breeze-qt5;
package = pkgs.kdePackages.breeze;
size = 24;
gtk.enable = true;
x11.enable = true;

View file

@ -29,8 +29,8 @@
};
xdg.portal = {
enable = true;
configPackages = [pkgs.libsForQt5.xdg-desktop-portal-kde];
extraPortals = [pkgs.libsForQt5.xdg-desktop-portal-kde];
configPackages = [pkgs.kdePackages.xdg-desktop-portal-kde];
extraPortals = [pkgs.kdePackages.xdg-desktop-portal-kde];
config.common.default = "kde";
};
home.file = let