mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-05-16 11:12:44 -04:00
Merge pull request #113 from naguiagahnim/main
Improve Nix packaging structure and update npm dependencies hash
This commit is contained in:
@@ -48,15 +48,15 @@ While the core functionality is working, please be aware that this is an early r
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Nix
|
### Nix
|
||||||
You can fetch this repository in your configuration using `pkgs.fetchFromGithub`:
|
You can add this package to your configuration using `pkgs.fetchFromGitHub`:
|
||||||
```nix
|
```nix
|
||||||
let
|
let
|
||||||
creamlinux = pkgs.callPackage (pkgs.fetchFromGitHub {
|
creamlinux = import (pkgs.fetchFromGitHub {
|
||||||
owner = "Novattz";
|
owner = "Novattz";
|
||||||
repo = "creamlinux-installer";
|
repo = "creamlinux-installer";
|
||||||
rev = "main";
|
rev = "main"; # replace with a commit hash to pin the version
|
||||||
hash = ""; # You can use nix-prefetch-url to determine which value to put here, or paste the value returned by the error your rebuild will output
|
hash = ""; # paste the value returned by the error your rebuild will output
|
||||||
}) {};
|
}) { inherit pkgs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ creamlinux ];
|
environment.systemPackages = [ creamlinux ];
|
||||||
@@ -65,15 +65,13 @@ in
|
|||||||
or, using `builtins.fetchTarball`:
|
or, using `builtins.fetchTarball`:
|
||||||
```nix
|
```nix
|
||||||
let
|
let
|
||||||
creamlinux-src = builtins.fetchTarball {
|
creamlinux = import (builtins.fetchTarball {
|
||||||
url = "https://github.com/Novattz/creamlinux-installer/archive/main.tar.gz";
|
url = "https://github.com/Novattz/creamlinux-installer/archive/main.tar.gz";
|
||||||
sha256 = ""; # See above
|
sha256 = ""; # See above
|
||||||
};
|
}) { inherit pkgs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [ creamlinux ];
|
||||||
(pkgs.callPackage creamlinux-src {})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
alternatively and if you want to pin the package version, using [npins](https://github.com/andir/npins):
|
alternatively and if you want to pin the package version, using [npins](https://github.com/andir/npins):
|
||||||
@@ -86,12 +84,11 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.callPackage "${sources.creamlinux-installer}/default.nix" {})
|
(import sources.creamlinux-installer { inherit pkgs; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Those are the recommended methods to add creamlinux-installer to your environment. However, you could also add it as an input of your flake, like so:
|
Those are the recommended methods to add creamlinux-installer to your environment. However, you could also add it as an input of your flake, like so:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
@@ -108,7 +105,7 @@ Those are the recommended methods to add creamlinux-installer to your environmen
|
|||||||
Then, in your configuration:
|
Then, in your configuration:
|
||||||
```nix
|
```nix
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.callPackage inputs.creamlinux-installer {})
|
(import inputs.creamlinux-installer { inherit pkgs; })
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
Similarly to running the AppImage, you will need to set `WEBKIT_DISABLE_DMABUF_RENDERER=1` if your GPU is from Nvidia in order to run the package.
|
Similarly to running the AppImage, you will need to set `WEBKIT_DISABLE_DMABUF_RENDERER=1` if your GPU is from Nvidia in order to run the package.
|
||||||
|
|||||||
+7
-57
@@ -1,57 +1,7 @@
|
|||||||
{pkgs ? import <nixpkgs> {}}: let
|
{
|
||||||
cargoRoot = "src-tauri";
|
pkgs ?
|
||||||
src = ./.;
|
import
|
||||||
|
(fetchTarball "https://github.com/NixOS/nixpkgs/archive/c6d65881c5624c9cae5ea6cedef24699b0c0a4c0.tar.gz")
|
||||||
patchSassEmbedded = pkgs.writeShellScriptBin "patch-sass-embedded" ''
|
{ },
|
||||||
NIX_LD="$(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker)"
|
}:
|
||||||
for dart_bin in node_modules/sass-embedded-linux-*/dart-sass/src/dart; do
|
pkgs.callPackage ./package.nix { }
|
||||||
if [ -f "$dart_bin" ]; then
|
|
||||||
${pkgs.patchelf}/bin/patchelf --set-interpreter "$NIX_LD" "$dart_bin"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
pkgs.rustPlatform.buildRustPackage {
|
|
||||||
pname = "creamlinux-installer";
|
|
||||||
version = "1.5.0-unstable-2026-04-23";
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
cargoLock.lockFile = ./src-tauri/Cargo.lock;
|
|
||||||
|
|
||||||
npmDeps = pkgs.fetchNpmDeps {
|
|
||||||
inherit src;
|
|
||||||
hash = "sha256-anYTERlnfOGDsGW0joy+h7wECJNDy6q+0a2to6t36pg=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs =
|
|
||||||
[
|
|
||||||
pkgs.cargo-tauri.hook
|
|
||||||
pkgs.nodejs
|
|
||||||
pkgs.npmHooks.npmConfigHook
|
|
||||||
pkgs.pkg-config
|
|
||||||
]
|
|
||||||
++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
|
||||||
pkgs.wrapGAppsHook4
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
|
|
||||||
pkgs.glib-networking
|
|
||||||
pkgs.openssl
|
|
||||||
pkgs.webkitgtk_4_1
|
|
||||||
];
|
|
||||||
|
|
||||||
inherit cargoRoot;
|
|
||||||
|
|
||||||
buildAndTestSubdir = cargoRoot;
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace src-tauri/tauri.conf.json \
|
|
||||||
--replace-fail '"createUpdaterArtifacts": true' '"createUpdaterArtifacts": false'
|
|
||||||
'';
|
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
${patchSassEmbedded}/bin/patch-sass-embedded
|
|
||||||
'';
|
|
||||||
|
|
||||||
env.NO_STRIP = true;
|
|
||||||
}
|
|
||||||
|
|||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
cargo-tauri,
|
||||||
|
writeShellScriptBin,
|
||||||
|
stdenv,
|
||||||
|
patchelf,
|
||||||
|
rustPlatform,
|
||||||
|
fetchNpmDeps,
|
||||||
|
nodejs,
|
||||||
|
npmHooks,
|
||||||
|
pkg-config,
|
||||||
|
lib,
|
||||||
|
wrapGAppsHook4,
|
||||||
|
glib-networking,
|
||||||
|
openssl,
|
||||||
|
webkitgtk_4_1,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cargoRoot = "src-tauri";
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
patchSassEmbedded = writeShellScriptBin "patch-sass-embedded" ''
|
||||||
|
NIX_LD="$(cat ${stdenv.cc}/nix-support/dynamic-linker)"
|
||||||
|
for dart_bin in node_modules/sass-embedded-linux-*/dart-sass/src/dart; do
|
||||||
|
if [ -f "$dart_bin" ]; then
|
||||||
|
${patchelf}/bin/patchelf --set-interpreter "$NIX_LD" "$dart_bin"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
rustPlatform.buildRustPackage {
|
||||||
|
pname = "creamlinux-installer";
|
||||||
|
version = "1.5.5-unstable-2026-05-03";
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
cargoLock.lockFile = ./src-tauri/Cargo.lock;
|
||||||
|
|
||||||
|
npmDeps = fetchNpmDeps {
|
||||||
|
inherit src;
|
||||||
|
hash = "sha256-9VUywt71u4kuHNCFxW2aiavqM7e6tvBMHyzeSdJIJ5o=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cargo-tauri.hook
|
||||||
|
nodejs
|
||||||
|
npmHooks.npmConfigHook
|
||||||
|
pkg-config
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isLinux [
|
||||||
|
wrapGAppsHook4
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = lib.optionals stdenv.isLinux [
|
||||||
|
glib-networking
|
||||||
|
openssl
|
||||||
|
webkitgtk_4_1
|
||||||
|
];
|
||||||
|
|
||||||
|
inherit cargoRoot;
|
||||||
|
|
||||||
|
buildAndTestSubdir = cargoRoot;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace src-tauri/tauri.conf.json \
|
||||||
|
--replace-fail '"createUpdaterArtifacts": true' '"createUpdaterArtifacts": false'
|
||||||
|
'';
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
${patchSassEmbedded}/bin/patch-sass-embedded
|
||||||
|
'';
|
||||||
|
|
||||||
|
env.NO_STRIP = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user