about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/default.nix16
-rw-r--r--lib/dns.nix4
-rw-r--r--lib/my.nix2
-rw-r--r--lib/packages.nix18
4 files changed, 35 insertions, 5 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 4bd731e..55a34cf 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,7 +1,16 @@
-lib: _: with lib; rec {
-  my = import ./my.nix lib;
+{
+  lib,
+  inputs,
+  system,
+  ...
+}:
+with lib;
+rec {
+  my = import ./my.nix { inherit lib inputs system; };
 
-  dns = import ./dns.nix;
+  dns = import ./dns.nix { inherit lib inputs system; };
+
+  packages = import ./packages.nix { inherit lib inputs system; };
 
   isEven =
     number:
@@ -102,4 +111,5 @@ lib: _: with lib; rec {
       )
     ];
   };
+
 }
diff --git a/lib/dns.nix b/lib/dns.nix
index e1f6b7a..da1f1f2 100644
--- a/lib/dns.nix
+++ b/lib/dns.nix
@@ -1,4 +1,6 @@
-{
+{ lib, inputs, ... }:
+with lib;
+recursiveUpdate inputs.dns.lib {
   const = {
     quad9 = {
       default = [
diff --git a/lib/my.nix b/lib/my.nix
index 30f0e5c..5f5703e 100644
--- a/lib/my.nix
+++ b/lib/my.nix
@@ -1,4 +1,4 @@
-lib:
+{ lib, ... }:
 with lib;
 (evalModules {
   modules = [
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