meta: refactor repository

This commit is contained in:
Artur Manuel 2025-03-26 15:08:13 +00:00
commit 599fe1903f
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
28 changed files with 276 additions and 136 deletions

View file

@ -1,38 +1,27 @@
{
description = "Go flake template";
description = "CHANGE DESC";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs = {
self,
nixpkgs,
}: let
allSystems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f:
nixpkgs.lib.genAttrs allSystems (system:
f {
pkgs = import nixpkgs {inherit system;};
inherit system;
});
in {
packages = forAllSystems ({
pkgs,
system,
}: {
default = pkgs.callPackage ./nix/package.nix {};
go-app = self.packages.${system}.default;
});
outputs = { self, nixpkgs, systems, }:
let
inherit (nixpkgs) lib;
pkgsFor = nixpkgs.legacyPackages;
forAllSystems = f:
lib.genAttrs (import systems) (system: f system pkgsFor.${system});
in {
packages = forAllSystems (system: pkgs: {
default = pkgs.callPackage ./flake/package.nix { };
CHANGE_NAME = self.packages.${system}.default;
});
devShells = forAllSystems ({
pkgs,
system,
}: {
default = pkgs.callPackage ./nix/shell.nix {inherit (self.packages.${system}) go-app;};
});
};
devShells = forAllSystems
(_: pkgs: { default = pkgs.callPackage ./flake/shell.nix { }; });
formatter =
forAllSystems (_: pkgs: pkgs.callPackage ./flake/formatter.nix { });
};
}