diff --git a/flake.lock b/flake.lock index c5bab68e..9881c4d6 100644 --- a/flake.lock +++ b/flake.lock @@ -207,12 +207,29 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1733097829, + "narHash": "sha256-9hbb1rqGelllb4kVUCZ307G2k3/UhmA8PPGBoyuWaSw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2c15aa59df0017ca140d9ba302412298ab4bf22a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "iosevka-custom": "iosevka-custom", "nixpkgs": "nixpkgs_2", - "stylix": "stylix" + "stylix": "stylix", + "treefmt-nix": "treefmt-nix" } }, "stylix": { @@ -314,6 +331,24 @@ "repo": "tinted-tmux", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1733761991, + "narHash": "sha256-s4DalCDepD22jtKL5Nw6f4LP5UwoMcPzPZgHWjAfqbQ=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "0ce9d149d99bc383d1f2d85f31f6ebd146e46085", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bcb0ecfb..76ccff3a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + treefmt-nix.url = "github:numtide/treefmt-nix"; iosevka-custom.url = "git+https://git.xenia.me.uk/pixelifytica/iosevka.git"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; @@ -23,8 +24,18 @@ }; outputs = - inputs@{ nixpkgs, ... }: + inputs@{ + self, + nixpkgs, + treefmt-nix, + ... + }: + let + treefmt = treefmt-nix.lib.evalModule nixpkgs.legacyPackages.x86_64-linux ./treefmt.nix; + in { + formatter.x86_64-linux = treefmt.config.build.wrapper; + checks.x86_64-linux.formatting = treefmt.config.build.check self; nixosConfigurations = { ## Server Legion = nixpkgs.lib.nixosSystem { diff --git a/system/hardware-configuration/Monarch.nix b/system/hardware-configuration/Monarch.nix index 14f1cd58..db2e917e 100644 --- a/system/hardware-configuration/Monarch.nix +++ b/system/hardware-configuration/Monarch.nix @@ -31,7 +31,8 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-bf1eab3a-6d92-430d-a282-8dd4c9efe2c7".device = "/dev/disk/by-uuid/bf1eab3a-6d92-430d-a282-8dd4c9efe2c7"; + boot.initrd.luks.devices."luks-bf1eab3a-6d92-430d-a282-8dd4c9efe2c7".device = + "/dev/disk/by-uuid/bf1eab3a-6d92-430d-a282-8dd4c9efe2c7"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/85D5-B6EC"; diff --git a/system/hardware-configuration/Northstar.nix b/system/hardware-configuration/Northstar.nix index 2b46114e..741ae945 100644 --- a/system/hardware-configuration/Northstar.nix +++ b/system/hardware-configuration/Northstar.nix @@ -26,7 +26,8 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-d1062931-ee58-4848-adf9-09452daeb6eb".device = "/dev/disk/by-uuid/d1062931-ee58-4848-adf9-09452daeb6eb"; + boot.initrd.luks.devices."luks-d1062931-ee58-4848-adf9-09452daeb6eb".device = + "/dev/disk/by-uuid/d1062931-ee58-4848-adf9-09452daeb6eb"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/ABE3-88E7"; diff --git a/system/hardware-configuration/Tone.nix b/system/hardware-configuration/Tone.nix index ee32fc32..2f1540d3 100644 --- a/system/hardware-configuration/Tone.nix +++ b/system/hardware-configuration/Tone.nix @@ -28,7 +28,8 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-08822b9c-e9d6-424c-bc75-373f8667526d".device = "/dev/disk/by-uuid/08822b9c-e9d6-424c-bc75-373f8667526d"; + boot.initrd.luks.devices."luks-08822b9c-e9d6-424c-bc75-373f8667526d".device = + "/dev/disk/by-uuid/08822b9c-e9d6-424c-bc75-373f8667526d"; fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/6009-89FC"; diff --git a/system/hardware-configuration/Vanguard.nix b/system/hardware-configuration/Vanguard.nix index a4c4b705..6c1c7a72 100644 --- a/system/hardware-configuration/Vanguard.nix +++ b/system/hardware-configuration/Vanguard.nix @@ -29,7 +29,8 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-0d50df5f-9456-4296-9156-f5b818e11552".device = "/dev/disk/by-uuid/0d50df5f-9456-4296-9156-f5b818e11552"; + boot.initrd.luks.devices."luks-0d50df5f-9456-4296-9156-f5b818e11552".device = + "/dev/disk/by-uuid/0d50df5f-9456-4296-9156-f5b818e11552"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/3297-A70D"; diff --git a/system/services/grafana.nix b/system/services/grafana.nix index 98b9ec39..51b8f03c 100644 --- a/system/services/grafana.nix +++ b/system/services/grafana.nix @@ -32,5 +32,6 @@ # } ]; }; - services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3000"; + services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = + "reverse_proxy http://localhost:3000"; } diff --git a/system/services/nix-serve.nix b/system/services/nix-serve.nix index 5ba93de5..7cc633bd 100644 --- a/system/services/nix-serve.nix +++ b/system/services/nix-serve.nix @@ -6,5 +6,6 @@ openFirewall = true; secretKeyFile = "/root/nix-serve.key"; }; - services.caddy.virtualHosts."nix.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:${toString config.services.nix-serve.port}"; + services.caddy.virtualHosts."nix.xenia.me.uk".extraConfig = + "reverse_proxy http://localhost:${toString config.services.nix-serve.port}"; } diff --git a/system/services/owncast.nix b/system/services/owncast.nix index 924d9ac5..b2d1e270 100644 --- a/system/services/owncast.nix +++ b/system/services/owncast.nix @@ -6,5 +6,6 @@ port = 9090; openFirewall = true; }; - services.caddy.virtualHosts."stream.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:${config.services.owncast.port}"; + services.caddy.virtualHosts."stream.xenia.me.uk".extraConfig = + "reverse_proxy http://localhost:${config.services.owncast.port}"; } diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 00000000..970592a6 --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + projectRootFile = "flake.nix"; + programs.nixfmt.enable = true; +}