remove default for clan.core.settings.machine.name and make readOnly
There is not reason that there needs to be a default. Machines are usually defined as an attrset, so there is no reason to have a default. Also make this readOnly as we never want to override it.
This commit is contained in:
@@ -9,10 +9,17 @@ in
|
||||
{
|
||||
hostPkgs = pkgs;
|
||||
# speed-up evaluation
|
||||
defaults = {
|
||||
defaults =
|
||||
{ config, options, ... }:
|
||||
{
|
||||
imports = [
|
||||
./minify.nix
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
(lib.optionalAttrs (options ? clan) {
|
||||
clan.core.settings.machine.name = config.networking.hostName;
|
||||
})
|
||||
{
|
||||
documentation.enable = lib.mkDefault false;
|
||||
boot.isContainer = true;
|
||||
|
||||
@@ -31,6 +38,8 @@ in
|
||||
|
||||
# we don't have permission to set cpu scheduler in our container
|
||||
systemd.services.nix-daemon.serviceConfig.CPUSchedulingPolicy = lib.mkForce "";
|
||||
}
|
||||
];
|
||||
};
|
||||
# to accept external dependencies such as disko
|
||||
node.specialArgs.self = self;
|
||||
|
||||
@@ -8,15 +8,22 @@ in
|
||||
hostPkgs = pkgs;
|
||||
# speed-up evaluation
|
||||
defaults = (
|
||||
{ config, ... }:
|
||||
{ config, options, ... }:
|
||||
{
|
||||
imports = [
|
||||
./minify.nix
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
(lib.optionalAttrs (options ? clan) {
|
||||
clan.core.settings.machine.name = config.networking.hostName;
|
||||
})
|
||||
{
|
||||
documentation.enable = lib.mkDefault false;
|
||||
nix.settings.min-free = 0;
|
||||
system.stateVersion = config.system.nixos.release;
|
||||
}
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
_module.args = { inherit self; };
|
||||
|
||||
@@ -94,9 +94,6 @@ let
|
||||
# Inherited from clan wide settings
|
||||
# TODO: remove these
|
||||
|
||||
# Machine specific settings
|
||||
# clan.core.settings.machine.name = name;
|
||||
|
||||
networking.hostName = lib.mkDefault name;
|
||||
|
||||
# For vars we need to override the system so we run vars
|
||||
|
||||
@@ -117,7 +117,7 @@ in
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "nixos";
|
||||
readOnly = true;
|
||||
description = ''
|
||||
the name of the machine
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user