Add treefmt with config, reformat nix files for nixfmt updates

This commit is contained in:
Evie Litherland-Smith 2024-12-12 07:26:01 +00:00
parent 1d535dc147
commit 1733e39552
10 changed files with 67 additions and 9 deletions

View file

@ -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",

View file

@ -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 {

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";
}

View file

@ -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}";
}

View file

@ -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}";
}

5
treefmt.nix Normal file
View file

@ -0,0 +1,5 @@
{ ... }:
{
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
}