flake: simplify hosts
This commit is contained in:
parent
c1d6f23674
commit
5b666b91d1
5 changed files with 73 additions and 69 deletions
|
@ -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";
|
||||
}
|
||||
|
|
13
darwin/hosts/Plato/hardware-configuration.nix
Normal file
13
darwin/hosts/Plato/hardware-configuration.nix
Normal 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";
|
||||
}
|
45
flake.nix
45
flake.nix
|
@ -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];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
21
nixos/hosts/Aristotle/hardware-configuration.nix
Normal file
21
nixos/hosts/Aristotle/hardware-configuration.nix
Normal 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";
|
||||
}
|
Loading…
Reference in a new issue