Compare commits

..

No commits in common. "673ead7863bec924ffc3ba7c971423c9b5d02e27" and "2d26b36e31ee449e0f01fdc2b3d41101f838bc22" have entirely different histories.

11 changed files with 26 additions and 52 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.my.home.mail.msmtp; cfg = config.my.home.mail.msmtp;
in in

View file

@ -7,7 +7,7 @@ in
enable = mkDisableOption "ssh configuration"; enable = mkDisableOption "ssh configuration";
}; };
config.programs.ssh = lib.mkIf cfg.enable { config.programs.ssh = {
enable = true; enable = true;
matchBlocks = { matchBlocks = {

View file

@ -12,7 +12,8 @@ let
}; };
mylib = makeExtensible (self: mylib = makeExtensible (self:
mapModules ./. (file: import file { inherit self lib pkgs inputs; }) with self; mapModules ./.
(file: import file { inherit self lib pkgs inputs; })
); );
in in
mylib.extend (self: super: mylib.extend (self: super:

View file

@ -3,48 +3,21 @@ let
inherit (builtins) readDir pathExists; inherit (builtins) readDir pathExists;
inherit (lib) hasPrefix hasSuffix nameValuePair removeSuffix; inherit (lib) hasPrefix hasSuffix nameValuePair removeSuffix;
inherit (self.attrs) mapFilterAttrs; inherit (self.attrs) mapFilterAttrs;
implOptionalRecursion = recurse:
let
recurseStep =
if recurse
then (n: path: fn: nameValuePair n (impl path fn))
else (_: _: _: nameValuePair "" null);
impl = dir: fn:
mapFilterAttrs
(n: _: n != "" && !(hasPrefix "_" n))
(n: v:
let
path = "${toString dir}/${n}";
in
if v == "directory"
then
if pathExists "${path}/default.nix"
then nameValuePair n (fn path)
else recurseStep n path fn
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
then nameValuePair (removeSuffix ".nix" n) (fn path)
else nameValuePair "" null)
(readDir dir);
in
impl;
in in
{ {
# Find all nix modules in a directory, discard any prefixed with "_", mapModules = dir: fn:
# map a function to each resulting path, and generate an attribute set mapFilterAttrs
# to associate module name to resulting value. (n: v:
# v != null &&
# mapModules :: !(hasPrefix "_" n))
# path (n: v:
# (path -> any) let path = "${toString dir}/${n}"; in
# attrs if v == "directory" && pathExists "${path}/default.nix"
mapModules = implOptionalRecursion false; then nameValuePair n (fn path)
else if v == "regular" &&
# Recursive version of mapModules. n != "default.nix" &&
# hasSuffix ".nix" n
# mapModulesRec :: then nameValuePair (removeSuffix ".nix" n) (fn path)
# path else nameValuePair "" null)
# (path -> any) (readDir dir);
# attrs
mapModulesRec = implOptionalRecursion true;
} }

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [

View file

@ -1,4 +1,4 @@
{ ... }: { lib, ... }:
{ {
config.my.services = { config.my.services = {
wireguard = { wireguard = {

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.my.hardware.upower; cfg = config.my.hardware.upower;
in in

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.my.services.paperless; cfg = config.my.services.paperless;
in in

View file

@ -1,5 +1,5 @@
# A simple podcast fetcher # A simple podcast fetcher
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.my.services.podgrab; cfg = config.my.services.podgrab;
in in

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, stdenv }: { lib, fetchurl, gnulib, stdenv }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "nolimips"; pname = "nolimips";
version = "0.11"; version = "0.11";

View file

@ -1,4 +1,4 @@
{ lib, gawk, stdenvNoCC, unified-hosts-lists }: { lib, fetchFromGitHub, gawk, stdenvNoCC, unified-hosts-lists }:
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
name = "unbound-zones-adblock"; name = "unbound-zones-adblock";
version = unified-hosts-lists.version; version = unified-hosts-lists.version;