summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix98
1 files changed, 48 insertions, 50 deletions
diff --git a/flake.nix b/flake.nix
index 5775907..458337b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,8 +2,8 @@
description = "getchoo's nix expressions";
nixConfig = {
- extra-substituters = ["https://getchoo.cachix.org"];
- extra-trusted-public-keys = ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="];
+ extra-substituters = [ "https://getchoo.cachix.org" ];
+ extra-trusted-public-keys = [ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" ];
};
inputs = {
@@ -12,57 +12,55 @@
flake-checks.url = "github:getchoo/flake-checks";
};
- outputs = {
- nixpkgs,
- flake-checks,
- ...
- }: let
- systems = [
- "x86_64-linux"
- "aarch64-linux"
- "x86_64-darwin"
- "aarch64-darwin"
- ];
+ outputs =
+ { nixpkgs, flake-checks, ... }:
+ let
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
- forAllSystems = fn: nixpkgs.lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
- in {
- checks = forAllSystems (pkgs: let
- flake-checks' = flake-checks.lib.mkChecks {
- root = ./.;
- inherit pkgs;
- };
- in {
- inherit
- (flake-checks')
- actionlint
- alejandra
- deadnix
- statix
- ;
- });
+ forAllSystems = fn: nixpkgs.lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
+ in
+ {
+ checks = forAllSystems (
+ pkgs:
+ let
+ flake-checks' = flake-checks.lib.mkChecks {
+ root = ./.;
+ inherit pkgs;
+ };
+ in
+ {
+ inherit (flake-checks') actionlint deadnix statix;
+ }
+ );
- packages = forAllSystems (
- {
- lib,
- pkgs,
- system,
- ...
- }: let
- /*
- this filters out packages that may be broken or not supported
- on the current system. packages that have no `broken` or `platforms`
- meta attribute are assumed to be valid
- */
- isValid = _: v:
- lib.elem pkgs.system (v.meta.platforms or [pkgs.system]) && !(v.meta.broken or false);
+ packages = forAllSystems (
+ {
+ lib,
+ pkgs,
+ system,
+ ...
+ }:
+ let
+ /*
+ this filters out packages that may be broken or not supported
+ on the current system. packages that have no `broken` or `platforms`
+ meta attribute are assumed to be valid
+ */
+ isValid =
+ _: v: lib.elem pkgs.system (v.meta.platforms or [ pkgs.system ]) && !(v.meta.broken or false);
- pkgs' = lib.filterAttrs isValid (import ./. {inherit pkgs;});
- in
- pkgs' // {default = pkgs'.treefetch;}
- );
+ pkgs' = lib.filterAttrs isValid (import ./. { inherit pkgs; });
+ in
+ pkgs' // { default = pkgs'.treefetch; }
+ );
- formatter = forAllSystems (pkgs: pkgs.alejandra);
+ formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
- templates = import ./templates;
- };
+ templates = import ./templates;
+ };
}