Compare commits
No commits in common. "1fb9627aa70899dbda00de190af9db2e2cffa262" and "9e33f85778db1902edad29ed06ac6584b5faf860" have entirely different histories.
1fb9627aa7
...
9e33f85778
28
flake.nix
28
flake.nix
|
|
@ -14,23 +14,29 @@
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
|
overlays = {
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
stable = import nixpkgs-stable {
|
||||||
|
system = prev.system;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
modules = [
|
||||||
inherit pkgs-stable;
|
system/configuration.nix
|
||||||
};
|
overlays
|
||||||
modules = [ system/configuration.nix ];
|
];
|
||||||
};
|
};
|
||||||
homeConfigurations.ahnwuoa = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations.ahnwuoa = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
extraSpecialArgs = rec {
|
modules = [
|
||||||
inherit pkgs-stable;
|
user/home.nix
|
||||||
username = "ahnwuoa";
|
overlays
|
||||||
homeDirectory = "/home/${username}";
|
];
|
||||||
};
|
|
||||||
modules = [ user/home.nix ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autorun = false;
|
autorun = false;
|
||||||
|
displayManager.startx.enable = true;
|
||||||
displayManager.sx.enable = true;
|
displayManager.sx.enable = true;
|
||||||
windowManager.awesome.enable = true;
|
windowManager.awesome.enable = true;
|
||||||
desktopManager.plasma5.enable = true;
|
desktopManager.plasma5.enable = true;
|
||||||
|
|
@ -135,11 +136,6 @@
|
||||||
};
|
};
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
systemd.user.services = {
|
|
||||||
plasma-kactivitymanagerd.enable = false;
|
|
||||||
plasma-xdg-desktop-portal-kde.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
19
user/bin.nix
19
user/bin.nix
|
|
@ -1,19 +0,0 @@
|
||||||
{ config, pkgs, homeDirectory, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
deps = {
|
|
||||||
bell = [ pkgs.pipewire pkgs.libnotify ];
|
|
||||||
nsxiv-rifle = [ pkgs.nsxiv ];
|
|
||||||
screenshot = [ pkgs.maim pkgs.xclip ];
|
|
||||||
};
|
|
||||||
mkln = x: config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.local/nixos/user/bin/${x}";
|
|
||||||
in {
|
|
||||||
home.file = builtins.listToAttrs (map
|
|
||||||
(x: {
|
|
||||||
name = ".local/bin/${x}";
|
|
||||||
value = { source = mkln x; };
|
|
||||||
})
|
|
||||||
(builtins.attrNames (builtins.readDir ./bin))
|
|
||||||
);
|
|
||||||
home.packages = pkgs.lib.lists.flatten (builtins.attrValues deps);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
WAV="$XDG_DATA_HOME/bell.wav"
|
|
||||||
if [ -f $WAV ] && [ $(pgrep pw-play | wc -l) -le 10 ]; then
|
|
||||||
pw-play --volume 0.5 "$WAV" &
|
|
||||||
else
|
|
||||||
notify-send "Bell"
|
|
||||||
fi
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
TMPDIR="${TMPDIR:-/tmp}"
|
|
||||||
tmp="$TMPDIR/nsxiv_rifle_$$"
|
|
||||||
|
|
||||||
is_img_extension() {
|
|
||||||
grep -iE '\.(jpe?g|png|gif|svg|webp|tiff|heif|avif|ico|bmp)$'
|
|
||||||
}
|
|
||||||
|
|
||||||
listfiles() {
|
|
||||||
find -L "///${1%/*}" -maxdepth 1 -type f -print |
|
|
||||||
is_img_extension | sort -V | tee "$tmp"
|
|
||||||
}
|
|
||||||
|
|
||||||
open_img() {
|
|
||||||
# only go through listfiles() if the file has a valid img extension
|
|
||||||
if echo "$1" | is_img_extension >/dev/null 2>&1; then
|
|
||||||
trap 'rm -f $tmp' EXIT
|
|
||||||
count="$(listfiles "$1" | grep -nF "$1")"
|
|
||||||
fi
|
|
||||||
if [ -n "$count" ]; then
|
|
||||||
nsxiv -i -n "${count%%:*}" -a -p -- < "$tmp"
|
|
||||||
else
|
|
||||||
# fallback incase file didn't have a valid extension, or we couldn't
|
|
||||||
# find it inside the list
|
|
||||||
nsxiv -a -p -- "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
[ "$1" = '--' ] && shift
|
|
||||||
case "$1" in
|
|
||||||
"") echo "Usage: ${0##*/} PICTURES" >&2; exit 1 ;;
|
|
||||||
/*) open_img "$1" ;;
|
|
||||||
"~"/*) open_img "$HOME/${1#"~"/}" ;;
|
|
||||||
*) open_img "$PWD/$1" ;;
|
|
||||||
esac
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
maim -su -f jpg -m 10 | xclip -selection clipboard -t image/png
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# tmux wrapper script to attach to unattached sessions and auto number session
|
|
||||||
|
|
||||||
new_session () {
|
|
||||||
n=1
|
|
||||||
sessions="$(tmux ls -F '#S' 2> /dev/null )"
|
|
||||||
while :; do
|
|
||||||
for session in $sessions; do
|
|
||||||
if [ "$n" = "$session" ]; then
|
|
||||||
n=$((n+1))
|
|
||||||
continue 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
break
|
|
||||||
done
|
|
||||||
tmux new-session -s $n 2> /dev/null
|
|
||||||
}
|
|
||||||
attach_session () {
|
|
||||||
for session in $(tmux ls -F '#{?session_attached,,#S}' 2> /dev/null); do
|
|
||||||
if [ ! -z "$session" ]; then
|
|
||||||
tmux attach -t "${session}" 2> /dev/null
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
new_session
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$1" = "-d" ]; then
|
|
||||||
SH_TMUX_PID=$(tmux show-environment | sed -n 's/^SH_TMUX_PID=//p')
|
|
||||||
kill -USR1 $SH_TMUX_PID
|
|
||||||
tmux detach-client
|
|
||||||
else
|
|
||||||
trap 'NOTMUX=y exec $SHELL' USR1
|
|
||||||
export SH_TMUX_PID=$$
|
|
||||||
|
|
||||||
if [ "$1" != "-n" ]; then
|
|
||||||
attach_session
|
|
||||||
else
|
|
||||||
new_session
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
@ -553,26 +553,6 @@ client.connect_signal("manage", function (c)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function custommaximizedbutton(c)
|
|
||||||
local widget = awful.titlebar.widget.button(c, "maximized", function(cl)
|
|
||||||
return not cl.floating and cl.first_tag and awful.layout.get(cl.first_tag.screen) == awful.layout.suit.max
|
|
||||||
end, function(cl)
|
|
||||||
if cl.floating then
|
|
||||||
cl.floating = false
|
|
||||||
if awful.layout.get(cl.first_tag.screen) ~= awful.layout.suit.max then
|
|
||||||
change_layout()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
change_layout()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
local function update()
|
|
||||||
if not c.valid then tag.disconnect_signal("property::layout", update)
|
|
||||||
else widget.update() end
|
|
||||||
end
|
|
||||||
tag.connect_signal("property::layout", update)
|
|
||||||
return widget
|
|
||||||
end
|
|
||||||
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
||||||
client.connect_signal("request::titlebars", function(c)
|
client.connect_signal("request::titlebars", function(c)
|
||||||
-- buttons for the titlebar
|
-- buttons for the titlebar
|
||||||
|
|
@ -605,7 +585,7 @@ client.connect_signal("request::titlebars", function(c)
|
||||||
},
|
},
|
||||||
{ -- Right
|
{ -- Right
|
||||||
awful.titlebar.widget.minimizebutton (c),
|
awful.titlebar.widget.minimizebutton (c),
|
||||||
custommaximizedbutton (c),
|
awful.titlebar.widget.maximizedbutton(c),
|
||||||
awful.titlebar.widget.closebutton (c),
|
awful.titlebar.widget.closebutton (c),
|
||||||
layout = wibox.layout.fixed.horizontal()
|
layout = wibox.layout.fixed.horizontal()
|
||||||
},
|
},
|
||||||
|
|
@ -617,13 +597,6 @@ end)
|
||||||
client.connect_signal("mouse::enter", function(c)
|
client.connect_signal("mouse::enter", function(c)
|
||||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||||
end)
|
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
|
|
||||||
end)
|
|
||||||
|
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
{ config, pkgs, pkgs-stable, username, homeDirectory, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
username = "ahnwuoa";
|
||||||
|
homeDirectory = "/home/${username}";
|
||||||
|
mkln = x: config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.local/nixos/user/${x}";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
./xdg.nix
|
|
||||||
./theme.nix
|
|
||||||
./bin.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home.username = username;
|
home.username = username;
|
||||||
home.homeDirectory = homeDirectory;
|
home.homeDirectory = homeDirectory;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
(pkgs.symlinkJoin {
|
(pkgs.symlinkJoin {
|
||||||
name = "firefox";
|
name = "firefox";
|
||||||
paths = [ pkgs-stable.firefox ];
|
paths = [ pkgs.stable.firefox ];
|
||||||
buildInputs = [ pkgs.makeWrapper ];
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/firefox \
|
wrapProgram $out/bin/firefox \
|
||||||
|
|
@ -31,7 +30,7 @@
|
||||||
picom
|
picom
|
||||||
obs-studio
|
obs-studio
|
||||||
screenkey
|
screenkey
|
||||||
pkgs-stable.safeeyes
|
pkgs.stable.safeeyes
|
||||||
libsForQt5.kcalc
|
libsForQt5.kcalc
|
||||||
libsForQt5.kolourpaint
|
libsForQt5.kolourpaint
|
||||||
libsForQt5.filelight
|
libsForQt5.filelight
|
||||||
|
|
@ -58,6 +57,9 @@
|
||||||
killall
|
killall
|
||||||
file
|
file
|
||||||
|
|
||||||
|
alsa-utils
|
||||||
|
libnotify
|
||||||
|
|
||||||
(python311.withPackages (python-pkgs: [
|
(python311.withPackages (python-pkgs: [
|
||||||
python-pkgs.pwntools
|
python-pkgs.pwntools
|
||||||
# python-pkgs.angr
|
# python-pkgs.angr
|
||||||
|
|
@ -86,5 +88,78 @@
|
||||||
pwninit
|
pwninit
|
||||||
patchelf
|
patchelf
|
||||||
];
|
];
|
||||||
|
xdg.configFile.alacritty.source = mkln "config/alacritty";
|
||||||
|
xdg.configFile.awesome.source = mkln "config/awesome";
|
||||||
|
xdg.configFile.bash.source = mkln "config/bash";
|
||||||
|
xdg.configFile.fcitx5.source = config/fcitx5;
|
||||||
|
xdg.configFile.fontconfig.source = config/fontconfig;
|
||||||
|
xdg.configFile."gdb/gdbinit.py".source = config/gdb/gdbinit.py;
|
||||||
|
xdg.configFile."gdb/gdbinit".text = ''
|
||||||
|
source ${pkgs.pwndbg}/share/pwndbg/gdbinit.py
|
||||||
|
source ~/.config/gdb/gdbinit.py
|
||||||
|
'';
|
||||||
|
xdg.configFile.git.source = config/git;
|
||||||
|
xdg.configFile.lsd.source = config/lsd;
|
||||||
|
xdg.configFile.picom.source = config/picom;
|
||||||
|
xdg.configFile.python.source = config/python;
|
||||||
|
xdg.configFile.qt5ct.source = config/qt5ct;
|
||||||
|
xdg.configFile.readline.source = config/readline;
|
||||||
|
xdg.configFile."starship.toml".source = config/starship.toml;
|
||||||
|
xdg.configFile.sx.source = mkln "config/sx";
|
||||||
|
xdg.configFile."tmux/tmux.conf".text = (builtins.readFile config/tmux/tmux.conf) + ''
|
||||||
|
run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp}
|
||||||
|
run ${pkgs.tmuxPlugins.sessionist.rtp}
|
||||||
|
'';
|
||||||
|
fonts.fontconfig.enable = false;
|
||||||
|
qt = {
|
||||||
|
enable = true;
|
||||||
|
platformTheme.name = "qtct";
|
||||||
|
style.name = "breeze";
|
||||||
|
style.package = pkgs.libsForQt5.breeze-qt5;
|
||||||
|
};
|
||||||
|
gtk = {
|
||||||
|
enable = true;
|
||||||
|
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||||
|
theme = {
|
||||||
|
name = "Breeze";
|
||||||
|
package = pkgs.libsForQt5.breeze-gtk;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home.pointerCursor = {
|
||||||
|
name = "breeze_cursors";
|
||||||
|
package = pkgs.libsForQt5.breeze-qt5;
|
||||||
|
size = 24;
|
||||||
|
gtk.enable = true;
|
||||||
|
};
|
||||||
|
home.file.".icons/default/index.theme".enable = false;
|
||||||
|
home.file.".icons/breeze_cursors".enable = false;
|
||||||
|
xdg.mimeApps.enable = true;
|
||||||
|
xdg.mimeApps.defaultApplications = let
|
||||||
|
image = "nsxiv.desktop";
|
||||||
|
browser = "firefox.desktop";
|
||||||
|
text = "nvim.desktop";
|
||||||
|
media = "mpv.desktop";
|
||||||
|
in {
|
||||||
|
"image/jpeg" = image;
|
||||||
|
"image/png" = image;
|
||||||
|
"image/gif" = media;
|
||||||
|
|
||||||
|
"audio/mpeg" = media;
|
||||||
|
"audio/ogg" = media;
|
||||||
|
"audio/vorbis" = media;
|
||||||
|
"audio/x-vorbis+ogg" = media;
|
||||||
|
|
||||||
|
"video/mp4" = media;
|
||||||
|
"video/mpeg" = media;
|
||||||
|
|
||||||
|
"text/plain" = text;
|
||||||
|
"application/xml" = text;
|
||||||
|
};
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
configPackages = [ pkgs.libsForQt5.xdg-desktop-portal-kde ];
|
||||||
|
extraPortals = [ pkgs.libsForQt5.xdg-desktop-portal-kde ];
|
||||||
|
config.common.default = "kde";
|
||||||
|
};
|
||||||
home.stateVersion = "24.05";
|
home.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 697 B |
|
|
@ -1,27 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
qt = {
|
|
||||||
enable = true;
|
|
||||||
platformTheme.name = "qtct";
|
|
||||||
style.name = "breeze";
|
|
||||||
style.package = pkgs.libsForQt5.breeze-qt5;
|
|
||||||
};
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
gtk2.extraConfig = "gtk-recent-files-max-age = 0";
|
|
||||||
gtk3.extraConfig = { gtk-recent-files-limit = 0; };
|
|
||||||
theme = {
|
|
||||||
name = "Breeze";
|
|
||||||
package = pkgs.libsForQt5.breeze-gtk;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home.pointerCursor = {
|
|
||||||
name = "breeze_cursors";
|
|
||||||
package = pkgs.libsForQt5.breeze-qt5;
|
|
||||||
size = 24;
|
|
||||||
gtk.enable = true;
|
|
||||||
};
|
|
||||||
home.file.".icons/default/index.theme".enable = false;
|
|
||||||
home.file.".icons/breeze_cursors".enable = false;
|
|
||||||
}
|
|
||||||
62
user/xdg.nix
62
user/xdg.nix
|
|
@ -1,62 +0,0 @@
|
||||||
{ config, pkgs, homeDirectory, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
mkln = x: config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.local/nixos/user/${x}";
|
|
||||||
in {
|
|
||||||
xdg.configFile.alacritty.source = mkln "config/alacritty";
|
|
||||||
xdg.configFile.awesome.source = mkln "config/awesome";
|
|
||||||
xdg.configFile.bash.source = mkln "config/bash";
|
|
||||||
xdg.configFile.fcitx5.source = config/fcitx5;
|
|
||||||
xdg.configFile.fontconfig.source = config/fontconfig;
|
|
||||||
xdg.configFile."gdb/gdbinit.py".source = config/gdb/gdbinit.py;
|
|
||||||
xdg.configFile."gdb/gdbinit".text = ''
|
|
||||||
source ${pkgs.pwndbg}/share/pwndbg/gdbinit.py
|
|
||||||
source ~/.config/gdb/gdbinit.py
|
|
||||||
'';
|
|
||||||
xdg.configFile.git.source = config/git;
|
|
||||||
xdg.configFile.lsd.source = config/lsd;
|
|
||||||
xdg.configFile.picom.source = config/picom;
|
|
||||||
xdg.configFile.python.source = config/python;
|
|
||||||
xdg.configFile.qt5ct.source = config/qt5ct;
|
|
||||||
xdg.configFile.readline.source = config/readline;
|
|
||||||
xdg.configFile."starship.toml".source = config/starship.toml;
|
|
||||||
xdg.configFile.sx.source = mkln "config/sx";
|
|
||||||
xdg.configFile."tmux/tmux.conf".text = (builtins.readFile config/tmux/tmux.conf) + ''
|
|
||||||
run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp}
|
|
||||||
run ${pkgs.tmuxPlugins.sessionist.rtp}
|
|
||||||
'';
|
|
||||||
fonts.fontconfig.enable = false;
|
|
||||||
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
|
||||||
xdg.dataFile."bell.wav".source = share/bell.wav;
|
|
||||||
xdg.dataFile."wallpaper.png".source = share/wallpaper.png;
|
|
||||||
xdg.dataFile."recently-used.xbel".text = "";
|
|
||||||
xdg.dataFile."RecentDocuments".text = "";
|
|
||||||
xdg.mimeApps.enable = true;
|
|
||||||
xdg.mimeApps.defaultApplications = let
|
|
||||||
image = "nsxiv.desktop";
|
|
||||||
browser = "firefox.desktop";
|
|
||||||
text = "nvim.desktop";
|
|
||||||
media = "mpv.desktop";
|
|
||||||
in {
|
|
||||||
"image/jpeg" = image;
|
|
||||||
"image/png" = image;
|
|
||||||
"image/gif" = media;
|
|
||||||
|
|
||||||
"audio/mpeg" = media;
|
|
||||||
"audio/ogg" = media;
|
|
||||||
"audio/vorbis" = media;
|
|
||||||
"audio/x-vorbis+ogg" = media;
|
|
||||||
|
|
||||||
"video/mp4" = media;
|
|
||||||
"video/mpeg" = media;
|
|
||||||
|
|
||||||
"text/plain" = text;
|
|
||||||
"application/xml" = text;
|
|
||||||
};
|
|
||||||
xdg.portal = {
|
|
||||||
enable = true;
|
|
||||||
configPackages = [ pkgs.libsForQt5.xdg-desktop-portal-kde ];
|
|
||||||
extraPortals = [ pkgs.libsForQt5.xdg-desktop-portal-kde ];
|
|
||||||
config.common.default = "kde";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue