Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special args, but actually #222

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading