Skip to content

Commit

Permalink
parts: add an option for headless configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
moni-dz committed Nov 17, 2023
1 parent 9ab07fd commit 3e7f121
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
mistral = {
system = "x86_64-linux";
stateVersion = "23.05";
server = true;

modules = [
inputs.nix-minecraft.nixosModules.minecraft-servers
Expand Down
6 changes: 4 additions & 2 deletions modules/parts/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let

nixosOpts = opts@{ config, name, ... }: {
options = {
server = lib.mkEnableOption "Host is a headless server configuration.";

system = lib.mkOption {
type = types.enum [ "aarch64-linux" "x86_64-linux" ];
description = "System architecture for the configuration.";
Expand All @@ -35,10 +37,10 @@ let

config._nixos = withSystem config.system (ctx:
inputs.nixpkgs.lib.nixosSystem {
modules = config.modules ++ [
modules = config.modules ++ lib.optionals (!config.server) [
# Shared configuration across all NixOS machines
../shared/nixos

] ++ [
({ pkgs, ... }: {
inherit (ctx) nix nixpkgs;
_module.args = ctx.extraModuleArgs;
Expand Down

0 comments on commit 3e7f121

Please sign in to comment.