Compare commits
10 commits
7bce6df38b
...
db8b0f1d5f
Author | SHA1 | Date | |
---|---|---|---|
db8b0f1d5f | |||
2249b4cc58 | |||
31267fa34c | |||
75d4187baa | |||
18b28c2e9d | |||
544930ff2d | |||
59506dac35 | |||
21582cbf81 | |||
1038d8a248 | |||
2f19307456 |
16 changed files with 480 additions and 6 deletions
33
flake.lock
generated
33
flake.lock
generated
|
@ -20,6 +20,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1753140376,
|
||||||
|
"narHash": "sha256-7lrVrE0jSvZHrxEzvnfHFE/Wkk9DDqb+mYCodI5uuB8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "545aba02960caa78a31bd9a8709a0ad4b6320a5c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -117,11 +137,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754229794,
|
"lastModified": 1754564048,
|
||||||
"narHash": "sha256-yOl7REX6O/1mh+tpscJPKgjK6nmXSMOB1xhmDNAMUZM=",
|
"narHash": "sha256-dz303vGuzWjzOPOaYkS9xSW+B93PSAJxvBd6CambXVA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "a872d985392ee5b19d8409bfcc3f106de2070070",
|
"rev": "26ed7a0d4b8741fe1ef1ee6fa64453ca056ce113",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -133,11 +153,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754028485,
|
"lastModified": 1754767907,
|
||||||
"narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=",
|
"narHash": "sha256-8OnUzRQZkqtUol9vuUuQC30hzpMreKptNyET2T9lB6g=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "59e69648d345d6e8fef86158c555730fa12af9de",
|
"rev": "c5f08b62ed75415439d48152c2a784e36909b1bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -241,6 +261,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"auto-cpufreq": "auto-cpufreq",
|
"auto-cpufreq": "auto-cpufreq",
|
||||||
|
"disko": "disko",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"lazy-apps": "lazy-apps",
|
"lazy-apps": "lazy-apps",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
|
|
58
flake.nix
58
flake.nix
|
@ -18,6 +18,10 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
|
proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
systems.url = "github:nix-systems/default-linux";
|
systems.url = "github:nix-systems/default-linux";
|
||||||
};
|
};
|
||||||
|
@ -30,6 +34,7 @@
|
||||||
home-manager,
|
home-manager,
|
||||||
auto-cpufreq,
|
auto-cpufreq,
|
||||||
proxmox-nixos,
|
proxmox-nixos,
|
||||||
|
disko,
|
||||||
systems,
|
systems,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
|
@ -111,6 +116,59 @@
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
srv01-hf = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
./hosts/srv01.hf
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
kube01 = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
./hosts/kube01
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
kube02 = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
./hosts/kube02
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
kube03 = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
./hosts/kube03
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
41
hosts/kube01/default.nix
Normal file
41
hosts/kube01/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ inputs, outputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
../../modules/disko/efi-full-btrfs.nix
|
||||||
|
../../modules/systemd-boot.nix
|
||||||
|
|
||||||
|
../../users/julius/nixos-server.nix
|
||||||
|
../../modules/nix.nix
|
||||||
|
../../modules/network-server.nix
|
||||||
|
../../modules/locale.nix
|
||||||
|
../../modules/server-cli.nix
|
||||||
|
../../modules/sshd.nix
|
||||||
|
../../modules/k3s.nix
|
||||||
|
../../modules/qemu-guest.nix
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
networking.hostName = "kube01"; # Define your hostname.
|
||||||
|
|
||||||
|
services.k3s = {
|
||||||
|
clusterInit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
}
|
24
hosts/kube01/hardware-configuration.nix
Normal file
24
hosts/kube01/hardware-configuration.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
41
hosts/kube02/default.nix
Normal file
41
hosts/kube02/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ inputs, outputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
../../modules/disko/efi-full-btrfs.nix
|
||||||
|
../../modules/systemd-boot.nix
|
||||||
|
|
||||||
|
../../users/julius/nixos-server.nix
|
||||||
|
../../modules/nix.nix
|
||||||
|
../../modules/network-server.nix
|
||||||
|
../../modules/locale.nix
|
||||||
|
../../modules/server-cli.nix
|
||||||
|
../../modules/sshd.nix
|
||||||
|
../../modules/k3s.nix
|
||||||
|
../../modules/qemu-guest.nix
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "kube02"; # Define your hostname.
|
||||||
|
|
||||||
|
services.k3s = {
|
||||||
|
serverAddr = "https://kube01:6443";
|
||||||
|
clusterInit = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
}
|
24
hosts/kube02/hardware-configuration.nix
Normal file
24
hosts/kube02/hardware-configuration.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
42
hosts/kube03/default.nix
Normal file
42
hosts/kube03/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{ inputs, outputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
../../modules/disko/efi-full-btrfs.nix
|
||||||
|
../../modules/systemd-boot.nix
|
||||||
|
|
||||||
|
../../users/julius/nixos-server.nix
|
||||||
|
../../modules/nix.nix
|
||||||
|
../../modules/network-server.nix
|
||||||
|
../../modules/locale.nix
|
||||||
|
../../modules/server-cli.nix
|
||||||
|
../../modules/sshd.nix
|
||||||
|
../../modules/k3s.nix
|
||||||
|
../../modules/qemu-guest.nix
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
networking.hostName = "kube03"; # Define your hostname.
|
||||||
|
|
||||||
|
services.k3s = {
|
||||||
|
serverAddr = "https://kube01:6443";
|
||||||
|
clusterInit = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
}
|
24
hosts/kube03/hardware-configuration.nix
Normal file
24
hosts/kube03/hardware-configuration.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
|
@ -34,6 +34,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nix.settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cache.saumon.network/proxmox-nixos"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"proxmox-nixos:D9RYSWpQQC/msZUWphOY2I5RLH5Dd6yQcaHIuug7dWM="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
services.proxmox-ve = {
|
services.proxmox-ve = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ipAddress = "192.168.122.71";
|
ipAddress = "192.168.122.71";
|
||||||
|
|
37
hosts/srv01.hf/default.nix
Normal file
37
hosts/srv01.hf/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{ inputs, outputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
../../modules/disko/efi-full-btrfs.nix
|
||||||
|
../../modules/systemd-boot.nix
|
||||||
|
|
||||||
|
../../users/julius/nixos-server.nix
|
||||||
|
../../modules/nix.nix
|
||||||
|
../../modules/network-server.nix
|
||||||
|
../../modules/locale.nix
|
||||||
|
../../modules/server-cli.nix
|
||||||
|
../../modules/sshd.nix
|
||||||
|
../../modules/qemu-guest.nix
|
||||||
|
../../modules/docker.nix
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
networking.hostName = "srv01-hf"; # Define your hostname.
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
}
|
24
hosts/srv01.hf/hardware-configuration.nix
Normal file
24
hosts/srv01.hf/hardware-configuration.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
56
modules/disko/efi-full-btrfs.nix
Normal file
56
modules/disko/efi-full-btrfs.nix
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
sda = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sda";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
priority = 1;
|
||||||
|
name = "ESP";
|
||||||
|
start = "1M";
|
||||||
|
end = "128M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ]; # Override existing partition
|
||||||
|
# Subvolumes must set a mountpoint in order to be mounted,
|
||||||
|
# unless their parent is mounted
|
||||||
|
subvolumes = {
|
||||||
|
# Subvolume name is different from mountpoint
|
||||||
|
"/rootfs" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
# Subvolume name is the same as the mountpoint
|
||||||
|
"/home" = {
|
||||||
|
mountOptions = [ "compress=zstd" ];
|
||||||
|
mountpoint = "/home";
|
||||||
|
};
|
||||||
|
# Sub(sub)volume doesn't need a mountpoint as its parent is mounted
|
||||||
|
"/home/julius" = { };
|
||||||
|
# Parent is not mounted so the mountpoint must be set
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mountpoint = "/partition-root";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
28
modules/k3s.nix
Normal file
28
modules/k3s.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
|
||||||
|
services.k3s = {
|
||||||
|
enable = true;
|
||||||
|
role = "server";
|
||||||
|
token = "verysecrettoken";
|
||||||
|
extraFlags = toString ([
|
||||||
|
"--write-kubeconfig-mode \"0644\""
|
||||||
|
"--disable servicelb"
|
||||||
|
"--disable traefik"
|
||||||
|
"--disable local-storage"
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
6443
|
||||||
|
2379
|
||||||
|
2380
|
||||||
|
];
|
||||||
|
networking.firewall.allowedUDPPorts = [
|
||||||
|
8472
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
7
modules/qemu-guest.nix
Normal file
7
modules/qemu-guest.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
|
||||||
|
}
|
15
modules/systemd-boot.nix
Normal file
15
modules/systemd-boot.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
tmp.useTmpfs = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
23
users/julius/nixos-server.nix
Normal file
23
users/julius/nixos-server.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
|
||||||
|
users = {
|
||||||
|
users = {
|
||||||
|
julius = {
|
||||||
|
initialPassword = "password";
|
||||||
|
isNormalUser = true;
|
||||||
|
uid = 1000;
|
||||||
|
group = "julius";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
groups = {
|
||||||
|
julius = {
|
||||||
|
gid = 1000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.trusted-users = [ "julius" ];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue