-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Add Nix Flake #122
base: develop
Are you sure you want to change the base?
[feat] Add Nix Flake #122
Conversation
I am watching some nix videos. |
I'm not an expert or package maintainer, but I want to share my observations on this topic. Repackaging AppImage or other binary distributions is much easier and could bootstrap the process. It's not preferable, but it might attract more attention and invite more people to improve. https://wiki.nixos.org/wiki/Appimage I want to help here but will be available only in three weeks from now ( |
@Dreaming-Codes wouldn't the fact that you're inheriting the |
apps/desktop doesn't have it's own pnpm lock since it's a workspace member |
That's what I was referring to, since there isn't a lockfile in the |
fetchDeps require src arg |
I haven't seen it being specifically required in the docs, aside from that, would specify the source root be of any help ? |
Honestly I don't even know where the docs of that option are but if I remove it it says that either src or srcs needs to be defined. I've already tried specifying the source root but had no luck |
Define the src as the project root rather than inheriting it, the root directory is where the lockfile can be found, that would probably remove the need for the lockfile argument in fetchDeps. |
buildAndTestSubdir = cargoRoot; | ||
|
||
pnpmDeps = pnpm.fetchDeps { | ||
inherit pname version src; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inherit pname version src; | |
inherit pname version; | |
src = ./. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tried this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't
@Dreaming-Codes Sorry for the extra ping, I made a few edits and it now finds the pnpmDeps = pnpm.fetchDeps {
inherit pname version;
src = ./.;
hash = "sha256-25uQRLB9ZqAJxbOIP2RwCAL5v3XBEaDl/MSsX1z0Ucw=";
};
pnpmRoot = ./.; This is the current error: error: builder for '/nix/store/yxmklkfajzz095rg9i1ay4qxw584fxvz-kunkun-0.0.0.drv' failed with exit code 243;
last 25 log lines:
> /nix/store/wg7lsdyjpsjnsa6r8x8xksh4g4l87s19-mgalc1m038ysafbdb6mbgklqpwys9p43-source /build/desktop
> Configuring pnpm store
> Installing dependencies
> WARN Unsupported engine: wanted: {"node":">=22"} (current: {"node":"v20.18.3","pnpm":"9.15.5"})
> Scope: all 28 workspace projects
> Lockfile is up to date, resolution step is skipped
> Progress: resolved 1, reused 0, downloaded 0, added 0
> Packages: +2130
>
> Progress: resolved 1, reused 0, downloaded 0, added 0
> Progress: resolved 2130, reused 0, downloaded 0, added 0
> EACCES EACCES: permission denied, mkdir '/nix/store/wg7lsdyjpsjnsa6r8x8xksh4g4l87s19-mgalc1m038ysafbdb6mbgklqpwys9p43-source/node_modules'
>
> pnpm: EACCES: permission denied, mkdir '/nix/store/wg7lsdyjpsjnsa6r8x8xksh4g4l87s19-mgalc1m038ysafbdb6mbgklqpwys9p43-source/node_modules'
> at async Object.mkdir (node:internal/fs/promises:858:10)
> at async Promise.all (index 1862)
> at async headlessInstall (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:145678:9)
> at async _install (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:185046:33)
> at async mutateModules (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:184904:23)
> at async recursive (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:186424:50)
> at async installDeps (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:186732:11)
> at async /nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:223175:21
> at async main (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:223134:34)
> at async runPnpm (/nix/store/h0mpqbm4a8g4j52pyxdh4lv8fklhx379-pnpm-9.15.5/libexec/pnpm/dist/pnpm.cjs:223406:5)
> Progress: resolved 2130, reused 0, downloaded 0, added 0
For full logs, run 'nix log /nix/store/yxmklkfajzz095rg9i1ay4qxw584fxvz-kunkun-0.0.0.drv'.
``` |
Closes #120
I want to preface this by saying that I am not a Nix expert. Even though I use NixOS and rely on it to manage all my projects, I have never truly learned Nix. As a result, this flake might not be state-of-the-art.
I'm opening this as a draft to share the work I've done so far. I still haven't managed to get it working because there seem to be issues with PNPM workspaces.
A special thanks to @fromtheeast710 for his Rust Tauri flake template.