diff --git a/bin/nixos-upgrade-script.sh b/bin/nixos-operations-script.sh similarity index 85% rename from bin/nixos-upgrade-script.sh rename to bin/nixos-operations-script.sh index 1447d6c..e31a00b 100755 --- a/bin/nixos-upgrade-script.sh +++ b/bin/nixos-operations-script.sh @@ -10,15 +10,13 @@ user=$(/run/current-system/sw/bin/whoami) # Which user account to use for remainingArgs="" # All remaining arguments that haven't yet been processed (will be passed to nixos-rebuild) function usage() { - echo "nixos-rebuild Operations Script (NOS) updates your system and your flake.lock file by pulling the latest versions." + echo "The NixOS Operations Script (NOS) is a nixos-rebuild wrapper for system maintenance." echo "" echo "Running the script with no parameters performs the following operations:" - echo " 1. Pull the latest version of the config" - echo " 2. Update your flake.lock file" - echo " 3. Commit any changes back to the repository" - echo " 4. Run 'nixos-rebuild switch'." + echo " 1. Pull the latest version of your Nix config repository" + echo " 2. Run 'nixos-rebuild switch'." echo "" - echo "Advanced usage: nixos-upgrade-script.sh [-o|--operation operation] [-f|--flake path-to-flake] [extra nixos-rebuild parameters]" + echo "Advanced usage: nixos-operations-script.sh [-o|--operation operation] [-f|--flake path-to-flake] [extra nixos-rebuild parameters]" echo "Options:" echo " -h, --help Show this help screen." echo " -o, --operation The nixos-rebuild operation to perform." diff --git a/modules/common.nix b/modules/common.nix index 0560761..33512bf 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -18,7 +18,7 @@ ]; # Install the nos helper script - aux.system.nixos-upgrade-script.enable = true; + aux.system.nixos-operations-script.enable = true; nixpkgs.overlays = [ (final: _prev: { diff --git a/modules/services/autoupgrade.nix b/modules/services/autoupgrade.nix index 00b7773..63c3107 100644 --- a/modules/services/autoupgrade.nix +++ b/modules/services/autoupgrade.nix @@ -54,7 +54,7 @@ in ]; # Deploy update script - aux.system.nixos-upgrade-script.enable = true; + aux.system.nixos-operations-script.enable = true; # Pull and apply updates. systemd = { @@ -66,7 +66,7 @@ in path = config.aux.system.corePackages; unitConfig.RequiresMountsFor = cfg.configDir; script = lib.strings.concatStrings [ - "/run/current-system/sw/bin/nixos-upgrade-script --operation ${cfg.operation} " + "/run/current-system/sw/bin/nixos-operations-script --operation ${cfg.operation} " (lib.mkIf (cfg.configDir != "") "--flake ${cfg.configDir} ").content (lib.mkIf (cfg.user != "") "--user ${cfg.user} ").content (lib.mkIf (cfg.pushUpdates) "--update ").content diff --git a/modules/system/nix.nix b/modules/system/nix.nix index b57913e..610ee69 100644 --- a/modules/system/nix.nix +++ b/modules/system/nix.nix @@ -10,8 +10,8 @@ let cfg = config.aux.system; - nixos-upgrade-script = pkgs.writeShellScriptBin "nixos-upgrade-script" ( - builtins.readFile ../../bin/nixos-upgrade-script.sh + nixos-operations-script = pkgs.writeShellScriptBin "nixos-operations-script" ( + builtins.readFile ../../bin/nixos-operations-script.sh ); in { @@ -23,7 +23,7 @@ in type = lib.types.str; default = "monthly"; }; - nixos-upgrade-script.enable = lib.mkEnableOption "Installs the nos (nixos-upgrade-script) helper script."; + nixos-operations-script.enable = lib.mkEnableOption "Installs the nos (nixos-operations-script) helper script."; }; }; config = lib.mkMerge [ @@ -79,9 +79,9 @@ in # Support for standard, dynamically-linked executables programs.nix-ld.enable = true; } - (lib.mkIf cfg.nixos-upgrade-script.enable { + (lib.mkIf cfg.nixos-operations-script.enable { # Enable and configure NOS - aux.system.packages = [ nixos-upgrade-script ]; + aux.system.packages = [ nixos-operations-script ]; environment.variables."FLAKE_DIR" = config.secrets.nixConfigFolder; }) ]; diff --git a/modules/users/aires/default.nix b/modules/users/aires/default.nix index 1d11444..53526d1 100644 --- a/modules/users/aires/default.nix +++ b/modules/users/aires/default.nix @@ -94,7 +94,7 @@ in theme = "gentoo"; }; shellAliases = { - nos = "nixos-upgrade-script"; + nos = "nixos-operations-script"; z = "zellij"; update = "upgrade"; upgrade = "nos"; diff --git a/modules/users/root/default.nix b/modules/users/root/default.nix index 9eb4b3f..14b53e1 100644 --- a/modules/users/root/default.nix +++ b/modules/users/root/default.nix @@ -5,12 +5,16 @@ imports = [ ../common/home-manager/git-crypt.nix ]; home.stateVersion = "24.05"; programs = { + git.extraConfig = { + safe.directory = "${config.secrets.nixConfigFolder}/.git"; + }; ssh = { enable = true; matchBlocks = config.secrets.users.root.sshConfig; }; - git.extraConfig = { - safe.directory = "${config.secrets.nixConfigFolder}/.git"; + zsh = { + oh-my-zsh.theme = "kardan"; + shellAliases.nos = "nixos-operations-script"; }; }; };