about summary refs log tree commit diff
path: root/lib/packages.nix
diff options
context:
space:
mode:
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