Merge pull request #307 from codgician/fix-darwin-module

fix: bad age.identityPaths default value on darwin, bump to macOS-latest in CI
This commit is contained in:
Nathan Henrie 2025-01-15 08:33:50 -07:00 committed by GitHub
commit e600439ec4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 9 deletions

View file

@ -17,10 +17,10 @@ jobs:
- run: nix fmt . -- --check
- run: nix flake check
tests-darwin:
runs-on: macos-12
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v24
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
system-features = nixos-test recursive-nix benchmark big-parallel kvm
@ -31,12 +31,17 @@ jobs:
- run: nix flake check
- name: "Install nix-darwin module"
run: |
# Determine architecture of GitHub runner
ARCH=x86_64
if [ "$(arch)" = arm64 ]; then
ARCH=aarch64
fi
# https://github.com/ryantm/agenix/pull/230#issuecomment-1867025385
sudo mv /etc/nix/nix.conf{,.bak}
nix \
--extra-experimental-features 'nix-command flakes' \
build .#checks.x86_64-darwin.integration
build .#checks."${ARCH}"-darwin.integration
./result/activate-user
sudo ./result/activate

View file

@ -228,22 +228,22 @@ in {
identityPaths = mkOption {
type = types.listOf types.path;
default =
if (config.services.openssh.enable or false)
then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys)
else if isDarwin
if isDarwin
then [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_rsa_key"
]
else if (config.services.openssh.enable or false)
then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys)
else [];
defaultText = literalExpression ''
if (config.services.openssh.enable or false)
then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys)
else if isDarwin
if isDarwin
then [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_rsa_key"
]
else if (config.services.openssh.enable or false)
then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys)
else [];
'';
description = ''