Compare commits
8 commits
2d26b36e31
...
673ead7863
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 673ead7863 | ||
Bruno BELANYI | 3d10461a6e | ||
Bruno BELANYI | 75312c747b | ||
Bruno BELANYI | 68be7743ad | ||
Bruno BELANYI | 9d362655e2 | ||
Bruno BELANYI | 604b99a7ac | ||
Bruno BELANYI | 8467fda721 | ||
Bruno BELANYI | bad9b8a06b |
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.mail.msmtp;
|
||||
in
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
enable = mkDisableOption "ssh configuration";
|
||||
};
|
||||
|
||||
config.programs.ssh = {
|
||||
config.programs.ssh = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
matchBlocks = {
|
||||
|
|
|
@ -12,8 +12,7 @@ let
|
|||
};
|
||||
|
||||
mylib = makeExtensible (self:
|
||||
with self; mapModules ./.
|
||||
(file: import file { inherit self lib pkgs inputs; })
|
||||
mapModules ./. (file: import file { inherit self lib pkgs inputs; })
|
||||
);
|
||||
in
|
||||
mylib.extend (self: super:
|
||||
|
|
|
@ -3,21 +3,48 @@ let
|
|||
inherit (builtins) readDir pathExists;
|
||||
inherit (lib) hasPrefix hasSuffix nameValuePair removeSuffix;
|
||||
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
|
||||
{
|
||||
mapModules = dir: fn:
|
||||
mapFilterAttrs
|
||||
(n: v:
|
||||
v != null &&
|
||||
!(hasPrefix "_" n))
|
||||
(n: v:
|
||||
let path = "${toString dir}/${n}"; in
|
||||
if v == "directory" && pathExists "${path}/default.nix"
|
||||
then nameValuePair n (fn path)
|
||||
else if v == "regular" &&
|
||||
n != "default.nix" &&
|
||||
hasSuffix ".nix" n
|
||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||
else nameValuePair "" null)
|
||||
(readDir dir);
|
||||
# Find all nix modules in a directory, discard any prefixed with "_",
|
||||
# map a function to each resulting path, and generate an attribute set
|
||||
# to associate module name to resulting value.
|
||||
#
|
||||
# mapModules ::
|
||||
# path
|
||||
# (path -> any)
|
||||
# attrs
|
||||
mapModules = implOptionalRecursion false;
|
||||
|
||||
# Recursive version of mapModules.
|
||||
#
|
||||
# mapModulesRec ::
|
||||
# path
|
||||
# (path -> any)
|
||||
# attrs
|
||||
mapModulesRec = implOptionalRecursion true;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
config.my.services = {
|
||||
wireguard = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.hardware.upower;
|
||||
in
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.paperless;
|
||||
in
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# A simple podcast fetcher
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.podgrab;
|
||||
in
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, fetchurl, gnulib, stdenv }:
|
||||
{ lib, fetchurl, stdenv }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nolimips";
|
||||
version = "0.11";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, fetchFromGitHub, gawk, stdenvNoCC, unified-hosts-lists }:
|
||||
{ lib, gawk, stdenvNoCC, unified-hosts-lists }:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
name = "unbound-zones-adblock";
|
||||
version = unified-hosts-lists.version;
|
||||
|
|
Loading…
Reference in a new issue