treewide: format using nixfmt

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641c36f9763e104087a559c148d0449f00
This commit is contained in:
Bloxx12 2025-07-20 01:23:48 +02:00
commit e641dfa114
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
113 changed files with 1545 additions and 1019 deletions

View file

@ -3,13 +3,15 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.modules) mkForce mkDefault;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int;
cfg = config.modules.system.boot;
in {
in
{
options.modules.system.boot = {
grub.enable = mkEnableOption "Grub, a bloated boot loader";
systemd-boot.enable = mkEnableOption "Poetteringboot";
@ -29,7 +31,8 @@ in {
message = "No bootloader is enabled.";
}
{
assertion = cfg.systemd-boot.enable -> !cfg.grub.enable && cfg.grub.enable -> !cfg.systemd-boot.enable;
assertion =
cfg.systemd-boot.enable -> !cfg.grub.enable && cfg.grub.enable -> !cfg.systemd-boot.enable;
message = "Please enable only ONE of systemd-boot or grub.";
}
];
@ -73,12 +76,11 @@ in {
plymouth = {
enable = true;
themePackages = [
(pkgs.adi1090x-plymouth-themes.override
{
selected_themes = [
"hud_3"
];
})
(pkgs.adi1090x-plymouth-themes.override {
selected_themes = [
"hud_3"
];
})
];
theme = "hud_3";
};

View file

@ -4,12 +4,14 @@
pkgs,
sources,
...
}: let
}:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.boot.lanzaboote;
in {
in
{
options.modules.system.boot.lanzaboote.enable = mkEnableOption "Lanzaboote";
imports = [
(sources.lanzaboote + "/nix/modules/lanzaboote.nix")
@ -29,6 +31,6 @@ in {
loader.systemd-boot.enable = lib.mkForce false;
};
environment.systemPackages = [pkgs.sbctl];
environment.systemPackages = [ pkgs.sbctl ];
};
}

View file

@ -3,19 +3,20 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.modules) mkIf;
cfg = config.modules.system.hardware.bluetooth;
in {
in
{
config = mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
inherit (cfg) powerOnBoot;
};
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
bluetuith
bluez
blueman

View file

@ -2,12 +2,14 @@
config,
lib,
...
}: let
}:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.hardware;
in {
in
{
options.modules.system.hardware = {
nvidia = {
enable = mkEnableOption "Nvidia graphics drivers";
@ -32,6 +34,6 @@ in {
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
};
services.xserver.videoDrivers = mkIf cfg.nvidia.enable ["nvidia"];
services.xserver.videoDrivers = mkIf cfg.nvidia.enable [ "nvidia" ];
};
}

View file

@ -3,19 +3,20 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.hardware.intel;
in {
in
{
options.modules.system.hardware.intel.enable = mkEnableOption "Intel Hardware";
config = mkIf cfg.enable {
hardware = {
cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware;
graphics.extraPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
intel-vaapi-driver
intel-media-driver
;

View file

@ -2,11 +2,13 @@
config,
lib,
...
}: let
}:
let
inherit (lib.modules) mkIf;
cfg = config.modules.system.sound;
in {
in
{
config = mkIf cfg.enable {
services.pipewire = {
enable = true;

View file

@ -4,23 +4,24 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.modules) mkDefault;
in {
in
{
imports = [
# (sources.watt + "/nix/module.nix")
];
config = {
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
acpi
powertop
;
};
boot = {
kernelModules = ["acpi_call"];
kernelModules = [ "acpi_call" ];
extraModulePackages = with config.boot.kernelPackages; [
acpi_call
cpupower

View file

@ -4,9 +4,12 @@
pkgs,
sources,
...
}: let
determinate = (import sources.flake-compat {src = sources.determinate;}).outputs;
dix = (import sources.flake-compat {src = determinate.inputs.nix;}).outputs.packages.${pkgs.stdenv.system}.nix;
}:
let
determinate = (import sources.flake-compat { src = sources.determinate; }).outputs;
dix =
(import sources.flake-compat { src = determinate.inputs.nix; })
.outputs.packages.${pkgs.stdenv.system}.nix;
# Stronger than mkDefault (1000), weaker than mkForce (50) and the "default override priority"
# (100).
@ -14,7 +17,8 @@
# Stronger than the "default override priority", as the upstream module uses that, and weaker than mkForce (50).
mkMorePreferable = lib.mkOverride 75;
in {
in
{
config = {
nix = {
package = dix;
@ -30,7 +34,9 @@ in {
services.nix-daemon.serviceConfig = {
ExecStart = [
""
"@${determinate.packages.${pkgs.stdenv.system}.default}/bin/determinate-nixd determinate-nixd --nix-bin ${config.nix.package}/bin daemon"
"@${
determinate.packages.${pkgs.stdenv.system}.default
}/bin/determinate-nixd determinate-nixd --nix-bin ${config.nix.package}/bin daemon"
];
KillMode = mkPreferable "process";
LimitNOFILE = mkMorePreferable 1048576;
@ -41,11 +47,14 @@ in {
nix-daemon.socketConfig.FileDescriptorName = "nix-daemon.socket";
determinate-nixd = {
description = "Determinate Nixd Daemon Socket";
wantedBy = ["sockets.target"];
before = ["multi-user.target"];
wantedBy = [ "sockets.target" ];
before = [ "multi-user.target" ];
unitConfig = {
RequiresMountsFor = ["/nix/store" "/nix/var/determinate"];
RequiresMountsFor = [
"/nix/store"
"/nix/var/determinate"
];
};
socketConfig = {

View file

@ -5,10 +5,12 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.modules) mkForce;
in {
in
{
nix = {
# Check that Nix can parse the generated nix.conf.
checkConfig = true;
@ -46,7 +48,7 @@ in {
# Automatically optimize nix store by removing hard links
optimise = {
automatic = true;
dates = ["21:00"];
dates = [ "21:00" ];
};
# NOTE:
@ -62,10 +64,18 @@ in {
auto-optimise-store = true;
# Users that are allowed to connect to the Nix daemon.
allowed-users = ["root" "@wheel" "nix-builder"];
allowed-users = [
"root"
"@wheel"
"nix-builder"
];
# Users that are allowed to connect to the Nix daemon.
trusted-users = ["root" "@wheel" "nix-builder"];
trusted-users = [
"root"
"@wheel"
"nix-builder"
];
# Let the system decide the number of max jobs
# based on available system specs. Usually this is

View file

@ -1,5 +1,6 @@
# taken from raf
{sources, ...}: {
{ sources, ... }:
{
# Global nixpkgs configuration.
# This is ignored if nixpkgs.pkgs is set, which should be avoided.
nixpkgs = {
@ -40,7 +41,7 @@
# List of derivation warnings to display while rebuilding.
# See: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/check-meta.nix>
showDerivationWarnings = [];
showDerivationWarnings = [ ];
};
};
}

View file

@ -4,12 +4,14 @@
lib,
sources,
...
}: let
}:
let
inherit (lib.modules) mkIf mkForce;
inherit (builtins) map;
cfg = config.modules.system.impermanence;
in {
in
{
imports = [
(sources.impermanence + "/nixos.nix")
];
@ -41,20 +43,36 @@ in {
];
users.cr = {
directories =
[
"cloud"
"repos"
]
++ map (
dir: ".config/${dir}"
) ["nicotine" "Signal" "Nextcloud" "emacs" "doom"]
++ map (
dir: ".cache/${dir}"
) ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "zsh" "nvim"]
++ map (
dir: ".local/share/${dir}"
) ["direnv" "Steam" "TelegramDesktop" "PrismLauncher" "nicotine" "zoxide" ".keepass"];
directories = [
"cloud"
"repos"
]
++ map (dir: ".config/${dir}") [
"nicotine"
"Signal"
"Nextcloud"
"emacs"
"doom"
]
++ map (dir: ".cache/${dir}") [
"tealdeer"
"keepassxc"
"nix"
"starship"
"nix-index"
"mozilla"
"zsh"
"nvim"
]
++ map (dir: ".local/share/${dir}") [
"direnv"
"Steam"
"TelegramDesktop"
"PrismLauncher"
"nicotine"
"zoxide"
".keepass"
];
};
};

View file

@ -3,10 +3,12 @@
lib,
pkgs,
...
}: let
}:
let
StateDirectory = "dnscrypt-proxy";
inherit (lib.modules) mkForce;
in {
in
{
networking = {
networkmanager.dns = mkForce "none";
nameservers = [

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
networking = {
# use nftables over iptables
nftables.enable = true;

View file

@ -1,6 +1,8 @@
{config, ...}: let
{ config, ... }:
let
inherit (config.modules.other.system) username;
in {
in
{
networking = {
enableIPv6 = true;
@ -40,7 +42,7 @@ in {
openFirewall = true;
};
users.users.${username}.extraGroups = ["networkmanager"];
users.users.${username}.extraGroups = [ "networkmanager" ];
# faster boot
systemd = {

View file

@ -1,11 +1,12 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
security = {
# Enable Soteria, a GTK-based Polkit authentication agent.
soteria.enable = true;
apparmor = {
enable = true;
killUnconfinedConfinables = true;
packages = [pkgs.apparmor-profiles];
packages = [ pkgs.apparmor-profiles ];
};
pam.services = {

View file

@ -2,16 +2,18 @@
lib,
pkgs,
...
}: let
}:
let
inherit (lib.modules) mkForce mkDefault;
in {
in
{
security = {
sudo-rs.enable = mkForce false;
sudo = {
enable = true;
# We use the default sudo package, but with insults if we
# fail to provide the correct password
package = pkgs.sudo.override {withInsults = true;};
package = pkgs.sudo.override { withInsults = true; };
# Wheel user should need the password to execute sudo commands
wheelNeedsPassword = mkDefault true;

View file

@ -1,11 +1,13 @@
{lib, ...}: let
{ lib, ... }:
let
inherit (lib.modules) mkForce;
in {
in
{
config.systemd = {
# faster startup
targets.network-online.wantedBy = mkForce []; # Normally ["multi-user.target"]
targets.network-online.wantedBy = mkForce [ ]; # Normally ["multi-user.target"]
services = {
NetworkManager-wait-online.wantedBy = mkForce []; # Normally ["network-online.target"]
NetworkManager-wait-online.wantedBy = mkForce [ ]; # Normally ["network-online.target"]
systemd-udev-settle.enable = false;
};
};

View file

@ -1,6 +1,8 @@
{config, ...}: let
{ config, ... }:
let
machine-id = builtins.substring 0 32 (builtins.hashString "sha256" config.networking.hostName);
in {
in
{
system = {
# My state version.
stateVersion = "23.11";