!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

896 Members
183 Servers

Load older messages


SenderMessageTime
5 Jan 2025
@elikoga:matrix.orgelikoga Since you're saying "in a flake build" I am assuming that you are triggering a build via nix build. So consider using --impure (only if you want impure builds) 13:29:39
@elikoga:matrix.orgelikoga * Since you're saying "in a flake build" I am assuming that you are triggering a build via nix build. So consider using --impure (only if you want impure builds) You already tried this 13:30:05
6 Jan 2025
@5sqrgsrdwk:matrix.org5sqrgsrdwkThank you!!!00:13:26
@5sqrgsrdwk:matrix.org5sqrgsrdwkAdding pkgs.cacert to buildInputs got me unstuck. Thanks again!00:40:51
@phaitonican:matrix.org@phaitonican:matrix.orgRedacted or Malformed Event21:08:21
@phaitonican:matrix.org@phaitonican:matrix.orgRedacted or Malformed Event21:08:58
7 Jan 2025
@sss:matrix.dark-alexandr.netsss 09:05:11
@sss:matrix.dark-alexandr.netsss changed their profile picture.09:06:24
9 Jan 2025
@vhdirk:matrix.orgDirk Van Haerenborgh joined the room.17:08:40
10 Jan 2025
@eldritchcookie:matrix.orgeldritchcookie joined the room.11:30:46
11 Jan 2025
@pandapip1:matrix.orgpandapip1 joined the room.21:20:52
12 Jan 2025
@strutztm:strutztm.de@strutztm:strutztm.de joined the room.00:21:30
@phaitonican:matrix.org@phaitonican:matrix.orgHello guys. I have a binary output from a Rust project built with "cargo build --release". The name of the binary file is "cosmic-comp". How would I install this prebuilt binary with a flake onto my system? Thanks a lot01:21:10
@elikoga:matrix.orgelikoga I don't see how this is closely related to flakes? This is asking "how do i package a rust package with nix" right? 01:22:09
@phaitonican:matrix.org@phaitonican:matrix.orgyes exactly. Sorry I am not sure what this would be related with01:23:06
@elikoga:matrix.orgelikogaThis should get you pretty far: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md01:23:39
@phaitonican:matrix.org@phaitonican:matrix.orgthank you very much01:23:57
@elikoga:matrix.orgelikoga I think #rust:nixos.org is more closely related to any issues you might encounter 01:24:56
@phaitonican:matrix.org@phaitonican:matrix.orgYes but the thing is it is already prebuild. so its a binary01:25:20
@phaitonican:matrix.org@phaitonican:matrix.orgso it has nothing really to do with rust anymore01:25:26
@phaitonican:matrix.org@phaitonican:matrix.orgJust packaging a prebuilt binary inside a flake you know01:25:45
@elikoga:matrix.orgelikogahttps://wiki.nixos.org/wiki/Packaging/Binaries01:25:59
@phaitonican:matrix.org@phaitonican:matrix.orgthank you a lot01:26:15
@phaitonican:matrix.org@phaitonican:matrix.orgim not sure why my google not find this thanks01:26:20
@phaitonican:matrix.org@phaitonican:matrix.org
{
  lib,
  fetchFromGitHub,
  rustPlatform,
  libcosmicAppHook,
  libdisplay-info,
  libgbm ? null,
  libinput,
  mesa,
  pixman,
  pkg-config,
  seatd,
  stdenv,
  udev,
  xwayland,
  useXWayland ? true,
  systemd,
  useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
  nix-update-script,
}:

rustPlatform.buildRustPackage {
  pname = "cosmic-comp";
  version = "1.0.0-alpha.5-unstable-2025-01-07";

    src = fetchGit {
        url = "https://github.com/phaitonican/cosmic-comp";
        rev = "9c028c17bb8cc4a6f8a8abc40824a5d74bee6818";
        ref = "gtk-border-dev";
    };

  useFetchCargoVendor = true;
  cargoHash = "sha256-P4/Y70vnyIR5JBpHCOhqLlyfan29eNsExkt3ux7joRw=";

  separateDebugInfo = true;

  nativeBuildInputs = [
    libcosmicAppHook
    pkg-config
  ];
  buildInputs = [
    libdisplay-info
    (if libgbm != null then libgbm else mesa)
    libinput
    pixman
    seatd
    udev
  ] ++ lib.optional useSystemd systemd;

  # only default feature is systemd
  buildNoDefaultFeatures = !useSystemd;

  # TODO: remove when <https://github.com/NixOS/nixpkgs/pull/371795> reaches nixos-unstable and nixos-24.11
  postConfigure = ''
    substituteInPlace ../.cargo/config.toml --replace-fail 'branch = "feature%2Fcopy_clone"' 'branch = "feature/copy_clone"'
  '';

  dontCargoInstall = true;

  makeFlags = [
    "prefix=${placeholder "out"}"
    "CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}"
  ];

  preFixup = lib.optionalString useXWayland ''
    libcosmicAppWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ xwayland ]})
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "epoch-(.*)"
    ];
  };

  meta = with lib; {
    homepage = "https://github.com/pop-os/cosmic-comp";
    description = "Compositor for the COSMIC Desktop Environment";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [
      # lilyinstarlight
    ];
    platforms = platforms.linux;
    mainProgram = "cosmic-comp";
  };
}
01:29:31
@phaitonican:matrix.org@phaitonican:matrix.orgI have to rewrite this so it point to my (local) prebuilt binary01:30:07
@phaitonican:matrix.org@phaitonican:matrix.orginstead of completlely rebuilding it from a github repo01:30:25
@phaitonican:matrix.org@phaitonican:matrix.orgnot sure if this was flake related sorry01:30:51
@elikoga:matrix.orgelikoga
In reply to @phaitonican:matrix.org
not sure if this was flake related sorry

Please don't feel bad for asking any questions, I'm just trying to understand why every single message in here is unrelated to the channel.

I'm wondering: What public communication indicates to you that this is related to flakes?

This is not related to pinning any flake input in any flake lockfile.

This is not related about the output forms tod the flake.

This is not related to any of the new commands introduced to work with flakes.

I am not sure what else I'm missing, except for the fact that the flake interface is the only sane mechanism to use nix (the packaging/building language) unless you want to write your own locking script, use someone elses, or edit hashes by hand every time someone makes a new commit somewhere. (or use channels God forbid)

01:31:55
@phaitonican:matrix.org@phaitonican:matrix.orghaha :D yea you are right its nix language related01:32:29

Show newer messages


Back to Room ListRoom Version: 6