From 6246fe357c27de4e7d31414680a4b27e3796f8e2 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Fri, 31 Jan 2025 19:09:18 +0300 Subject: [PATCH 01/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 841ef65..ea9bf73 100644 --- a/configuration.nix +++ b/configuration.nix @@ -254,7 +254,14 @@ in # настройки Nix nixpkgs.config.allowUnfree = true; - nix.settings.auto-optimise-store = true; + nix.settings = { + substituters = [ + "https://cache.nixos.org" + "http://10.0.174.12:5000" + ]; + trusted-public-keys = ["kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw="]; + auto-optimise-store = true; + }; nix.extraOptions = '' experimental-features = nix-command flakes ''; @@ -304,9 +311,12 @@ in '')+"/uuid"); enable = true; nssmdns4 = true; + openFirewall = true; publish = { enable = true; hinfo = true; + workstation = true; + domain = true; addresses = true; }; }; @@ -320,7 +330,17 @@ in networking.nameservers = [ serverIP ]; # каждый компьютер знает, что kafpi.local - это адрес нашего сервера - networking.hosts."${serverIP}" = [ "kafpi.local" ]; + networking.hosts."${serverIP}" = [ "kafpi.local" "hydra.kafpi.local" ]; + security.pki.certificateFiles = [ + (builtins.fetchurl { + url = "http://10.0.174.12/server.crt"; + sha256 = "sha256:0qx4acdhiciffvk1l7wkxyzapjwjy9zisq0mwyl727x97zrmi5ds"; + }) + (builtins.fetchurl { + url = "http://10.0.174.12/hydra.crt"; + sha256 = "sha256:1l5cvsikb5dnf49ajjjmz50avfkxm28jy65vnb9xidlv5vapi1zp"; + }) + ]; #### ЛОКАЛИЗАЦИЯ ##### From e64783b4713a906645fa5c6909ab0f6c57e29e92 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 20 Feb 2025 23:55:45 +0300 Subject: [PATCH 02/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 156 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 153 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index ea9bf73..e62a852 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,5 @@ { + lib, config, pkgs, simintech, @@ -34,6 +35,52 @@ in dontUnpack = true; installPhase = "unzip $src; mkdir -p $out; mv ./${nam}/* $out"; }; + ptFiles = pkgs.stdenv.mkDerivation { + name = "PacketTracer7drv"; + version = "7.3.1"; + dontUnpack = true; + src = pkgs.fetchurl { + url = "http://kafpi.local/PacketTracer_731_amd64.deb"; + hash = "sha256-w5gC0V3WHQC6J/uMEW2kX9hWKrS0mZZVWtZriN6s4n8="; + }; + nativeBuildInputs = with pkgs; [ + dpkg + makeWrapper + ]; + + installPhase = '' + dpkg-deb -x $src $out + makeWrapper "$out/opt/pt/bin/PacketTracer7" "$out/bin/packettracer7" \ + --prefix LD_LIBRARY_PATH : "$out/opt/pt/bin" + ''; + }; + ptFhsEnv = pkgs.buildFHSEnv { + name = "packettracer7"; + runScript = "${ptFiles}/bin/packettracer7 -guest"; + + targetPkgs = + pkgs: with pkgs; [ + alsa-lib + dbus + expat + fontconfig + glib + libglvnd + libpulseaudio + libudev0-shim + libxkbcommon + libxml2 + libxslt + nspr + nss + xorg.libICE + xorg.libSM + xorg.libX11 + xorg.libXScrnSaver + ]; + }; + + in with pkgs; [ @@ -154,7 +201,31 @@ in stm32loader ##### СЕТЕВЫЕ УТИЛИТЫ ####### - nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей + (pkgs.stdenv.mkDerivation { + pname = "ciscoPacketTracer7"; + version = "7.3.1"; + dontUnpack = true; + installPhase = '' + mkdir $out + ${pkgs.xorg.lndir}/bin/lndir -silent ${ptFhsEnv} $out + ''; + desktopItems = [ + (pkgs.makeDesktopItem { + name = "cisco-pt7.desktop"; + desktopName = "Cisco Packet Tracer 7"; + icon = "${ptFiles}/opt/pt/art/app.png"; + exec = "packettracer7 %f"; + mimeTypes = [ + "application/x-pkt" + "application/x-pka" + "application/x-pkz" + ]; + })]; + + nativeBuildInputs = [ copyDesktopItems pkgs.xorg.lndir ]; +}) + + nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей httpie httpie-desktop # - передовой клиент HTTP-запросов netcat socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК opcua-client-gui # - простой графический клиент OPC UA @@ -163,6 +234,61 @@ in logisim-evolution unityhub # UnityHub - 3D-моделирование, визуализация, геймдев, AR/VR + (pkgs.stdenv.mkDerivation rec { + pname = "cnc_vmc_sim"; + version = "1.0.0-share"; + src = builtins.fetchTarball { + url = "http://kafpi.local/linux_cnc_vmc_share.tar.xz"; + sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; + }; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + cp ${src}/icon.png $out/share/icons/${pname}.png + cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + ''; + + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs"; + targetPkgs = p: with p; [ + eudev.out + libGL.out + openal.out + xorg.libX11.out + ]; + runScript = "${src}/${pname}"; + }; + + desktopItem = pkgs.makeDesktopItem { + name = "CNC VMC (free)"; + exec = "${pname}"; + desktopName = "CNC VMC (free)"; + categories = [ "Development" ]; + icon = "${pname}"; + terminal = false; + startupNotify = false; + }; + }) + (pkgs.stdenv.mkDerivation rec { + pname = "ramus"; + version = "0.1.3"; + src = builtins.fetchTarball { + url = "http://10.0.174.12:30000/ramus.tar.xz"; + sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; + }; + installPhase = '' + sed -e "s~ramus.ico~$out/share/icons/ramus.ico~;" -i share/applications/ramus.desktop + mkdir $out + cp -r share bin lib $out + echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus + chmod +x $out/bin/ramus + ''; + }) + # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! @@ -253,11 +379,13 @@ in time.hardwareClockInLocalTime = hasBootPartition; # настройки Nix - nixpkgs.config.allowUnfree = true; + nixpkgs.config = { + allowUnfree = true; + nvidia.acceptLicense = true; + }; nix.settings = { substituters = [ "https://cache.nixos.org" - "http://10.0.174.12:5000" ]; trusted-public-keys = ["kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw="]; auto-optimise-store = true; @@ -270,15 +398,37 @@ in hardware.graphics = { enable = true; enable32Bit = true; + extraPackages = with pkgs; [ nvidia-vaapi-driver ]; }; services.xserver = { enable = true; + videoDrivers = [ + "nvidia" + "modesetting" + "fbdev" + ]; xkb.layout = "us,ru"; xkb.options = "grp:alt_shift_toggle"; }; + hardware.enableAllFirmware = true; + hardware.nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + modesetting.enable = true; + powerManagement.enable = true; + open = false; + nvidiaSettings = false; + }; + boot.blacklistedKernelModules = [ "nouveau" ]; + boot.extraModprobeConfig = "options nvidia " + lib.concatStringsSep " " [ + "NVreg_UsePageAttributeTable=1" + "NVreg_EnablePCIeGen3=1" + "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" + ]; + services.displayManager.autoLogin.user = "student"; services.getty.autologinUser = "student"; services.xserver.displayManager.lightdm.enable = true; + services.xserver.displayManager.startx.enable = true; services.displayManager.defaultSession = "MIREA-WindowsLike+Metacity"; services.xserver.displayManager.session = [ { From 9b764b358248e990108baa5e161c2d5d10aed05f Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 22 Feb 2025 13:21:27 +0300 Subject: [PATCH 03/41] ciscopacket --- flake.lock | 344 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c4f8523 --- /dev/null +++ b/flake.lock @@ -0,0 +1,344 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "nix-jetbrains-plugins", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "gostfont": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1736170321, + "narHash": "sha256-/dY+z0JBdFvyJy4fuIidNpEGKQPR+JB1Lc6PbNoyvvs=", + "owner": "gregorybednov", + "repo": "gostfont", + "rev": "4f11a7fdd2b0a390f98c8764e8f6830f75201096", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "gostfont", + "type": "github" + } + }, + "mireadesktop": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1737932603, + "narHash": "sha256-YKCNo6UGpWLDP1UwiP85aJ91nplHupBU5UU/Hy8y2bo=", + "owner": "gregorybednov", + "repo": "mireadesktop", + "rev": "fa628ed1aff70c4121f718be450626bab46a1eab", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "mireadesktop", + "type": "github" + } + }, + "mireapython": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1737741645, + "narHash": "sha256-MaT05qTfUSHsoWgWJqv33LRie7spTz0b6FReJWDV4yk=", + "owner": "gregorybednov", + "repo": "mireapython", + "rev": "b7172d602ff62aa02d68bd9852168bd3c32aa726", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "mireapython", + "type": "github" + } + }, + "nix-jetbrains-plugins": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_4", + "systems": "systems" + }, + "locked": { + "lastModified": 1739546448, + "narHash": "sha256-wOlLg5tkCl2LW8php5bOZ9XACcEF/Wi3578AgHOY0aA=", + "owner": "gregorybednov", + "repo": "nix-jetbrains-plugins", + "rev": "afba27c8c3f6b978e2662f55e618d5eb88694142", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "nix-jetbrains-plugins", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1737299813, + "narHash": "sha256-Qw2PwmkXDK8sPQ5YQ/y/icbQ+TYgbxfjhgnkNJyT1X8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "107d5ef05c0b1119749e381451389eded30fb0d5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1733412085, + "narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1739923778, + "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "packettracer7": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1740143112, + "narHash": "sha256-sawn/IVgT++IzbCsy/EhJ+w3+s2bxUF9jZ0kIPIXmcE=", + "owner": "gregorybednov", + "repo": "packettracer7", + "rev": "eb673a5d201d9c32e8fc642e47b9c66ed6130379", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "packettracer7", + "type": "github" + } + }, + "root": { + "inputs": { + "gostfont": "gostfont", + "mireadesktop": "mireadesktop", + "mireapython": "mireapython", + "nix-jetbrains-plugins": "nix-jetbrains-plugins", + "nixpkgs": "nixpkgs_5", + "packettracer7": "packettracer7", + "simintech": "simintech", + "stm32cubemx": "stm32cubemx" + } + }, + "simintech": { + "inputs": { + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1736199151, + "narHash": "sha256-maK9G10f/AD/BS3kZP3h3ADhLzYh5qXBUj2HXEr7t4s=", + "owner": "gregorybednov", + "repo": "simintech_nix", + "rev": "3ce193218e3f5b8cc5b5a212be550785d8e64e86", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "simintech_nix", + "type": "github" + } + }, + "stm32cubemx": { + "inputs": { + "nixpkgs": "nixpkgs_8" + }, + "locked": { + "lastModified": 1735908219, + "narHash": "sha256-5VRV0ThLNWpCet8+Zpk9LqJnjJXQKI2pfak/I0Cxhvs=", + "owner": "gregorybednov", + "repo": "stm32cubemx", + "rev": "d1ebff9193ed7be660e14167f8fb1625be8df4f0", + "type": "github" + }, + "original": { + "owner": "gregorybednov", + "repo": "stm32cubemx", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} + From 27dd0b03870666eb8bd6d5656f1163ff39aeaa2b Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 22 Feb 2025 13:46:14 +0300 Subject: [PATCH 04/41] corrected ip --- configuration.nix | 157 +++++++++++++++------------------------------- flake.nix | 58 +++++++++-------- 2 files changed, 80 insertions(+), 135 deletions(-) diff --git a/configuration.nix b/configuration.nix index e62a852..edcc634 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,15 +4,13 @@ pkgs, simintech, stm32cubemx, + packettracer7, inputs, ... }: let serverIP = "10.0.174.12"; hasBootPartition = config.fileSystems ? "/boot"; - isNvidia = (builtins.readFile (pkgs.runCommandLocal "isNvidia" {} '' - ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out - '')) != ""; in { users.users.student = { @@ -22,65 +20,19 @@ in packages = let # определение как скачивать плагины jetbrains (скачивать с нашего сервера копию) - customJBPlugin = + customJBPlugin = nam: ver: sha: pkgs.stdenv.mkDerivation { name = nam; version = ver; src = pkgs.fetchurl { - url = "http://kafpi.local/custom-jetbrains-plugins/${nam}-${ver}.zip"; + url = "http://${serverIP}/custom-jetbrains-plugins/${nam}-${ver}.zip"; sha256 = sha; }; nativeBuildInputs = with pkgs; [ unzip ]; dontUnpack = true; installPhase = "unzip $src; mkdir -p $out; mv ./${nam}/* $out"; }; - ptFiles = pkgs.stdenv.mkDerivation { - name = "PacketTracer7drv"; - version = "7.3.1"; - dontUnpack = true; - src = pkgs.fetchurl { - url = "http://kafpi.local/PacketTracer_731_amd64.deb"; - hash = "sha256-w5gC0V3WHQC6J/uMEW2kX9hWKrS0mZZVWtZriN6s4n8="; - }; - nativeBuildInputs = with pkgs; [ - dpkg - makeWrapper - ]; - - installPhase = '' - dpkg-deb -x $src $out - makeWrapper "$out/opt/pt/bin/PacketTracer7" "$out/bin/packettracer7" \ - --prefix LD_LIBRARY_PATH : "$out/opt/pt/bin" - ''; - }; - ptFhsEnv = pkgs.buildFHSEnv { - name = "packettracer7"; - runScript = "${ptFiles}/bin/packettracer7 -guest"; - - targetPkgs = - pkgs: with pkgs; [ - alsa-lib - dbus - expat - fontconfig - glib - libglvnd - libpulseaudio - libudev0-shim - libxkbcommon - libxml2 - libxslt - nspr - nss - xorg.libICE - xorg.libSM - xorg.libX11 - xorg.libXScrnSaver - ]; - }; - - in with pkgs; [ @@ -89,11 +41,12 @@ in # набор плагинов, я бы сказал, богат до избыточности, но главное есть Python # и Database Nagivator. Остальное - любителям и любознательным. (with inputs.nix-jetbrains-plugins.plugins."${system}"; [ - idea-community."2024.1"."mobi.hsz.idea.gitignore" + #idea-community."2024.1"."mobi.hsz.idea.gitignore" idea-community."2024.1"."org.jetbrains.erlang" idea-community."2024.1"."JProfiler" idea-community."2024.1"."DBN" idea-community."2024.1"."MatlabSupport" + #idea-community."2024.1"."com.intellij.notebooks.core" idea-community."2024.1"."PlantUML integration" idea-community."2024.1"."org.intellij.scala" idea-community."2024.1"."PythonCore" @@ -105,10 +58,11 @@ in idea-community."2024.1"."String Manipulation" idea-community."2024.1"."quokka.js" idea-community."2024.1"."org.asciidoctor.intellij.asciidoc" - idea-community."2024.1"."R4Intellij" + #idea-community."2024.1"."R4Intellij" idea-community."2024.1"."com.redhat.devtools.lsp4ij" ]) - ++ [ + ++ + [ # поддежка языка C/C++ на уровне подсветки синтаксиса и автодополнения (customJBPlugin "clsp" "1.0.1" "sha256-AU/Q61YYsGn2BAYykCGm4XGNyeSwd5K/txGNzP2dJg0=") @@ -147,7 +101,7 @@ in # поставка Python, полный список возможностей # см. на github.com/gregorybednov/mireapython - inputs.mireapython.packages.x86_64-linux.mireapython + inputs.mireapython.packages.x86_64-linux.mireapython # базовая поддержка C/C++ и дебага clang @@ -156,7 +110,7 @@ in cpplint cppcheck gcc-arm-embedded # компиляция С/C++ под STM32 и прочие arm - + octaveFull # GNU Octave shellcheck # проверка шелл-кода (bash, POSIX sh, ...) @@ -166,7 +120,7 @@ in # go gopls delve golint go-tools # - Go jdk kotlin # - Java, Kotlin (идут вместе с IJ IDEA) # ghc haskell-language-server # - Haskell - # nodePackages.intelephense # - PHP + # nodePackages.intelephense # - PHP # dotnet-sdk # - C# ####### Проектирование и разработка баз данных, ИУС, ... ####### @@ -174,19 +128,19 @@ in # Workbench для управления и ER-моделирования БД на mysql # у КАЖДОГО nixos есть свой локальный сервер mysql, см. ниже по файлу mysql-workbench - + # аналог Bizagi Modeler, расширенный вариант bpmn.io camunda-modeler # графическое моделирование UML-диаграмм - # также доступно моделирование BPMN и ER + # также доступно моделирование BPMN и ER staruml # Язык текстового описания UML-диаграмм # актуально для разработчиков ПО (встраивание диаграмм в код) # поддерживается нашей поставкой IJ IDEA CE plantuml - + archi # поддержка archimate @@ -200,31 +154,8 @@ in stlink-gui stm32loader - ##### СЕТЕВЫЕ УТИЛИТЫ ####### - (pkgs.stdenv.mkDerivation { - pname = "ciscoPacketTracer7"; - version = "7.3.1"; - dontUnpack = true; - installPhase = '' - mkdir $out - ${pkgs.xorg.lndir}/bin/lndir -silent ${ptFhsEnv} $out - ''; - desktopItems = [ - (pkgs.makeDesktopItem { - name = "cisco-pt7.desktop"; - desktopName = "Cisco Packet Tracer 7"; - icon = "${ptFiles}/opt/pt/art/app.png"; - exec = "packettracer7 %f"; - mimeTypes = [ - "application/x-pkt" - "application/x-pka" - "application/x-pkz" - ]; - })]; - - nativeBuildInputs = [ copyDesktopItems pkgs.xorg.lndir ]; -}) - + ##### СЕТЕВЫЕ УТИЛИТЫ ###### + # установлен Cisco Packet Tracer, обернут в firejail чтобы не стучался на Netacad.com nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей httpie httpie-desktop # - передовой клиент HTTP-запросов netcat socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК @@ -238,7 +169,7 @@ in pname = "cnc_vmc_sim"; version = "1.0.0-share"; src = builtins.fetchTarball { - url = "http://kafpi.local/linux_cnc_vmc_share.tar.xz"; + url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; }; @@ -277,11 +208,11 @@ in pname = "ramus"; version = "0.1.3"; src = builtins.fetchTarball { - url = "http://10.0.174.12:30000/ramus.tar.xz"; + url = "http://${serverIP}/ramus.tar.xz"; sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; }; installPhase = '' - sed -e "s~ramus.ico~$out/share/icons/ramus.ico~;" -i share/applications/ramus.desktop + sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop mkdir $out cp -r share bin lib $out echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus @@ -293,7 +224,7 @@ in # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! simintech.packages.x86_64-linux.simintech - + # POSIX утилиты для совместимости om4 pax @@ -306,15 +237,15 @@ in uucp util-linux cflow - ncompress + ncompress ]; }; # вставленные флешки автоматически монтируются - services.devmon.enable = true; + services.devmon.enable = true; # необходимо для совместимости с POSIX по команде at, при отсутствии необходимости можно удалить - services.atd = { + services.atd = { enable = true; allowEveryone = true; }; @@ -331,7 +262,7 @@ in local all all trust ''; }; - + # и оба поддерживают вход без пароля в "руты" system.userActivationScripts.mycnf = { text = '' @@ -424,7 +355,7 @@ in "NVreg_EnablePCIeGen3=1" "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" ]; - + services.displayManager.autoLogin.user = "student"; services.getty.autologinUser = "student"; services.xserver.displayManager.lightdm.enable = true; @@ -454,7 +385,7 @@ in ##### СЕТЕВЫЕ НАСТРОЙКИ ####### # каждый компьютер виден под уникальным именем через Avahi services.avahi = { - hostName = "nixos" + hostName = "nixos" + builtins.readFile ((pkgs.runCommandLocal "uuid" {} '' mkdir $out cat /proc/sys/kernel/random/uuid > $out/uuid @@ -475,23 +406,23 @@ in networking.networkmanager.enable = true; networking.hostName = "nixos"; - + # каждый компьютер ресолвит DNS-запросы СТРОГО через наш сервер networking.nameservers = [ serverIP ]; - + # каждый компьютер знает, что kafpi.local - это адрес нашего сервера networking.hosts."${serverIP}" = [ "kafpi.local" "hydra.kafpi.local" ]; - security.pki.certificateFiles = [ - (builtins.fetchurl { - url = "http://10.0.174.12/server.crt"; - sha256 = "sha256:0qx4acdhiciffvk1l7wkxyzapjwjy9zisq0mwyl727x97zrmi5ds"; - }) - (builtins.fetchurl { - url = "http://10.0.174.12/hydra.crt"; - sha256 = "sha256:1l5cvsikb5dnf49ajjjmz50avfkxm28jy65vnb9xidlv5vapi1zp"; - }) - ]; - + #security.pki.certificateFiles = [ + # (builtins.fetchurl { + # url = "http://${serverIP}/server.crt"; + # sha256 = "sha256:0qx4acdhiciffvk1l7wkxyzapjwjy9zisq0mwyl727x97zrmi5ds"; + # }) + # (builtins.fetchurl { + # url = "http://${serverIP}/hydra.crt"; + # sha256 = "sha256:1l5cvsikb5dnf49ajjjmz50avfkxm28jy65vnb9xidlv5vapi1zp"; + # }) + #]; + #### ЛОКАЛИЗАЦИЯ ##### time.timeZone = "Europe/Moscow"; @@ -529,6 +460,15 @@ in services.gnome.gnome-keyring.enable = true; programs = { + firejail = { + enable = true; + wrappedBinaries = { + packettracer7 = { + executable = "${packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; + extraArgs = [ "--net=none" "--noprofile" ]; + }; + }; + }; java.enable = true; gnupg.agent = { enable = true; @@ -549,3 +489,4 @@ in # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } + diff --git a/flake.nix b/flake.nix index 5c9ccf8..2ac383a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,30 +1,34 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - inputs.simintech.url = "github:gregorybednov/simintech_nix"; # /94cb0192edb8f42e21362dae2c3712a4cfa7d71e; - inputs.mireadesktop.url = "github:gregorybednov/mireadesktop"; - inputs.stm32cubemx.url = "github:gregorybednov/stm32cubemx"; - inputs.gostfont.url = "github:gregorybednov/gostfont"; - inputs.nix-jetbrains-plugins.url = "github:gregorybednov/nix-jetbrains-plugins"; - inputs.mireapython.url = "github:gregorybednov/mireapython"; - - outputs = - { - self, - nixpkgs, - simintech, - stm32cubemx, - ... - }@inputs: - { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit simintech; - inherit stm32cubemx; - inherit inputs; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.simintech.url = "github:gregorybednov/simintech_nix"; # /94cb0192edb8f42e21362dae2c3712a4cfa7d71e; + inputs.mireadesktop.url = "github:gregorybednov/mireadesktop"; + inputs.stm32cubemx.url = "github:gregorybednov/stm32cubemx"; + inputs.packettracer7.url = "github:gregorybednov/packettracer7"; + inputs.gostfont.url = "github:gregorybednov/gostfont"; + inputs.nix-jetbrains-plugins.url = "github:gregorybednov/nix-jetbrains-plugins"; + inputs.mireapython.url = "github:gregorybednov/mireapython"; + + outputs = + { + self, + nixpkgs, + simintech, + stm32cubemx, + packettracer7, + ... + }@inputs: + { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit simintech; + inherit stm32cubemx; + inherit packettracer7; + inherit inputs; + }; + modules = [ + ./configuration.nix + ]; }; - modules = [ - ./configuration.nix - ]; }; - }; -} + } + From b12b4a96a228d72974cf7acf0f6cd1a6d7a02121 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 29 Apr 2025 11:28:39 +0300 Subject: [PATCH 05/41] simintech update --- configuration.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index edcc634..16c5836 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ lib, config, pkgs, - simintech, + #simintech, stm32cubemx, packettracer7, inputs, @@ -223,7 +223,56 @@ in # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! - simintech.packages.x86_64-linux.simintech + #simintech.packages.x86_64-linux.simintech + (pkgs.stdenv.mkDerivation rec { + pname = "simintech"; + version = "2.23.13"; + src = builtins.fetchTarball { + url = "http://kafpi.local/simintech_rus_linux.tgz"; + sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; + }; + dontFixLibtool = true; + + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs-env"; + targetPkgs = p: with p; [ + at-spi2-atk.out + gdk-pixbuf.out + glamoroustoolkit.out + glib.out + gtk2.out + libGL.out + libGLU.out + pango.out + xorg.libX11.out + zlib.out + (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox + ]; + runScript = "${src}/bin/mmain"; + }; + + desktopItem = pkgs.makeDesktopItem { + name = "SimInTech"; + exec = "simintech"; + desktopName = "SimInTech"; + categories = [ "Development" ]; + icon = "simintech"; + terminal = false; + startupNotify = false; + mimeTypes = [ "x-scheme-handler/prt" ]; + }; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + #cp ${src}/share/icon.svg $out/share/icons/simintech.svg + cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + runHook postInstall + ''; + }) # POSIX утилиты для совместимости om4 From 2ca9ce7b7c9a50699a15343118eee5b244433629 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 29 Apr 2025 11:37:36 +0300 Subject: [PATCH 06/41] flake update --- flake.lock | 126 ++++++++++++++++++++++++++--------------------------- flake.nix | 14 +++--- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/flake.lock b/flake.lock index c4f8523..c7ce627 100644 --- a/flake.lock +++ b/flake.lock @@ -45,15 +45,15 @@ "locked": { "lastModified": 1736170321, "narHash": "sha256-/dY+z0JBdFvyJy4fuIidNpEGKQPR+JB1Lc6PbNoyvvs=", - "owner": "gregorybednov", - "repo": "gostfont", + "ref": "refs/heads/main", "rev": "4f11a7fdd2b0a390f98c8764e8f6830f75201096", - "type": "github" + "revCount": 6, + "type": "git", + "url": "git://10.0.174.12/gostfont" }, "original": { - "owner": "gregorybednov", - "repo": "gostfont", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/gostfont" } }, "mireadesktop": { @@ -63,15 +63,15 @@ "locked": { "lastModified": 1737932603, "narHash": "sha256-YKCNo6UGpWLDP1UwiP85aJ91nplHupBU5UU/Hy8y2bo=", - "owner": "gregorybednov", - "repo": "mireadesktop", + "ref": "refs/heads/main", "rev": "fa628ed1aff70c4121f718be450626bab46a1eab", - "type": "github" + "revCount": 34, + "type": "git", + "url": "git://10.0.174.12/mireadesktop" }, "original": { - "owner": "gregorybednov", - "repo": "mireadesktop", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/mireadesktop" } }, "mireapython": { @@ -81,15 +81,15 @@ "locked": { "lastModified": 1737741645, "narHash": "sha256-MaT05qTfUSHsoWgWJqv33LRie7spTz0b6FReJWDV4yk=", - "owner": "gregorybednov", - "repo": "mireapython", + "ref": "refs/heads/main", "rev": "b7172d602ff62aa02d68bd9852168bd3c32aa726", - "type": "github" + "revCount": 12, + "type": "git", + "url": "git://10.0.174.12/mireapython" }, "original": { - "owner": "gregorybednov", - "repo": "mireapython", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/mireapython" } }, "nix-jetbrains-plugins": { @@ -99,26 +99,26 @@ "systems": "systems" }, "locked": { - "lastModified": 1739546448, - "narHash": "sha256-wOlLg5tkCl2LW8php5bOZ9XACcEF/Wi3578AgHOY0aA=", - "owner": "gregorybednov", - "repo": "nix-jetbrains-plugins", - "rev": "afba27c8c3f6b978e2662f55e618d5eb88694142", - "type": "github" + "lastModified": 1740136774, + "narHash": "sha256-LJ6bXznu20nuRHe1D0sPmKozuS1wXeJvrDscCHRU85w=", + "ref": "refs/heads/main", + "rev": "c1b6f1b23bd29d520ac3f46fd596564ac6e84e2a", + "revCount": 44, + "type": "git", + "url": "git://10.0.174.12/nix-jetbrains-plugins" }, "original": { - "owner": "gregorybednov", - "repo": "nix-jetbrains-plugins", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/nix-jetbrains-plugins" } }, "nixpkgs": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -130,11 +130,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -178,11 +178,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -194,11 +194,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -210,11 +210,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -226,11 +226,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { @@ -248,15 +248,15 @@ "locked": { "lastModified": 1740143112, "narHash": "sha256-sawn/IVgT++IzbCsy/EhJ+w3+s2bxUF9jZ0kIPIXmcE=", - "owner": "gregorybednov", - "repo": "packettracer7", + "ref": "refs/heads/main", "rev": "eb673a5d201d9c32e8fc642e47b9c66ed6130379", - "type": "github" + "revCount": 2, + "type": "git", + "url": "git://10.0.174.12/packettracer7" }, "original": { - "owner": "gregorybednov", - "repo": "packettracer7", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/packettracer7" } }, "root": { @@ -278,15 +278,15 @@ "locked": { "lastModified": 1736199151, "narHash": "sha256-maK9G10f/AD/BS3kZP3h3ADhLzYh5qXBUj2HXEr7t4s=", - "owner": "gregorybednov", - "repo": "simintech_nix", + "ref": "refs/heads/main", "rev": "3ce193218e3f5b8cc5b5a212be550785d8e64e86", - "type": "github" + "revCount": 10, + "type": "git", + "url": "git://10.0.174.12/simintech_nix" }, "original": { - "owner": "gregorybednov", - "repo": "simintech_nix", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/simintech_nix" } }, "stm32cubemx": { @@ -296,15 +296,15 @@ "locked": { "lastModified": 1735908219, "narHash": "sha256-5VRV0ThLNWpCet8+Zpk9LqJnjJXQKI2pfak/I0Cxhvs=", - "owner": "gregorybednov", - "repo": "stm32cubemx", + "ref": "refs/heads/main", "rev": "d1ebff9193ed7be660e14167f8fb1625be8df4f0", - "type": "github" + "revCount": 31, + "type": "git", + "url": "git://10.0.174.12/stm32cubemx" }, "original": { - "owner": "gregorybednov", - "repo": "stm32cubemx", - "type": "github" + "type": "git", + "url": "git://10.0.174.12/stm32cubemx" } }, "systems": { diff --git a/flake.nix b/flake.nix index 2ac383a..a975229 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,12 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - inputs.simintech.url = "github:gregorybednov/simintech_nix"; # /94cb0192edb8f42e21362dae2c3712a4cfa7d71e; - inputs.mireadesktop.url = "github:gregorybednov/mireadesktop"; - inputs.stm32cubemx.url = "github:gregorybednov/stm32cubemx"; - inputs.packettracer7.url = "github:gregorybednov/packettracer7"; - inputs.gostfont.url = "github:gregorybednov/gostfont"; - inputs.nix-jetbrains-plugins.url = "github:gregorybednov/nix-jetbrains-plugins"; - inputs.mireapython.url = "github:gregorybednov/mireapython"; + inputs.simintech.url = "git://10.0.174.12/simintech_nix"; + inputs.mireadesktop.url = "git://10.0.174.12/mireadesktop"; + inputs.stm32cubemx.url = "git://10.0.174.12/stm32cubemx"; + inputs.packettracer7.url = "git://10.0.174.12/packettracer7"; + inputs.gostfont.url = "git://10.0.174.12/gostfont"; + inputs.nix-jetbrains-plugins.url = "git://10.0.174.12/nix-jetbrains-plugins"; + inputs.mireapython.url = "git://10.0.174.12/mireapython"; outputs = { From ec565c41f158707eb6662f71e42d3a4aef90f638 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 29 Apr 2025 11:48:14 +0300 Subject: [PATCH 07/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix=20=09=D0=B8?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE:=20=20=20=20=20=20fl?= =?UTF-8?q?ake.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 338 +++++++++++++++++++++++++--------------------- flake.nix | 63 +++++---- 2 files changed, 216 insertions(+), 185 deletions(-) diff --git a/configuration.nix b/configuration.nix index 16c5836..c294ef4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -16,7 +16,12 @@ in users.users.student = { isNormalUser = true; initialPassword = "student"; # вход беспарольный, но пароль student - extraGroups = [ "video" "sound" "input" "storage" ]; + extraGroups = [ + "video" + "sound" + "input" + "storage" + ]; packages = let # определение как скачивать плагины jetbrains (скачивать с нашего сервера копию) @@ -61,8 +66,7 @@ in #idea-community."2024.1"."R4Intellij" idea-community."2024.1"."com.redhat.devtools.lsp4ij" ]) - ++ - [ + ++ [ # поддежка языка C/C++ на уровне подсветки синтаксиса и автодополнения (customJBPlugin "clsp" "1.0.1" "sha256-AU/Q61YYsGn2BAYykCGm4XGNyeSwd5K/txGNzP2dJg0=") @@ -74,13 +78,18 @@ in )) chromium # браузер - pinta # графический редактор - sakura # терминал + pinta # графический редактор + sakura # терминал unzipNLS # поддержка zip - unrar # поддержка rar - gtk3 whitesur-icon-theme # необходимо для иконок - (pkgs.writeShellScriptBin "powermenu" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu)) - (pkgs.writeShellScriptBin "resethome" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome)) + unrar # поддержка rar + gtk3 + whitesur-icon-theme # необходимо для иконок + (pkgs.writeShellScriptBin "powermenu" ( + builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu + )) + (pkgs.writeShellScriptBin "resethome" ( + builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome + )) pandoc #onlyoffice-desktopeditors # к сожалению, пока у OnlyOffice баг со шрифтами. Ждём фикс @@ -118,7 +127,8 @@ in # Другие возможные языки и инструменты, например: # rustc # - Rust # go gopls delve golint go-tools # - Go - jdk kotlin # - Java, Kotlin (идут вместе с IJ IDEA) + jdk + kotlin # - Java, Kotlin (идут вместе с IJ IDEA) # ghc haskell-language-server # - Haskell # nodePackages.intelephense # - PHP # dotnet-sdk # - C# @@ -143,7 +153,6 @@ in archi # поддержка archimate - ##### Утилиты и программы для STM32 ##### # 1) STM32CubeIDE упаковать не удалось # 2) есть основания полагать, что её функциональность лучше встроить @@ -156,123 +165,126 @@ in ##### СЕТЕВЫЕ УТИЛИТЫ ###### # установлен Cisco Packet Tracer, обернут в firejail чтобы не стучался на Netacad.com - nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей - httpie httpie-desktop # - передовой клиент HTTP-запросов - netcat socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК - opcua-client-gui # - простой графический клиент OPC UA + nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей + httpie + httpie-desktop # - передовой клиент HTTP-запросов + netcat + socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК + opcua-client-gui # - простой графический клиент OPC UA ###### Другой софт ####### logisim-evolution unityhub # UnityHub - 3D-моделирование, визуализация, геймдев, AR/VR (pkgs.stdenv.mkDerivation rec { - pname = "cnc_vmc_sim"; - version = "1.0.0-share"; - src = builtins.fetchTarball { - url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; - sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; - }; + pname = "cnc_vmc_sim"; + version = "1.0.0-share"; + src = builtins.fetchTarball { + url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; + sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - cp ${src}/icon.png $out/share/icons/${pname}.png - cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + cp ${src}/icon.png $out/share/icons/${pname}.png + cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + ''; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs"; - targetPkgs = p: with p; [ - eudev.out - libGL.out - openal.out - xorg.libX11.out - ]; - runScript = "${src}/${pname}"; - }; - - desktopItem = pkgs.makeDesktopItem { - name = "CNC VMC (free)"; - exec = "${pname}"; - desktopName = "CNC VMC (free)"; - categories = [ "Development" ]; - icon = "${pname}"; - terminal = false; - startupNotify = false; - }; - }) - (pkgs.stdenv.mkDerivation rec { - pname = "ramus"; - version = "0.1.3"; - src = builtins.fetchTarball { - url = "http://${serverIP}/ramus.tar.xz"; - sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; - }; - installPhase = '' - sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop - mkdir $out - cp -r share bin lib $out - echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus - chmod +x $out/bin/ramus - ''; - }) + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs"; + targetPkgs = + p: with p; [ + eudev.out + libGL.out + openal.out + xorg.libX11.out + ]; + runScript = "${src}/${pname}"; + }; + desktopItem = pkgs.makeDesktopItem { + name = "CNC VMC (free)"; + exec = "${pname}"; + desktopName = "CNC VMC (free)"; + categories = [ "Development" ]; + icon = "${pname}"; + terminal = false; + startupNotify = false; + }; + }) + (pkgs.stdenv.mkDerivation rec { + pname = "ramus"; + version = "0.1.3"; + src = builtins.fetchTarball { + url = "http://${serverIP}/ramus.tar.xz"; + sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; + }; + installPhase = '' + sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop + mkdir $out + cp -r share bin lib $out + echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus + chmod +x $out/bin/ramus + ''; + }) # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! #simintech.packages.x86_64-linux.simintech (pkgs.stdenv.mkDerivation rec { - pname = "simintech"; - version = "2.23.13"; - src = builtins.fetchTarball { - url = "http://kafpi.local/simintech_rus_linux.tgz"; - sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; - }; - dontFixLibtool = true; + pname = "simintech"; + version = "2.23.13"; + src = builtins.fetchTarball { + url = "http://kafpi.local/simintech_rus_linux.tgz"; + sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; + }; + dontFixLibtool = true; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs-env"; - targetPkgs = p: with p; [ - at-spi2-atk.out - gdk-pixbuf.out - glamoroustoolkit.out - glib.out - gtk2.out - libGL.out - libGLU.out - pango.out - xorg.libX11.out - zlib.out - (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox - ]; - runScript = "${src}/bin/mmain"; - }; + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs-env"; + targetPkgs = + p: with p; [ + at-spi2-atk.out + gdk-pixbuf.out + glamoroustoolkit.out + glib.out + gtk2.out + libGL.out + libGLU.out + pango.out + xorg.libX11.out + zlib.out + (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox + ]; + runScript = "${src}/bin/mmain"; + }; - desktopItem = pkgs.makeDesktopItem { - name = "SimInTech"; - exec = "simintech"; - desktopName = "SimInTech"; - categories = [ "Development" ]; - icon = "simintech"; - terminal = false; - startupNotify = false; - mimeTypes = [ "x-scheme-handler/prt" ]; - }; + desktopItem = pkgs.makeDesktopItem { + name = "SimInTech"; + exec = "simintech"; + desktopName = "SimInTech"; + categories = [ "Development" ]; + icon = "simintech"; + terminal = false; + startupNotify = false; + mimeTypes = [ "x-scheme-handler/prt" ]; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - #cp ${src}/share/icon.svg $out/share/icons/simintech.svg - cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - runHook postInstall - ''; - }) + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + #cp ${src}/share/icon.svg $out/share/icons/simintech.svg + cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + runHook postInstall + ''; + }) # POSIX утилиты для совместимости om4 @@ -307,9 +319,9 @@ in services.postgresql = { enable = true; authentication = pkgs.lib.mkOverride 10 '' - #type database DBuser auth-method - local all all trust - ''; + #type database DBuser auth-method + local all all trust + ''; }; # и оба поддерживают вход без пароля в "руты" @@ -338,24 +350,34 @@ in # если машина установлена на диск с Windows, # то она позволяет "увидеть" и выбрать Windows в течение 30 с # иначе - 5 c таймаута (для виртуалок) - boot.loader = if hasBootPartition then { - efi.canTouchEfiVariables = true; - timeout = 30; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - useOSProber = true; - theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Выберите ОС"; }}"; - }; - } else { - timeout = 5; - grub = { - enable = true; - device = "/dev/sda"; - theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Загрузчик Linux"; }}"; - }; - }; + boot.loader = + if hasBootPartition then + { + efi.canTouchEfiVariables = true; + timeout = 30; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + useOSProber = true; + theme = "${pkgs.sleek-grub-theme.override { + withStyle = "orange"; + withBanner = "Выберите ОС"; + }}"; + }; + } + else + { + timeout = 5; + grub = { + enable = true; + device = "/dev/sda"; + theme = "${pkgs.sleek-grub-theme.override { + withStyle = "orange"; + withBanner = "Загрузчик Linux"; + }}"; + }; + }; time.hardwareClockInLocalTime = hasBootPartition; # настройки Nix @@ -365,9 +387,9 @@ in }; nix.settings = { substituters = [ - "https://cache.nixos.org" + "https://cache.nixos.org" ]; - trusted-public-keys = ["kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw="]; + trusted-public-keys = [ "kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw=" ]; auto-optimise-store = true; }; nix.extraOptions = '' @@ -392,18 +414,20 @@ in }; hardware.enableAllFirmware = true; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_470; - modesetting.enable = true; - powerManagement.enable = true; - open = false; - nvidiaSettings = false; + package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + modesetting.enable = true; + powerManagement.enable = true; + open = false; + nvidiaSettings = false; }; boot.blacklistedKernelModules = [ "nouveau" ]; - boot.extraModprobeConfig = "options nvidia " + lib.concatStringsSep " " [ - "NVreg_UsePageAttributeTable=1" - "NVreg_EnablePCIeGen3=1" - "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" - ]; + boot.extraModprobeConfig = + "options nvidia " + + lib.concatStringsSep " " [ + "NVreg_UsePageAttributeTable=1" + "NVreg_EnablePCIeGen3=1" + "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" + ]; services.displayManager.autoLogin.user = "student"; services.getty.autologinUser = "student"; @@ -434,11 +458,15 @@ in ##### СЕТЕВЫЕ НАСТРОЙКИ ####### # каждый компьютер виден под уникальным именем через Avahi services.avahi = { - hostName = "nixos" - + builtins.readFile ((pkgs.runCommandLocal "uuid" {} '' - mkdir $out - cat /proc/sys/kernel/random/uuid > $out/uuid - '')+"/uuid"); + hostName = + "nixos" + + builtins.readFile ( + (pkgs.runCommandLocal "uuid" { } '' + mkdir $out + cat /proc/sys/kernel/random/uuid > $out/uuid + '') + + "/uuid" + ); enable = true; nssmdns4 = true; openFirewall = true; @@ -460,7 +488,10 @@ in networking.nameservers = [ serverIP ]; # каждый компьютер знает, что kafpi.local - это адрес нашего сервера - networking.hosts."${serverIP}" = [ "kafpi.local" "hydra.kafpi.local" ]; + networking.hosts."${serverIP}" = [ + "kafpi.local" + "hydra.kafpi.local" + ]; #security.pki.certificateFiles = [ # (builtins.fetchurl { # url = "http://${serverIP}/server.crt"; @@ -492,7 +523,6 @@ in liberation_ttf ]; - ####### ПРОЧИЕ НАСТРОЙКИ ####### environment.systemPackages = with pkgs; [ vim @@ -514,7 +544,10 @@ in wrappedBinaries = { packettracer7 = { executable = "${packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; - extraArgs = [ "--net=none" "--noprofile" ]; + extraArgs = [ + "--net=none" + "--noprofile" + ]; }; }; }; @@ -538,4 +571,3 @@ in # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } - diff --git a/flake.nix b/flake.nix index a975229..0e54926 100644 --- a/flake.nix +++ b/flake.nix @@ -1,34 +1,33 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - inputs.simintech.url = "git://10.0.174.12/simintech_nix"; - inputs.mireadesktop.url = "git://10.0.174.12/mireadesktop"; - inputs.stm32cubemx.url = "git://10.0.174.12/stm32cubemx"; - inputs.packettracer7.url = "git://10.0.174.12/packettracer7"; - inputs.gostfont.url = "git://10.0.174.12/gostfont"; - inputs.nix-jetbrains-plugins.url = "git://10.0.174.12/nix-jetbrains-plugins"; - inputs.mireapython.url = "git://10.0.174.12/mireapython"; - - outputs = - { - self, - nixpkgs, - simintech, - stm32cubemx, - packettracer7, - ... - }@inputs: - { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit simintech; - inherit stm32cubemx; - inherit packettracer7; - inherit inputs; - }; - modules = [ - ./configuration.nix - ]; - }; - }; - } + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.simintech.url = "git://10.0.174.12/simintech_nix"; + inputs.mireadesktop.url = "git://10.0.174.12/mireadesktop"; + inputs.stm32cubemx.url = "git://10.0.174.12/stm32cubemx"; + inputs.packettracer7.url = "git://10.0.174.12/packettracer7"; + inputs.gostfont.url = "git://10.0.174.12/gostfont"; + inputs.nix-jetbrains-plugins.url = "git://10.0.174.12/nix-jetbrains-plugins"; + inputs.mireapython.url = "git://10.0.174.12/mireapython"; + outputs = + { + self, + nixpkgs, + simintech, + stm32cubemx, + packettracer7, + ... + }@inputs: + { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit simintech; + inherit stm32cubemx; + inherit packettracer7; + inherit inputs; + }; + modules = [ + ./configuration.nix + ]; + }; + }; +} From d6538f1508d243eb17a78016dda2db8db41bdc76 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Mon, 30 Jun 2025 14:42:13 +0300 Subject: [PATCH 08/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index c294ef4..0fc95d6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -142,9 +142,36 @@ in # аналог Bizagi Modeler, расширенный вариант bpmn.io camunda-modeler + # StarUML + # staruml + # записано через mkDerivation, чтобы был вечный evalution mode # графическое моделирование UML-диаграмм # также доступно моделирование BPMN и ER - staruml + (pkgs.stdenv.mkDerivation rec { + pname = "staruml"; + version = "6.2.2"; + src = ./.; + nativeBuildInputs = [ pkgs.staruml ]; + dontBuild = true; + installPhase = '' +mkdir -p $out/bin +cat < $out/bin/staruml +rm -rf /home/student/.config/StarUML; +${pkgs.staruml}/bin/StarUML +EOF +chmod +x $out/bin/staruml +''; + desktopItem = pkgs.makeDesktopItem { + name = "staruml"; + exec = "staruml"; + desktopName = "StarUML"; + categories = [ "Database" ]; + icon = "staruml"; + terminal = false; + startupNotify = false; + mimeTypes = [ "x-scheme-handler/mdj" ]; + }; + }) # Язык текстового описания UML-диаграмм # актуально для разработчиков ПО (встраивание диаграмм в код) From c4a72e89446282191ca365de9f37e11d37f6c427 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 23 Aug 2025 18:07:01 +0300 Subject: [PATCH 09/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 382 ++++++++++++++++++++-------------------------- 1 file changed, 165 insertions(+), 217 deletions(-) diff --git a/configuration.nix b/configuration.nix index 0fc95d6..a5edc00 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,17 +11,15 @@ let serverIP = "10.0.174.12"; hasBootPartition = config.fileSystems ? "/boot"; + isNvidia = (builtins.readFile (pkgs.runCommandLocal "isNvidia" {} '' + ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out + '')) != ""; in { users.users.student = { isNormalUser = true; initialPassword = "student"; # вход беспарольный, но пароль student - extraGroups = [ - "video" - "sound" - "input" - "storage" - ]; + extraGroups = [ "video" "sound" "input" "storage" ]; packages = let # определение как скачивать плагины jetbrains (скачивать с нашего сервера копию) @@ -66,7 +64,8 @@ in #idea-community."2024.1"."R4Intellij" idea-community."2024.1"."com.redhat.devtools.lsp4ij" ]) - ++ [ + ++ + [ # поддежка языка C/C++ на уровне подсветки синтаксиса и автодополнения (customJBPlugin "clsp" "1.0.1" "sha256-AU/Q61YYsGn2BAYykCGm4XGNyeSwd5K/txGNzP2dJg0=") @@ -78,18 +77,13 @@ in )) chromium # браузер - pinta # графический редактор - sakura # терминал + pinta # графический редактор + sakura # терминал unzipNLS # поддержка zip - unrar # поддержка rar - gtk3 - whitesur-icon-theme # необходимо для иконок - (pkgs.writeShellScriptBin "powermenu" ( - builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu - )) - (pkgs.writeShellScriptBin "resethome" ( - builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome - )) + unrar # поддержка rar + gtk3 whitesur-icon-theme # необходимо для иконок + (pkgs.writeShellScriptBin "powermenu" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu)) + (pkgs.writeShellScriptBin "resethome" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome)) pandoc #onlyoffice-desktopeditors # к сожалению, пока у OnlyOffice баг со шрифтами. Ждём фикс @@ -127,8 +121,7 @@ in # Другие возможные языки и инструменты, например: # rustc # - Rust # go gopls delve golint go-tools # - Go - jdk - kotlin # - Java, Kotlin (идут вместе с IJ IDEA) + jdk kotlin # - Java, Kotlin (идут вместе с IJ IDEA) # ghc haskell-language-server # - Haskell # nodePackages.intelephense # - PHP # dotnet-sdk # - C# @@ -142,36 +135,9 @@ in # аналог Bizagi Modeler, расширенный вариант bpmn.io camunda-modeler - # StarUML - # staruml - # записано через mkDerivation, чтобы был вечный evalution mode # графическое моделирование UML-диаграмм # также доступно моделирование BPMN и ER - (pkgs.stdenv.mkDerivation rec { - pname = "staruml"; - version = "6.2.2"; - src = ./.; - nativeBuildInputs = [ pkgs.staruml ]; - dontBuild = true; - installPhase = '' -mkdir -p $out/bin -cat < $out/bin/staruml -rm -rf /home/student/.config/StarUML; -${pkgs.staruml}/bin/StarUML -EOF -chmod +x $out/bin/staruml -''; - desktopItem = pkgs.makeDesktopItem { - name = "staruml"; - exec = "staruml"; - desktopName = "StarUML"; - categories = [ "Database" ]; - icon = "staruml"; - terminal = false; - startupNotify = false; - mimeTypes = [ "x-scheme-handler/mdj" ]; - }; - }) + staruml # Язык текстового описания UML-диаграмм # актуально для разработчиков ПО (встраивание диаграмм в код) @@ -180,6 +146,7 @@ chmod +x $out/bin/staruml archi # поддержка archimate + ##### Утилиты и программы для STM32 ##### # 1) STM32CubeIDE упаковать не удалось # 2) есть основания полагать, что её функциональность лучше встроить @@ -192,126 +159,123 @@ chmod +x $out/bin/staruml ##### СЕТЕВЫЕ УТИЛИТЫ ###### # установлен Cisco Packet Tracer, обернут в firejail чтобы не стучался на Netacad.com - nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей - httpie - httpie-desktop # - передовой клиент HTTP-запросов - netcat - socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК - opcua-client-gui # - простой графический клиент OPC UA + nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей + httpie httpie-desktop # - передовой клиент HTTP-запросов + netcat socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК + opcua-client-gui # - простой графический клиент OPC UA ###### Другой софт ####### logisim-evolution unityhub # UnityHub - 3D-моделирование, визуализация, геймдев, AR/VR (pkgs.stdenv.mkDerivation rec { - pname = "cnc_vmc_sim"; - version = "1.0.0-share"; - src = builtins.fetchTarball { - url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; - sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; - }; + pname = "cnc_vmc_sim"; + version = "1.0.0-share"; + src = builtins.fetchTarball { + url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; + sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - cp ${src}/icon.png $out/share/icons/${pname}.png - cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + cp ${src}/icon.png $out/share/icons/${pname}.png + cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + ''; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs"; - targetPkgs = - p: with p; [ - eudev.out - libGL.out - openal.out - xorg.libX11.out - ]; - runScript = "${src}/${pname}"; - }; + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs"; + targetPkgs = p: with p; [ + eudev.out + libGL.out + openal.out + xorg.libX11.out + ]; + runScript = "${src}/${pname}"; + }; + + desktopItem = pkgs.makeDesktopItem { + name = "CNC VMC (free)"; + exec = "${pname}"; + desktopName = "CNC VMC (free)"; + categories = [ "Development" ]; + icon = "${pname}"; + terminal = false; + startupNotify = false; + }; + }) + (pkgs.stdenv.mkDerivation rec { + pname = "ramus"; + version = "0.1.3"; + src = builtins.fetchTarball { + url = "http://${serverIP}/ramus.tar.xz"; + sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; + }; + installPhase = '' + sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop + mkdir $out + cp -r share bin lib $out + echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus + chmod +x $out/bin/ramus + ''; + }) - desktopItem = pkgs.makeDesktopItem { - name = "CNC VMC (free)"; - exec = "${pname}"; - desktopName = "CNC VMC (free)"; - categories = [ "Development" ]; - icon = "${pname}"; - terminal = false; - startupNotify = false; - }; - }) - (pkgs.stdenv.mkDerivation rec { - pname = "ramus"; - version = "0.1.3"; - src = builtins.fetchTarball { - url = "http://${serverIP}/ramus.tar.xz"; - sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; - }; - installPhase = '' - sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop - mkdir $out - cp -r share bin lib $out - echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus - chmod +x $out/bin/ramus - ''; - }) # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! #simintech.packages.x86_64-linux.simintech (pkgs.stdenv.mkDerivation rec { - pname = "simintech"; - version = "2.23.13"; - src = builtins.fetchTarball { - url = "http://kafpi.local/simintech_rus_linux.tgz"; - sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; - }; - dontFixLibtool = true; + pname = "simintech"; + version = "2.23.13"; + src = builtins.fetchTarball { + url = "http://kafpi.local/simintech_rus_linux.tgz"; + sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; + }; + dontFixLibtool = true; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs-env"; - targetPkgs = - p: with p; [ - at-spi2-atk.out - gdk-pixbuf.out - glamoroustoolkit.out - glib.out - gtk2.out - libGL.out - libGLU.out - pango.out - xorg.libX11.out - zlib.out - (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox - ]; - runScript = "${src}/bin/mmain"; - }; + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs-env"; + targetPkgs = p: with p; [ + at-spi2-atk.out + gdk-pixbuf.out + glamoroustoolkit.out + glib.out + gtk2.out + libGL.out + libGLU.out + pango.out + xorg.libX11.out + zlib.out + (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox + ]; + runScript = "${src}/bin/mmain"; + }; - desktopItem = pkgs.makeDesktopItem { - name = "SimInTech"; - exec = "simintech"; - desktopName = "SimInTech"; - categories = [ "Development" ]; - icon = "simintech"; - terminal = false; - startupNotify = false; - mimeTypes = [ "x-scheme-handler/prt" ]; - }; + desktopItem = pkgs.makeDesktopItem { + name = "SimInTech"; + exec = "simintech"; + desktopName = "SimInTech"; + categories = [ "Development" ]; + icon = "simintech"; + terminal = false; + startupNotify = false; + mimeTypes = [ "x-scheme-handler/prt" ]; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - #cp ${src}/share/icon.svg $out/share/icons/simintech.svg - cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - runHook postInstall - ''; - }) + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + #cp ${src}/share/icon.svg $out/share/icons/simintech.svg + cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + runHook postInstall + ''; + }) # POSIX утилиты для совместимости om4 @@ -346,9 +310,9 @@ chmod +x $out/bin/staruml services.postgresql = { enable = true; authentication = pkgs.lib.mkOverride 10 '' - #type database DBuser auth-method - local all all trust - ''; + #type database DBuser auth-method + local all all trust + ''; }; # и оба поддерживают вход без пароля в "руты" @@ -377,34 +341,24 @@ chmod +x $out/bin/staruml # если машина установлена на диск с Windows, # то она позволяет "увидеть" и выбрать Windows в течение 30 с # иначе - 5 c таймаута (для виртуалок) - boot.loader = - if hasBootPartition then - { - efi.canTouchEfiVariables = true; - timeout = 30; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - useOSProber = true; - theme = "${pkgs.sleek-grub-theme.override { - withStyle = "orange"; - withBanner = "Выберите ОС"; - }}"; - }; - } - else - { - timeout = 5; - grub = { - enable = true; - device = "/dev/sda"; - theme = "${pkgs.sleek-grub-theme.override { - withStyle = "orange"; - withBanner = "Загрузчик Linux"; - }}"; - }; - }; + boot.loader = if hasBootPartition then { + efi.canTouchEfiVariables = true; + timeout = 30; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + useOSProber = true; + theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Выберите ОС"; }}"; + }; + } else { + timeout = 5; + grub = { + enable = true; + device = "/dev/sda"; + theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Загрузчик Linux"; }}"; + }; + }; time.hardwareClockInLocalTime = hasBootPartition; # настройки Nix @@ -414,9 +368,9 @@ chmod +x $out/bin/staruml }; nix.settings = { substituters = [ - "https://cache.nixos.org" + "https://cache.nixos.org" ]; - trusted-public-keys = [ "kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw=" ]; + trusted-public-keys = ["kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw="]; auto-optimise-store = true; }; nix.extraOptions = '' @@ -426,35 +380,37 @@ chmod +x $out/bin/staruml ##### НАСТРОЙКИ ГРАФИКИ И РАБОЧЕГО СТОЛА ###### hardware.graphics = { enable = true; - enable32Bit = true; - extraPackages = with pkgs; [ nvidia-vaapi-driver ]; + #enable32Bit = true; + extraPackages = if isNvidia then with pkgs; [ nvidia-vaapi-driver vaapiVdpau libvdpau-va-gl] else []; }; services.xserver = { enable = true; - videoDrivers = [ - "nvidia" - "modesetting" - "fbdev" - ]; + videoDrivers = if isNvidia then [ "nvidia" ] else [ "modesetting" "fbdev" ]; xkb.layout = "us,ru"; xkb.options = "grp:alt_shift_toggle"; }; hardware.enableAllFirmware = true; + #hardware.nvidia = { + # package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + # modesetting.enable = true; + # powerManagement.enable = true; + # open = false; + # nvidiaSettings = false; + #}; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; powerManagement.enable = true; open = false; nvidiaSettings = false; }; - boot.blacklistedKernelModules = [ "nouveau" ]; - boot.extraModprobeConfig = - "options nvidia " - + lib.concatStringsSep " " [ - "NVreg_UsePageAttributeTable=1" - "NVreg_EnablePCIeGen3=1" - "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" - ]; + boot.kernelParams = if isNvidia then ["nvidia-drm.modeset=1" ] else []; + boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else []; + boot.extraModprobeConfig = if isNvidia then "options nvidia " + lib.concatStringsSep " " [ + "NVreg_UsePageAttributeTable=1" + "NVreg_EnablePCIeGen3=1" + "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" + ] else ""; services.displayManager.autoLogin.user = "student"; services.getty.autologinUser = "student"; @@ -485,15 +441,11 @@ chmod +x $out/bin/staruml ##### СЕТЕВЫЕ НАСТРОЙКИ ####### # каждый компьютер виден под уникальным именем через Avahi services.avahi = { - hostName = - "nixos" - + builtins.readFile ( - (pkgs.runCommandLocal "uuid" { } '' - mkdir $out - cat /proc/sys/kernel/random/uuid > $out/uuid - '') - + "/uuid" - ); + hostName = "nixos" + + builtins.readFile ((pkgs.runCommandLocal "uuid" {} '' + mkdir $out + cat /proc/sys/kernel/random/uuid > $out/uuid + '')+"/uuid"); enable = true; nssmdns4 = true; openFirewall = true; @@ -515,10 +467,7 @@ chmod +x $out/bin/staruml networking.nameservers = [ serverIP ]; # каждый компьютер знает, что kafpi.local - это адрес нашего сервера - networking.hosts."${serverIP}" = [ - "kafpi.local" - "hydra.kafpi.local" - ]; + networking.hosts."${serverIP}" = [ "kafpi.local" "hydra.kafpi.local" ]; #security.pki.certificateFiles = [ # (builtins.fetchurl { # url = "http://${serverIP}/server.crt"; @@ -550,6 +499,7 @@ chmod +x $out/bin/staruml liberation_ttf ]; + ####### ПРОЧИЕ НАСТРОЙКИ ####### environment.systemPackages = with pkgs; [ vim @@ -571,10 +521,7 @@ chmod +x $out/bin/staruml wrappedBinaries = { packettracer7 = { executable = "${packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; - extraArgs = [ - "--net=none" - "--noprofile" - ]; + extraArgs = [ "--net=none" "--noprofile" ]; }; }; }; @@ -598,3 +545,4 @@ chmod +x $out/bin/staruml # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } + From 4909c94fadaab2a6cbce8ff6e58e0bfbc4023c55 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 23 Aug 2025 19:48:14 +0300 Subject: [PATCH 10/41] no systemd plugin for ij idea --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index a5edc00..308edc6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -53,7 +53,7 @@ in idea-community."2024.1"."PlantUML integration" idea-community."2024.1"."org.intellij.scala" idea-community."2024.1"."PythonCore" - idea-community."2024.1"."net.sjrx.intellij.plugins.systemdunitfiles" + #idea-community."2024.1"."net.sjrx.intellij.plugins.systemdunitfiles" idea-community."2024.1"."com.intellij.jsonpath" idea-community."2024.1"."Lombook Plugin" idea-community."2024.1"."org.mapstruct.intellij" From 37946c90ae5cbdbe58727a211d8a66e5ff1f96ce Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 23 Aug 2025 20:07:02 +0300 Subject: [PATCH 11/41] no stm32cube --- configuration.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 308edc6..8b459ca 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,7 +3,7 @@ config, pkgs, #simintech, - stm32cubemx, + #stm32cubemx, packettracer7, inputs, ... @@ -151,7 +151,7 @@ in # 1) STM32CubeIDE упаковать не удалось # 2) есть основания полагать, что её функциональность лучше встроить # в IJ IDEA CE, как это сделано в настоящем Clion; - stm32cubemx.packages.x86_64-linux.stm32cubemx + #stm32cubemx.packages.x86_64-linux.stm32cubemx stm32flash stlink stlink-gui From 8e2d4a753ff50bd2a71260eccdbab47801ecb711 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Mon, 25 Aug 2025 13:46:09 +0300 Subject: [PATCH 12/41] tmux added --- configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configuration.nix b/configuration.nix index 8b459ca..ef341f6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -337,6 +337,12 @@ in }; imports = [ ./hardware-configuration.nix ]; + programs.tmux = { + enable = true; + withUtempter = true; + historyLimit = 5000; + clock24 = true; + }; # если машина установлена на диск с Windows, # то она позволяет "увидеть" и выбрать Windows в течение 30 с From f760950ae9f1bd4ebb29986df55000fd2d920e62 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 27 Dec 2025 04:35:58 +0300 Subject: [PATCH 13/41] ygg again --- configuration.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index ef341f6..e232f58 100644 --- a/configuration.nix +++ b/configuration.nix @@ -293,6 +293,15 @@ in ]; }; + programs.vscode = { + enable = true; + extenstions = with pkgs.vscode-extensions; [ + ms-vscode.cpptools-extension-pack + zainchen.json + ]; + defaultEditor = true; + }; + # вставленные флешки автоматически монтируются services.devmon.enable = true; @@ -445,14 +454,18 @@ in ]; ##### СЕТЕВЫЕ НАСТРОЙКИ ####### - # каждый компьютер виден под уникальным именем через Avahi + services.yggdrasil = { + enable = true; + persistentKeys = true; + settings = { Peers = [ "tcp://10.0.174.12:12345" ]; }; + }; services.avahi = { + enable = false; hostName = "nixos" + builtins.readFile ((pkgs.runCommandLocal "uuid" {} '' mkdir $out cat /proc/sys/kernel/random/uuid > $out/uuid '')+"/uuid"); - enable = true; nssmdns4 = true; openFirewall = true; publish = { From 601b2ac402e722e7910d1aecf44128b231f3b397 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 27 Dec 2025 04:47:19 +0300 Subject: [PATCH 14/41] programs.vscode was invented too recently --- configuration.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index e232f58..efe54ca 100644 --- a/configuration.nix +++ b/configuration.nix @@ -277,6 +277,14 @@ in ''; }) + (vscode-with-extensions.override { + vscodeExtensions = with vscode-extensions; [ + "ms-vscode.cpptools-extension-pack" + "zainchen.json" + "ms-dotnettools.csharp" + ]; + }) + # POSIX утилиты для совместимости om4 pax @@ -293,15 +301,6 @@ in ]; }; - programs.vscode = { - enable = true; - extenstions = with pkgs.vscode-extensions; [ - ms-vscode.cpptools-extension-pack - zainchen.json - ]; - defaultEditor = true; - }; - # вставленные флешки автоматически монтируются services.devmon.enable = true; From 04ad357b59f235bc24602cb50e404538625ac086 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 27 Dec 2025 04:58:34 +0300 Subject: [PATCH 15/41] fixed || true issue --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index efe54ca..cf7f1bb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,7 +12,7 @@ let serverIP = "10.0.174.12"; hasBootPartition = config.fileSystems ? "/boot"; isNvidia = (builtins.readFile (pkgs.runCommandLocal "isNvidia" {} '' - ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out + ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out || true '')) != ""; in { From 493c848267b59f583a3014455f866b4def783660 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 27 Dec 2025 05:10:14 +0300 Subject: [PATCH 16/41] vscode extensions --- configuration.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index cf7f1bb..8b21040 100644 --- a/configuration.nix +++ b/configuration.nix @@ -279,9 +279,9 @@ in (vscode-with-extensions.override { vscodeExtensions = with vscode-extensions; [ - "ms-vscode.cpptools-extension-pack" - "zainchen.json" - "ms-dotnettools.csharp" + ms-vscode.cpptools-extension-pack + zainchen.json + ms-dotnettools.csharp ]; }) From ff43c9d25b9433ba61d3c9fe7f31b31b7a30a880 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Mon, 26 Jan 2026 13:13:47 +0300 Subject: [PATCH 17/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 216 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 173 insertions(+), 43 deletions(-) diff --git a/configuration.nix b/configuration.nix index 8b21040..f9ef9ce 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,12 +10,24 @@ }: let serverIP = "10.0.174.12"; + buildNodeYggIP = "[200:ccc6:1361:5c84:aba0:1244:35f5:c903]"; hasBootPartition = config.fileSystems ? "/boot"; isNvidia = (builtins.readFile (pkgs.runCommandLocal "isNvidia" {} '' ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out || true '')) != ""; + starumlDebUrl = "http://${serverIP}/StarUML_6.2.2_amd64.deb"; # подставь точное имя in { + nixpkgs.overlays = [ + (final: prev: { + staruml = prev.staruml.overrideAttrs (old: { + src = final.fetchurl { + url = starumlDebUrl; + hash = "sha256-1zxrT7phXeQYNbWHWMyPuHiUglrPSMPP0bfAcfvt8dM="; + }; + }); + }) + ]; users.users.student = { isNormalUser = true; initialPassword = "student"; # вход беспарольный, но пароль student @@ -44,12 +56,11 @@ in # набор плагинов, я бы сказал, богат до избыточности, но главное есть Python # и Database Nagivator. Остальное - любителям и любознательным. (with inputs.nix-jetbrains-plugins.plugins."${system}"; [ - #idea-community."2024.1"."mobi.hsz.idea.gitignore" - idea-community."2024.1"."org.jetbrains.erlang" + idea-community."2024.1"."mobi.hsz.idea.gitignore" + #idea-community."2024.1"."org.jetbrains.erlang" idea-community."2024.1"."JProfiler" idea-community."2024.1"."DBN" idea-community."2024.1"."MatlabSupport" - #idea-community."2024.1"."com.intellij.notebooks.core" idea-community."2024.1"."PlantUML integration" idea-community."2024.1"."org.intellij.scala" idea-community."2024.1"."PythonCore" @@ -59,9 +70,9 @@ in idea-community."2024.1"."org.mapstruct.intellij" idea-community."2024.1"."ski.chrzanow.foldableprojectview" idea-community."2024.1"."String Manipulation" - idea-community."2024.1"."quokka.js" + #idea-community."2024.1"."quokka.js" idea-community."2024.1"."org.asciidoctor.intellij.asciidoc" - #idea-community."2024.1"."R4Intellij" + idea-community."2024.1"."R4Intellij" idea-community."2024.1"."com.redhat.devtools.lsp4ij" ]) ++ @@ -91,7 +102,7 @@ in # Напоминаю что у нас есть СЕТЕВОЙ ДИСК по адресу 10.0.174.12 # и для студентов пока есть единая учётка student@mirea.ru, - # рассматривается вариант авторизации через login.mirea.ru. + # рассматривается вариант авторизации через sso.mirea.ru. # Преподаватели могут зарегистрироваться ОТДЕЛЬНО seafile-client @@ -151,8 +162,6 @@ in # 1) STM32CubeIDE упаковать не удалось # 2) есть основания полагать, что её функциональность лучше встроить # в IJ IDEA CE, как это сделано в настоящем Clion; - #stm32cubemx.packages.x86_64-linux.stm32cubemx - stm32flash stlink stlink-gui stm32loader @@ -168,6 +177,115 @@ in logisim-evolution unityhub # UnityHub - 3D-моделирование, визуализация, геймдев, AR/VR +(pkgs.stdenv.mkDerivation rec { + pname = "dwsim"; + version = "9.0.5"; + + src = pkgs.fetchurl { + url = "http://${serverIP}/dwsim_9.0.5-amd64.deb"; + sha256 = "sha256:0352mxz9czfh52z4lf7njlyqvikvbh2bgs2h4zi2dsjrssql3h2j"; + }; + + nativeBuildInputs = [ + pkgs.dpkg + pkgs.makeWrapper + pkgs.bubblewrap + ]; + + buildInputs = (with pkgs; [ + dotnet-runtime + gtk3 + glib + pango + cairo + gdk-pixbuf + atk + fontconfig + freetype + ] ++ (with pkgs.xorg; [ + libX11 + libXcursor + libXrandr + libXinerama + libXi + ])); + + unpackPhase = '' + dpkg-deb -x $src . + ''; + + installPhase = '' + mkdir -p $out/lib/dwsim + mkdir -p $out/bin + + cp -r usr/local/lib/dwsim/* $out/lib/dwsim/ + mkdir -p $out/share/icons/hicolor/256x256/apps + cp $out/lib/dwsim/bitmaps/DWSIM_ico.png \ + $out/share/icons/hicolor/256x256/apps/dwsim.png + mkdir -p "$out/lib/dwsim/DWSIM Application Data" + + cat > $out/bin/dwsim << 'EOF' +#!/bin/sh +set -e + + +APPDIR="@out@/lib/dwsim" +APPDATA="$HOME/.local/share/dwsim-appdata" + +mkdir -p "$APPDATA" + +# LD_LIBRARY_PATH для GtkSharp +export LD_LIBRARY_PATH="@gtk3@/lib:@glib@/lib:@pango@/lib:@cairo@/lib:@gdk-pixbuf@/lib:@atk@/lib:@fontconfig@/lib:@freetype@/lib:$LD_LIBRARY_PATH" + +export DISPLAY="$DISPLAY" + +exec @bwrap@ \ + --bind "@out@" "@out@" \ + --bind "$APPDATA" "$APPDIR/DWSIM Application Data" \ + --ro-bind /nix /nix \ + --ro-bind "$XAUTHORITY" "$HOME/.Xauthority" \ + --setenv XAUTHORITY "$HOME/.Xauthority" \ + --dev /dev \ + --proc /proc \ + --bind /tmp/.X11-unix /tmp/.X11-unix \ + --setenv DISPLAY $DISPLAY \ + --chdir "$APPDIR" \ + @dotnet@ "$APPDIR/DWSIM.UI.Desktop.exe" "$@" +EOF + + substituteInPlace $out/bin/dwsim \ + --subst-var out \ + --subst-var-by bwrap ${pkgs.bubblewrap}/bin/bwrap \ + --subst-var-by dotnet ${pkgs.dotnet-runtime}/bin/dotnet \ + --subst-var-by gtk3 ${pkgs.gtk3} \ + --subst-var-by glib ${pkgs.glib} \ + --subst-var-by pango ${pkgs.pango} \ + --subst-var-by cairo ${pkgs.cairo} \ + --subst-var-by gdk-pixbuf ${pkgs.gdk-pixbuf} \ + --subst-var-by atk ${pkgs.atk} \ + --subst-var-by fontconfig ${pkgs.fontconfig} \ + --subst-var-by freetype ${pkgs.freetype} + + chmod +x $out/bin/dwsim + +mkdir -p $out/share/applications + +cat > $out/share/applications/dwsim.desktop << EOF +[Desktop Entry] +Type=Application +Name=DWSIM +GenericName=Process Simulator +Comment=Chemical Process Simulation Environment +Exec=dwsim +Icon=dwsim +Terminal=false +Categories=Development +StartupWMClass=DWSIM +EOF + + + ''; +}) (pkgs.stdenv.mkDerivation rec { pname = "cnc_vmc_sim"; version = "1.0.0-share"; @@ -231,7 +349,7 @@ in pname = "simintech"; version = "2.23.13"; src = builtins.fetchTarball { - url = "http://kafpi.local/simintech_rus_linux.tgz"; + url = "http://${serverIP}/simintech_rus_linux.tgz"; sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; }; dontFixLibtool = true; @@ -249,6 +367,8 @@ in pango.out xorg.libX11.out zlib.out + xorg.libX11.out + zlib.out (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox ]; runScript = "${src}/bin/mmain"; @@ -277,11 +397,36 @@ in ''; }) + (pkgs.writeShellScriptBin "gcc" ''${pkgs.clang}/bin/clang "$@"'') + (pkgs.writeShellScriptBin "g++" ''${pkgs.clang}/bin/clang++ "$@"'') + (vscode-with-extensions.override { vscodeExtensions = with vscode-extensions; [ ms-vscode.cpptools-extension-pack zainchen.json ms-dotnettools.csharp + formulahendry.code-runner + tomoki1207.pdf + ms-vscode.hexeditor + jebbs.plantuml + ms-toolsai.jupyter + ms-toolsai.vscode-jupyter-slideshow + ms-toolsai.vscode-jupyter-cell-tags + ms-vscode-remote.remote-ssh + timonwong.shellcheck + ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "better-cpp-syntax"; + publisher = "jeff-hykin"; + version = "1.27.1"; + sha256 = "sha256-GO/ooq50KLFsiEuimqTbD/mauQYcD/p2keHYo/6L9gw="; + } + { + name = "vscode-cppcheck"; + publisher = "brobeson"; + version = "0.1.0"; + sha256 = "sha256-RDgO8/XenttOcYQSGEu4N2FKg9+FZaQe6HYkVjztH5o="; + } ]; }) @@ -351,6 +496,20 @@ in historyLimit = 5000; clock24 = true; }; + programs.chromium = { + enable = true; + extraOpts = { + "BrowserSignin" = 0; + "SyncDisabled" = true; + "PasswordManagerEnabled" = false; + "SpellcheckEnabled" = true; + "SpellcheckLanguage" = [ + "ru" + "en-US" + "fr" + ]; + }; + }; # если машина установлена на диск с Windows, # то она позволяет "увидеть" и выбрать Windows в течение 30 с @@ -381,10 +540,9 @@ in nvidia.acceptLicense = true; }; nix.settings = { - substituters = [ + substituters = if config.services.harmonia.enable then [ "https://cache.nixos.org" - ]; - trusted-public-keys = ["kafpi.local:PttR9S1eDyint3v0LCp5zfBGG+xfxzQ+cxKAQARNpyw="]; + ] else [ "https://cache.nixos.org" "http://${buildNodeYggIP}:5000" ]; auto-optimise-store = true; }; nix.extraOptions = '' @@ -456,24 +614,7 @@ in services.yggdrasil = { enable = true; persistentKeys = true; - settings = { Peers = [ "tcp://10.0.174.12:12345" ]; }; - }; - services.avahi = { - enable = false; - hostName = "nixos" - + builtins.readFile ((pkgs.runCommandLocal "uuid" {} '' - mkdir $out - cat /proc/sys/kernel/random/uuid > $out/uuid - '')+"/uuid"); - nssmdns4 = true; - openFirewall = true; - publish = { - enable = true; - hinfo = true; - workstation = true; - domain = true; - addresses = true; - }; + settings = { Peers = [ "tcp://${serverIP}:12345" ]; }; }; # каждый компьютер имеет выход в интернет @@ -481,11 +622,9 @@ in networking.hostName = "nixos"; - # каждый компьютер ресолвит DNS-запросы СТРОГО через наш сервер - networking.nameservers = [ serverIP ]; - # каждый компьютер знает, что kafpi.local - это адрес нашего сервера - networking.hosts."${serverIP}" = [ "kafpi.local" "hydra.kafpi.local" ]; + networking.hosts."${serverIP}" = [ "kafpi.local" ]; + networking.hosts."${buildNodeYggIP}" = [ "nixos-builds-node" ]; #security.pki.certificateFiles = [ # (builtins.fetchurl { # url = "http://${serverIP}/server.crt"; @@ -548,15 +687,6 @@ in enable = true; enableSSHSupport = true; }; - chromium = { - enable = true; - extraOpts = { - "SyncDisabled" = true; - "PasswordManagerEnabled" = false; - "SpellcheckEnabled" = false; - "homepageLocation" = "https://ya.ru"; - }; - }; udevil.enable = true; # тоже нужно для флешек }; From 9b11843fe2975ea9026c9460032801d6d89dcd53 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Mon, 26 Jan 2026 18:28:03 +0300 Subject: [PATCH 18/41] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE:=20=20=20=20=20=20configuration.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration.nix | 688 +++++++++++++++++++++++++--------------------- 1 file changed, 369 insertions(+), 319 deletions(-) diff --git a/configuration.nix b/configuration.nix index f9ef9ce..4f330c0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,19 +10,21 @@ }: let serverIP = "10.0.174.12"; - buildNodeYggIP = "[200:ccc6:1361:5c84:aba0:1244:35f5:c903]"; + buildNodeYggIP = "200:ccc6:1361:5c84:aba0:1244:35f5:c903"; hasBootPartition = config.fileSystems ? "/boot"; - isNvidia = (builtins.readFile (pkgs.runCommandLocal "isNvidia" {} '' + isNvidia = + (builtins.readFile ( + pkgs.runCommandLocal "isNvidia" { } '' ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out || true - '')) != ""; - starumlDebUrl = "http://${serverIP}/StarUML_6.2.2_amd64.deb"; # подставь точное имя + '' + )) != ""; in { nixpkgs.overlays = [ (final: prev: { staruml = prev.staruml.overrideAttrs (old: { src = final.fetchurl { - url = starumlDebUrl; + url = "http://${serverIP}/StarUML_6.2.2_amd64.deb"; hash = "sha256-1zxrT7phXeQYNbWHWMyPuHiUglrPSMPP0bfAcfvt8dM="; }; }); @@ -31,7 +33,12 @@ in users.users.student = { isNormalUser = true; initialPassword = "student"; # вход беспарольный, но пароль student - extraGroups = [ "video" "sound" "input" "storage" ]; + extraGroups = [ + "video" + "sound" + "input" + "storage" + ]; packages = let # определение как скачивать плагины jetbrains (скачивать с нашего сервера копию) @@ -75,8 +82,7 @@ in idea-community."2024.1"."R4Intellij" idea-community."2024.1"."com.redhat.devtools.lsp4ij" ]) - ++ - [ + ++ [ # поддежка языка C/C++ на уровне подсветки синтаксиса и автодополнения (customJBPlugin "clsp" "1.0.1" "sha256-AU/Q61YYsGn2BAYykCGm4XGNyeSwd5K/txGNzP2dJg0=") @@ -88,13 +94,18 @@ in )) chromium # браузер - pinta # графический редактор - sakura # терминал + pinta # графический редактор + sakura # терминал unzipNLS # поддержка zip - unrar # поддержка rar - gtk3 whitesur-icon-theme # необходимо для иконок - (pkgs.writeShellScriptBin "powermenu" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu)) - (pkgs.writeShellScriptBin "resethome" (builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome)) + unrar # поддержка rar + gtk3 + whitesur-icon-theme # необходимо для иконок + (pkgs.writeShellScriptBin "powermenu" ( + builtins.readFile inputs.mireadesktop.packages.x86_64-linux.powermenu + )) + (pkgs.writeShellScriptBin "resethome" ( + builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome + )) pandoc #onlyoffice-desktopeditors # к сожалению, пока у OnlyOffice баг со шрифтами. Ждём фикс @@ -132,7 +143,8 @@ in # Другие возможные языки и инструменты, например: # rustc # - Rust # go gopls delve golint go-tools # - Go - jdk kotlin # - Java, Kotlin (идут вместе с IJ IDEA) + jdk + kotlin # - Java, Kotlin (идут вместе с IJ IDEA) # ghc haskell-language-server # - Haskell # nodePackages.intelephense # - PHP # dotnet-sdk # - C# @@ -148,7 +160,20 @@ in # графическое моделирование UML-диаграмм # также доступно моделирование BPMN и ER - staruml + (staruml.overrideAttrs (oldAttrs: { + nativeBuildInputs = (oldAttrs.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ]; + + postFixup = + (oldAttrs.postFixup or "") + + '' + # Rename the original binary + mv $out/bin/staruml $out/bin/.staruml-org + + # Create the wrapper script + makeWrapper ${pkgs.bash}/bin/bash $out/bin/staruml \ + --add-flags "-c 'rm -rf \$HOME/.config/StarUML && exec $out/bin/.staruml-org \"\$@\"'" + ''; + })) # Язык текстового описания UML-диаграмм # актуально для разработчиков ПО (встраивание диаграмм в код) @@ -157,7 +182,6 @@ in archi # поддержка archimate - ##### Утилиты и программы для STM32 ##### # 1) STM32CubeIDE упаковать не удалось # 2) есть основания полагать, что её функциональность лучше встроить @@ -168,267 +192,277 @@ in ##### СЕТЕВЫЕ УТИЛИТЫ ###### # установлен Cisco Packet Tracer, обернут в firejail чтобы не стучался на Netacad.com - nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей - httpie httpie-desktop # - передовой клиент HTTP-запросов - netcat socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК - opcua-client-gui # - простой графический клиент OPC UA + nodePackages.node-red # - лоукод-платформа программирования устройств, в частности интернета вещей + httpie + httpie-desktop # - передовой клиент HTTP-запросов + netcat + socat # - низкоуровневые простейшие утилиты установления TCP или UDP между компьютерами или с ПЛК + opcua-client-gui # - простой графический клиент OPC UA ###### Другой софт ####### logisim-evolution unityhub # UnityHub - 3D-моделирование, визуализация, геймдев, AR/VR -(pkgs.stdenv.mkDerivation rec { - pname = "dwsim"; - version = "9.0.5"; - - src = pkgs.fetchurl { - url = "http://${serverIP}/dwsim_9.0.5-amd64.deb"; - sha256 = "sha256:0352mxz9czfh52z4lf7njlyqvikvbh2bgs2h4zi2dsjrssql3h2j"; - }; - - nativeBuildInputs = [ - pkgs.dpkg - pkgs.makeWrapper - pkgs.bubblewrap - ]; - - buildInputs = (with pkgs; [ - dotnet-runtime - gtk3 - glib - pango - cairo - gdk-pixbuf - atk - fontconfig - freetype - ] ++ (with pkgs.xorg; [ - libX11 - libXcursor - libXrandr - libXinerama - libXi - ])); - - unpackPhase = '' - dpkg-deb -x $src . - ''; - - installPhase = '' - mkdir -p $out/lib/dwsim - mkdir -p $out/bin - - cp -r usr/local/lib/dwsim/* $out/lib/dwsim/ - mkdir -p $out/share/icons/hicolor/256x256/apps - cp $out/lib/dwsim/bitmaps/DWSIM_ico.png \ - $out/share/icons/hicolor/256x256/apps/dwsim.png - mkdir -p "$out/lib/dwsim/DWSIM Application Data" - - cat > $out/bin/dwsim << 'EOF' -#!/bin/sh -set -e - - -APPDIR="@out@/lib/dwsim" -APPDATA="$HOME/.local/share/dwsim-appdata" - -mkdir -p "$APPDATA" - -# LD_LIBRARY_PATH для GtkSharp -export LD_LIBRARY_PATH="@gtk3@/lib:@glib@/lib:@pango@/lib:@cairo@/lib:@gdk-pixbuf@/lib:@atk@/lib:@fontconfig@/lib:@freetype@/lib:$LD_LIBRARY_PATH" - -export DISPLAY="$DISPLAY" - -exec @bwrap@ \ - --bind "@out@" "@out@" \ - --bind "$APPDATA" "$APPDIR/DWSIM Application Data" \ - --ro-bind /nix /nix \ - --ro-bind "$XAUTHORITY" "$HOME/.Xauthority" \ - --setenv XAUTHORITY "$HOME/.Xauthority" \ - --dev /dev \ - --proc /proc \ - --bind /tmp/.X11-unix /tmp/.X11-unix \ - --setenv DISPLAY $DISPLAY \ - --chdir "$APPDIR" \ - @dotnet@ "$APPDIR/DWSIM.UI.Desktop.exe" "$@" -EOF - - substituteInPlace $out/bin/dwsim \ - --subst-var out \ - --subst-var-by bwrap ${pkgs.bubblewrap}/bin/bwrap \ - --subst-var-by dotnet ${pkgs.dotnet-runtime}/bin/dotnet \ - --subst-var-by gtk3 ${pkgs.gtk3} \ - --subst-var-by glib ${pkgs.glib} \ - --subst-var-by pango ${pkgs.pango} \ - --subst-var-by cairo ${pkgs.cairo} \ - --subst-var-by gdk-pixbuf ${pkgs.gdk-pixbuf} \ - --subst-var-by atk ${pkgs.atk} \ - --subst-var-by fontconfig ${pkgs.fontconfig} \ - --subst-var-by freetype ${pkgs.freetype} - - chmod +x $out/bin/dwsim - -mkdir -p $out/share/applications - -cat > $out/share/applications/dwsim.desktop << EOF -[Desktop Entry] -Type=Application -Name=DWSIM -GenericName=Process Simulator -Comment=Chemical Process Simulation Environment -Exec=dwsim -Icon=dwsim -Terminal=false -Categories=Development -StartupWMClass=DWSIM -EOF - - - ''; -}) (pkgs.stdenv.mkDerivation rec { - pname = "cnc_vmc_sim"; - version = "1.0.0-share"; - src = builtins.fetchTarball { - url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; - sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; - }; + pname = "dwsim"; + version = "9.0.5"; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - cp ${src}/icon.png $out/share/icons/${pname}.png - cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - ''; + src = pkgs.fetchurl { + url = "http://${serverIP}/dwsim_9.0.5-amd64.deb"; + sha256 = "sha256:0352mxz9czfh52z4lf7njlyqvikvbh2bgs2h4zi2dsjrssql3h2j"; + }; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs"; - targetPkgs = p: with p; [ - eudev.out - libGL.out - openal.out - xorg.libX11.out - ]; - runScript = "${src}/${pname}"; - }; + nativeBuildInputs = [ + pkgs.dpkg + pkgs.makeWrapper + pkgs.bubblewrap + ]; - desktopItem = pkgs.makeDesktopItem { - name = "CNC VMC (free)"; - exec = "${pname}"; - desktopName = "CNC VMC (free)"; - categories = [ "Development" ]; - icon = "${pname}"; - terminal = false; - startupNotify = false; - }; - }) - (pkgs.stdenv.mkDerivation rec { - pname = "ramus"; - version = "0.1.3"; - src = builtins.fetchTarball { - url = "http://${serverIP}/ramus.tar.xz"; - sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; - }; - installPhase = '' - sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop - mkdir $out - cp -r share bin lib $out - echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus - chmod +x $out/bin/ramus - ''; - }) + buildInputs = ( + with pkgs; + [ + dotnet-runtime + gtk3 + glib + pango + cairo + gdk-pixbuf + atk + fontconfig + freetype + ] + ++ (with pkgs.xorg; [ + libX11 + libXcursor + libXrandr + libXinerama + libXi + ]) + ); + unpackPhase = '' + dpkg-deb -x $src . + ''; + + installPhase = '' + mkdir -p $out/lib/dwsim + mkdir -p $out/bin + + cp -r usr/local/lib/dwsim/* $out/lib/dwsim/ + mkdir -p $out/share/icons/hicolor/256x256/apps + cp $out/lib/dwsim/bitmaps/DWSIM_ico.png \ + $out/share/icons/hicolor/256x256/apps/dwsim.png + mkdir -p "$out/lib/dwsim/DWSIM Application Data" + + cat > $out/bin/dwsim << 'EOF' + #!/bin/sh + set -e + + + APPDIR="@out@/lib/dwsim" + APPDATA="$HOME/.local/share/dwsim-appdata" + + mkdir -p "$APPDATA" + + # LD_LIBRARY_PATH для GtkSharp + export LD_LIBRARY_PATH="@gtk3@/lib:@glib@/lib:@pango@/lib:@cairo@/lib:@gdk-pixbuf@/lib:@atk@/lib:@fontconfig@/lib:@freetype@/lib:$LD_LIBRARY_PATH" + + export DISPLAY="$DISPLAY" + + exec @bwrap@ \ + --bind "@out@" "@out@" \ + --bind "$APPDATA" "$APPDIR/DWSIM Application Data" \ + --ro-bind /nix /nix \ + --ro-bind "$XAUTHORITY" "$HOME/.Xauthority" \ + --setenv XAUTHORITY "$HOME/.Xauthority" \ + --dev /dev \ + --proc /proc \ + --bind /tmp/.X11-unix /tmp/.X11-unix \ + --setenv DISPLAY $DISPLAY \ + --chdir "$APPDIR" \ + @dotnet@ "$APPDIR/DWSIM.UI.Desktop.exe" "$@" + EOF + + substituteInPlace $out/bin/dwsim \ + --subst-var out \ + --subst-var-by bwrap ${pkgs.bubblewrap}/bin/bwrap \ + --subst-var-by dotnet ${pkgs.dotnet-runtime}/bin/dotnet \ + --subst-var-by gtk3 ${pkgs.gtk3} \ + --subst-var-by glib ${pkgs.glib} \ + --subst-var-by pango ${pkgs.pango} \ + --subst-var-by cairo ${pkgs.cairo} \ + --subst-var-by gdk-pixbuf ${pkgs.gdk-pixbuf} \ + --subst-var-by atk ${pkgs.atk} \ + --subst-var-by fontconfig ${pkgs.fontconfig} \ + --subst-var-by freetype ${pkgs.freetype} + + chmod +x $out/bin/dwsim + + mkdir -p $out/share/applications + + cat > $out/share/applications/dwsim.desktop << EOF + [Desktop Entry] + Type=Application + Name=DWSIM + GenericName=Process Simulator + Comment=Chemical Process Simulation Environment + Exec=dwsim + Icon=dwsim + Terminal=false + Categories=Development + StartupWMClass=DWSIM + EOF + + + ''; + }) + (pkgs.stdenv.mkDerivation rec { + pname = "cnc_vmc_sim"; + version = "1.0.0-share"; + src = builtins.fetchTarball { + url = "http://${serverIP}/linux_cnc_vmc_share.tar.xz"; + sha256 = "sha256:1hjkm2wq6dfmddb2van1q8hdvf41bp4snslcbkj0b1myi3zpi1md"; + }; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + cp ${src}/icon.png $out/share/icons/${pname}.png + cp ${fhsEnv}/bin/${pname}-fhs $out/bin/${pname} + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + ''; + + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs"; + targetPkgs = + p: with p; [ + eudev.out + libGL.out + openal.out + xorg.libX11.out + ]; + runScript = "${src}/${pname}"; + }; + + desktopItem = pkgs.makeDesktopItem { + name = "CNC VMC (free)"; + exec = "${pname}"; + desktopName = "CNC VMC (free)"; + categories = [ "Development" ]; + icon = "${pname}"; + terminal = false; + startupNotify = false; + }; + }) + (pkgs.stdenv.mkDerivation rec { + pname = "ramus"; + version = "0.1.3"; + src = builtins.fetchTarball { + url = "http://${serverIP}/ramus.tar.xz"; + sha256 = "sha256:1a9fha7zwyyag0q4glk58pzigqdczshxpnax7cdzg1bry4aw6f9d"; + }; + installPhase = '' + sed -e "s~ramus.ico~$out/share/icons/ramus.ico~; s~Other~Database~" -i share/applications/ramus.desktop + mkdir $out + cp -r share bin lib $out + echo "JDK_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' ${pkgs.jre8}/bin/java -jar $out/bin/ramus-startup.jar" > $out/bin/ramus + chmod +x $out/bin/ramus + ''; + }) # поставка SimInTech. Кодогенерация библиотек для ПК работает, # но несовместима с .dll из windows! #simintech.packages.x86_64-linux.simintech (pkgs.stdenv.mkDerivation rec { - pname = "simintech"; - version = "2.23.13"; - src = builtins.fetchTarball { - url = "http://${serverIP}/simintech_rus_linux.tgz"; - sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; - }; - dontFixLibtool = true; + pname = "simintech"; + version = "2.23.13"; + src = builtins.fetchTarball { + url = "http://${serverIP}/simintech_rus_linux.tgz"; + sha256 = "sha256:1i9plx6vx6jm38bx4kbh4piak5jwrpc4hxxjd3b89zyng1g4abvs"; + }; + dontFixLibtool = true; - fhsEnv = pkgs.buildFHSEnv { - name = "${pname}-fhs-env"; - targetPkgs = p: with p; [ - at-spi2-atk.out - gdk-pixbuf.out - glamoroustoolkit.out - glib.out - gtk2.out - libGL.out - libGLU.out - pango.out - xorg.libX11.out - zlib.out - xorg.libX11.out - zlib.out - (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox - ]; - runScript = "${src}/bin/mmain"; - }; + fhsEnv = pkgs.buildFHSEnv { + name = "${pname}-fhs-env"; + targetPkgs = + p: with p; [ + at-spi2-atk.out + gdk-pixbuf.out + glamoroustoolkit.out + glib.out + gtk2.out + libGL.out + libGLU.out + pango.out + xorg.libX11.out + zlib.out + xorg.libX11.out + zlib.out + (pkgs.writeShellScriptBin "firefox" "exec ${pkgs.chromium}/bin/chromium \"$@\"") # похоже, что SimInTech захардкодил Firefox, но не все так юзают Firefox + ]; + runScript = "${src}/bin/mmain"; + }; - desktopItem = pkgs.makeDesktopItem { - name = "SimInTech"; - exec = "simintech"; - desktopName = "SimInTech"; - categories = [ "Development" ]; - icon = "simintech"; - terminal = false; - startupNotify = false; - mimeTypes = [ "x-scheme-handler/prt" ]; - }; + desktopItem = pkgs.makeDesktopItem { + name = "SimInTech"; + exec = "simintech"; + desktopName = "SimInTech"; + categories = [ "Development" ]; + icon = "simintech"; + terminal = false; + startupNotify = false; + mimeTypes = [ "x-scheme-handler/prt" ]; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/applications - mkdir -p $out/share/icons - #cp ${src}/share/icon.svg $out/share/icons/simintech.svg - cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech - cp ${desktopItem}/share/applications/*.desktop $out/share/applications - runHook postInstall - ''; - }) + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons + #cp ${src}/share/icon.svg $out/share/icons/simintech.svg + cp ${fhsEnv}/bin/${pname}-fhs-env $out/bin/simintech + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + runHook postInstall + ''; + }) - (pkgs.writeShellScriptBin "gcc" ''${pkgs.clang}/bin/clang "$@"'') - (pkgs.writeShellScriptBin "g++" ''${pkgs.clang}/bin/clang++ "$@"'') + (pkgs.writeShellScriptBin "gcc" ''${pkgs.clang}/bin/clang "$@"'') + (pkgs.writeShellScriptBin "g++" ''${pkgs.clang}/bin/clang++ "$@"'') - (vscode-with-extensions.override { - vscodeExtensions = with vscode-extensions; [ - ms-vscode.cpptools-extension-pack - zainchen.json - ms-dotnettools.csharp - formulahendry.code-runner - tomoki1207.pdf - ms-vscode.hexeditor - jebbs.plantuml - ms-toolsai.jupyter - ms-toolsai.vscode-jupyter-slideshow - ms-toolsai.vscode-jupyter-cell-tags - ms-vscode-remote.remote-ssh - timonwong.shellcheck - ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "better-cpp-syntax"; - publisher = "jeff-hykin"; - version = "1.27.1"; - sha256 = "sha256-GO/ooq50KLFsiEuimqTbD/mauQYcD/p2keHYo/6L9gw="; - } - { - name = "vscode-cppcheck"; - publisher = "brobeson"; - version = "0.1.0"; - sha256 = "sha256-RDgO8/XenttOcYQSGEu4N2FKg9+FZaQe6HYkVjztH5o="; - } - ]; - }) + (vscode-with-extensions.override { + vscodeExtensions = + with vscode-extensions; + [ + ms-vscode.cpptools-extension-pack + zainchen.json + ms-dotnettools.csharp + formulahendry.code-runner + tomoki1207.pdf + ms-vscode.hexeditor + jebbs.plantuml + ms-toolsai.jupyter + ms-toolsai.vscode-jupyter-slideshow + ms-toolsai.vscode-jupyter-cell-tags + ms-vscode-remote.remote-ssh + timonwong.shellcheck + ] + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "better-cpp-syntax"; + publisher = "jeff-hykin"; + version = "1.27.1"; + sha256 = "sha256-GO/ooq50KLFsiEuimqTbD/mauQYcD/p2keHYo/6L9gw="; + } + { + name = "vscode-cppcheck"; + publisher = "brobeson"; + version = "0.1.0"; + sha256 = "sha256-RDgO8/XenttOcYQSGEu4N2FKg9+FZaQe6HYkVjztH5o="; + } + ]; + }) # POSIX утилиты для совместимости om4 @@ -463,9 +497,9 @@ EOF services.postgresql = { enable = true; authentication = pkgs.lib.mkOverride 10 '' - #type database DBuser auth-method - local all all trust - ''; + #type database DBuser auth-method + local all all trust + ''; }; # и оба поддерживают вход без пароля в "руты" @@ -491,10 +525,10 @@ EOF imports = [ ./hardware-configuration.nix ]; programs.tmux = { - enable = true; - withUtempter = true; - historyLimit = 5000; - clock24 = true; + enable = true; + withUtempter = true; + historyLimit = 5000; + clock24 = true; }; programs.chromium = { enable = true; @@ -507,31 +541,41 @@ EOF "ru" "en-US" "fr" - ]; + ]; }; }; # если машина установлена на диск с Windows, # то она позволяет "увидеть" и выбрать Windows в течение 30 с # иначе - 5 c таймаута (для виртуалок) - boot.loader = if hasBootPartition then { - efi.canTouchEfiVariables = true; - timeout = 30; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - useOSProber = true; - theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Выберите ОС"; }}"; - }; - } else { - timeout = 5; - grub = { - enable = true; - device = "/dev/sda"; - theme = "${pkgs.sleek-grub-theme.override{ withStyle = "orange"; withBanner = "Загрузчик Linux"; }}"; - }; - }; + boot.loader = + if hasBootPartition then + { + efi.canTouchEfiVariables = true; + timeout = 30; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + useOSProber = true; + theme = "${pkgs.sleek-grub-theme.override { + withStyle = "orange"; + withBanner = "Выберите ОС"; + }}"; + }; + } + else + { + timeout = 5; + grub = { + enable = true; + device = "/dev/sda"; + theme = "${pkgs.sleek-grub-theme.override { + withStyle = "orange"; + withBanner = "Загрузчик Linux"; + }}"; + }; + }; time.hardwareClockInLocalTime = hasBootPartition; # настройки Nix @@ -540,9 +584,8 @@ EOF nvidia.acceptLicense = true; }; nix.settings = { - substituters = if config.services.harmonia.enable then [ - "https://cache.nixos.org" - ] else [ "https://cache.nixos.org" "http://${buildNodeYggIP}:5000" ]; + extra-substituters = [ "http://nixos.builds.node" ]; + trusted-public-keys = [ "nixos.builds.node:E/XNkcdzB0EyTyEJuOTXJH8qynxgCfQ87JHkbD88uF8=" ]; auto-optimise-store = true; }; nix.extraOptions = '' @@ -553,36 +596,50 @@ EOF hardware.graphics = { enable = true; #enable32Bit = true; - extraPackages = if isNvidia then with pkgs; [ nvidia-vaapi-driver vaapiVdpau libvdpau-va-gl] else []; + extraPackages = + if isNvidia then + with pkgs; + [ + nvidia-vaapi-driver + vaapiVdpau + libvdpau-va-gl + ] + else + [ ]; }; services.xserver = { enable = true; - videoDrivers = if isNvidia then [ "nvidia" ] else [ "modesetting" "fbdev" ]; + videoDrivers = + if isNvidia then + [ "nvidia" ] + else + [ + "modesetting" + "fbdev" + ]; xkb.layout = "us,ru"; xkb.options = "grp:alt_shift_toggle"; }; hardware.enableAllFirmware = true; - #hardware.nvidia = { - # package = config.boot.kernelPackages.nvidiaPackages.legacy_470; - # modesetting.enable = true; - # powerManagement.enable = true; - # open = false; - # nvidiaSettings = false; - #}; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.stable; + package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; powerManagement.enable = true; open = false; nvidiaSettings = false; }; - boot.kernelParams = if isNvidia then ["nvidia-drm.modeset=1" ] else []; - boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else []; - boot.extraModprobeConfig = if isNvidia then "options nvidia " + lib.concatStringsSep " " [ - "NVreg_UsePageAttributeTable=1" - "NVreg_EnablePCIeGen3=1" - "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" - ] else ""; + boot.kernelParams = if isNvidia then [ "nvidia-drm.modeset=1" ] else [ ]; + boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else [ ]; + boot.extraModprobeConfig = + if isNvidia then + "options nvidia " + + lib.concatStringsSep " " [ + "NVreg_UsePageAttributeTable=1" + "NVreg_EnablePCIeGen3=1" + "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" + ] + else + ""; services.displayManager.autoLogin.user = "student"; services.getty.autologinUser = "student"; @@ -614,7 +671,9 @@ EOF services.yggdrasil = { enable = true; persistentKeys = true; - settings = { Peers = [ "tcp://${serverIP}:12345" ]; }; + settings = { + Peers = [ "tcp://${serverIP}:12345" ]; + }; }; # каждый компьютер имеет выход в интернет @@ -624,17 +683,7 @@ EOF # каждый компьютер знает, что kafpi.local - это адрес нашего сервера networking.hosts."${serverIP}" = [ "kafpi.local" ]; - networking.hosts."${buildNodeYggIP}" = [ "nixos-builds-node" ]; - #security.pki.certificateFiles = [ - # (builtins.fetchurl { - # url = "http://${serverIP}/server.crt"; - # sha256 = "sha256:0qx4acdhiciffvk1l7wkxyzapjwjy9zisq0mwyl727x97zrmi5ds"; - # }) - # (builtins.fetchurl { - # url = "http://${serverIP}/hydra.crt"; - # sha256 = "sha256:1l5cvsikb5dnf49ajjjmz50avfkxm28jy65vnb9xidlv5vapi1zp"; - # }) - #]; + networking.hosts."${buildNodeYggIP}" = [ "nixos.builds.node" ]; #### ЛОКАЛИЗАЦИЯ ##### @@ -656,7 +705,6 @@ EOF liberation_ttf ]; - ####### ПРОЧИЕ НАСТРОЙКИ ####### environment.systemPackages = with pkgs; [ vim @@ -678,7 +726,10 @@ EOF wrappedBinaries = { packettracer7 = { executable = "${packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; - extraArgs = [ "--net=none" "--noprofile" ]; + extraArgs = [ + "--net=none" + "--noprofile" + ]; }; }; }; @@ -693,4 +744,3 @@ EOF # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } - From a78a0d4ac6e618cb0c78d4f893fce45605db4d04 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 14:28:59 +0300 Subject: [PATCH 19/41] modified: configuration.nix --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 4f330c0..27d2973 100644 --- a/configuration.nix +++ b/configuration.nix @@ -718,6 +718,7 @@ in enable = true; settings.PermitRootLogin = "yes"; }; + users.users.root.openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyBYo/E/FkFZVABzMixLS2TWaipfN5T24y8f+E6Px1t+IG8PLnQ38dLJiCR8k971DOycLuJUfKWsC06BK3XLWTO0+PmpfGKNT4NI6dwP2REl/umaignP/QQSs2w9Ff49WqPjIYTSmATTsCNZSVB0VtM0eJ+Y9Ff4CXb1frtt4GYztk6XB3jc3TxV72qzB0g6DqrHkf6pT5YAq2UeuFGZYSZCqBvVXCGcvKHkO1KBubuo95itVA5XbzK3INQTZpQowbtK4ULhUYlaGBcX5tYq1bdiTCDlTcLt6MfxYfFHSFiHbJOzdGPd+mXM7urOQhq49uQOf07dHt9qAzQHajItQb+X3FOgyFt4n6Y9Q37gn/6KC3PH1zClldq9DtgttuG/Xk15q+uvCldji9YIgb80aRHBIp6DY8PlYodmGGesBLiBMGQ7hgKupfkqszjfMkxnMYIkZodUCQVgaqsxsEQ7lD84JJMgBY8HkNLxKhy+6dP6kTc4vTtrpjezq/Ph95PFE= bednov@kafpi-108-1-mainserver2" ]; services.gnome.gnome-keyring.enable = true; programs = { From 2a2ff8957e9d867f2e62dcdf29aaafe1105d8825 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 15:44:20 +0300 Subject: [PATCH 20/41] modified: configuration.nix --- configuration.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/configuration.nix b/configuration.nix index 27d2973..3fd9615 100644 --- a/configuration.nix +++ b/configuration.nix @@ -441,6 +441,12 @@ in formulahendry.code-runner tomoki1207.pdf ms-vscode.hexeditor + ms-vscode.makefile-tools + ms-ceintl.vscode-language-pack-ru + ms-python.python + ms-python.pylint + ms-python.isort + ms-python.black-formatter jebbs.plantuml ms-toolsai.jupyter ms-toolsai.vscode-jupyter-slideshow @@ -461,9 +467,49 @@ in version = "0.1.0"; sha256 = "sha256-RDgO8/XenttOcYQSGEu4N2FKg9+FZaQe6HYkVjztH5o="; } + { + name = "cortex-debug"; + publisher = "marus25"; + version = "1.12.1"; + sha256 = "sha256-ioK6gwtkaAcfxn11lqpwhrpILSfft/byeEqoEtJIfM0="; + } + { + name = "vscode-serial-monitor"; + publisher = "ms-vscode"; + version = "0.13.251128001"; + sha256 = "sha256-eTQcLyF6DMvzDByKLw2KR8PrjVwejsOU60Hew7IOmY8="; + } + { + name = "linux-arm-none-eabi"; + publisher = "metalcode-eu"; + version = "0.1.2"; + sha256 = "sha256-MCpBsd491pCO1K9tgL5KBJQbtr4IuVEuTPQzQHeQSWQ="; + } + { + name = "arm-assembly-syntax"; + publisher = "ciprianelies"; + version = "1.7.6"; + sha256 = "sha256-4vWw0ogtZ3mOw0lT95k/5I/7GMvU5kfaaztwc+eI/do="; + } + { + name = "stm32-for-vscode"; + publisher = "bmd"; + version = "3.2.13"; + sha256 = "sha256-Dzj++F0xTDOaL9VA3X/bVtAhkxd8kPPl3Oz8LWrXpAA="; + } + { + name = "qt-cpp-pack"; + publisher = "TheQtCompany"; + version = "1.0.2"; + sha256 = "sha256-Kd2/kk3qJUOahz71Uh3mUI1wDuwS8/t84tgdWorRPG4"; + } ]; }) + qtcreator + isort black + + # POSIX утилиты для совместимости om4 pax From 0ddff4795881e5cdeaf02bd6b44a5097e9597564 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 15:53:35 +0300 Subject: [PATCH 21/41] modified: configuration.nix --- configuration.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3fd9615..eae21bb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -502,12 +502,17 @@ in publisher = "TheQtCompany"; version = "1.0.2"; sha256 = "sha256-Kd2/kk3qJUOahz71Uh3mUI1wDuwS8/t84tgdWorRPG4"; + } + { + name = "debug-tracker-vscode"; + publisher = "mcu-debug"; + version = "0.0.15"; } ]; }) - qtcreator - isort black + qtcreator + isort black # POSIX утилиты для совместимости From 5803a68b5ba6b1dde5091bf89dd789d3a1e353a3 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 15:58:25 +0300 Subject: [PATCH 22/41] modified: configuration.nix --- configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index eae21bb..64cd22f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,7 +3,7 @@ config, pkgs, #simintech, - #stm32cubemx, + stm32cubemx, packettracer7, inputs, ... @@ -507,6 +507,7 @@ in name = "debug-tracker-vscode"; publisher = "mcu-debug"; version = "0.0.15"; + sha256 = "sha256-2u4Moixrf94vDLBQzz57dToLbqzz7OenQL6G9BMCn3I="; } ]; }) From 74b95c57bc27cf0f924d44f286e069221b0e52a4 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 16:21:06 +0300 Subject: [PATCH 23/41] modified: configuration.nix --- configuration.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configuration.nix b/configuration.nix index 64cd22f..026624b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -38,6 +38,7 @@ in "sound" "input" "storage" + "dialout" ]; packages = let @@ -508,8 +509,27 @@ in publisher = "mcu-debug"; version = "0.0.15"; sha256 = "sha256-2u4Moixrf94vDLBQzz57dToLbqzz7OenQL6G9BMCn3I="; + } + { + name = "memory-view"; + publisher = "mcu-debug"; + version = "0.0.28"; + sha256 = "sha256-mQr/uLulKoPVXz0GaMMEHZ/ZSmSAEfO9UpFzy4MfcW4="; + } + { + name = "rtos-views"; + publisher = "mcu-debug"; + version = "0.0.13"; + sha256 = "sha256-eTEdZkHbAGSDXP9A06YL6jDBfO8rU1kC9RysxOUxI1U="; + } + { + name = "peripheral-viewer"; + publisher = "mcu-debug"; + version = "1.6.0"; + sha256 = "sha256-nKK8HRzeqDixpdKmgacjhNzanJaTsAnYLC6nCbmWXuU="; } ]; + }) qtcreator @@ -797,3 +817,4 @@ in # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } + From 2ca2f0454abaa7e2a65081544b9146568e0f34c8 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 16:30:57 +0300 Subject: [PATCH 24/41] modified: configuration.nix --- configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 026624b..23cad37 100644 --- a/configuration.nix +++ b/configuration.nix @@ -108,6 +108,8 @@ in builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome )) + inputs.stm32cubemx.packages.x86_64-linux.stm32cubemx + pandoc #onlyoffice-desktopeditors # к сожалению, пока у OnlyOffice баг со шрифтами. Ждём фикс libreoffice # поэтому пока что у нас Libreoffice... @@ -817,4 +819,3 @@ in # НЕ МЕНЯТЬ, иначе придётся все компы переустанавливать, а не обновлять system.stateVersion = "24.05"; } - From 127d0d846f5a525bd93c47dd516fa69d6f57601b Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Thu, 29 Jan 2026 17:42:00 +0300 Subject: [PATCH 25/41] modified: configuration.nix --- configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 23cad37..7a046cd 100644 --- a/configuration.nix +++ b/configuration.nix @@ -752,8 +752,9 @@ in # каждый компьютер имеет выход в интернет networking.networkmanager.enable = true; - networking.hostName = "nixos"; + networking.firewall.allowedTCPPorts = [ 22 ] ++ lib.optionals config.services.harmonia.enable [ 80 ]; + # каждый компьютер знает, что kafpi.local - это адрес нашего сервера networking.hosts."${serverIP}" = [ "kafpi.local" ]; From ee289d87dfea5015f141968dc3d4fbd91af04f61 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Fri, 30 Jan 2026 17:07:13 +0300 Subject: [PATCH 26/41] modified: configuration.nix --- configuration.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 7a046cd..52be205 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,6 +18,12 @@ let ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep NVIDIA | ${pkgs.busybox}/bin/grep VGA > $out || true '' )) != ""; + isAdata = # ADATA is a famous cheap troubleful NVMe controllers + (builtins.readFile ( + pkgs.runCommandLocal "isAdata" { } '' + ${pkgs.pciutils}/bin/lspci | ${pkgs.busybox}/bin/grep ADATA | ${pkgs.busybox}/bin/grep -i NVMe > $out || true + '' + )) != ""; in { nixpkgs.overlays = [ @@ -702,7 +708,12 @@ in open = false; nvidiaSettings = false; }; - boot.kernelParams = if isNvidia then [ "nvidia-drm.modeset=1" ] else [ ]; + services.udev.extraRules = if isAdata then '' + ACTION=="add|change",KERNEL=="nvme[0-9]", ATTR{queue/scheduler}="none" + '' else ""; + boot.kernelParams = lib.optionals isNvidia [ "nvidia-drm.modeset=1" ] + ++ lib.optionals isAdata [ "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=4294967295" ]; + boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else [ ]; boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else [ ]; boot.extraModprobeConfig = if isNvidia then From 57642b225755c1d893731693832720a758b5e852 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Fri, 30 Jan 2026 17:19:59 +0300 Subject: [PATCH 27/41] modified: configuration.nix --- configuration.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 52be205..61c898a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -713,8 +713,7 @@ in '' else ""; boot.kernelParams = lib.optionals isNvidia [ "nvidia-drm.modeset=1" ] ++ lib.optionals isAdata [ "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=4294967295" ]; - boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else [ ]; - boot.blacklistedKernelModules = if isNvidia then [ "nouveau" ] else [ ]; + boot.blacklistedKernelModules = lib.optionals isNvidia then [ "nouveau" ]; boot.extraModprobeConfig = if isNvidia then "options nvidia " From 2eb25c0d48992484d83d5bb56f4f69d9cab848be Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Fri, 30 Jan 2026 17:21:31 +0300 Subject: [PATCH 28/41] modified: configuration.nix --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 61c898a..a0a7fd4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -713,7 +713,7 @@ in '' else ""; boot.kernelParams = lib.optionals isNvidia [ "nvidia-drm.modeset=1" ] ++ lib.optionals isAdata [ "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=4294967295" ]; - boot.blacklistedKernelModules = lib.optionals isNvidia then [ "nouveau" ]; + boot.blacklistedKernelModules = lib.optionals isNvidia [ "nouveau" ]; boot.extraModprobeConfig = if isNvidia then "options nvidia " From b536cb64922ad15943353f830f6d7f02a940d6d7 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sun, 8 Feb 2026 20:11:43 +0300 Subject: [PATCH 29/41] modified: configuration.nix --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index a0a7fd4..5dfd2d3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -141,6 +141,7 @@ in clang clang-tools lldb + valgrind cpplint cppcheck gcc-arm-embedded # компиляция С/C++ под STM32 и прочие arm From a70e76f3c98f5ecfe15bd2c21a319746b2fea1e8 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Mon, 16 Feb 2026 22:55:16 +0300 Subject: [PATCH 30/41] modified: configuration.nix modified: flake.nix deleted: flake.lock --- configuration.nix | 7 +++++-- flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index 5dfd2d3..6c1836b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,6 @@ lib, config, pkgs, - #simintech, stm32cubemx, packettracer7, inputs, @@ -603,8 +602,12 @@ in PGUSER = "postgres"; }; }; + services.grdcontrol.enable = true; - imports = [ ./hardware-configuration.nix ]; + imports = [ + inputs.grdcontrol-flake.nixosModules.grdcontrol + ./hardware-configuration.nix + ]; programs.tmux = { enable = true; withUtempter = true; diff --git a/flake.nix b/flake.nix index 0e54926..6d51afb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,41 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - inputs.simintech.url = "git://10.0.174.12/simintech_nix"; - inputs.mireadesktop.url = "git://10.0.174.12/mireadesktop"; - inputs.stm32cubemx.url = "git://10.0.174.12/stm32cubemx"; - inputs.packettracer7.url = "git://10.0.174.12/packettracer7"; - inputs.gostfont.url = "git://10.0.174.12/gostfont"; - inputs.nix-jetbrains-plugins.url = "git://10.0.174.12/nix-jetbrains-plugins"; - inputs.mireapython.url = "git://10.0.174.12/mireapython"; + inputs.simintech = { + url = "git://10.0.174.12/simintech_nix"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.mireadesktop = { + url = "git://10.0.174.12/mireadesktop"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.stm32cubemx = { + url = "git://10.0.174.12/stm32cubemx"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.packettracer7= { + url = "git://10.0.174.12/packettracer7"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.gostfont = { + url= "git://10.0.174.12/gostfont"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.nix-jetbrains-plugins = { + url = "git://10.0.174.12/nix-jetbrains-plugins"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.mireapython = { + url = "git://10.0.174.12/mireapython"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.kompas3d = { + url = "git://10.0.174.12/kompas3d"; + inputs.nixpkgs.follows = "nixpkgs"; + } + inputs.guardant = { + url = "git://10.0.174.12/guardant"; + inputs.nixpkgs.follows = "nixpkgs"; + } outputs = { @@ -15,6 +44,8 @@ simintech, stm32cubemx, packettracer7, + guardant, + kompas3d, ... }@inputs: { @@ -23,6 +54,9 @@ inherit simintech; inherit stm32cubemx; inherit packettracer7; + inherit guardant; + inherit kompas3d; + ... inherit inputs; }; modules = [ From d8aef2a2d1046166fb8c31995eec2379d50d2427 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 17 Feb 2026 09:05:18 +0300 Subject: [PATCH 31/41] modified: configuration.nix modified: flake.lock modified: flake.nix --- configuration.nix | 8 +- flake.lock | 191 ++++++++++++++++------------------------------ flake.nix | 28 +++---- 3 files changed, 81 insertions(+), 146 deletions(-) diff --git a/configuration.nix b/configuration.nix index 6c1836b..d684c77 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,8 +2,6 @@ lib, config, pkgs, - stm32cubemx, - packettracer7, inputs, ... }: @@ -113,6 +111,8 @@ in builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome )) + inputs.kompas3d.packages.${pkgs.system}.default + inputs.stm32cubemx.packages.x86_64-linux.stm32cubemx pandoc @@ -605,7 +605,7 @@ in services.grdcontrol.enable = true; imports = [ - inputs.grdcontrol-flake.nixosModules.grdcontrol + inputs.guardant.nixosModules.grdcontrol ./hardware-configuration.nix ]; programs.tmux = { @@ -815,7 +815,7 @@ in enable = true; wrappedBinaries = { packettracer7 = { - executable = "${packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; + executable = "${inputs.packettracer7.packages.x86_64-linux.default}/bin/packettracer7"; extraArgs = [ "--net=none" "--noprofile" diff --git a/flake.lock b/flake.lock index c7ce627..8a1798a 100644 --- a/flake.lock +++ b/flake.lock @@ -40,7 +40,9 @@ }, "gostfont": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1736170321, @@ -56,9 +58,51 @@ "url": "git://10.0.174.12/gostfont" } }, + "guardant": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771271444, + "narHash": "sha256-tN8hBh6zr7xT0lYWLiJLLDXVNAjdjxoklStbJbJoZl4=", + "ref": "refs/heads/master", + "rev": "e20554b30029b6d84f04cdf7fb226aff3be7e5d5", + "revCount": 1, + "type": "git", + "url": "git://10.0.174.12/guardant" + }, + "original": { + "type": "git", + "url": "git://10.0.174.12/guardant" + } + }, + "kompas3d": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771306148, + "narHash": "sha256-6waxhcHMzmReOp5KUCAkycTR4YHgPCKF/C+3r5lCGkQ=", + "ref": "refs/heads/master", + "rev": "6e1860b78382cbd42f43663b459487e457abd251", + "revCount": 13, + "type": "git", + "url": "git://10.0.174.12/kompas3d" + }, + "original": { + "type": "git", + "url": "git://10.0.174.12/kompas3d" + } + }, "mireadesktop": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1737932603, @@ -76,7 +120,9 @@ }, "mireapython": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1737741645, @@ -95,7 +141,9 @@ "nix-jetbrains-plugins": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_4", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems" }, "locked": { @@ -114,59 +162,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1737299813, - "narHash": "sha256-Qw2PwmkXDK8sPQ5YQ/y/icbQ+TYgbxfjhgnkNJyT1X8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "107d5ef05c0b1119749e381451389eded30fb0d5", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1733412085, - "narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=", + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", "type": "github" }, "original": { @@ -176,74 +176,12 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { - "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_8": { - "locked": { - "lastModified": 1745742390, - "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "packettracer7": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_6" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1740143112, @@ -262,10 +200,12 @@ "root": { "inputs": { "gostfont": "gostfont", + "guardant": "guardant", + "kompas3d": "kompas3d", "mireadesktop": "mireadesktop", "mireapython": "mireapython", "nix-jetbrains-plugins": "nix-jetbrains-plugins", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs", "packettracer7": "packettracer7", "simintech": "simintech", "stm32cubemx": "stm32cubemx" @@ -273,7 +213,9 @@ }, "simintech": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1736199151, @@ -291,7 +233,9 @@ }, "stm32cubemx": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1735908219, @@ -341,4 +285,3 @@ "root": "root", "version": 7 } - diff --git a/flake.nix b/flake.nix index 6d51afb..6221272 100644 --- a/flake.nix +++ b/flake.nix @@ -3,39 +3,39 @@ inputs.simintech = { url = "git://10.0.174.12/simintech_nix"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.mireadesktop = { url = "git://10.0.174.12/mireadesktop"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.stm32cubemx = { url = "git://10.0.174.12/stm32cubemx"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.packettracer7= { url = "git://10.0.174.12/packettracer7"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.gostfont = { url= "git://10.0.174.12/gostfont"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.nix-jetbrains-plugins = { url = "git://10.0.174.12/nix-jetbrains-plugins"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.mireapython = { url = "git://10.0.174.12/mireapython"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.kompas3d = { url = "git://10.0.174.12/kompas3d"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; inputs.guardant = { url = "git://10.0.174.12/guardant"; inputs.nixpkgs.follows = "nixpkgs"; - } + }; outputs = { @@ -50,15 +50,7 @@ }@inputs: { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit simintech; - inherit stm32cubemx; - inherit packettracer7; - inherit guardant; - inherit kompas3d; - ... - inherit inputs; - }; + specialArgs = { inherit inputs; }; modules = [ ./configuration.nix ]; From e2c254a4b9b75a266422654ab3fd83a73125fd8c Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 17 Feb 2026 21:54:10 +0300 Subject: [PATCH 32/41] modified: configuration.nix --- configuration.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index d684c77..0651763 100644 --- a/configuration.nix +++ b/configuration.nix @@ -102,6 +102,7 @@ in sakura # терминал unzipNLS # поддержка zip unrar # поддержка rar + mate.engrampa gtk3 whitesur-icon-theme # необходимо для иконок (pkgs.writeShellScriptBin "powermenu" ( @@ -111,7 +112,8 @@ in builtins.readFile inputs.mireadesktop.packages.x86_64-linux.resethome )) - inputs.kompas3d.packages.${pkgs.system}.default + inputs.kompas3d.packages.${pkgs.system}.default # KOMPAS-3D + freecad elmerfem gmsh # FEM calculation inputs.stm32cubemx.packages.x86_64-linux.stm32cubemx From 0eed59a5c5384900e9349fb91be6afca40682407 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 17 Feb 2026 22:02:33 +0300 Subject: [PATCH 33/41] modified: configuration.nix --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 0651763..fb3e84e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -113,7 +113,7 @@ in )) inputs.kompas3d.packages.${pkgs.system}.default # KOMPAS-3D - freecad elmerfem gmsh # FEM calculation + freecad elmerfem calculix-ccx gmsh # FEM calculation inputs.stm32cubemx.packages.x86_64-linux.stm32cubemx From 1d0c1a9b7506b5f04c48b81dfe8520355b5329d1 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Tue, 17 Feb 2026 22:30:56 +0300 Subject: [PATCH 34/41] modified: configuration.nix --- configuration.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index fb3e84e..1a42f30 100644 --- a/configuration.nix +++ b/configuration.nix @@ -100,8 +100,9 @@ in chromium # браузер pinta # графический редактор sakura # терминал - unzipNLS # поддержка zip - unrar # поддержка rar + unzipNLS zip # поддержка zip + unrar rar # поддержка rar + p7zip # поддержка 7z mate.engrampa gtk3 whitesur-icon-theme # необходимо для иконок @@ -128,7 +129,7 @@ in seafile-client # утилиты разработчика - git + gitFull cmakeWithGui gnumake From c4edf403a38362e52c75f419cc4fd2639580d0a1 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Wed, 18 Feb 2026 16:37:00 +0300 Subject: [PATCH 35/41] kompas and desktop major update --- configuration.nix | 13 ++++++++----- flake.lock | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index 1a42f30..03120b3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -100,9 +100,8 @@ in chromium # браузер pinta # графический редактор sakura # терминал - unzipNLS zip # поддержка zip - unrar rar # поддержка rar - p7zip # поддержка 7z + unzipNLS # поддержка zip + unrar # поддержка rar mate.engrampa gtk3 whitesur-icon-theme # необходимо для иконок @@ -114,7 +113,7 @@ in )) inputs.kompas3d.packages.${pkgs.system}.default # KOMPAS-3D - freecad elmerfem calculix-ccx gmsh # FEM calculation + freecad elmerfem gmsh # FEM calculation inputs.stm32cubemx.packages.x86_64-linux.stm32cubemx @@ -129,7 +128,7 @@ in seafile-client # утилиты разработчика - gitFull + git cmakeWithGui gnumake @@ -544,6 +543,10 @@ in }) qtcreator + qt6.full + qt6.qtbase + gdb + isort black diff --git a/flake.lock b/flake.lock index 8a1798a..ab224e0 100644 --- a/flake.lock +++ b/flake.lock @@ -105,11 +105,11 @@ ] }, "locked": { - "lastModified": 1737932603, - "narHash": "sha256-YKCNo6UGpWLDP1UwiP85aJ91nplHupBU5UU/Hy8y2bo=", + "lastModified": 1771410028, + "narHash": "sha256-6BVwicCjt+VzBJSmC1d61KVXgYxDrvGZKun7S4jhhJM=", "ref": "refs/heads/main", - "rev": "fa628ed1aff70c4121f718be450626bab46a1eab", - "revCount": 34, + "rev": "9b2e1caaef17e803fc75381396085e9928a80542", + "revCount": 38, "type": "git", "url": "git://10.0.174.12/mireadesktop" }, From 7f02867646ed75da3aecafef7e2d23e793c60ba9 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 7 Mar 2026 17:43:05 +0300 Subject: [PATCH 36/41] modified: flake.lock --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ab224e0..1925a47 100644 --- a/flake.lock +++ b/flake.lock @@ -162,11 +162,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751274312, - "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", + "lastModified": 1745742390, + "narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", + "rev": "26245db0cb552047418cfcef9a25da91b222d6c7", "type": "github" }, "original": { From d722f38fab7476b219e64004d5beb3815d7b4562 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 7 Mar 2026 22:08:26 +0300 Subject: [PATCH 37/41] modified: configuration.nix --- configuration.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/configuration.nix b/configuration.nix index 03120b3..2046915 100644 --- a/configuration.nix +++ b/configuration.nix @@ -439,6 +439,69 @@ in ''; }) + (stdenv.mkDerivation { + pname = "erlu-idef0-editor"; + version = "1.0.1"; + + src = builtins.fetchGit { + url = "http://45.87.246.92/forgejo/gregorbednov/erlu.git"; + ref = "master"; + rev = "58198c6ecd8572f1c7db42b90c8189954c9a32fc"; + }; + nativeBuildInputs = with pkgs; [ + cmake + pkg-config + qt6.wrapQtAppsHook + qt6.qttools + ]; + + buildInputs = with pkgs; [ + qt6.qtbase + qt6.qtsvg + ]; + + configurePhase = '' + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$out \ + -DBUILD_COLORS_PLUGIN=ON + ''; + + buildPhase = '' + cmake --build build + find . -path "*/translations/*.ts" -print0 | while IFS= read -r -d "" f; do + out_path=$(printf '%s\n' "$f" | sed 's/\.ts$/.qm/') + lrelease "$f" -qm "$out_path" + done + ''; + + installPhase = '' + runHook preInstall + cmake --install build --prefix $out + # app translations + if [ -d translations ]; then + mkdir -p $out/share/idef0/translations + find translations -maxdepth 1 -type f -name '*.qm' -print0 | xargs -0 -r cp -t $out/share/idef0/translations + fi + # plugin translations + find src/plugins -path "*/translations/*.qm" -print0 | while IFS= read -r -d "" f; do + rel="''${f#src/plugins/}" # e.g., color/translations/colors_en.qm + plugdir="''${rel%%/translations/*}" # e.g., color + dest="$out/plugins/$plugdir/translations" + mkdir -p "$dest" + cp "$f" "$dest/" + done + runHook postInstall + ''; + + qtWrapperArgs = [ "--set" "QT_LOGGING_RULES" "qt.qpa.wayland.textinput=false" ]; + meta = with lib; { + description = "IDEF0 diagram editor built with Qt 6 Widgets"; + license = licenses.lgpl3Plus; + mainProgram = "erlu_idef0_editor"; + platforms = platforms.linux; + }; + }) + (pkgs.writeShellScriptBin "gcc" ''${pkgs.clang}/bin/clang "$@"'') (pkgs.writeShellScriptBin "g++" ''${pkgs.clang}/bin/clang++ "$@"'') From 8b5a82104d71794a72f836a50305f85ab8f0f109 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sat, 7 Mar 2026 22:42:21 +0300 Subject: [PATCH 38/41] modified: flake.lock --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 1925a47..d8fff71 100644 --- a/flake.lock +++ b/flake.lock @@ -105,11 +105,11 @@ ] }, "locked": { - "lastModified": 1771410028, - "narHash": "sha256-6BVwicCjt+VzBJSmC1d61KVXgYxDrvGZKun7S4jhhJM=", + "lastModified": 1772912419, + "narHash": "sha256-/PN1Mjtc43Rue4pc3LT1YLfbrNwBrEHDT/o2vUrsji8=", "ref": "refs/heads/main", - "rev": "9b2e1caaef17e803fc75381396085e9928a80542", - "revCount": 38, + "rev": "aee862d014ff92f0309efa0217a04bff173fb6dd", + "revCount": 39, "type": "git", "url": "git://10.0.174.12/mireadesktop" }, From f10133b86423a3a18c010db493237d0b64e73b97 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sun, 8 Mar 2026 03:18:51 +0300 Subject: [PATCH 39/41] modified: configuration.nix --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index 2046915..f949362 100644 --- a/configuration.nix +++ b/configuration.nix @@ -811,6 +811,8 @@ in start = '' ${inputs.mireadesktop.packages.x86_64-linux.tint2} & ${inputs.mireadesktop.packages.x86_64-linux.pcmanfm} & + ${inputs.mireadesktop.packages.x86_64-linux.sxhkd} & + ${inputs.mireadesktop.packages.x86_64-linux.xcape} & waitPID=$! ''; } From ee00bb7ac7e0b436df11ee2f03358f20a1b885c7 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sun, 8 Mar 2026 03:29:36 +0300 Subject: [PATCH 40/41] modified: configuration.nix modified: flake.lock --- configuration.nix | 2 +- flake.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configuration.nix b/configuration.nix index f949362..8377bc1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -812,7 +812,7 @@ in ${inputs.mireadesktop.packages.x86_64-linux.tint2} & ${inputs.mireadesktop.packages.x86_64-linux.pcmanfm} & ${inputs.mireadesktop.packages.x86_64-linux.sxhkd} & - ${inputs.mireadesktop.packages.x86_64-linux.xcape} & + #${inputs.mireadesktop.packages.x86_64-linux.xcape} & waitPID=$! ''; } diff --git a/flake.lock b/flake.lock index d8fff71..692e743 100644 --- a/flake.lock +++ b/flake.lock @@ -105,11 +105,11 @@ ] }, "locked": { - "lastModified": 1772912419, - "narHash": "sha256-/PN1Mjtc43Rue4pc3LT1YLfbrNwBrEHDT/o2vUrsji8=", + "lastModified": 1772927247, + "narHash": "sha256-qU9kHhp99W2ymeoZsC7L29BKUAonxw8ckFa0ratpx1s=", "ref": "refs/heads/main", - "rev": "aee862d014ff92f0309efa0217a04bff173fb6dd", - "revCount": 39, + "rev": "a19e2f8ac520ef2be55d0c0472aab125a4d3a357", + "revCount": 45, "type": "git", "url": "git://10.0.174.12/mireadesktop" }, From e032b5358b90fcd645f98c1f1f462bcb7998f406 Mon Sep 17 00:00:00 2001 From: Gregory Bednov Date: Sun, 15 Mar 2026 17:05:36 +0300 Subject: [PATCH 41/41] modified: flake.lock modified: flake.nix --- flake.lock | 36 ++++++++++++------------- flake.nix | 78 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 53 deletions(-) diff --git a/flake.lock b/flake.lock index 692e743..de7f08e 100644 --- a/flake.lock +++ b/flake.lock @@ -51,11 +51,11 @@ "rev": "4f11a7fdd2b0a390f98c8764e8f6830f75201096", "revCount": 6, "type": "git", - "url": "git://10.0.174.12/gostfont" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/gostfont.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/gostfont" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/gostfont.git" } }, "guardant": { @@ -71,11 +71,11 @@ "rev": "e20554b30029b6d84f04cdf7fb226aff3be7e5d5", "revCount": 1, "type": "git", - "url": "git://10.0.174.12/guardant" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/guardant.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/guardant" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/guardant.git" } }, "kompas3d": { @@ -91,11 +91,11 @@ "rev": "6e1860b78382cbd42f43663b459487e457abd251", "revCount": 13, "type": "git", - "url": "git://10.0.174.12/kompas3d" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/kompas3d.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/kompas3d" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/kompas3d.git" } }, "mireadesktop": { @@ -111,11 +111,11 @@ "rev": "a19e2f8ac520ef2be55d0c0472aab125a4d3a357", "revCount": 45, "type": "git", - "url": "git://10.0.174.12/mireadesktop" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/mireadesktop.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/mireadesktop" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/mireadesktop.git" } }, "mireapython": { @@ -131,11 +131,11 @@ "rev": "b7172d602ff62aa02d68bd9852168bd3c32aa726", "revCount": 12, "type": "git", - "url": "git://10.0.174.12/mireapython" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/mireapython.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/mireapython" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/mireapython.git" } }, "nix-jetbrains-plugins": { @@ -153,11 +153,11 @@ "rev": "c1b6f1b23bd29d520ac3f46fd596564ac6e84e2a", "revCount": 44, "type": "git", - "url": "git://10.0.174.12/nix-jetbrains-plugins" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/nix-jetbrains-plugins.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/nix-jetbrains-plugins" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/nix-jetbrains-plugins.git" } }, "nixpkgs": { @@ -190,11 +190,11 @@ "rev": "eb673a5d201d9c32e8fc642e47b9c66ed6130379", "revCount": 2, "type": "git", - "url": "git://10.0.174.12/packettracer7" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/packettracer7.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/packettracer7" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/packettracer7.git" } }, "root": { @@ -224,11 +224,11 @@ "rev": "3ce193218e3f5b8cc5b5a212be550785d8e64e86", "revCount": 10, "type": "git", - "url": "git://10.0.174.12/simintech_nix" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/simintech_nix.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/simintech_nix" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/simintech_nix.git" } }, "stm32cubemx": { @@ -244,11 +244,11 @@ "rev": "d1ebff9193ed7be660e14167f8fb1625be8df4f0", "revCount": 31, "type": "git", - "url": "git://10.0.174.12/stm32cubemx" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/stm32cubemx.git" }, "original": { "type": "git", - "url": "git://10.0.174.12/stm32cubemx" + "url": "https://gregorbednov.ru/forgejo/gregorbednov/stm32cubemx.git" } }, "systems": { diff --git a/flake.nix b/flake.nix index 6221272..b784237 100644 --- a/flake.nix +++ b/flake.nix @@ -1,41 +1,49 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; inputs.simintech = { - url = "git://10.0.174.12/simintech_nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.mireadesktop = { - url = "git://10.0.174.12/mireadesktop"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.stm32cubemx = { - url = "git://10.0.174.12/stm32cubemx"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.packettracer7= { - url = "git://10.0.174.12/packettracer7"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.gostfont = { - url= "git://10.0.174.12/gostfont"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.nix-jetbrains-plugins = { - url = "git://10.0.174.12/nix-jetbrains-plugins"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.mireapython = { - url = "git://10.0.174.12/mireapython"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.kompas3d = { - url = "git://10.0.174.12/kompas3d"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - inputs.guardant = { - url = "git://10.0.174.12/guardant"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/simintech_nix.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.mireadesktop = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/mireadesktop.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.stm32cubemx = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/stm32cubemx.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.packettracer7 = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/packettracer7.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.gostfont = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/gostfont.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.nix-jetbrains-plugins = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/nix-jetbrains-plugins.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.mireapython = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/mireapython.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.kompas3d = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/kompas3d.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; + +inputs.guardant = { + url = "git+https://gregorbednov.ru/forgejo/gregorbednov/guardant.git"; + inputs.nixpkgs.follows = "nixpkgs"; +}; outputs = {