nik-nox
February 16, 2026, 5:38am
1
Hello! I want to try this sudo clone called please:
Project’s homepage:
please, a sudo clone
This is what I’m using in my NixOS config (no flakes):
security.please = {
enable = true;
settings = {
nik_run_any_as_root = {
name = "nik";
require_pass = true;
rule = ".*";
target = "root";
type = "run";
permit_env = "NIX_PATH";
};
};
};
Everything else works as expected but I can’t rebuild my system, it shows:
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.nixos-rebuild --no-out-link' returned non-zero exit status 1.
Can someone help me fix this? I can’t seem to figure out what am I doing wrong. Thanks.
TLATER
February 16, 2026, 6:57am
2
Can you share the rest of your configuration, as well as nix-channel --list and - I guess - please nix-channel list? Maybe also env and please env?
I suspect please cleans up your environment and you’re missing stuff in NIX_PATH or something along those lines.
NobbZ
February 16, 2026, 8:09am
3
Or it doesn’t adhere to PAM controlled env, and is therefore doing the wrong thing, similar to the issues we have with doas.
Also dear nik-nox, please do not crosspost.
You received the very same questions in the discord as well. Basically increasing in doing 2 poeple the same work for no reaason.
nik-nox
February 16, 2026, 10:42am
5
Discourse doesn’t seem to be as active so I thought posting on unofficial communities would be a good idea. Sorry about that.
So there’s no solution for it yet unless upstream project makes the desired changes right?
NobbZ
February 16, 2026, 10:44am
6
So far we do not know what the issue is, but only do have some assumption. And I do not know what requested changes you are talking about.
TLATER
February 16, 2026, 11:52am
7
Almost every post gets a reply within 24 hours. The ones that don’t are seen, but too niche or open-ended. Your issue is quite simple, if you’d actually give us the info we ask for.
If discord seems more active, that’s likely because it’s a chat platform that some people abuse as a help forum; yes, there will be lots of chatter, that’s the exact point of a chat platform. That by itself won’t help you get answers faster; people aren’t there primarily to help you out.
4 Likes
nik-nox
February 16, 2026, 3:31pm
8
That was my observation from very little time here so you might be right.
Here’s my config: paaster
nix-channel –list gives no output, with please:
nixos https://channels.nixos.org/nixos-25.11
nixos-unstable https://nixos.org/channels/nixos-unstable
env
SHELL=/run/current-system/sw/bin/zsh
HYPRLAND_CMD=/run/current-system/sw/bin/hyprland
XDG_CONFIG_DIRS=/etc/xdg:/home/nik/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/nik/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/nik/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg
NIX_LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib
XDG_BACKEND=wayland
_P9K_TTY=/dev/pts/0
LC_ADDRESS=en_IN
LC_NAME=en_IN
P9K_TTY=old
XCURSOR_PATH=/home/nik/.icons:/home/nik/.local/share/icons:/home/nik/.nix-profile/share/icons:/home/nik/.nix-profile/share/pixmaps:/nix/profile/share/icons:/nix/profile/share/pixmaps:/home/nik/.local/state/nix/profile/share/icons:/home/nik/.local/state/nix/profile/share/pixmaps:/etc/profiles/per-user/nik/share/icons:/etc/profiles/per-user/nik/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps
LC_MONETARY=en_IN
HL_INITIAL_WORKSPACE_TOKEN=b4d68458-32c1-4d9e-b154-08f70f8db6c5
NO_AT_BRIDGE=1
XCURSOR_SIZE=24
EDITOR=nano
XDG_SEAT=seat0
NAUTILUS_4_EXTENSION_DIR=/nix/store/c71fvh9pb93zyi61wa2q1kzpmik1z9hd-nautilus-python-4.1.0/lib/nautilus/extensions-4
PWD=/home/nik
NIX_PROFILES=/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/nik /home/nik/.local/state/nix/profile /nix/profile /home/nik/.nix-profile
LOGNAME=nik
XDG_SESSION_TYPE=wayland
NIX_PATH=/home/nik/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
NIXPKGS_CONFIG=/etc/nix/nixpkgs-config.nix
HOME=/home/nik
SSH_ASKPASS=
LANG=en_IN
LC_PAPER=en_IN
NIXOS_OZONE_WL=1
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=8
_JAVA_AWT_WM_NONREPARENTING=1
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:.7z=01;31: .ace=01;31:.alz=01;31: .apk=01;31:.arc=01;31: .arj=01;31:.bz=01;31: .bz2=01;31:.cab=01;31: .cpio=01;31:.crate=01;31: .deb=01;31:.drpm=01;31: .dwm=01;31:.dz=01;31: .ear=01;31:.egg=01;31: .esd=01;31:.gz=01;31: .jar=01;31:.lha=01;31: .lrz=01;31:.lz=01;31: .lz4=01;31:.lzh=01;31: .lzma=01;31:.lzo=01;31: .pyz=01;31:.rar=01;31: .rpm=01;31:.rz=01;31: .sar=01;31:.swm=01;31: .t7z=01;31:.tar=01;31: .taz=01;31:.tbz=01;31: .tbz2=01;31:.tgz=01;31: .tlz=01;31:.txz=01;31: .tz=01;31:.tzo=01;31: .tzst=01;31:.udeb=01;31: .war=01;31:.whl=01;31: .wim=01;31:.xz=01;31: .z=01;31:.zip=01;31: .zoo=01;31:.zst=01;31: .avif=01;35:.jpg=01;35: .jpeg=01;35:.jxl=01;35: .mjpg=01;35:.mjpeg=01;35: .gif=01;35:.bmp=01;35: .pbm=01;35:.pgm=01;35: .ppm=01;35:.tga=01;35: .xbm=01;35:.xpm=01;35: .tif=01;35:.tiff=01;35: .png=01;35:.svg=01;35: .svgz=01;35:.mng=01;35: .pcx=01;35:.mov=01;35: .mpg=01;35:.mpeg=01;35: .m2v=01;35:.mkv=01;35: .webm=01;35:.webp=01;35: .ogm=01;35:.mp4=01;35: .m4v=01;35:.mp4v=01;35: .vob=01;35:.qt=01;35: .nuv=01;35:.wmv=01;35: .asf=01;35:.rm=01;35: .rmvb=01;35:.flc=01;35: .avi=01;35:.fli=01;35: .flv=01;35:.gl=01;35: .dl=01;35:.xcf=01;35: .xwd=01;35:.yuv=01;35: .cgm=01;35:.emf=01;35: .ogv=01;35:.ogx=01;35: .aac=00;36:.au=00;36: .flac=00;36:.m4a=00;36: .mid=00;36:.midi=00;36: .mka=00;36:.mp3=00;36: .mpc=00;36:.ogg=00;36: .ra=00;36:.wav=00;36: .oga=00;36:.opus=00;36: .spx=00;36:.xspf=00;36: ~=00;90:#=00;90: .bak=00;90:.crdownload=00;90: .dpkg-dist=00;90:.dpkg-new=00;90: .dpkg-old=00;90:.dpkg-tmp=00;90: .old=00;90:.orig=00;90: .part=00;90:.rej=00;90: .rpmnew=00;90:.rpmorig=00;90: .rpmsave=00;90:.swp=00;90: .tmp=00;90:.ucf-dist=00;90: .ucf-new=00;90:*.ucf-old=00;90:
XDG_CURRENT_DESKTOP=Hyprland
WAYLAND_DISPLAY=wayland-1
GIO_EXTRA_MODULES=/nix/store/0fgzpacpdr0qhvk6k8sf1aawh7d5ghk5-gvfs-1.58.0/lib/gio/modules:/nix/store/9ry3b1n6g4x9yb3ysgdaq8zadhb4lvkk-dconf-0.49.0-lib/lib/gio/modules
GTK_A11Y=none
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/nik
INFOPATH=/home/nik/.nix-profile/info:/home/nik/.nix-profile/share/info:/nix/profile/info:/nix/profile/share/info:/home/nik/.local/state/nix/profile/info:/home/nik/.local/state/nix/profile/share/info:/etc/profiles/per-user/nik/info:/etc/profiles/per-user/nik/share/info:/nix/var/nix/profiles/default/info:/nix/var/nix/profiles/default/share/info:/run/current-system/sw/info:/run/current-system/sw/share/info
XDG_SESSION_CLASS=user
TERM=foot
LC_IDENTIFICATION=en_IN
GTK_PATH=/home/nik/.nix-profile/lib/gtk-2.0:/home/nik/.nix-profile/lib/gtk-3.0:/home/nik/.nix-profile/lib/gtk-4.0:/nix/profile/lib/gtk-2.0:/nix/profile/lib/gtk-3.0:/nix/profile/lib/gtk-4.0:/home/nik/.local/state/nix/profile/lib/gtk-2.0:/home/nik/.local/state/nix/profile/lib/gtk-3.0:/home/nik/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/nik/lib/gtk-2.0:/etc/profiles/per-user/nik/lib/gtk-3.0:/etc/profiles/per-user/nik/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0
USER=nik
TZDIR=/etc/zoneinfo
NIX_LD=/run/current-system/sw/share/nix-ld/lib/ld.so
HYPRLAND_INSTANCE_SIGNATURE=unknown_1771064743_407551447
MANPAGER=sh -c ‘sed -u -e “s/\x1B[[0-9;]*m//g; s/.\x08//g” | bat -p -lman’
DISPLAY=:0
SHLVL=2
MOZ_ENABLE_WAYLAND=1
PAGER=less
LC_TELEPHONE=en_IN
QTWEBKIT_PLUGIN_PATH=/home/nik/.nix-profile/lib/mozilla/plugins/:/nix/profile/lib/mozilla/plugins/:/home/nik/.local/state/nix/profile/lib/mozilla/plugins/:/etc/profiles/per-user/nik/lib/mozilla/plugins/:/nix/var/nix/profiles/default/lib/mozilla/plugins/:/run/current-system/sw/lib/mozilla/plugins/
LC_MEASUREMENT=en_IN
_P9K_SSH_TTY=/dev/pts/0
__NIXOS_SET_ENVIRONMENT_DONE=1
XDG_VTNR=1
XDG_SESSION_ID=1
LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
LESSKEYIN_SYSTEM=/nix/store/fmlw8j2rnkdvi74hhidkz74dfaw0dhah-lessconfig
TERMINFO_DIRS=/home/nik/.nix-profile/share/terminfo:/nix/profile/share/terminfo:/home/nik/.local/state/nix/profile/share/terminfo:/etc/profiles/per-user/nik/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo
XDG_RUNTIME_DIR=/run/user/1000
NIX_XDG_DESKTOP_PORTAL_DIR=/run/current-system/sw/share/xdg-desktop-portal/portals
LC_TIME=en_IN
XDG_DATA_DIRS=/home/nik/.nix-profile/share:/nix/profile/share:/home/nik/.local/state/nix/profile/share:/etc/profiles/per-user/nik/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share
HUSHLOGIN=FALSE
LIBEXEC_PATH=/home/nik/.nix-profile/libexec:/nix/profile/libexec:/home/nik/.local/state/nix/profile/libexec:/etc/profiles/per-user/nik/libexec:/nix/var/nix/profiles/default/libexec:/run/current-system/sw/libexec
PATH=/run/wrappers/bin:/home/nik/.nix-profile/bin:/nix/profile/bin:/home/nik/.local/state/nix/profile/bin:/etc/profiles/per-user/nik/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/nik/.lmstudio/bin:/nix/store/q464imnlzzwwrnv98iclp9f7zfi4a1z2-binutils-wrapper-2.44/bin:/nix/store/a9b9a5ng6id99illxvxdrn4rwlsq0ygl-hyprland-qtutils-0.1.5/bin:/nix/store/hnif0bxpp0p4w3h7gdfmaglmgk0dp6x8-pciutils-3.14.0/bin:/nix/store/pdffzr7kinwlr0mwan5hrh09rvcfldy8-pkgconf-wrapper-2.4.3/bin:/home/nik/.lmstudio/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
LC_NUMERIC=en_IN
OLDPWD=/home/nik
HYPRCURSOR_SIZE=24
_=/run/current-system/sw/bin/env
COLORTERM=truecolor
TERMINFO=/nix/store/h6b95pg56xrq3sagzrsdzaxm4550ilx1-foot-1.25.0-terminfo/share/terminfo
P9K_SSH=0
please env
LOGNAME=root
LANG=en_IN
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:.7z=01;31: .ace=01;31:.alz=01;31: .apk=01;31:.arc=01;31: .arj=01;31:.bz=01;31: .bz2=01;31:.cab=01;31: .cpio=01;31:.crate=01;31: .deb=01;31:.drpm=01;31: .dwm=01;31:.dz=01;31: .ear=01;31:.egg=01;31: .esd=01;31:.gz=01;31: .jar=01;31:.lha=01;31: .lrz=01;31:.lz=01;31: .lz4=01;31:.lzh=01;31: .lzma=01;31:.lzo=01;31: .pyz=01;31:.rar=01;31: .rpm=01;31:.rz=01;31: .sar=01;31:.swm=01;31: .t7z=01;31:.tar=01;31: .taz=01;31:.tbz=01;31: .tbz2=01;31:.tgz=01;31: .tlz=01;31:.txz=01;31: .tz=01;31:.tzo=01;31: .tzst=01;31:.udeb=01;31: .war=01;31:.whl=01;31: .wim=01;31:.xz=01;31: .z=01;31:.zip=01;31: .zoo=01;31:.zst=01;31: .avif=01;35:.jpg=01;35: .jpeg=01;35:.jxl=01;35: .mjpg=01;35:.mjpeg=01;35: .gif=01;35:.bmp=01;35: .pbm=01;35:.pgm=01;35: .ppm=01;35:.tga=01;35: .xbm=01;35:.xpm=01;35: .tif=01;35:.tiff=01;35: .png=01;35:.svg=01;35: .svgz=01;35:.mng=01;35: .pcx=01;35:.mov=01;35: .mpg=01;35:.mpeg=01;35: .m2v=01;35:.mkv=01;35: .webm=01;35:.webp=01;35: .ogm=01;35:.mp4=01;35: .m4v=01;35:.mp4v=01;35: .vob=01;35:.qt=01;35: .nuv=01;35:.wmv=01;35: .asf=01;35:.rm=01;35: .rmvb=01;35:.flc=01;35: .avi=01;35:.fli=01;35: .flv=01;35:.gl=01;35: .dl=01;35:.xcf=01;35: .xwd=01;35:.yuv=01;35: .cgm=01;35:.emf=01;35: .ogv=01;35:.ogx=01;35: .aac=00;36:.au=00;36: .flac=00;36:.m4a=00;36: .mid=00;36:.midi=00;36: .mka=00;36:.mp3=00;36: .mpc=00;36:.ogg=00;36: .ra=00;36:.wav=00;36: .oga=00;36:.opus=00;36: .spx=00;36:.xspf=00;36: ~=00;90:#=00;90: .bak=00;90:.crdownload=00;90: .dpkg-dist=00;90:.dpkg-new=00;90: .dpkg-old=00;90:.dpkg-tmp=00;90: .old=00;90:.orig=00;90: .part=00;90:.rej=00;90: .rpmnew=00;90:.rpmorig=00;90: .rpmsave=00;90:.swp=00;90: .tmp=00;90:.ucf-dist=00;90: .ucf-new=00;90:*.ucf-old=00;90:
TERM=foot
DISPLAY=:0
PLEASE_USER=nik
PLEASE_UID=1000
PLEASE_GID=100
PLEASE_COMMAND=/run/current-system/sw/bin/env
SUDO_USER=nik
SUDO_UID=1000
SUDO_GID=100
SUDO_COMMAND=/run/current-system/sw/bin/env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOME=/root
MAIL=/var/mail/root
SHELL=/run/current-system/sw/bin/zsh
USER=root
TLATER
February 16, 2026, 5:53pm
9
Yep, looks like the $NIX_PATH isn’t inherited, and since you’re using nixos rather than nixpkgs the fallback isn’t used (I believe, I forgot once again exactly how those fit together). @NobbZ is likely right that this has to do with PAM env setting, which I’d wager is deliberately not implemented by please.
AFAICT, the short term fix is to use:
please -a NIX_PATH nixos-rebuild
Since the setting in please.ini only allows passing through the variable, it doesn’t do so by default.
Longer term you’d need to convince either upstream to support the other. Perhaps please could get a wrapper that adds the NIX_PATH, but technically that’s unclean since the root user’s NIX_PATH can differ.
Personally, I’d just go with sudo-rs or run0, you should have fewer integration problems with those.
1 Like
nik-nox
February 17, 2026, 7:29am
10
Got it. Thanks so much for your assistance.
run0 is annoying because it doesn’t have persistence and calls for polkit agent. I’ll give sudo-rs a try.