From 44eb1c3ffb2def8ab03a4b7dc7a19899395503e8 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Thu, 22 May 2025 18:11:45 +0800 Subject: [PATCH] add overklay --- default.nix | 17 +++++++++++++---- nix/sources.json | 18 +++--------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/default.nix b/default.nix index 7ef803d..cec452a 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,15 @@ let - # Import sources - sources = import ./nix/sources.nix; + sources = imports ./nix/sources.nix; -# And return that specific nixpkgs -in sources.nixpkgs + hello = pkgs.writeShellScriptBin "hello" '' + echo "Hello from the Nix channel overlay!" + ''; + + pkgs = import sources.nixpkgs { + overlays = [ + (self: super: { + inherit hello; + }) + ]; + }; +in pkgs diff --git a/nix/sources.json b/nix/sources.json index ff4892f..81e4b4a 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,22 +5,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "6c43a3495a11e261e5f41e5d7eda2d71dae1b2fe", - "sha256": "16f329z831bq7l3wn1dfvbkh95l2gcggdwn6rk3cisdmv2aa3189", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "sha256": "0m6prywp2axikm2sld8x6g362lzy2y8nf51w106j2riaklg6mfav", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/6c43a3495a11e261e5f41e5d7eda2d71dae1b2fe.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "xbuild": { - "branch": "master", - "description": "xbuild for all in one appimage integrated with tools for build environment", - "homepage": null, - "owner": "shen390s", - "repo": "xbuild", - "rev": "ca08d8d69df0881b944526d295c64bcf23951dd3", - "sha256": "1m5f6qa6z2r5yj83vwcciwm135gz9dngp2acad4j563qf9vii0l1", - "type": "tarball", - "url": "https://github.com/shen390s/xbuild/archive/ca08d8d69df0881b944526d295c64bcf23951dd3.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/2795c506fe8fb7b03c36ccb51f75b6df0ab2553f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } }