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
|
let
|
||||||
cfg = config.my.home.mail.msmtp;
|
cfg = config.my.home.mail.msmtp;
|
||||||
in
|
in
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
enable = mkDisableOption "ssh configuration";
|
enable = mkDisableOption "ssh configuration";
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.ssh = {
|
config.programs.ssh = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
|
|
|
@ -12,8 +12,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
mylib = makeExtensible (self:
|
mylib = makeExtensible (self:
|
||||||
with self; mapModules ./.
|
mapModules ./. (file: import file { inherit self lib pkgs inputs; })
|
||||||
(file: import file { inherit self lib pkgs inputs; })
|
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
mylib.extend (self: super:
|
mylib.extend (self: super:
|
||||||
|
|
|
@ -3,21 +3,48 @@ 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
|
||||||
{
|
{
|
||||||
mapModules = dir: fn:
|
# Find all nix modules in a directory, discard any prefixed with "_",
|
||||||
mapFilterAttrs
|
# map a function to each resulting path, and generate an attribute set
|
||||||
(n: v:
|
# to associate module name to resulting value.
|
||||||
v != null &&
|
#
|
||||||
!(hasPrefix "_" n))
|
# mapModules ::
|
||||||
(n: v:
|
# path
|
||||||
let path = "${toString dir}/${n}"; in
|
# (path -> any)
|
||||||
if v == "directory" && pathExists "${path}/default.nix"
|
# attrs
|
||||||
then nameValuePair n (fn path)
|
mapModules = implOptionalRecursion false;
|
||||||
else if v == "regular" &&
|
|
||||||
n != "default.nix" &&
|
# Recursive version of mapModules.
|
||||||
hasSuffix ".nix" n
|
#
|
||||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
# mapModulesRec ::
|
||||||
else nameValuePair "" null)
|
# path
|
||||||
(readDir dir);
|
# (path -> any)
|
||||||
|
# attrs
|
||||||
|
mapModulesRec = implOptionalRecursion true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
config.my.services = {
|
config.my.services = {
|
||||||
wireguard = {
|
wireguard = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.hardware.upower;
|
cfg = config.my.hardware.upower;
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.services.paperless;
|
cfg = config.my.services.paperless;
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# A simple podcast fetcher
|
# A simple podcast fetcher
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.services.podgrab;
|
cfg = config.my.services.podgrab;
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, fetchurl, gnulib, stdenv }:
|
{ lib, fetchurl, stdenv }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "nolimips";
|
pname = "nolimips";
|
||||||
version = "0.11";
|
version = "0.11";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, fetchFromGitHub, gawk, stdenvNoCC, unified-hosts-lists }:
|
{ lib, 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;
|
||||||
|
|
Loading…
Reference in a new issue