From b33b1ea8ef5d5511e34fed41ad9a8199d0d58331 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Jul 2024 20:07:08 +0300 Subject: 2024-07-21 --- lib/default.nix | 16 +++++++++++++--- lib/dns.nix | 4 +++- lib/my.nix | 2 +- lib/packages.nix | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 lib/packages.nix (limited to 'lib') 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"; +} -- cgit 1.4.1