Move fn functions to system specialArgs.
This commit is contained in:
parent
b73ea3b5de
commit
b2da82bff1
9 changed files with 12 additions and 24 deletions
|
@ -26,7 +26,7 @@
|
|||
machineFiles = lib.filter (name: lib.strings.hasSuffix ".nix" name) (fn.lst { p = machinePath; b = true; });
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = attrs;
|
||||
specialArgs = attrs // { fn = fn; };
|
||||
modules = [
|
||||
(toString ./options/machine.nix)
|
||||
sops-nix.nixosModules.sops
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, fn, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
fn = import (toString ../fn.nix) { inherit lib; };
|
||||
metapkgs = let
|
||||
pPath = (toString ../pkgsets);
|
||||
in (lists.forEach (fn.lsfRec pPath true) (v: replaceStrings [ "${pPath}/" "/" ".nix" ] [ "" "::" "" ] v));
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
fn = import (toString ../fn.nix) { inherit lib; };
|
||||
pkgsets = fn.lst { p = (toString ../pkgsets); b = true;};
|
||||
in {
|
||||
imports = pkgsets;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
fn = import (toString ../fn.nix) { inherit lib; };
|
||||
modefiles = fn.lst { p = (toString ./emacs); b = true; };
|
||||
in rec {
|
||||
imports = [
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
let
|
||||
fn = import ../fn.nix { inherit lib; };
|
||||
in {
|
||||
{
|
||||
config.machine.pkgsets.haskell.pkgwrap = (pkgs.haskellPackages.ghcWithPackages (pkgs: (fn.pkgFilter config.machine.pkgsets.haskell.pkgs)));
|
||||
config.machine.pkgsets.haskell.pkgs = with pkgs.haskellPackages; [
|
||||
hindent
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
let
|
||||
fn = import ../fn.nix { inherit lib; };
|
||||
in {
|
||||
{
|
||||
config.machine.pkgsets.php.pkgwrap = (fn.pkgFilter config.machine.pkgsets.php.pkgs);
|
||||
config.machine.pkgsets.php.pkgs = (with pkgs.php82Packages; [
|
||||
composer
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
fn = import ../fn.nix { inherit lib; };
|
||||
# ocv3 = pkgs.python38Packages.opencv3.override { enableGtk2 = true; enableFfmpeg = true; enableGStreamer = true; };
|
||||
in {
|
||||
{
|
||||
config.machine.pkgsets.python3.pkgwrap = (pkgs.python310.withPackages (ps: (fn.pkgFilter config.machine.pkgsets.python3.pkgs)));
|
||||
config.machine.pkgsets.python3.pkgs = with pkgs.python310Packages; [
|
||||
GitPython
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
{ options, config, lib, fn, pkgs, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
||||
let
|
||||
fn = import (../. + (toPath "/fn.nix")) { inherit lib; };
|
||||
cfg = config.machine;
|
||||
in mkIf (elem "acme" cfg.services) {
|
||||
security.acme = {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
# This Configuration is meant for local DNS setups only!
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
{ options, config, lib, fn, pkgs, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
||||
let
|
||||
fn = import (../. + (toPath "/fn.nix")) { inherit lib; };
|
||||
cfg = config.machine;
|
||||
in mkIf (elem "bind" cfg.services) {
|
||||
services.bind = {
|
||||
|
|
Loading…
Reference in a new issue