diff --git a/modules/services/autoupgrade.nix b/modules/services/autoupgrade.nix index 344539f..d7bf297 100644 --- a/modules/services/autoupgrade.nix +++ b/modules/services/autoupgrade.nix @@ -31,6 +31,15 @@ in type = lib.types.bool; description = "Enables automatic system updates."; }; + branches = lib.mkOption { + type = lib.types.attrs; + description = "Which local and remote branches to compare."; + default = { + local = "main"; + remote = "main"; + remoteName = "origin"; + }; + }; configDir = lib.mkOption { type = lib.types.str; description = "Path where your NixOS configuration files are stored."; @@ -70,7 +79,7 @@ in # Check if there are changes from Git. echo "Pulling latest version..." sudo -u ${cfg.user} git fetch - sudo -u ${cfg.user} git diff --quiet --exit-code || true + sudo -u ${cfg.user} git diff --quiet --exit-code ${cfg.branches.local} ${cfg.branches.remoteName}/${cfg.branches.remote} || true # If we have changes (git diff returns 1), pull changes and run the update if [ $? -eq 1 ]; then echo "Updates found, running nixos-rebuild..." diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 1a393dd..e88e287 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -8,7 +8,7 @@ in host.services.ssh = { enable = lib.mkEnableOption (lib.mdDoc "Enables SSH server."); ports = lib.mkOption { - default = [ ]; + default = [ 22 ]; type = lib.types.listOf lib.types.int; description = "Ports for SSH to listen on."; };