about summary refs log tree commit diff
path: root/lib/packages.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-07-21 20:07:08 +0300
committerAzat Bahawi <azat@bahawi.net>2024-07-21 20:07:08 +0300
commitb33b1ea8ef5d5511e34fed41ad9a8199d0d58331 (patch)
tree9195b87cbfc135a85b56f0a415efa23e504f8c40 /lib/packages.nix
parent2024-07-14 (diff)
2024-07-21
Diffstat (limited to '')
-rw-r--r--lib/packages.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/packages.nix b/lib/packages.nix
new file mode 100644
index 0000000..7f9dfcb
--- /dev/null
+++ b/lib/packages.nix
@@ -0,0 +1,18 @@
+{ inputs, system, ... }:
+rec {
+  useNixpkgs = nixpkgs: import nixpkgs { inherit system; };
+
+  fromMaster = useNixpkgs inputs.nixpkgs-master;
+  fromStable = useNixpkgs inputs.nixpkgs-stable;
+  fromUnstable = useNixpkgs (inputs.nixpkgs-unstable or inputs.nixpkgs);
+  fromRev =
+    rev: hash:
+    useNixpkgs (
+      inputs.nixpkgs.legacyPackages.${system}.fetchFromGitHub {
+        owner = "NixOS";
+        repo = "nixpkgs";
+        inherit rev hash;
+      }
+    );
+  fromPR = pr: fromRev "refs/pull/${toString pr}/head";
+}

Consider giving Nix/NixOS a try! <3