Skip to content

Commit

Permalink
Merge pull request #222 from DBCDK/special-args-actually
Browse files Browse the repository at this point in the history
special args, but actually
  • Loading branch information
srhb authored Sep 18, 2024
2 parents d13c3d6 + a891776 commit 1f4cd19
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
3 changes: 3 additions & 0 deletions data/eval-machines.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let
lib = network.network.lib or nwPkgs.lib or (import <nixpkgs/lib>);
evalConfig =
network.network.evalConfig or ((nwPkgs.path or <nixpkgs>) + "/nixos/lib/eval-config.nix");
specialArgs = network.network.specialArgs or { };
runCommand = network.network.runCommand or nwPkgs.runCommand or (import <nixpkgs> { }).runCommand;
in
with lib;
Expand Down Expand Up @@ -77,6 +78,7 @@ rec {
map (machineName: {
name = machineName;
value = import evalConfig {
inherit specialArgs;
# Force decide system in module system
system = null;
modules = modules {
Expand All @@ -93,6 +95,7 @@ rec {
map (machineName: {
name = machineName;
value = import evalConfig {
inherit specialArgs;
# Force decide system in module system
system = null;
modules = modules {
Expand Down
39 changes: 22 additions & 17 deletions examples/simple.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ in
{
network = {
inherit pkgs;
specialArgs = {
systemdBoot = true;
};
description = "simple hosts";
ordering = {
tags = [
Expand All @@ -13,25 +16,27 @@ in
};
};

"web01" = _: {
deployment.tags = [ "web" ];

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

services.nginx.enable = true;

fileSystems = {
"/" = {
label = "nixos";
fsType = "ext4";
};
"/boot" = {
label = "boot";
fsType = "vfat";
"web01" =
{ systemdBoot, ... }:
{
deployment.tags = [ "web" ];

boot.loader.systemd-boot.enable = systemdBoot;
boot.loader.efi.canTouchEfiVariables = true;

services.nginx.enable = true;

fileSystems = {
"/" = {
label = "nixos";
fsType = "ext4";
};
"/boot" = {
label = "boot";
fsType = "vfat";
};
};
};
};

"db01" = _: {
deployment.tags = [ "db" ];
Expand Down

0 comments on commit 1f4cd19

Please sign in to comment.