!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

887 Members
179 Servers

Load older messages


SenderMessageTime
18 Feb 2024
@netpleb:matrix.orgnetpleb with a flakes enabled system does it still make sense to use system.autoUpgrade at all? or do you usually manage upgrading manually by updating your flake inputs? 19:29:25
@loving-melody:matrix.org@loving-melody:matrix.orgI use it, autoUpgrade doesnt have to update the flake inputs20:52:00
@mr-qubo:matrix.orgmr-qubo
In reply to @loving-melody:matrix.org
I use it, autoUpgrade doesnt have to update the flake inputs
What's the purpose of autoUpgrade with flakes?
21:07:42
@loving-melody:matrix.org@loving-melody:matrix.orgMutli system flakes, can apply changes to other systems 21:10:23
19 Feb 2024
@samasaur:matrix.orgsamasauryou could also update your flake in CI, and then use autoUpgrade to upgrade to that newer version00:27:50
@rhizomes:matrix.orgrhizomes joined the room.04:27:25
@mr-qubo:matrix.orgmr-qubo

I have a simple flake like this:

{
  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
    let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      devShell = pkgs.mkShell {};
    });
}

When I do nix develop I get things like gcc, patchelf, file, etc. in my PATH. I don't want that, anyone knows where does that come from and how can I get rid of that?

16:32:17
@philiptaron:matrix.org@philiptaron:matrix.org mr-qubo: that is the nixpkgs stdenv. 16:34:27
@philiptaron:matrix.org@philiptaron:matrix.orghttps://nixos.org/manual/nixpkgs/stable/#part-stdenv16:35:06
@philiptaron:matrix.org@philiptaron:matrix.orgAre you looking for a shell with just... bash?16:35:20
@mr-qubo:matrix.orgmr-qubo
In reply to @philiptaron:matrix.org
Are you looking for a shell with just... bash?
That's just an example, I want some packages in this shell, but I don't want this stdenv. No idea why it's there in the first place.
16:37:38
@philiptaron:matrix.org@philiptaron:matrix.org

It's coming from pkgs.mkShell.

To read how that happens, open up pkgs/top-level/all-packages.nix, find mkShell. That gets you to pkgs/build-support/mkshell/default.nix.

Inside pkgs/build-support/mkshell/default.nix, note how the return value is stdenv.mkDerivation. (that stdenv is the key).

Consider also mkShellNoCC for your use case. Note how that definition in pkgs/top-level/all-packages.nix does this:

mkShellNoCC = mkShell.override { stdenv = stdenvNoCC; };

You can do similarly to override the stdenv with whatever's appropriate for your usecase.

16:50:23
@mr-qubo:matrix.orgmr-quboThanks, that's very helpful!16:54:12
@bitraten:matrix.orgbitraten joined the room.19:27:19
@mr-qubo:matrix.orgmr-qubo
In reply to @mr-qubo:matrix.org
When I do e.g. nix shell 'nixpkgs#htop' only htop is added to path. But if I create flake with devShell and htop in buildInputs, and use nix develop dependencies are added into the PATH as well, like with nix-shell -p htop. Is it possible to have this work as nix shell?
Also, as a second question, is it possible to group multiple packages and link all bins in one path, so only one entry in PATH is added instead of separate entry for each package?
I switched to https://devenv.sh/. It fixes my problem with unwanted packages in PATH and automatically uses buildEnv to create single PATH entry for all packages.
20:05:55
20 Feb 2024
@sofo:matrix.org@sofo:matrix.org changed their display name from Sofi to Sofie.07:39:15
@sofo:matrix.org@sofo:matrix.org changed their profile picture.14:39:08
@sofo:matrix.org@sofo:matrix.org changed their profile picture.14:41:41
@sofo:matrix.org@sofo:matrix.org changed their profile picture.14:42:46
@sofo:matrix.org@sofo:matrix.org changed their profile picture.14:44:03
@duffyduke:matrix.orgduffyduke joined the room.21:30:17
22 Feb 2024
@atakan:atkn.me@atakan:atkn.me joined the room.03:10:03
@hx-markus:matrix.orghx-markus joined the room.12:25:43
26 Feb 2024
@maribox:matrix.orgmaribox joined the room.14:34:09
@maribox:matrix.orgmariboximage.png
Download image.png
14:40:27
@maribox:matrix.orgmariboxHey! I added flakes as an experimental feature in my configuration.nix but I got the error in the image. After I removed the experimental-features line I still get the same error when running nixos-rebuild switch, even though there's no mention of flakes in the configuration.nix file. I'm a super noob, what am I missing here?14:41:58
@maribox:matrix.orgmariboxAlso when I load an older version of my OS, even the first one, the same Error appears, even though I just added the flakes line in the last rebuild...14:46:09
@2xsaiko:tchncs.de@2xsaiko:tchncs.de
In reply to @maribox:matrix.org
sent an image.
it loads /etc/nixos/flake.nix instead of configuration.nix if it exists
14:49:12
@2xsaiko:tchncs.de@2xsaiko:tchncs.derename/remove it14:49:23
@2xsaiko:tchncs.de@2xsaiko:tchncs.de(it has nothing to do with whether the experimental option is enabled, but purely with the existence of the file)14:50:22

Show newer messages


Back to Room ListRoom Version: 6