diff --git a/flake.lock b/flake.lock index 55ae5f8..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": [ @@ -105,16 +251,37 @@ ] }, "locked": { - "lastModified": 1685599623, - "narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "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", - "ref": "release-23.05", "repo": "home-manager", "type": "github" } @@ -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 a7e0875..7e3e92b 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Home manager - home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; ros.url = "github:lopsided98/nix-ros-overlay"; @@ -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. @@ -111,6 +115,19 @@ ./nixos/zerotier.nix ]; }; + bill = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs outputs; + hostname = "bill"; + mainUser = "bill"; + }; + modules = [ + ./nixos/configuration.nix + ./nixos/kde-desktop.nix + ./nixos/family.nix + ./nixos/zerotier.nix + ]; + }; }; # Standalone home-manager configuration entrypoint diff --git a/home-manager/home.nix b/home-manager/home.nix index eedacc2..900329b 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -47,19 +47,124 @@ }; }; - # TODO: Set your username + home = { - username = "your-username"; - homeDirectory = "/home/your-username"; + username = "traverseda"; + homeDirectory = "/home/traverseda"; }; - # Add stuff for your user as you see fit: - # programs.neovim.enable = true; - # home.packages = with pkgs; [ steam ]; + programs.git = { + enable = true; + userName = "Alex Davies"; + userEmail = "traverse.da@gmail.com"; + extraConfig = { + core = { + editor = "vim"; # Set default editor for Git + }; + color = { + ui = "auto"; # Enable colored output in the terminal + }; + push = { + default = "simple"; # Default push behavior to 'simple' + }; + pull = { + rebase = "false"; # Avoid rebasing by default on pull + }; + credential = { + helper = "cache --timeout=3600"; # Cache credentials for 1 hour (3600 seconds) + }; + }; + }; + + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + plugins = with pkgs.vimPlugins; [ + nvim-lspconfig + nvim-treesitter.withAllGrammars + vim-bufferline + tokyonight-nvim + { + plugin = which-key-nvim; + } + ]; + }; + + programs.ssh = { + enable = true; # Enable SSH module + extraConfig = '' + Host * + ControlMaster auto + ControlPath ~/.ssh/sockets/%r@%h-%p + ControlPersist 600 + ''; + }; + + home.packages = with pkgs; [ + pkgs.htop + pkgs.zsh + pkgs.xclip + pkgs.ripgrep + pkgs.mosh + pkgs.waypipe + pkgs.pwgen + pkgs.chezmoi + pkgs.neovim-remote + pkgs.pipx + pkgs.rclone + pkgs.pyright + pkgs.mosh + pkgs.jq + pkgs.copier + pkgs.pv + pkgs.poetry + pkgs.nmap + pkgs.dig + pkgs.tree + pkgs.curl + pkgs.wget + pkgs.wl-clipboard + + (pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Hack"]; }) + + (pkgs.writeShellScriptBin "nvr-edit" '' + nvr --remote-wait $@ + '') + (pkgs.writeShellScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec "$@" + '') + ]; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + history.size = 10000; + history.path = "${config.xdg.dataHome}/zsh/history"; + oh-my-zsh = { + enable = true; + plugins = [ "git" "docker" "docker-compose"]; + theme = "robbyrussell"; + }; + initExtra = '' + if [[ -n ''${NVIM+x} ]]; then + alias vim="nvr --remote" + export EDITOR=nvr-edit + fi + ''; + }; # Enable home-manager and git programs.home-manager.enable = true; - programs.git.enable = true; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; 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 c00d703..0e193ba 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -15,6 +15,7 @@ # Import your generated (nixos-generate-config) hardware configuration ./hardware/${hostname}.nix + inputs.home-manager.nixosModules.home-manager ]; nixpkgs = { @@ -45,6 +46,7 @@ networking.hostName = hostname; # Define your hostname. networking.networkmanager.enable = true; + virtualisation.vmVariant = { # following configuration is added only when building VM with build-vm virtualisation.cores = 4; @@ -69,9 +71,10 @@ nix.settings = { # Enable flakes and new 'nix' command experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store - auto-optimise-store = true; }; + + #Deduplicate nix store on a timer + nix.optimise.automatic = true; environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. @@ -81,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; @@ -111,6 +123,14 @@ }; }; + home-manager = { + extraSpecialArgs = { inherit inputs outputs; }; + backupFileExtension = ".bak"; + users = { + traverseda = import ../home-manager/home.nix; + }; + }; + # This setups a SSH server. Very important if you're setting up a headless system. # Feel free to remove if you don't need it. services.openssh = { @@ -123,6 +143,15 @@ AllowUsers = [ "traverseda" ]; }; }; + system.autoUpgrade = { + enable = true; + flake = "git+https://codeberg.org/traverseda/nixos-config#${hostname}"; + flags = [ + ]; + dates = "02:00"; + randomizedDelaySec = "45min"; + }; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "23.05"; diff --git a/nixos/family.nix b/nixos/family.nix index eb3f04c..f9988ea 100644 --- a/nixos/family.nix +++ b/nixos/family.nix @@ -7,9 +7,10 @@ }; users.users = { gwen = { - # You can set an initial password for your user. - # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. - # Be sure to change it (using passwd) after rebooting! + isNormalUser = true; + extraGroups = [ "networkManager" ]; + }; + bill = { isNormalUser = true; extraGroups = [ "networkManager" ]; }; diff --git a/nixos/hardware/gwen.nix b/nixos/hardware/gwen.nix index 656b8f7..aae306d 100644 --- a/nixos/hardware/gwen.nix +++ b/nixos/hardware/gwen.nix @@ -8,32 +8,30 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/91d9a91c-9c69-4d82-85dc-42598b9ceaec"; + { device = "/dev/disk/by-uuid/946dac58-4ad2-463d-b0a4-46064a3e9e2f"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/BED6-71B3"; + { device = "/dev/disk/by-uuid/6D60-03A9"; fsType = "vfat"; }; - swapDevices = - [ { device = "/dev/disk/by-uuid/693adc19-c9d6-43a2-8e80-044f93a73af9"; } - ]; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/nixos/kde-desktop.nix b/nixos/kde-desktop.nix index 82e3168..a4836f0 100644 --- a/nixos/kde-desktop.nix +++ b/nixos/kde-desktop.nix @@ -22,6 +22,7 @@ services.fprintd.enable = true; services.printing.enable = true; + programs.kdeconnect.enable = true; environment.systemPackages = with pkgs; [ pkgs.krfb @@ -36,8 +37,12 @@ pkgs.gimp pkgs.krita pkgs.nextcloud-client + pkgs.iw + pkgs.vlc ]; +programs.dconf.enable = true; + programs.firefox = { enable = true; policies = { @@ -55,6 +60,7 @@ DontCheckDefaultBrowser = true; Preferences = { "widget.use-xdg-desktop-portal.file-picker" = 1; + "widget.use-xdg-desktop-portal.mime-handler" = 1; }; ExtensionSettings = { "*".installation_mode = "allowed"; diff --git a/nixos/work.nix b/nixos/work.nix index a4898eb..f45d92c 100644 --- a/nixos/work.nix +++ b/nixos/work.nix @@ -7,6 +7,8 @@ environment.systemPackages = with pkgs; [ pkgs.qgroundcontrol pkgs.distrobox + pkgs.element-desktop + pkgs.logseq ]; } diff --git a/nixos/zerotier.nix b/nixos/zerotier.nix index a96b001..9849d8b 100644 --- a/nixos/zerotier.nix +++ b/nixos/zerotier.nix @@ -6,15 +6,18 @@ in { networking.firewall.trustedInterfaces = privateZeroTierInterfaces; # TRUST VPN ONLY - services.avahi.enable = true; - #services.avahi.allowInterfaces = privateZeroTierInterfaces; # ONLY BROADCAST ON VPN - services.avahi.ipv6 = true; - services.avahi.publish.enable = true; - services.avahi.publish.userServices = true; - services.avahi.publish.addresses = true; - services.avahi.publish.domain = true; - services.avahi.nssmdns4 = true; - services.avahi.publish.workstation = true; # ADDED TO DESKTOP MACHINES + services.avahi = { + enable = true; + #allowInterfaces = privateZeroTierInterfaces; # ONLY BROADCAST ON VPN + ipv6 = true; + publish.enable = true; + publish.userServices = true; + publish.addresses = true; + publish.domain = true; + nssmdns4 = true; + publish.workstation = true; # ADDED TO DESKTOP MACHINES + cacheEntriesMax = 512; + }; systemd.services.createDevicemap = { description = "Create ZeroTier devicemap file"; 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 { }; }