diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-07-21 20:07:08 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-07-21 20:07:08 +0300 |
commit | b33b1ea8ef5d5511e34fed41ad9a8199d0d58331 (patch) | |
tree | 9195b87cbfc135a85b56f0a415efa23e504f8c40 /lib | |
parent | 2024-07-14 (diff) |
2024-07-21
Diffstat (limited to '')
-rw-r--r-- | lib/default.nix | 16 | ||||
-rw-r--r-- | lib/dns.nix | 4 | ||||
-rw-r--r-- | lib/my.nix | 2 | ||||
-rw-r--r-- | lib/packages.nix | 18 |
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"; +} |