fix: use ssh-askpass to use gparted

This commit is contained in:
matt1432 2023-06-20 15:35:36 +02:00
parent 67f1a68090
commit 0934df7b6f
2 changed files with 44 additions and 147 deletions

View file

@ -6,6 +6,16 @@
<home-manager/nixos>
];
# Define a user account. Don't forget to set a password with 'passwd'.
users.users.matt = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "adm" "mlocate" "video" ];
# packages = with pkgs; [
# firefox
# tree
# ];
};
home-manager.useGlobalPkgs = true;
programs.dconf.enable = true;
@ -27,7 +37,6 @@
home.packages = with pkgs;
(with xorg; [
xhost # for gparted
xcursorthemes
]) ++
@ -37,10 +46,18 @@
]) ++
(with plasma5Packages; [
polkit-kde-agent
qtstyleplugin-kvantum
breeze-icons
dolphin # install plugins
kio-admin # dbus issues
dolphin
dolphin-plugins
ffmpegthumbs
kio-admin # needs to be both here and in system pkgs
ark
kcharselect
#kdenlive
kmime
okular
]) ++
(with gnome; [
@ -59,14 +76,11 @@
neofetch
photoqt
progress
tlp
wl-color-picker # add bind for this in hyprland
xclip
xdg-utils
zathura # set default
pavucontrol # TODO: open on left click
gimp-with-plugins
gparted # doesn't open without sudo
jdk8_headless
bluez-tools
spotify
@ -97,7 +111,6 @@
swayidle
wl-clipboard
cliphist
polkit-kde-agent
gtklock
gtklock-playerctl-module
gtklock-powerbar-module
@ -115,10 +128,26 @@
squeekboard
glib
appimage-run
gparted # doesn't open without sudo
(writeShellScriptBin "Gparted" ''
(
sleep 0.5
while killall -r -0 ksshaskpass > /dev/null 2>&1
do
sleep 0.1
if [[ $(hyprctl activewindow | grep Ksshaskpas) == "" ]]; then
killall -r ksshaskpass
fi
done
) &
exec sudo -k -EA '${gparted}/bin/${gparted.pname}' "$@"
'')
];
home.sessionVariables = {
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:\$XDG_DATA_DIRS";
SUDO_ASKPASS= "${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}";
};
imports = [
@ -133,8 +162,11 @@
];
extraConfig = ''
exec-once = ${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1
source = ~/.config/hypr/main.conf
env = XDG_DATA_DIRS, ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:$XDG_DATA_DIRS
env = SUDO_ASKPASS, ${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname}
'';
};

View file

@ -4,78 +4,22 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./overlays/list.nix
./cfg/boot.nix
./cfg/security.nix
./cfg/extra-hardware.nix
./overlays/list.nix
./cfg/services.nix
./cfg/packages.nix
./cfg/home-manager.nix
];
services.xserver = {
enable = true;
layout = "ca";
displayManager = {
gdm.enable = true;
gdm.wayland = true;
sessionPackages = [ pkgs.hyprland pkgs.gnome.gnome-session.sessions ];
};
};
services.locate = {
enable = true;
interval = "hourly";
prunePaths = [
"/tmp"
"/var/tmp"
"/var/cache"
"/var/lock"
"/var/run"
"/var/spool"
"/nix/var/log/nix"
"/proc"
];
};
programs.tmux = {
enable = true;
keyMode = "vi";
terminal = "screen-256color";
newSession = true;
historyLimit = 30000;
extraConfig = ''
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
set -g mouse on
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
'';
};
programs.git = { # TODO: make better config
enable = true;
lfs.enable = true;
};
programs.htop = {
enable = true;
};
programs.fzf = {
fuzzyCompletion = true;
keybindings = true;
};
networking.hostName = "wim";
networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd";
# Set your time zone.
time.timeZone = "America/Montreal";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
#time.timeZone = "America/Montreal";
time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
@ -85,88 +29,9 @@
#useXkbConfig = true; # use xkbOptions in tty.
};
virtualisation = {
waydroid.enable = true;
lxd.enable = true;
};
services.dbus.enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [
pkgs.xdg-desktop-portal-hyprland
];
services.flatpak.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with 'passwd'.
users.users.matt = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "adm" "mlocate" "video" ];
# packages = with pkgs; [
# firefox
# tree
# ];
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
# List packages in root user PATH
environment.systemPackages = with pkgs; [
wl-clipboard
alsa-utils
wget
tree
rsync
killall
ripgrep-all
neovim # TODO: use nix
imagemagick
usbutils
evtest
];
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
#emoji = [ "Noto Color Emoji" ];
#monospace = [ "MesloLGS Nerd Font" ];
#sansSerif = [ "MesloLGS Nerd Font" ];
#serif = [ "MesloLGS Nerd Font" ];
};
};
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" "Go-Mono" "Iosevka" "NerdFontsSymbolsOnly" "SpaceMono" "Ubuntu" ]; })
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
font-awesome
meslo-lgs-nf
jetbrains-mono
#google-fonts
ubuntu_font_family
];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
};
# TODO: see if setting them in Hyprland.nix works
environment.sessionVariables = {