chore: formatter
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
handle = "shahab96";
|
||||
email = {user = "shahab@dogar.dev";};
|
||||
userFullName = "Shahab Dogar";
|
||||
domain = "rihla";
|
||||
networking.ports.tcp.ssh = 22;
|
||||
};
|
||||
|
||||
@@ -56,7 +55,7 @@
|
||||
warn-dirty = false;
|
||||
trusted-users = ["@wheel"];
|
||||
|
||||
substituters = ["https://hyprland.cachix.org"];
|
||||
substituters = ["https://hyprland.cachix.org" "https://nix.dogar.dev"];
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
|
||||
44
hosts/common/disks/aamil.nix
Normal file
44
hosts/common/disks/aamil.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
vdb = {
|
||||
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";
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "crypted";
|
||||
type = "luks";
|
||||
passwordFile = "/tmp/secret.key";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];
|
||||
};
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
hosts/common/optional/services/k3s.nix
Normal file
15
hosts/common/optional/services/k3s.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
k3s
|
||||
cifs-utils
|
||||
nfs-utils
|
||||
];
|
||||
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
role = "agent";
|
||||
# Add this before running
|
||||
token = "";
|
||||
serverAddr = "https://rashid:6443";
|
||||
};
|
||||
}
|
||||
8
hosts/common/optional/services/openiscsi.nix
Normal file
8
hosts/common/optional/services/openiscsi.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{config, ...}: let
|
||||
hostName = config.hostSpec.hostName;
|
||||
in {
|
||||
services.openiscsi = {
|
||||
enable = true;
|
||||
name = "iqn.2016-04.com.open-iscsi:${hostName}";
|
||||
};
|
||||
}
|
||||
@@ -19,7 +19,7 @@ in {
|
||||
home = hostSpec.home;
|
||||
isNormalUser = true;
|
||||
hashedPassword = "$y$j9T$pvjyL7hL5x2VBarGNTnMl1$mLA2UsWTbfp8Hgp/ug5l8224thi..Mo8.p7ME.tDZ.4";
|
||||
extraGroups = ["networkmanager" "wheel" "input" "libvirtd"];
|
||||
extraGroups = ["networkmanager" "wheel" "input" "libvirtd" "docker"];
|
||||
|
||||
# Read all keys in ./keys and add them to authorizedKeys.
|
||||
openssh.authorizedKeys.keys =
|
||||
|
||||
92
hosts/nixos/aamil-1/default.nix
Normal file
92
hosts/nixos/aamil-1/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hostName = "aamil-1";
|
||||
in {
|
||||
imports = lib.flatten [
|
||||
#
|
||||
# ========= Hardware =========
|
||||
#
|
||||
./hardware-configuration.nix
|
||||
|
||||
#
|
||||
# ========= Disk Layout =========
|
||||
#
|
||||
inputs.disko.nixosModules.disko
|
||||
(lib.custom.relativeToRoot "hosts/common/disks/aamil.nix")
|
||||
|
||||
#
|
||||
# ========= Required Configs =========
|
||||
#
|
||||
(map lib.custom.relativeToRoot ["hosts/common/core"])
|
||||
|
||||
#
|
||||
# ========= Services =========
|
||||
#
|
||||
(map
|
||||
(s: lib.custom.relativeToRoot "hosts/common/optional/services/${s}.nix") [
|
||||
"k3s"
|
||||
"openiscsi"
|
||||
"openssh"
|
||||
])
|
||||
];
|
||||
|
||||
#
|
||||
# ========= Host specification =========
|
||||
#
|
||||
hostSpec = {
|
||||
hostName = hostName;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
require-sigs = false;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
};
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Karachi";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
# Fixes for longhorn
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
|
||||
];
|
||||
virtualisation.docker.logDriver = "json-file";
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = ["shahab"];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = ["NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
git
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
31
hosts/nixos/aamil-1/hardware-configuration.nix
Normal file
31
hosts/nixos/aamil-1/hardware-configuration.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# 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,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 1;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = ["ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
|
||||
kernelModules = [];
|
||||
};
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
92
hosts/nixos/aamil-2/default.nix
Normal file
92
hosts/nixos/aamil-2/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hostName = "aamil-2";
|
||||
in {
|
||||
imports = lib.flatten [
|
||||
#
|
||||
# ========= Hardware =========
|
||||
#
|
||||
./hardware-configuration.nix
|
||||
|
||||
#
|
||||
# ========= Disk Layout =========
|
||||
#
|
||||
inputs.disko.nixosModules.disko
|
||||
(lib.custom.relativeToRoot "hosts/common/disks/aamil.nix")
|
||||
|
||||
#
|
||||
# ========= Required Configs =========
|
||||
#
|
||||
(map lib.custom.relativeToRoot ["hosts/common/core"])
|
||||
|
||||
#
|
||||
# ========= Services =========
|
||||
#
|
||||
(map
|
||||
(s: lib.custom.relativeToRoot "hosts/common/optional/services/${s}.nix") [
|
||||
"k3s"
|
||||
"openiscsi"
|
||||
"openssh"
|
||||
])
|
||||
];
|
||||
|
||||
#
|
||||
# ========= Host specification =========
|
||||
#
|
||||
hostSpec = {
|
||||
hostName = hostName;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
require-sigs = false;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
};
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Karachi";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
# Fixes for longhorn
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
|
||||
];
|
||||
virtualisation.docker.logDriver = "json-file";
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = ["shahab"];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = ["NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
git
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
31
hosts/nixos/aamil-2/hardware-configuration.nix
Normal file
31
hosts/nixos/aamil-2/hardware-configuration.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# 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,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = config.hostSpec.bootHistoryLimit;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = ["nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
|
||||
kernelModules = [];
|
||||
};
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
92
hosts/nixos/aamil-3/default.nix
Normal file
92
hosts/nixos/aamil-3/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hostName = "aamil-3";
|
||||
in {
|
||||
imports = lib.flatten [
|
||||
#
|
||||
# ========= Hardware =========
|
||||
#
|
||||
./hardware-configuration.nix
|
||||
|
||||
#
|
||||
# ========= Disk Layout =========
|
||||
#
|
||||
inputs.disko.nixosModules.disko
|
||||
(lib.custom.relativeToRoot "hosts/common/disks/aamil.nix")
|
||||
|
||||
#
|
||||
# ========= Required Configs =========
|
||||
#
|
||||
(map lib.custom.relativeToRoot ["hosts/common/core"])
|
||||
|
||||
#
|
||||
# ========= Services =========
|
||||
#
|
||||
(map
|
||||
(s: lib.custom.relativeToRoot "hosts/common/optional/services/${s}.nix") [
|
||||
"k3s"
|
||||
"openiscsi"
|
||||
"openssh"
|
||||
])
|
||||
];
|
||||
|
||||
#
|
||||
# ========= Host specification =========
|
||||
#
|
||||
hostSpec = {
|
||||
hostName = hostName;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
require-sigs = false;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
};
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Karachi";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
# Fixes for longhorn
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
|
||||
];
|
||||
virtualisation.docker.logDriver = "json-file";
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = ["shahab"];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = ["NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
git
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
31
hosts/nixos/aamil-3/hardware-configuration.nix
Normal file
31
hosts/nixos/aamil-3/hardware-configuration.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# 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,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = config.hostSpec.bootHistoryLimit;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = ["nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
|
||||
kernelModules = [];
|
||||
};
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
@@ -26,6 +25,7 @@
|
||||
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
binfmt.emulatedSystems = ["aarch64-linux"]; # Add other target architectures as needed
|
||||
};
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
||||
Reference in New Issue
Block a user