Compare commits

...

2 Commits

Author SHA1 Message Date
3c63ae7741 refactor: overlay 2025-07-04 21:32:45 +08:00
e79ed0f643 feat(doas): add sudo wrapper 2025-07-04 21:32:35 +08:00
3 changed files with 14 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ lib.my.makeHomeProgramConfig {
name = "monospace"; name = "monospace";
size = 14; size = 14;
}; };
shellIntegration.mode = "no-cursor no-sudo";
extraConfig = '' extraConfig = ''
include ${./tokyonight-storm.conf} include ${./tokyonight-storm.conf}
''; '';

View File

@@ -35,20 +35,22 @@ lib.my.makeSwitch {
}; };
users.users.root.hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path; users.users.root.hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path;
security.sudo.enable = false;
security.doas = { security.doas = {
enable = true; enable = true;
extraRules = [ extraRules = [
{ {
users = [ username ]; users = [ username ];
noPass = true; noPass = true;
keepEnv = true;
} }
]; ];
}; };
environment.shellAliases = { environment.shellAliases = {
sudo = "doas";
sudoedit = "doasedit"; sudoedit = "doasedit";
}; };
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellScriptBin "sudo" ''exec doas "$@"'')
(pkgs.writeShellScriptBin "doasedit" '' (pkgs.writeShellScriptBin "doasedit" ''
if [ -n "''${2}" ]; then if [ -n "''${2}" ]; then
printf 'Expected only one argument\n' printf 'Expected only one argument\n'

View File

@@ -14,15 +14,17 @@
) )
''; '';
sing-box.__output.version.__assign = "unstable-2024-08-16"; sing-box.__assign = infuse prev.sing-box {
sing-box.__output.src.__assign = final.fetchFromGitHub { version.__assign = "unstable-2024-08-16";
src.__assign = final.fetchFromGitHub {
owner = "PuerNya"; owner = "PuerNya";
repo = "sing-box"; repo = "sing-box";
rev = "067c81a73e1fb7b6edbc58e6b06b8b943fa6c40a"; rev = "067c81a73e1fb7b6edbc58e6b06b8b943fa6c40a";
hash = "sha256-03mkClYVAfAatfYJ1OuM1OvABj/fgbseqK8jPbBtI8g="; hash = "sha256-03mkClYVAfAatfYJ1OuM1OvABj/fgbseqK8jPbBtI8g=";
}; };
sing-box.__output.vendorHash.__assign = "sha256-ZWFZkVRtybQAK9oZRIMBGeDfxXTV7kzXwNSbkvslMFk="; vendorHash.__assign = "sha256-ZWFZkVRtybQAK9oZRIMBGeDfxXTV7kzXwNSbkvslMFk=";
sing-box.__output.postInstall.__assign = ""; postInstall.__assign = "";
};
}; };
# this allows us to access specific version of nixpkgs # this allows us to access specific version of nixpkgs