| 15 Aug 2023 |
| Christina Sørensen changed their profile picture. | 14:58:02 |
| @10leej:matrix.org left the room. | 19:34:10 |
| 16 Aug 2023 |
lxsameer | hey folks, is it possible to have multiple devShells for a platform? for example, one with glibc and one with musl under linux? | 22:21:46 |
Ilan Joselevich (Kranzes) | Yep, the flake schema is devShells.x86_64-linux.X | 23:04:46 |
Ilan Joselevich (Kranzes) | devShells.x86_64-linux = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.cmatrix ];
};
};
| 23:11:05 |
Ilan Joselevich (Kranzes) | devShells.${system} is an attrset | 23:11:17 |
Ilan Joselevich (Kranzes) | what's the musl stdenv that I don't know | 23:11:59 |
CRTified | In reply to @kranzes:matrix.org
devShells.x86_64-linux = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.cmatrix ];
};
};
Where's pkgs coming from there? | 23:21:53 |
Ilan Joselevich (Kranzes) | let binding | 23:22:08 |
CRTified | nixpkgs instantiation? | 23:22:10 |
Ilan Joselevich (Kranzes) | inputs.nixpkgs.legacyPackages.x86_64-linux | 23:22:30 |
CRTified | 👌 Just wanted to be sure whether devShells behaves differently | 23:22:46 |
Ilan Joselevich (Kranzes) | {
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = inputs:
let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
devShells.${system} = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
};
}
| 23:23:14 |
Ilan Joselevich (Kranzes) | really basic flake for 1 system architecture | 23:23:37 |
lxsameer | Pretty cool. Thanks folks | 23:31:13 |
| 17 Aug 2023 |
lxsameer | hey friends, I have a very basic flake that follows. when i do nix flake show I get error: expected a derivation. Where might be the error? is there any way to get a traceback? | 11:04:36 |
lxsameer | description = "A very basic flake";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
devShells.${system} = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}
);
}
| 11:04:47 |
lxsameer | * description = "A very basic flake";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
devShells.${system} = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}
);
}
| 11:05:01 |
lxsameer | * description = "A very basic flake";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
devShells.${system} = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}
);
}
| 11:05:14 |
lxsameer | * {
description = "A very basic flake";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
devShells.${system} = {
clang = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = [ pkgs.hello ];
};
gcc = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}
);
}
| 11:06:31 |
Ilan Joselevich (Kranzes) | That's a flake-utils moment. Omit the ${system} part from devShells. | 12:25:13 |
Ilan Joselevich (Kranzes) | devShells.${system} -> devShells | 12:25:24 |
Ilan Joselevich (Kranzes) | flake-utils handles the genAttrs part for the outputs | 12:25:53 |
CRTified | For more context, https://ayats.org/blog/no-flake-utils/ is a good writeup about flake-utils | 12:25:57 |
Ilan Joselevich (Kranzes) | You should probably stay away from flake-utils anyway | 12:26:05 |
lxsameer | I change the flake and I'm not using flake-util like before | 13:03:07 |
lxsameer | I'm just using the system wrappre now | 13:03:16 |
lxsameer | thanks folks | 13:03:33 |
@antifuchs:asf.computer | I find flake.parts a much better-done thing that does all flake-utils does; the post above is great for learning what they do, at any rate | 13:07:43 |
Charles | In reply to @crtified:crtified.me For more context, https://ayats.org/blog/no-flake-utils/ is a good writeup about flake-utils I don't find the arguments made here to be very compelling. Either way you do it, there's a problem of actually knowing how to use your tools; copy-pasting some nix code doesn't guarantee understandability, which is the stated problem. Also, this article doesn't mention https://github.com/nix-systems/nix-systems at all, which flake-utils pulls in for you automatically but would need to be manually integrated into a custom nix expression like the one suggested therein | 15:31:27 |