From 8132dae08af22e64387ab951a5b74074897cd5a0 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Mon, 12 Jun 2023 12:02:01 +0200 Subject: [PATCH] added some beginning docu --- README.md | 14 ++++++++++++-- flake-module.nix | 5 ++++- nixos/flake-module.nix | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cf71ecf..739c823 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ -# nixMail +# nixConfig -a try to configure a nixOS mail server \ No newline at end of file +## Build a machine +### Local +If you want to build the machineconfiguration for machine +run +``` +nix build .#nixosConfiguration. +``` + +### On the machine +clone this repo to `/etc/nixos/` and `nixos-rebuild` that will select +the appropriate machine based on hostname diff --git a/flake-module.nix b/flake-module.nix index 589de49..2220d58 100644 --- a/flake-module.nix +++ b/flake-module.nix @@ -1,6 +1,9 @@ {inputs, ...}: { - debug = true; + # debug = true; + # We only define machines config in this flake yet, so we only include + # the module that builds these. This file might get fuller, if we need to + # build our own packages, that are not flakes. imports = [ ./nixos/flake-module.nix # To import a flake module # 1. Add foo to inputs diff --git a/nixos/flake-module.nix b/nixos/flake-module.nix index 3e5a6cc..cca5849 100644 --- a/nixos/flake-module.nix +++ b/nixos/flake-module.nix @@ -1,4 +1,7 @@ # copied and adopted from maralorns config + +# This automatically searches for nixos configs in ./machines/${name}/configuration.nix +# and exposes them as outputs.nixosConfigurations.${name} { withSystem, lib, inputs, ... }: { flake = { nixosConfigurations = withSystem "x86_64-linux" ({ pkgs, ... }: