This commit is contained in:
ZMSUN 2025-10-03 12:45:53 +08:00
commit c8991b8e7e
Signed by: zm
GPG key ID: 9887E5061F495C4C
3 changed files with 49 additions and 0 deletions

23
flake.lock generated Normal file
View file

@ -0,0 +1,23 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1759143120,
"narHash": "sha256-Lz9jvhswQu/niKVttNvOds0w+OS+2x63NivPVJng5G4=",
"type": "tarball",
"url": "https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

17
flake.nix Normal file
View file

@ -0,0 +1,17 @@
{
description = "My personal nix packages";
inputs.nixpkgs.url = "https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz";
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
myOverlay = import ./overlays/my-pkgs.nix;
pkgs = import nixpkgs {
inherit system;
overlays = [ myOverlay ];
};
in {
overlays = [ myOverlay ];
packages.${system} = pkgs;
};
}

9
overlays/my-pkgs.nix Normal file
View file

@ -0,0 +1,9 @@
self: super: let
pkgsDir = ./../pkgs;
pkgNames = builtins.attrNames (builtins.readDir pkgsDir);
myPkgs = builtins.listToAttrs (map (name: {
name = name; value = super.callPackage (pkgsDir + "/" + name) {};
}) pkgNames);
in
super // myPkgs