-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial nixos configuration for first rack machine
- Loading branch information
1 parent
15e1cf2
commit 6dc08c6
Showing
9 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ ... }: | ||
{ | ||
imports = [ | ||
../../modules | ||
../../modules/hardware/intel-nuc.nix | ||
../../modules/roles/k8s-master.nix | ||
../../modules/format/raw-efi.nix | ||
]; | ||
|
||
networking.hostName = "rack-01-k8s-master-nuc-01"; | ||
|
||
_module.args.nixinate = { | ||
host = "tarox-1"; | ||
sshUser = "michael"; | ||
buildOn = "remote"; | ||
substituteOnTarget = true; | ||
hermetic = false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ ... }: | ||
{ | ||
system.stateVersion = "25.11"; | ||
|
||
console.keyMap = "de"; | ||
|
||
imports = [ | ||
./nix.nix | ||
./ssh.nix | ||
./users.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
make-disk-image, | ||
... | ||
}: | ||
{ | ||
system.build.disk-image = make-disk-image { | ||
inherit config lib pkgs; | ||
partitionTableType = "efi"; | ||
format = "raw"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ lib, ... }: | ||
{ | ||
nixpkgs.hostPlatform = "x86_64-linux"; | ||
|
||
boot = { | ||
growPartition = true; | ||
kernelParams = [ "console=tty0" ]; | ||
initrd.availableKernelModules = [ "uas" ]; | ||
}; | ||
|
||
fileSystems."/boot" = { | ||
device = "/dev/disk/by-label/ESP"; | ||
fsType = "vfat"; | ||
}; | ||
|
||
boot.loader = { | ||
timeout = lib.mkDefault 3; | ||
grub = { | ||
device = "nodev"; | ||
efiSupport = true; | ||
efiInstallAsRemovable = true; | ||
}; | ||
}; | ||
|
||
fileSystems."/" = { | ||
device = "/dev/disk/by-label/nixos"; | ||
autoResize = true; | ||
fsType = "ext4"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ pkgs, ... }: | ||
{ | ||
nix = { | ||
package = pkgs.nix; | ||
settings = { | ||
experimental-features = [ | ||
"nix-command" | ||
"flakes" | ||
]; | ||
trusted-users = [ "@wheel" ]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ lib, ... }: | ||
{ | ||
services.etcd.enable = true; | ||
# services.kubernetes = { | ||
# apiserver.enable = lib.mkDefault true; | ||
# scheduler.enable = lib.mkDefault true; | ||
# controllerManager.enable = true; | ||
# kubelet.enable = true; | ||
# }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ ... }: | ||
{ | ||
services.openssh = { | ||
enable = true; | ||
ports = [ 62518 ]; | ||
settings = { | ||
PasswordAuthentication = false; | ||
PermitRootLogin = "no"; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ ... }: | ||
{ | ||
users.users.michael = { | ||
extraGroups = [ "wheel" ]; | ||
isNormalUser = true; | ||
openssh.authorizedKeys.keys = [ | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8OCYTaHjQy7Y7bRmxzVwNBgnD9P21UQPzVpJ3NKwVV" | ||
]; | ||
initialPassword = "fsbEh&PzR9Eo"; | ||
}; | ||
} |