forked from clan/clan-core
improve starter template
This commit is contained in:
parent
cb103c7772
commit
1fc4739ee3
@ -11,6 +11,45 @@
|
|||||||
clan = clan-core.lib.buildClan {
|
clan = clan-core.lib.buildClan {
|
||||||
directory = self;
|
directory = self;
|
||||||
clanName = "__CHANGE_ME__";
|
clanName = "__CHANGE_ME__";
|
||||||
|
machines = {
|
||||||
|
machine1 = {
|
||||||
|
nixpkgs.hostPlatform = system;
|
||||||
|
imports = [
|
||||||
|
# TODO: boot into the installer
|
||||||
|
# remote> nixos-generate-config --root /tmp/config --no-filesystems
|
||||||
|
# local> mkdir -p ./machines/machine1
|
||||||
|
# local> scp -r root@machine1:/tmp/config ./machines/machine1
|
||||||
|
# local> Edit ./machines/machine1/configuration.nix to your liking
|
||||||
|
./modules/disko.nix
|
||||||
|
clan-core.clanModules.sshd
|
||||||
|
{
|
||||||
|
# Set this for clan commands use ssh i.e. `clan machines update`
|
||||||
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@<IP_ADDRESS>";
|
||||||
|
# remote> lsblk --output NAME,PTUUID,FSTYPE,SIZE,MOUNTPOINT
|
||||||
|
|
||||||
|
config.disko.devices.disk.main.device = "/dev/disk/by-id/__CHANGE_ME__";
|
||||||
|
|
||||||
|
clan.networking.zerotier.controller.enable = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
machine2 = {
|
||||||
|
nixpkgs.hostPlatform = system;
|
||||||
|
imports = [
|
||||||
|
# ./machines/machine2/configuration.nix
|
||||||
|
./modules/disko.nix
|
||||||
|
clan-core.clanModules.sshd
|
||||||
|
{
|
||||||
|
# Set this for clan commands use ssh i.e. `clan machines update`
|
||||||
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@<IP_ADDRESS>";
|
||||||
|
|
||||||
|
config.disko.devices.disk.main.device = "/dev/disk/by-id/__CHANGE_ME__";
|
||||||
|
# local> clan facts generate
|
||||||
|
clan.networking.zerotier.networkId = builtins.readFile ./machines/machine1/facts/zerotier-network-id;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
36
templates/new-clan/modules/disko.nix
Normal file
36
templates/new-clan/modules/disko.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
config.disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = throw "Change this to your disk device";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
boot = {
|
||||||
|
size = "1M";
|
||||||
|
type = "EF02"; # for grub MBR
|
||||||
|
};
|
||||||
|
ESP = {
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user