Add formatter to project.

This commit is contained in:
Kevin Baensch 2023-09-11 20:05:16 +02:00
parent 3e1fe49657
commit 1dc50ae17d
Signed by: derped
GPG key ID: C0F1D326C7626543
2 changed files with 86 additions and 1 deletions

View file

@ -1,5 +1,28 @@
{ {
"nodes": { "nodes": {
"alejandra": {
"inputs": {
"fenix": "fenix",
"flakeCompat": "flakeCompat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1660510326,
"narHash": "sha256-xFumnivtVwu5fFBOrTxrv6fv3geHKF04RGP23EsDVaI=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "ef03f7ef74ec97fd91a016a51c9c9667fb315652",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"ref": "3.0.0",
"repo": "alejandra",
"type": "github"
}
},
"blobs": { "blobs": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -16,6 +39,28 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"fenix": {
"inputs": {
"nixpkgs": [
"alejandra",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1657607339,
"narHash": "sha256-HaqoAwlbVVZH2n4P3jN2FFPMpVuhxDy1poNOR7kzODc=",
"owner": "nix-community",
"repo": "fenix",
"rev": "b814c83d9e6aa5a28d0cf356ecfdafb2505ad37d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -32,6 +77,22 @@
"type": "github" "type": "github"
} }
}, },
"flakeCompat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"mailserver": { "mailserver": {
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
@ -181,6 +242,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"alejandra": "alejandra",
"mailserver": "mailserver", "mailserver": "mailserver",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-git": "nixpkgs-git", "nixpkgs-git": "nixpkgs-git",
@ -189,6 +251,23 @@
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1657557289,
"narHash": "sha256-PRW+nUwuqNTRAEa83SfX+7g+g8nQ+2MMbasQ9nt6+UM=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "caf23f29144b371035b864a1017dbc32573ad56d",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View file

@ -5,15 +5,20 @@
nixpkgs-stable.url = "github:/NixOS/nixpkgs/nixos-22.11"; nixpkgs-stable.url = "github:/NixOS/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:/NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:/NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:/NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:/NixOS/nixpkgs/nixos-unstable";
alejandra = {
url = github:kamadorueda/alejandra/3.0.0;
inputs.nixpkgs.follows = "nixpkgs";
};
mailserver.url = "gitlab:/simple-nixos-mailserver/nixos-mailserver"; mailserver.url = "gitlab:/simple-nixos-mailserver/nixos-mailserver";
sops-nix = { sops-nix = {
url = github:Mic92/sops-nix; url = github:Mic92/sops-nix;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, sops-nix, mailserver, ... }@attrs: let outputs = { self, nixpkgs, alejandra, mailserver, sops-nix, ... }@attrs: let
lib = nixpkgs.lib; lib = nixpkgs.lib;
fn = import ./fn.nix { inherit lib; }; fn = import ./fn.nix { inherit lib; };
mappedFormatter = builtins.mapAttrs (arch: packages: packages.default) alejandra.packages;
system = "x86_64-linux"; system = "x86_64-linux";
machineList = fn.lst { p = (toString ./machines); t = "directory"; b = false; }; machineList = fn.lst { p = (toString ./machines); t = "directory"; b = false; };
configFiles = fn.lst { p = (toString ./config); b = true; }; configFiles = fn.lst { p = (toString ./config); b = true; };
@ -37,6 +42,7 @@
}; };
}; };
in { in {
formatter = mappedFormatter;
nixosConfigurations = lib.listToAttrs (map nixosSystemFor machineList); nixosConfigurations = lib.listToAttrs (map nixosSystemFor machineList);
}; };
} }