diff --git a/flake.lock b/flake.lock index 45b1ba4..7d4207e 100644 --- a/flake.lock +++ b/flake.lock @@ -59,10 +59,134 @@ "type": "github" } }, + "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "owner": "numtide", + "repo": "devshell", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_2" }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, "locked": { "lastModified": 1705309234, "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", @@ -77,6 +201,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -119,6 +265,27 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715486357, + "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nix-colors": { "inputs": { "base16-schemes": "base16-schemes", @@ -138,6 +305,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715653378, + "narHash": "sha256-6kbg/PI3+SBP17f4T0js3CBsMLVtlD0JqJhDKgzk1mQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "de8b0d60d6fd34f35abffc46adc94ebaa6996ce2", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1703013332, @@ -202,6 +390,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1715787315, + "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1707268954, "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", @@ -217,6 +421,60 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1715976947, + "narHash": "sha256-cfU0THstf6phd6vpzIzsew89Ns5JdPq7CyeiLRajE1g=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "7c4fe30f814595bc617d6b1b682ab9cbfe535d33", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715609711, + "narHash": "sha256-/5u29K0c+4jyQ8x7dUIEUWlz2BoTSZWUP2quPwFCE7M=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "c182c876690380f8d3b9557c4609472ebfa1b141", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -224,13 +482,14 @@ "nix-colors": "nix-colors", "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", "ros": "ros" } }, "ros": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1713569614, @@ -275,6 +534,57 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714058656, + "narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index f01466a..dc425a1 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,9 @@ # Shameless plug: looking for a way to nixify your themes and make # everything match nicely? Try nix-colors! nix-colors.url = "github:misterio77/nix-colors"; + + nixvim.url = "github:nix-community/nixvim"; + }; outputs = { @@ -71,6 +74,7 @@ ./nixos/kde-desktop.nix ./nixos/cad.nix ./nixos/zerotier.nix + ./nixos/work.nix ]; }; #Work laptop, dell g15. diff --git a/home-manager/home.nix b/home-manager/home.nix index 28a258d..900329b 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -128,6 +128,8 @@ pkgs.wget pkgs.wl-clipboard + (pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Hack"]; }) + (pkgs.writeShellScriptBin "nvr-edit" '' nvr --remote-wait $@ '') diff --git a/nixos/cad.nix b/nixos/cad.nix index e07e004..18e2f22 100644 --- a/nixos/cad.nix +++ b/nixos/cad.nix @@ -6,6 +6,22 @@ pkgs.openscad pkgs.blender pkgs.freecad + (pkgs.appimageTools.wrapType2 + { + name = "creality-print"; + src = pkgs.fetchurl { + url = "https://file2-cdn.creality.com/file/05a4538e0c7222ce547eb8d58ef0251e/Creality_Print-v4.3.7.6627-x86_64-Release.AppImage"; + sha256 = "sha256-WUsL7UbxSY94H4F1Ww8vLsfRyeg2/DZ+V4B6eH3M6+M="; + }; + }) + # (pkgs.appimageTools.wrapType2 + # { + # name = "orca-slicer"; + # src = pkgs.fetchurl { + # url = "https://github.com/SoftFever/OrcaSlicer/releases/download/v2.0.0/OrcaSlicer_Linux_V2.0.0.AppImage"; + # sha256 = "sha256-PcCsqF1RKdSrbdp1jCF0n5Mu30EniaBEuJNw3XdPhO4="; + # }; + # }) ]; } diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c8a0e5b..7621fee 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -84,8 +84,17 @@ pkgs.git pkgs.usbutils pkgs.pciutils + appimage-run ]; + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/nixos/kde-desktop.nix b/nixos/kde-desktop.nix index 8807a96..a4836f0 100644 --- a/nixos/kde-desktop.nix +++ b/nixos/kde-desktop.nix @@ -37,6 +37,8 @@ pkgs.gimp pkgs.krita pkgs.nextcloud-client + pkgs.iw + pkgs.vlc ]; programs.dconf.enable = true; diff --git a/nixos/work.nix b/nixos/work.nix index a4898eb..1c05eff 100644 --- a/nixos/work.nix +++ b/nixos/work.nix @@ -7,6 +7,7 @@ environment.systemPackages = with pkgs; [ pkgs.qgroundcontrol pkgs.distrobox + pkgs.element-desktop ]; } diff --git a/pkgs/creality-print/default.nix b/pkgs/creality-print/default.nix new file mode 100644 index 0000000..5513351 --- /dev/null +++ b/pkgs/creality-print/default.nix @@ -0,0 +1,46 @@ +{ pkgs ? import {} }: + +let + creality-print = pkgs.appimageTools.wrapType2 { + name = "creality-print"; + src = pkgs.fetchurl { + url = "https://file2-cdn.creality.com/file/05a4538e0c7222ce547eb8d58ef0251e/Creality_Print-v4.3.7.6627-x86_64-Release.AppImage"; + sha256 = "sha256-WUsL7UbxSY94H4F1Ww8vLsfRyeg2/DZ+V4B6eH3M6+M="; + }; + profile = '' + export LC_ALL=C.UTF-8 + ''; + multiPkgs = pkgs: with pkgs; [ qt5.qtbase libGL libz ]; + }; + + desktopItem = pkgs.makeDesktopItem { + name = "creality-print"; + exec = "${creality-print}/bin/creality-print"; + icon = "creality-print"; + desktopName = "Creality Print"; + genericName = "3D Printer Software"; + categories = [ "Graphics" ]; + }; + +in +pkgs.stdenv.mkDerivation { + name = "creality-print-app"; + buildInputs = [ creality-print ]; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + unpackPhase = "true"; + + installPhase = '' + mkdir -p $out/bin $out/share/applications + cp ${creality-print}/bin/* $out/bin + ln -s ${desktopItem}/share/applications/* $out/share/applications/ + ''; + + meta = with pkgs.lib; { + description = "Creality Print is a 3D printer software for Creality printers"; + homepage = "https://www.creality.com/"; + license = licenses.unfree; + platforms = platforms.linux; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 80822ef..6762b7f 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,9 @@ # Custom packages, that can be defined similarly to ones from nixpkgs # You can build them using 'nix build .#example' -pkgs: { +# +{ pkgs, ... }: + +{ # example = pkgs.callPackage ./example { }; - custom-creality-print = pkgs.callPackage ./custom-creality-print { }; + creality-print = pkgs.callPackage ./creality-print { }; }