diff --git a/configuration.nix b/configuration.nix index 692d1a2..9b68b41 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,6 +2,7 @@ let username = "usuario"; + learningml-desktop = pkgs.callPackage ./pkgs/learningml-desktop.nix { }; in { imports = @@ -103,6 +104,7 @@ in # using appimage because it seems to be one major version up cura-appimage arduino-ide + learningml-desktop # python stuff goes here (python314.withPackages (ps: with ps; [ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8c7ac0c --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1773821835, + "narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/learningml-desktop.nix b/pkgs/learningml-desktop.nix new file mode 100644 index 0000000..0e6aeb0 --- /dev/null +++ b/pkgs/learningml-desktop.nix @@ -0,0 +1,97 @@ +# this file has been ai generated + +{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, xdg-utils, alsa-lib +, atk, at-spi2-atk, cairo, cups, dbus, expat, fontconfig, freetype +, gdk-pixbuf, glib, gtk3, libdrm, libnotify, libsecret, libuuid, mesa, nspr +, nss, pango, systemd, xorg }: + +stdenv.mkDerivation (finalAttrs: { + pname = "learningml-desktop"; + version = "1.4.3"; + + src = fetchurl { + url = "https://github.com/LearningML-Education/learningml-desktop-releases/releases/download/${finalAttrs.version}/learningml-desktop_${finalAttrs.version}_amd64.deb"; + hash = "sha256-08r5l5daq6nn3xqdaxfqvhs55dv398x43pd1nmblixd1pipgw767"; + }; + + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + ]; + + buildInputs = [ + alsa-lib + atk + at-spi2-atk + cairo + cups + dbus + expat + fontconfig + freetype + gdk-pixbuf + glib + gtk3 + libdrm + libnotify + libsecret + libuuid + mesa + nspr + nss + pango + systemd + xdg-utils + xorg.libX11 + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst + xorg.libxcb + ]; + + sourceRoot = "."; + + unpackPhase = '' + runHook preUnpack + ar x "$src" + tar xf data.tar.xz + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/libexec/learningml-desktop $out/share + + cp -r opt/LearningMLDesktop/* $out/libexec/learningml-desktop/ + cp -r usr/share/icons $out/share/ + + install -Dm644 \ + usr/share/applications/learningml-desktop.desktop \ + $out/share/applications/learningml-desktop.desktop + + makeWrapper \ + $out/libexec/learningml-desktop/learningml-desktop \ + $out/bin/learningml-desktop \ + --add-flags "--no-sandbox" + + substituteInPlace $out/share/applications/learningml-desktop.desktop \ + --replace-fail "/opt/LearningMLDesktop/learningml-desktop" "$out/bin/learningml-desktop" + + runHook postInstall + ''; + + meta = with lib; { + description = "Desktop version of LearningML"; + homepage = "https://github.com/LearningML-Education/learningml-desktop-releases"; + license = licenses.cc0; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + mainProgram = "learningml-desktop"; + }; +}) diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..8a9ef78 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# configuración lab ordenadores [REDACTED] + +## Por qué NixOS? \ No newline at end of file diff --git a/update.sh b/update.sh index 16ebe1e..4867862 100644 --- a/update.sh +++ b/update.sh @@ -8,4 +8,4 @@ if [ $? -ne 0 ]; then exit 1 fi -nixos-rebuild switch --flake .# \ No newline at end of file +nixos-rebuild switch --flake path:.#nixos