Skip to content

[FEAT] Nix flake #781

Description

@benjajaja
  • There is no nix flake, and I haven't found any for this project on github.

I created one here: https://github.com/benjajaja/nixos-rk3588/blob/main/meshmonitor/flake.nix

  {
    inputs = {
      nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
      meshmonitor.url = "github:gipsy/orange?dir=ops/meshmonitor";
      meshmonitor.inputs.nixpkgs.follows = "nixpkgs";
    };

    outputs = { nixpkgs, meshmonitor, ... }: {
      nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          meshmonitor.nixosModules.default
          {
            services.meshmonitor = {
              enable = true;
              meshtasticNodeIP = "192.168.1.100";
              adminPassword = "secretpassword";
              openFirewall = true;
            };
          }
        ];
      };
    };
  }

Many projects include a flake.nix in the project itself, keeping it up-to-date with master. However, this usually requires some work to keep it up-to-date, namely changing some hash when npm deps change. Also, if the code changes so that the nix build breaks, this must also be fixed. Usually there would be some minimum nix build job:

  # .github/workflows/nix.yml
  name: Nix build
  on: [push, pull_request]

  jobs:
    build:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v4
          with:
            submodules: true
        - uses: cachix/install-nix-action@v27
        - run: nix build

With all this, it might be a good start to simply reference github:gipsy/orange?dir=ops/meshmonitor as a 3rd party nix flake installation method. I'm not sure where this would go though, as there is no plain "installation" documentation section, but it's spread over "getting started" and "production deployment".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions