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) # iMac 18,3 (2017)
_: { {...}: {
networking.knownNetworkServices = [ imports = [
"Ethernet" ../../profiles/core
"Wi-Fi" ../../profiles/device-type/desktop
"Thunderbolt Bridge"
"Thunderbolt Bridge 2" ../../../users/guanranwang/darwin/profiles/core
"iPhone USB" ../../../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. networking.hostName = "Plato";
nixpkgs.hostPlatform = "x86_64-darwin"; 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 ### NixOS
nixosConfigurations = { nixosConfigurations = {
"Aristotle" = mkNixOS "x86_64-linux" [ "Aristotle" = mkNixOS "x86_64-linux" [./nixos/hosts/Aristotle];
# 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
}
];
}; };
### Darwin ### Darwin
darwinConfigurations = { darwinConfigurations = {
"Plato" = mkDarwin "x86_64-darwin" [ "Plato" = mkDarwin "x86_64-darwin" [./darwin/hosts/Plato];
./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";
}
];
}; };
}; };
} }

View file

@ -1,21 +1,28 @@
{ {...}: {
modulesPath,
inputs,
...
}: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") # OS
inputs.nixos-hardware.nixosModules.lenovo-legion-y530-15ich ../../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; networking.hostName = "Aristotle";
myFlake.hardware.components = { time.timeZone = "Asia/Shanghai";
audio.enable = true; _module.args.disks = ["/dev/nvme0n1"]; # Disko
bluetooth.enable = true;
tpm.enable = true;
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
boot.kernelModules = ["kvm-intel"];
nixpkgs.hostPlatform = "x86_64-linux";
} }

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";
}