Skip to content

Commit

Permalink
style: remove unnecessary parentheses around primitive expressions an…
Browse files Browse the repository at this point in the history
…d add inherits
  • Loading branch information
yunfachi committed Dec 24, 2023
1 parent baacf8f commit 37c82f9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
14 changes: 8 additions & 6 deletions home/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ in {

settings = lib.mkMerge [
{
monitor = map (
m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
in "${m.name},${resolution},${position},${toString m.scale}"
) (config.yunfachi.monitors);
monitor =
map (
m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
in "${m.name},${resolution},${position},${toString m.scale}"
)
config.yunfachi.monitors;

input = {
kb_layout = "${
Expand Down
6 changes: 3 additions & 3 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
hosts = builtins.attrNames (lib.filterAttrs (name: type: type == "directory") (builtins.readDir ./.));

mkHost = host: let
config = specialArgs.self.nixosConfigurations."${host}".config;
inherit (specialArgs.self.nixosConfigurations."${host}") config;

nixosModules = [
./${host}/hardware.nix
Expand All @@ -25,12 +25,12 @@
../options
../home
]
++ builtins.map (host: (import ./${host}/shared.nix {host = host;})) hosts;
++ builtins.map (host: (import ./${host}/shared.nix {inherit host;})) hosts;

extraSpecialArgs =
{
inherit host isNixOS;
type = config.yunfachi.type;
inherit (config.yunfachi) type;
}
// specialArgs;
in
Expand Down
12 changes: 8 additions & 4 deletions hosts/dekomori/hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
}: {
imports = [];

boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
kernelModules = [];
};
kernelModules = ["kvm-amd"];
extraModulePackages = [];
};

fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
Expand Down
13 changes: 8 additions & 5 deletions hosts/mitama/hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
(modulesPath + "/installer/scan/not-detected.nix")
];

boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
kernelModules = [];
};
kernelModules = ["kvm-amd"];
extraModulePackages = [];
};

fileSystems."/" = {
device = "/dev/disk/by-uuid/66b29ea1-e3d5-4e5f-b0e9-298b3ea7c10f";
Expand All @@ -29,7 +33,6 @@
];

networking.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "${system}";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
4 changes: 1 addition & 3 deletions nixos/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ in {
};
wg-quick.interfaces = {
wg0 =
{
privateKey = cfg.privateKey;
}
{inherit (cfg) privateKey;}
// (
if cfg.type == "server"
then {
Expand Down
2 changes: 1 addition & 1 deletion options/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ in {
description = "The private key of the current host.";
};
routedIPs = mkOption {
type = types.listOf (types.str);
type = types.listOf types.str;
default = ["0.0.0.0/0" "::/0"];
example = [];
description = "A list of IP addresses or CIDR blocks that will be routed through the VPN. Only needed for the client.";
Expand Down

0 comments on commit 37c82f9

Please sign in to comment.