feat: add flake package output

This commit is contained in:
Guz
2026-02-21 17:11:32 -03:00
parent 7201eed595
commit 10c52c7b3e
2 changed files with 47 additions and 3 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ out.css
*.db
tmp
.direnv
result

View File

@@ -2,7 +2,11 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {nixpkgs, ...}: let
outputs = {
self,
nixpkgs,
...
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
@@ -13,9 +17,48 @@
nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {inherit system;};
in
f system pkgs);
f {
inherit pkgs;
inherit (pkgs) lib;
});
in {
devShells = forAllSystems (system: pkgs: {
packages = forAllSystems ({
lib,
pkgs,
...
}: {
guzone = pkgs.buildGoModule {
name = "guz.one";
pname = "guz.one";
env = {
GOWORK = "off";
};
version = "v0.1.0";
src = lib.cleanSource ./.;
nativeBuildInputs = [
pkgs.tailwindcss_4
];
vendorHash = "sha256-qw60GsRSZcevR4tvxsoQi3RWbZU291s6ZB8YJnaoh0Q=";
preBuild = ''
tailwindcss \
-i ./assets/tailwind.css \
-o ./assets/out.css
ls -a ./assets
'';
meta = {
mainProgram = "guz.one";
};
};
default = self.packages.${pkgs.stdenv.hostPlatform.system}.guzone;
});
devShells = forAllSystems ({pkgs, ...}: {
default = pkgs.mkShell {
CGO_ENABLED = "1";
hardeningDisable = ["fortify"];