Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

om show should display system configurations #161

Closed
Tracked by #162
srid opened this issue Jul 17, 2024 · 6 comments · Fixed by #166
Closed
Tracked by #162

om show should display system configurations #161

srid opened this issue Jul 17, 2024 · 6 comments · Fixed by #166
Labels
enhancement New feature or request

Comments

@srid
Copy link
Member

srid commented Jul 17, 2024

om show should display nixosConfigurations and darwinConfigurations as well. Currently it doesn't:

image
@srid srid added the enhancement New feature or request label Jul 17, 2024
@srid srid mentioned this issue Jul 17, 2024
9 tasks
@shivaraj-bh
Copy link
Member

https://github.com/srid/nixos-config/blob/ab552c356dfb19fdea55ae700b4963750b498b99/flake.nix#L51-L53 darwinConfigurations is present but doesn’t show up in nix flake show github:srid/nixos-config —json:

{
  "checks": {
    "aarch64-darwin": {
      "treefmt": {
        "name": "treefmt-check",
        "type": "derivation"
      }
    },
    "aarch64-linux": {
      "treefmt": {}
    },
    "x86_64-linux": {
      "treefmt": {}
    }
  },
  "darwinConfigurations": {
    "type": "unknown"
  },
  "darwinModules": {
    "type": "unknown"
  },
  "darwinModules_": {
    "type": "unknown"
  },
  "devShells": {
    "aarch64-darwin": {
      "default": {
        "name": "nix-shell",
        "type": "derivation"
      }
    },
    "aarch64-linux": {
      "default": {}
    },
    "x86_64-linux": {
      "default": {}
    }
  },
  "formatter": {
    "aarch64-darwin": {
      "description": "one CLI to format the code tree",
      "name": "treefmt",
      "type": "derivation"
    },
    "aarch64-linux": {},
    "x86_64-linux": {}
  },
  "homeModules": {
    "type": "unknown"
  },
  "legacyPackages": {
    "aarch64-darwin": {},
    "aarch64-linux": {},
    "x86_64-linux": {}
  },
  "nixos-flake": {
    "type": "unknown"
  },
  "nixosConfigurations": {
    "immediacy": {
      "type": "nixos-configuration"
    }
  },
  "nixosModules": {
    "common": {
      "type": "nixos-module"
    },
    "default": {
      "type": "nixos-module"
    },
    "home-manager": {
      "type": "nixos-module"
    },
    "my-home": {
      "type": "nixos-module"
    },
    "nixosFlake": {
      "type": "nixos-module"
    }
  },
  "packages": {
    "aarch64-darwin": {
      "activate": {
        "description": "Activate NixOS/nix-darwin/home-manager configurations",
        "name": "activate",
        "type": "derivation"
      },
      "default": {
        "description": "Activate NixOS/nix-darwin/home-manager configurations",
        "name": "activate",
        "type": "derivation"
      },
      "update": {
        "name": "update-main-flake-inputs",
        "type": "derivation"
      }
    },
    "aarch64-linux": {
      "activate": {},
      "default": {},
      "update": {}
    },
    "x86_64-linux": {
      "activate": {},
      "default": {},
      "update": {}
    }
  }
}

Is it because the type is unknown and nix doesn’t recognise it? how else should we fetch darwinConfigurations?

@shivaraj-bh
Copy link
Member

darwinConfigurations falls under Known but unchecked community attribute:
https://github.com/NixOS/nix/blob/8ce4287409319e04f46ed1352deb956c30e35fc6/src/nix/flake.cc#L774-L786

@srid
Copy link
Member Author

srid commented Jul 18, 2024

We could adopt https://github.com/DeterminateSystems/flake-schemas which does (or is designed to) recognize it.

EDIT: I believe FlakeHub itself uses it.

@srid
Copy link
Member Author

srid commented Jul 18, 2024

/// TODO: Use <https://github.com/DeterminateSystems/flake-schemas>
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct FlakeSchema {

@srid
Copy link
Member Author

srid commented Jul 18, 2024

Easiest way to use flake-schemas probably is to use their fork of Nix, just for nix flake show:

NixOS/nix#8892

(Until it gets upstreamed)

@shivaraj-bh
Copy link
Member

nixosConfigurations based on the current flake output schema is done here: #165

flake-schemas is being tried out here: #166

@srid srid mentioned this issue Aug 1, 2024
4 tasks
@srid srid closed this as completed in #166 Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants