diff --git a/flake.lock b/flake.lock index 3242ff9..2dd00af 100644 --- a/flake.lock +++ b/flake.lock @@ -665,7 +665,8 @@ "nuschtos": "nuschtos", "snm": "snm", "sops-nix": "sops-nix_2", - "srvos": "srvos" + "srvos": "srvos", + "treefmt-nix": "treefmt-nix_4" } }, "snm": { @@ -866,6 +867,26 @@ "repo": "treefmt-nix", "type": "github" } + }, + "treefmt-nix_4": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743081648, + "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2d96da2..e9908e5 100644 --- a/flake.nix +++ b/flake.nix @@ -59,17 +59,25 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.disko.follows = "disko"; }; + + # Flake Stuff + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs@{ self, nixpkgs, + treefmt-nix, ... }: let forSystems = f: nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: f system); pkgs' = system: nixpkgs.legacyPackages.${system}; + treefmtEval = system: treefmt-nix.lib.evalModule (pkgs' system) ./treefmt.nix; in { modules.default = import ./modules; @@ -83,25 +91,9 @@ pkgs = pkgs' system; } ); - formatter = forSystems ( - system: - let - pkgs = pkgs' system; - in - pkgs.treefmt.withConfig { - runtimeInputs = with pkgs; [ - nixfmt-rfc-style - ]; - settings = { - tree-root-file = ".git/index"; - formatter = { - nixfmt = { - command = "nixfmt"; - includes = [ "*.nix" ]; - }; - }; - }; - } - ); + formatter = forSystems (system: (treefmtEval system).config.build.wrapper); + checks = forSystems (system: { + formatting = (treefmtEval system).config.build.check self; + }); }; } diff --git a/nixos-modules/audio/default.nix b/nixos-modules/audio/default.nix index 13f3fe3..830b3ae 100644 --- a/nixos-modules/audio/default.nix +++ b/nixos-modules/audio/default.nix @@ -65,13 +65,13 @@ in environment.sessionVariables = let makePluginPath = - format: - "$HOME/.${format}:" - + (lib.makeSearchPath format [ + format: + "$HOME/.${format}:" + + (lib.makeSearchPath format [ "$HOME/.nix-profile/lib" "/run/current-system/sw/lib" "/etc/profiles/per-user/$USER/lib" - ]); + ]); in { CLAP_PATH = lib.mkDefault (makePluginPath "clap"); diff --git a/systems/hetzner/default.nix b/systems/hetzner/default.nix index bcb41ea..a2823b5 100644 --- a/systems/hetzner/default.nix +++ b/systems/hetzner/default.nix @@ -7,8 +7,7 @@ }: let - network_interface_name = - (lib.elemAt config.facter.report.hardware.network_interface 0).unix_device_name; + network_interface_name = (lib.elemAt config.facter.report.hardware.network_interface 0).unix_device_name; in { @@ -117,7 +116,7 @@ in federating = true; federation_incoming_replies_max_depth = null; max_remote_account_fields = 100; - federated_timeline_available = true; + federated_timeline_available =true; languages = [ "en" "de" diff --git a/systems/omoikane/hardware.nix b/systems/omoikane/hardware.nix index db35b43..006d1f7 100644 --- a/systems/omoikane/hardware.nix +++ b/systems/omoikane/hardware.nix @@ -12,10 +12,7 @@ fileSystems."/home/jopejoe1/Public/games" = { device = "/dev/sda"; fsType = "bcachefs"; - options = [ - "compression=zstd" - "nofail" - ]; + options = [ "compression=zstd" "nofail" ]; }; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 0000000..b9f9658 --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: +{ + projectRootFile = "flake.nix"; + programs.nixfmt-rfc-style.enable = true; +}