Sudo -> run0 alias

This commit is contained in:
Henry Hiles 2025-03-17 15:06:01 -04:00
parent 91a62a686d
commit f41698a4ec
4 changed files with 17 additions and 6 deletions

View file

@ -9,6 +9,7 @@
vscodeExtensions = with vscode-extensions; [
mkhl.direnv
eamodio.gitlens
dart-code.dart-code
dart-code.flutter
jnoortheen.nix-ide
timonwong.shellcheck

View file

@ -26,9 +26,9 @@
commit = "git commit -am";
# NixOS
garbage = "run0 nix-collect-garbage -d && nix-collect-garbage -d";
rebuild = "run0 nixos-rebuild switch --flake ~/.config/nixos/#";
update = "pushd ~/.config/nixos && nix flake update && rebuild && popd";
clean = "nh clean all";
rebuild = "nh os switch";
update = "pushd ~/.config/nixos && nix flake update && popd && rebuild";
};
};
users.defaultUserShell = pkgs.fish;

7
modules/common/nh.nix Normal file
View file

@ -0,0 +1,7 @@
{
programs.nh = {
enable = true;
clean.enable = true;
flake = "/home/quadradical/.config/nixos";
};
}

View file

@ -1,4 +1,7 @@
{
security.sudo.enable = false;
security.pam.services.systemd-run0 = {};
{pkgs, ...}: {
environment.systemPackages = [(pkgs.writeShellScriptBin "sudo" "run0 $@")];
security = {
sudo.enable = false;
pam.services.systemd-run0 = {};
};
}