Help making shell from flake on github

I’m trying to initialize a shell from a flake in a repository of mine on GitHub. When I run nix shell github:biscotty666/RCensus I get the error

error: flake 'github:biscotty666/RCensus' does not provide attribute 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

I have played with the outputs, but still get the error. I’ve never tried this before, I’ve always just cloned the repository. The relevant (I think) part of the flake is:

{
  description = "A basic flake with a shell";
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    systems.url = "github:nix-systems/default";
    flake-utils = {
      url = "github:numtide/flake-utils";
      inputs.systems.follows = "systems";
    };
  };

  outputs =
    { self, nixpkgs, flake-utils, devDB, ... }:
    let supportedSystems = [
         "x86_64-linux"
         "x86_64-darwin"
         "aarch64-linux"
         "aarch64-darwin"      
    ];
    in
    flake-utils.lib.eachSystem supportedSystems (
      system:
      let
        pkgs = import nixpkgs { inherit system; };
      in
      {
        devShells.default = with pkgs; mkShell {
          nativeBuildInputs = [ bashInteractive ];
          buildInputs = [
            R
...
            rstudio
          ];
        };
      }
    );
}

I’d appreciate any help on this, and if I can improve on the flake please tell me.

Thanks

nix shell is for packages; use nix develop instead.

1 Like

Thank you so much. One more quick question: with one repository I tried, I get an error fatal: not a git repository (or any of the parent directories): .git. Despite the error message, the shell seems to load as expected, so not really a problem. Any idea why I get this message.

No idea, need a link to the repo to know why.

It’s the one in the original message, coincidentally: biscotty666/RCensus. The others I’ve tried, eg. biscotty666/biscottys-workshop, do not produce the error message. Even with the message, the shell is initialized.

This shellHook will execute in the directory you run nix develop in, whether it is a Git repository or not.

1 Like

I feel stupid I didn’t notice that. Thank you so much for your help.