Skip to content

Commit

Permalink
style: apply nix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarrio committed Feb 9, 2025
1 parent 89e0ed2 commit 4e3b7b6
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 65 deletions.
81 changes: 39 additions & 42 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,49 +182,46 @@
let
mkNuc = user: name: libx.mkGeneratorImage { systemType = "server"; hostname = name; username = user; };
in
(libx.forAllSystems
libx.forAllSystems
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
internalPkgs = (import ./pkgs { inherit pkgs; });
in ({
# Universal systems: Maybe a use case exists but for now this is empty 🤷
} // (lib.optionalAttrs (system == "x86_64-linux") {
# TODO: Linode image is still too large: reduction with `qemu-img resize --shrink ./nixos.img 5.5G` didn't error out but image will not boot
linode-base-image = libx.mkGeneratorImage { systemType = "server"; hostname = "linode-base-image"; username = "archon"; format = "linode"; diskSize = 5120; };
digital-ocean-base-image = libx.mkGeneratorImage { systemType = "server"; hostname = "generic-base-image"; username = "archon"; format = "do"; };

# TODO: Customize disk layout and installation
# method to support raw image generation
# obsidian-efi = libx.mkGeneratorImage {
# systemType = "workstation";
# hostname = "obsidian";
# username = "tcarrio";
# desktop = "pantheon";
# diskSize = "65536"; # 64GB
# extraModules = {
# chaotic = true;
# };
# };

## NUC server configurations
system-image-nuc0 = mkNuc "archon" "nuc0";
system-image-nuc1 = mkNuc "archon" "nuc1";
system-image-nuc2 = mkNuc "archon" "nuc2";
system-image-nuc3 = mkNuc "archon" "nuc3";
system-image-nuc4 = mkNuc "archon" "nuc4";
system-image-nuc5 = mkNuc "archon" "nuc5";
system-image-nuc6 = mkNuc "archon" "nuc6";
system-image-nuc7 = mkNuc "archon" "nuc7";
system-image-nuc8 = mkNuc "archon" "nuc8";
system-image-nuc9 = mkNuc "archon" "nuc9";
# TODO: Revise init image strategy
# nuc-init = mkNuc "nixos" "nuc-init";
}) // (lib.optionalAttrs (system == "armv7l-linux") {
# TODO: Implement Nvidia Tegra TK1 image
tk1 = libx.mkSdImage { hostname = "tk1"; username = "root"; systemType = "server"; };
})
({
# Universal systems: Maybe a use case exists but for now this is empty 🤷
} // (lib.optionalAttrs (system == "x86_64-linux") {
# TODO: Linode image is still too large: reduction with `qemu-img resize --shrink ./nixos.img 5.5G` didn't error out but image will not boot
linode-base-image = libx.mkGeneratorImage { systemType = "server"; hostname = "linode-base-image"; username = "archon"; format = "linode"; diskSize = 5120; };
digital-ocean-base-image = libx.mkGeneratorImage { systemType = "server"; hostname = "generic-base-image"; username = "archon"; format = "do"; };

# TODO: Customize disk layout and installation
# method to support raw image generation
# obsidian-efi = libx.mkGeneratorImage {
# systemType = "workstation";
# hostname = "obsidian";
# username = "tcarrio";
# desktop = "pantheon";
# diskSize = "65536"; # 64GB
# extraModules = {
# chaotic = true;
# };
# };

## NUC server configurations
system-image-nuc0 = mkNuc "archon" "nuc0";
system-image-nuc1 = mkNuc "archon" "nuc1";
system-image-nuc2 = mkNuc "archon" "nuc2";
system-image-nuc3 = mkNuc "archon" "nuc3";
system-image-nuc4 = mkNuc "archon" "nuc4";
system-image-nuc5 = mkNuc "archon" "nuc5";
system-image-nuc6 = mkNuc "archon" "nuc6";
system-image-nuc7 = mkNuc "archon" "nuc7";
system-image-nuc8 = mkNuc "archon" "nuc8";
system-image-nuc9 = mkNuc "archon" "nuc9";
# TODO: Revise init image strategy
# nuc-init = mkNuc "nixos" "nuc-init";
}) // (lib.optionalAttrs (system == "armv7l-linux") {
# TODO: Implement Nvidia Tegra TK1 image
tk1 = libx.mkSdImage { hostname = "tk1"; username = "root"; systemType = "server"; };
})
)
));
);
};
}
2 changes: 1 addition & 1 deletion lib/helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
sshMatrix = import ./ssh-matrix.nix { };
tailnetMatrix = import ./tailnet-matrix.nix { };

inherit (inputs.nixpkgs) lib;
in
{
Expand Down
10 changes: 2 additions & 8 deletions nixos/mixins/network-shares/ds418-nfs.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{ pkgs, lib, config, ... }:
{ pkgs, config, ... }:
let
intranetHost = "192.168.40.186";
nfsHostname = "nas-ds418-00";

tailscaleEnabled = config.services.tailscale.enable;
# host = intranetHost;
host = if tailscaleEnabled then nfsHostname else intranetHost;

mountLocation = "/mnt/${nfsHostname}";
remoteLocation = "/volumes/home1";
in
{
# more info in https://nixos.wiki/wiki/NFS
Expand All @@ -23,7 +17,7 @@ in
fileSystems."/mnt/${nfsHostname}" = {
device = "${intranetHost}:/volume1/homes";
fsType = "nfs";
options = ["nfsvers=3"];
options = [ "nfsvers=3" ];
};

## TODO: Improve with lazy mounting and tailscale networking
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/desktop/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
cfg = config.oxc.desktop.fonts;

optionalList = condition: list: if condition then list else [];
optionalList = condition: list: if condition then list else [ ];
in
{
options.oxc.desktop.fonts = {
Expand Down
12 changes: 6 additions & 6 deletions nixos/modules/services/nbd-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ let
genericSection = {
generic = cfg.server.extraOptions
// {
user = "root";
group = "root";
port = cfg.server.listenPort;
}
user = "root";
group = "root";
port = cfg.server.listenPort;
}
// (optionalAttrs (cfg.server.listenAddress != null) {
listenaddr = cfg.server.listenAddress;
});
listenaddr = cfg.server.listenAddress;
});
};
exportSections = lib.mapAttrs
(
Expand Down
4 changes: 2 additions & 2 deletions nixos/workstation/obsidian/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SATA: 500GB SSD
# SATA: 2TB SSHD

{ inputs, lib, pkgs, tailnetMatrix, ... }: {
{ inputs, lib, pkgs, ... }: {
imports = [
(import ./disks.nix { })
./hardware-configuration.nix
Expand Down Expand Up @@ -93,7 +93,7 @@
efi.efiSysMountPoint = "/boot/efi";
};
};


environment.systemPackages = with pkgs; [
distrobox
Expand Down
2 changes: 1 addition & 1 deletion nixos/workstation/obsidian/disks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _: {
# ⚠️ DESTRUCTIVE ACTION.
# This will destroy and re-create partitions on the device!
extraArgs = [ "-f" ];

# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
Expand Down
2 changes: 1 addition & 1 deletion nixos/workstation/obsidian/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.nvidia.forceFullCompositionPipeline = true;
}
6 changes: 3 additions & 3 deletions nixos/workstation/t510/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 30;

# Battery charging behavior to reduce wear on battery health
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 80;
# Battery charging behavior to reduce wear on battery health
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 80;
};
};
## END LFG
Expand Down

0 comments on commit 4e3b7b6

Please sign in to comment.