forked from clan/clan-infra
Merge pull request 'update formatter configuration' (#201) from Mic92-main into main
This commit is contained in:
commit
ded75bf7ab
17
LICENSE.md
17
LICENSE.md
@ -1,7 +1,18 @@
|
|||||||
Copyright 2023 Clan contributers
|
Copyright 2023 Clan contributers
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
10
README.md
10
README.md
@ -4,8 +4,10 @@ This repository contains nixos modules and terraform code that powers clan.lol.
|
|||||||
The website and git hosting is currently on [hetzner](https://www.hetzner.com/).
|
The website and git hosting is currently on [hetzner](https://www.hetzner.com/).
|
||||||
|
|
||||||
## Servers
|
## Servers
|
||||||
|
|
||||||
- web01:
|
- web01:
|
||||||
- Instance type: [ex101](https://www.hetzner.com/de/dedicated-rootserver/ex101)
|
- Instance type:
|
||||||
|
[ex101](https://www.hetzner.com/de/dedicated-rootserver/ex101)
|
||||||
- CPU: Intel Core i9-13900 (24 cores / 32 threads)
|
- CPU: Intel Core i9-13900 (24 cores / 32 threads)
|
||||||
- RAM: 64GB DDR5
|
- RAM: 64GB DDR5
|
||||||
- Drives: 2 x 1.92 TB NVME
|
- Drives: 2 x 1.92 TB NVME
|
||||||
@ -26,5 +28,7 @@ $ ./tf.sh apply
|
|||||||
|
|
||||||
## To add a new project to CI
|
## To add a new project to CI
|
||||||
|
|
||||||
1. Add the 'buildbot-clan' topic to the repository using the "Manage topics" button below the project description
|
1. Add the 'buildbot-clan' topic to the repository using the "Manage topics"
|
||||||
2. Go to https://buildbot.clan.lol/#/builders/2 and press "Update projects" after you have logged in.
|
button below the project description
|
||||||
|
2. Go to https://buildbot.clan.lol/#/builders/2 and press "Update projects"
|
||||||
|
after you have logged in.
|
||||||
|
30
flake.lock
30
flake.lock
@ -202,7 +202,7 @@
|
|||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-24_05": "nixpkgs-24_05"
|
"nixpkgs-24_05": []
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718697807,
|
"lastModified": 1718697807,
|
||||||
@ -220,11 +220,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719468428,
|
"lastModified": 1719760900,
|
||||||
"narHash": "sha256-vN5xJAZ4UGREEglh3lfbbkIj+MPEYMuqewMn4atZFaQ=",
|
"narHash": "sha256-NkvFphHXKtQQ8F0XrqGlqkOhjHbE3671F8oLxwtTHhk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1e3deb3d8a86a870d925760db1a5adecc64d329d",
|
"rev": "12a9c0004bc987afb1ff511ebb97b67497a68e22",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -234,21 +234,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-24_05": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1717144377,
|
|
||||||
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "nixpkgs",
|
|
||||||
"ref": "nixos-24.05",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"buildbot-nix": "buildbot-nix",
|
"buildbot-nix": "buildbot-nix",
|
||||||
@ -328,15 +313,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719749022,
|
"lastModified": 1719836491,
|
||||||
"narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=",
|
"narHash": "sha256-0kZeCwwYe51lN/9X2eCcBaAxFHeHTN1ieyuq/4UG8xg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd",
|
"rev": "e78a4ce2041d5179f84b9a91001d9d35e72d3d21",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
|
"ref": "opentofu",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
23
flake.nix
23
flake.nix
@ -12,13 +12,13 @@
|
|||||||
flake-compat.url = "github:edolstra/flake-compat";
|
flake-compat.url = "github:edolstra/flake-compat";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
treefmt-nix.url = "github:numtide/treefmt-nix/opentofu";
|
||||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nixos-mailserver = {
|
nixos-mailserver = {
|
||||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.utils.follows = "flake-utils";
|
inputs.nixpkgs-24_05.follows = "";
|
||||||
inputs.flake-compat.follows = "flake-compat";
|
inputs.flake-compat.follows = "flake-compat";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,12 +58,29 @@
|
|||||||
lib,
|
lib,
|
||||||
self',
|
self',
|
||||||
system,
|
system,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
treefmt = {
|
treefmt = {
|
||||||
|
package = pkgs.treefmt.overrideAttrs (_old: {
|
||||||
|
# https://github.com/numtide/treefmt/pull/325
|
||||||
|
patches = [ ./treefmt-config.patch ];
|
||||||
|
});
|
||||||
projectRootFile = ".git/config";
|
projectRootFile = ".git/config";
|
||||||
programs.hclfmt.enable = true;
|
programs.terraform.enable = true;
|
||||||
|
programs.shellcheck.enable = true;
|
||||||
|
|
||||||
|
programs.deno.enable = true;
|
||||||
|
settings.global.excludes = [
|
||||||
|
# generated files
|
||||||
|
"sops/*"
|
||||||
|
"terraform.tfstate"
|
||||||
|
"*.tfvars.sops.json"
|
||||||
|
"*nixos-vars.json"
|
||||||
|
"secrets.yaml"
|
||||||
|
];
|
||||||
|
|
||||||
programs.nixfmt-rfc-style.enable = true;
|
programs.nixfmt-rfc-style.enable = true;
|
||||||
settings.formatter.nixfmt-rfc-style.excludes = [
|
settings.formatter.nixfmt-rfc-style.excludes = [
|
||||||
# generated files
|
# generated files
|
||||||
|
@ -4,31 +4,31 @@ resource "hetznerdns_zone" "server" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "hetznerdns_record" "root_a" {
|
resource "hetznerdns_record" "root_a" {
|
||||||
zone_id = hetznerdns_zone.server.id
|
zone_id = hetznerdns_zone.server.id
|
||||||
name = "@"
|
name = "@"
|
||||||
type = "A"
|
type = "A"
|
||||||
value = var.ipv4_address
|
value = var.ipv4_address
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "hetznerdns_record" "root_aaaa" {
|
resource "hetznerdns_record" "root_aaaa" {
|
||||||
zone_id = hetznerdns_zone.server.id
|
zone_id = hetznerdns_zone.server.id
|
||||||
name = "@"
|
name = "@"
|
||||||
type = "AAAA"
|
type = "AAAA"
|
||||||
value = var.ipv6_address
|
value = var.ipv6_address
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "hetznerdns_record" "wildcard_a" {
|
resource "hetznerdns_record" "wildcard_a" {
|
||||||
zone_id = hetznerdns_zone.server.id
|
zone_id = hetznerdns_zone.server.id
|
||||||
name = "*"
|
name = "*"
|
||||||
type = "A"
|
type = "A"
|
||||||
value = var.ipv4_address
|
value = var.ipv4_address
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "hetznerdns_record" "wildcard_aaaa" {
|
resource "hetznerdns_record" "wildcard_aaaa" {
|
||||||
zone_id = hetznerdns_zone.server.id
|
zone_id = hetznerdns_zone.server.id
|
||||||
name = "*"
|
name = "*"
|
||||||
type = "AAAA"
|
type = "AAAA"
|
||||||
value = var.ipv6_address
|
value = var.ipv6_address
|
||||||
}
|
}
|
||||||
|
|
||||||
# for sending emails
|
# for sending emails
|
||||||
|
23
treefmt-config.patch
Normal file
23
treefmt-config.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From 43b15f8757a7f8de0340cc977ff9619741a5d43f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Brian McGee <brian@bmcgee.ie>
|
||||||
|
Date: Mon, 1 Jul 2024 14:20:22 +0100
|
||||||
|
Subject: [PATCH] fix: configure toml key for global excludes
|
||||||
|
|
||||||
|
Signed-off-by: Brian McGee <brian@bmcgee.ie>
|
||||||
|
---
|
||||||
|
config/config.go | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config/config.go b/config/config.go
|
||||||
|
index d9e281f..be5c991 100644
|
||||||
|
--- a/config/config.go
|
||||||
|
+++ b/config/config.go
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
||||||
|
type Config struct {
|
||||||
|
Global struct {
|
||||||
|
// Excludes is an optional list of glob patterns used to exclude certain files from all formatters.
|
||||||
|
- Excludes []string
|
||||||
|
+ Excludes []string `toml:"excludes"`
|
||||||
|
}
|
||||||
|
Formatters map[string]*Formatter `toml:"formatter"`
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user