Skip to content

Latest Version Of Morph(1.8) Breaks CI #228

@bdkiran

Description

@bdkiran

I set up a GitHub actions that deploys to my virtual machines running in digital ocean, this has been running fine over the past couple of months until a few days ago when the 1.8 Version of Morph was released.

I'm getting the error when running the morph deploy network.nix switch command. This is being run in a Nix Shell on ubuntu:

       error: Neither nixpkgs.hostPlatform nor the legacy option nixpkgs.system has been set.
       You can set nixpkgs.hostPlatform in hardware-configuration.nix by re-running
       a recent version of nixos-generate-config.
       The option nixpkgs.system is still fully supported for NixOS 22.05 interoperability,
       but will be deprecated in the future, so we recommend to set nixpkgs.hostPlatform.
Error while running `nix-instantiate ..`: exit status 1

My understanding is that some nixpkgs.hostPlatform or nixpkgs.system needs to be set but is this option available in a nix-shell? Maybe there is a flag I can set on my nix-shell to emulate this.

Here is my deployment yaml for github actions

name: infra-deployment

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Code
      uses: actions/checkout@v4

    - name: Add SSH key
      env:
        SSH_AUTH_SOCK: /tmp/ssh_agent.sock
      run: |
          setup ssh keys
    
    - name: Install Nix On Runner
      uses: cachix/install-nix-action@v30
      with:
        nix_path: nixpkgs=channel:nixos-24.05-small

    - name: Deploy to Production
      uses: workflow/nix-shell-action@v3
      env:
        SSH_AUTH_SOCK: /tmp/ssh_agent.sock
      with:
        packages: morph
        script: |
          morph deploy network.nix switch

I understand that this is not a common use case of this package but I would like to resolve it. I would gladly contribute my workflows for others that want to do similar things in their pipelines. It has really helped me set up CI/CD in my nix server workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions