Skip to content

Instantly share code, notes, and snippets.

@pbsds
Last active July 8, 2023 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbsds/6e1d3f012b2731573711766764816c01 to your computer and use it in GitHub Desktop.
Save pbsds/6e1d3f012b2731573711766764816c01 to your computer and use it in GitHub Desktop.
flake shell example
NIX_CONFIG="extra-experimental-features = nix-command flakes" use flake
{
description = "My awesome flake";
# update with `nix flake update`
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
#inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, ... } @ inputs: let
forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: f rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.legacyPackages.${system}.lib;
});
in {
devShells = forAllSystems ({ pkgs, ... }: rec {
default = pkgs.mkShell {
packages = [
pkgs.bashInteractive
];
};
});
};
}
@pbsds
Copy link
Author

pbsds commented Jul 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment