flake: simplify hosts

This commit is contained in:
Guanran Wang 2023-12-18 14:20:44 +08:00
parent c1d6f23674
commit 5b666b91d1
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
5 changed files with 73 additions and 69 deletions

View file

@ -1,13 +1,17 @@
# iMac 18,3 (2017)
_: {
networking.knownNetworkServices = [
"Ethernet"
"Wi-Fi"
"Thunderbolt Bridge"
"Thunderbolt Bridge 2"
"iPhone USB"
{...}: {
imports = [
../../profiles/core
../../profiles/device-type/desktop
../../../users/guanranwang/darwin/profiles/core
../../../users/guanranwang/darwin/profiles/device-type/desktop
../../../users/guanranwang/darwin/profiles/opt-in/clash-meta-client.nix
./hardware.configuration.nix
../../hardware/apple/imac/18-3
];
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "x86_64-darwin";
networking.hostName = "Plato";
time.timeZone = "Asia/Shanghai";
}

View file

@ -0,0 +1,13 @@
# iMac 18,3 (2017)
_: {
networking.knownNetworkServices = [
"Ethernet"
"Wi-Fi"
"Thunderbolt Bridge"
"Thunderbolt Bridge 2"
"iPhone USB"
];
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "x86_64-darwin";
}

View file

@ -174,53 +174,12 @@
### NixOS
nixosConfigurations = {
"Aristotle" = mkNixOS "x86_64-linux" [
# OS
./nixos/profiles/core
./nixos/profiles/device-type/laptop
./nixos/profiles/opt-in/zram-generator.nix
./nixos/profiles/opt-in/gaming.nix
./nixos/profiles/opt-in/wayland.nix
./nixos/profiles/opt-in/virt-manager.nix
# User
./users/guanranwang/nixos/profiles/core
./users/guanranwang/nixos/profiles/device-type/laptop
./users/guanranwang/nixos/profiles/opt-in/clash-meta-client.nix
./users/guanranwang/nixos/profiles/opt-in/gaming
./users/guanranwang/nixos/profiles/opt-in/torrenting
# Hardware
./nixos/hosts/Aristotle
./nixos/profiles/opt-in/lanzaboote.nix
./nixos/profiles/opt-in/impermanence.nix
./nixos/profiles/opt-in/disko.nix
{
networking.hostName = "Aristotle";
time.timeZone = "Asia/Shanghai";
_module.args.disks = ["/dev/nvme0n1"]; # Disko
}
];
"Aristotle" = mkNixOS "x86_64-linux" [./nixos/hosts/Aristotle];
};
### Darwin
darwinConfigurations = {
"Plato" = mkDarwin "x86_64-darwin" [
./darwin/profiles/core
./darwin/profiles/device-type/desktop
./users/guanranwang/darwin/profiles/core
./users/guanranwang/darwin/profiles/device-type/desktop
./users/guanranwang/darwin/profiles/opt-in/clash-meta-client.nix
./darwin/hosts/Plato
{
networking.hostName = "Plato";
time.timeZone = "Asia/Shanghai";
}
];
"Plato" = mkDarwin "x86_64-darwin" [./darwin/hosts/Plato];
};
};
}

View file

@ -1,21 +1,28 @@
{
modulesPath,
inputs,
...
}: {
{...}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.nixos-hardware.nixosModules.lenovo-legion-y530-15ich
# OS
../../profiles/core
../../profiles/device-type/laptop
../../profiles/opt-in/zram-generator.nix
../../profiles/opt-in/gaming.nix
../../profiles/opt-in/wayland.nix
../../profiles/opt-in/virt-manager.nix
# User
../../../users/guanranwang/nixos/profiles/core
../../../users/guanranwang/nixos/profiles/device-type/laptop
../../../users/guanranwang/nixos/profiles/opt-in/clash-meta-client.nix
../../../users/guanranwang/nixos/profiles/opt-in/gaming
../../../users/guanranwang/nixos/profiles/opt-in/torrenting
# Hardware
./hardware-configuration.nix
../../profiles/opt-in/lanzaboote.nix
../../profiles/opt-in/impermanence.nix
../../profiles/opt-in/disko.nix
];
services.hdapsd.enable = false;
myFlake.hardware.components = {
audio.enable = true;
bluetooth.enable = true;
tpm.enable = true;
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
boot.kernelModules = ["kvm-intel"];
nixpkgs.hostPlatform = "x86_64-linux";
networking.hostName = "Aristotle";
time.timeZone = "Asia/Shanghai";
_module.args.disks = ["/dev/nvme0n1"]; # Disko
}

View file

@ -0,0 +1,21 @@
{
modulesPath,
inputs,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.nixos-hardware.nixosModules.lenovo-legion-y530-15ich
];
services.hdapsd.enable = false;
myFlake.hardware.components = {
audio.enable = true;
bluetooth.enable = true;
tpm.enable = true;
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
boot.kernelModules = ["kvm-intel"];
nixpkgs.hostPlatform = "x86_64-linux";
}