From ba3c46b8f4ebb351c28492d2b83d807be4fac9fe Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Thu, 4 Jan 2024 20:55:43 +0000 Subject: [PATCH] beatific: alias cp to -rp --- modules/beatific.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/beatific.nix b/modules/beatific.nix index 0eadd72..d4a758c 100644 --- a/modules/beatific.nix +++ b/modules/beatific.nix @@ -53,8 +53,15 @@ in { # Options to always set networking.hostName = cfg.hostName; nix.extraOptions = "experimental-features = nix-command flakes"; + # Link /etc/nixos to the flake source environment.etc.nixos.source = ./..; - environment.shellAliases.nr = "sudo nixos-rebuild --flake $HOME/nixos-configs"; + environment.shellAliases = { + # Shortcut for nixos-rebuild + nr = "sudo nixos-rebuild --flake $HOME/nixos-configs"; + # Set some user-friendly defaults (use e.g. "command cp" to skip the alias) + # -r (recursively copy dirs) -p (preserve mode, ownership, timestamps) + cp = "cp -rp"; + }; security.sudo.extraRules = [{ users = [ "tvb" ]; commands = [ { command = "/run/current-system/sw/bin/nixos-rebuild"; options = [ "NOPASSWD" ]; } ];