Auto import files instead of maintaining file list.

This commit is contained in:
Kevin Baensch 2020-03-29 09:10:14 +02:00
parent 081d10bc21
commit c543303ab9
Signed by: derped
GPG key ID: C0F1D326C7626543
15 changed files with 12 additions and 99 deletions

View file

@ -1,12 +0,0 @@
{
imports = [
./etc.nix
./fonts.nix
./locale.nix
./networking.nix
./nix.nix
./security.nix
./users.nix
./zsh.nix
];
}

View file

@ -12,16 +12,16 @@ let
hostVal hostVal
(fileContents /secret/hostName); (fileContents /secret/hostName);
machinePath = (builtins.toPath ( ./machines + ("/" + hostName))); machinePath = (builtins.toPath ( ./machines + ("/" + hostName)));
machineConf = machinePath + "/configuration.nix"; machineFiles = fn.lst { p = machinePath; b = true; };
machineOpts = machinePath + "/options.nix"; configFiles = fn.lst { p = (toString ./config); b = true; };
pkgsFiles = fn.lst { p = (toString ./pkgs); b = true; };
serviceFiles = fn.lst { p = (toString ./services); b = true; };
in { in {
imports = [ imports = [
machineConf ./options/machine.nix
machineOpts ./services/mailserver/default.nix
./config/default.nix ] ++ machineFiles
./pkgs/nixpkgs.nix ++ configFiles
./pkgs/systemPackages.nix ++ pkgsFiles
./services/containers.nix ++ serviceFiles;
./services/default.nix
];
} }

View file

@ -1,10 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [
./hardware-configuration.nix
];
services.cron.enable = false; services.cron.enable = false;
programs.gnome-terminal.enable = true; programs.gnome-terminal.enable = true;

View file

@ -4,7 +4,6 @@ with lib;
{ {
imports = [ imports = [
../../options/machine.nix
../../options/copySysConf.nix ../../options/copySysConf.nix
]; ];

View file

@ -3,10 +3,6 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ {
imports = [
./hardware-configuration.nix
];
system.autoUpgrade.enable = false; system.autoUpgrade.enable = false;
services.haveged.enable = true; services.haveged.enable = true;
@ -15,5 +11,4 @@
# servers. You should change this only after NixOS release notes say you # servers. You should change this only after NixOS release notes say you
# should. # should.
system.stateVersion = "19.03"; system.stateVersion = "19.03";
} }

View file

@ -6,7 +6,6 @@ let
cfg = config.machine; cfg = config.machine;
in { in {
imports = [ imports = [
../../options/machine.nix
../../options/mailman3/options.nix ../../options/mailman3/options.nix
]; ];

View file

@ -3,10 +3,6 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ {
imports = [
./hardware-configuration.nix
];
system.autoUpgrade.enable = false; system.autoUpgrade.enable = false;
programs.zsh.promptInit = "PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[magenta]%}%n@)%m %{$fg_bold[green]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '"; programs.zsh.promptInit = "PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[magenta]%}%n@)%m %{$fg_bold[green]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '";

View file

@ -3,10 +3,6 @@
with lib; with lib;
{ {
imports = [
../../options/machine.nix
];
config.machine = rec { config.machine = rec {
hostName = "DavidsServer"; hostName = "DavidsServer";
administrators = [ { name = "david"; id = 1000; } ]; administrators = [ { name = "david"; id = 1000; } ];

View file

@ -1,10 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [
./hardware-configuration.nix
];
programs.gnome-terminal.enable = true; programs.gnome-terminal.enable = true;
services.cron.enable = false; services.cron.enable = false;

View file

@ -4,7 +4,6 @@ with lib;
{ {
imports = [ imports = [
../../options/machine.nix
../../options/copySysConf.nix ../../options/copySysConf.nix
]; ];
config.machine = { config.machine = {

View file

@ -3,10 +3,6 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ {
imports = [
./hardware-configuration.nix
];
system.autoUpgrade.enable = false; system.autoUpgrade.enable = false;
# services.vsftp = { # services.vsftp = {
@ -18,10 +14,10 @@
# }; # };
services.haveged.enable = true; services.haveged.enable = true;
programs.zsh.promptInit = "PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[cyan]%}%n@)%m %{$fg_bold[magenta]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '"; programs.zsh.promptInit = "PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[cyan]%}%n@)%m %{$fg_bold[magenta]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '";
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you # servers. You should change this only after NixOS release notes say you
# should. # should.
system.stateVersion = "19.03"; system.stateVersion = "19.03";
} }

View file

@ -6,7 +6,6 @@ let
cfg = config.machine; cfg = config.machine;
in { in {
imports = [ imports = [
../../options/machine.nix
../../options/mailman3/options.nix ../../options/mailman3/options.nix
]; ];

View file

@ -5,7 +5,7 @@ with lib;
let let
cfg = config.machine; cfg = config.machine;
fn = import (toString ../fn.nix) { inherit lib; }; fn = import (toString ../fn.nix) { inherit lib; };
pkgsets = map (v: (toString ../.) + "/pkgsets/${v}") (fn.lsf (toString ../pkgsets)); pkgsets = fn.lst { p = (toString ../pkgsets); b = true;};
in { in {
imports = pkgsets; imports = pkgsets;

View file

@ -1,18 +0,0 @@
{
imports = [
./acme.nix
./cups.nix
./docker.nix
./fail2ban.nix
./gitea.nix
./hydra.nix
./mailserver/default.nix
./mailserver.nix
./mariaDB.nix
./nextcloud.nix
./nginx.nix
./openssh.nix
./udev.nix
./desktop.nix
];
}

View file

@ -1,28 +0,0 @@
{
services.prosody = {
enable = true;
admins = [ "derped@ophanim.de" ];
allowRegistration = false;
extraConfig = ''
use_libevent = true
s2s_require_encryption = true
c2s_require_encryption = true
'';
extraModules = [ "private" "vcard" "privacy" "compression" "component" "muc" "pep" "adhoc" "lastactivity" "admin_adhoc" "blocklist"];
# modules.legacyauth = false;
ssl.cert = "/var/lib/acme/ophanim.de/fullchain.pem";
ssl.key = "/var/lib/acme/ophanim.de/key.pem";
virtualHosts = {
localhost = {
domain = "localhost";
enabled = true;
};
"ophanim.de" = {
domain = "ophanim.de";
enabled = true;
};
};
};
}