learn-flakes-the-fun-way/flake.nix
2024-07-08 12:18:24 -05:00

25 lines
611 B
Nix

{
inputs.nixpkgs.url = "nixpkgs/nixos-24.05";
outputs = {
self,
nixpkgs,
...
}: let
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
pkgsFor = func: (nixpkgs.lib.genAttrs systems (system: (func (import nixpkgs {inherit system;}))));
in {
packages = pkgsFor (pkgs: {
default = pkgs.callPackage ./what-is-my-ip.nix {};
});
devShells = pkgsFor (pkgs: {
default = pkgs.mkShell {
packages = [self.outputs.packages.${pkgs.system}.default];
shellHook = ''
echo "Hello, Nix!"
'';
};
});
};
}