Skip to content

Commit

Permalink
Merge pull request ryantm#307 from codgician/fix-darwin-module
Browse files Browse the repository at this point in the history
fix: bad age.identityPaths default value on darwin, bump to macOS-latest in CI
  • Loading branch information
n8henrie authored Jan 15, 2025
2 parents f6291c5 + 4d0d81e commit e600439
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions modules/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down

0 comments on commit e600439

Please sign in to comment.