1
{
2
description = "nóssa";
3
4
inputs = {
5
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
6
flake-parts.url = "github:hercules-ci/flake-parts";
7
flake-root.url = "github:srid/flake-root";
8
rust-analyzer-src = {
9
url = "github:rust-lang/rust-analyzer/nightly";
10
flake = false;
11
};
12
fenix = {
13
url = "github:nix-community/fenix";
14
inputs.nixpkgs.follows = "nixpkgs";
15
inputs.rust-analyzer-src.follows = "rust-analyzer-src";
16
};
17
expert = {
18
url = "github:elixir-lang/expert";
19
inputs.nixpkgs.follows = "nixpkgs";
20
};
21
};
22
23
outputs =
24
{
25
self,
26
nixpkgs,
27
flake-parts,
28
flake-root,
29
fenix,
30
...
31
}@inputs:
32
flake-parts.lib.mkFlake { inherit inputs; } (
33
{ withSystem, ... }:
34
{
35
imports = [
36
flake-root.flakeModule
37
];
38
systems = [
39
"aarch64-darwin"
40
"aarch64-linux"
41
"x86_64-darwin"
42
"x86_64-linux"
43
];
44
perSystem =
45
{
46
config,
47
system,
48
pkgs,
49
...
50
}:
51
let
52
callPackage = pkgs.lib.callPackageWith (
53
pkgs
54
// rec {
55
erlang = pkgs.beam_minimal.interpreters.erlang_27;
56
beamPackages = pkgs.beam_minimal.packagesWith erlang;
57
elixir = beamPackages.elixir_1_18;
58
expert = inputs.expert.packages.${system}.default;
59
inherit fenix;
60
}
61
);
62
in
63
{
64
_module.args.pkgs = import nixpkgs {
65
inherit system;
66
overlays = [ fenix.overlays.default ];
67
};
68
69
formatter = pkgs.nixfmt;
70
71
packages =
72
let
73
docker = callPackage ./nix/docker.nix {
74
nossa-rev = self.rev or "dev";
75
inherit (config.packages) nossa;
76
};
77
in
78
{
79
default = callPackage ./nix/package.nix { };
80
81
nossa = config.packages.default;
82
83
nossa-docker-build = docker.build;
84
nossa-docker-stream-layered = docker.stream-layered;
85
};
86
87
devShells = {
88
default = callPackage ./nix/shell.nix { inherit (config) flake-root; };
89
};
90
91
checks = {
92
nossa-nixos-module = callPackage ./nix/module-test.nix { inherit self; };
93
};
94
};
95
96
flake.nixosModules.nossa =
97
{ pkgs, ... }:
98
{
99
imports = [ ./nix/module.nix ];
100
services.nossa.package = withSystem pkgs.stdenv.hostPlatform.system (
101
{ config, ... }: config.packages.nossa
102
);
103
};
104
}
105
);
106
}
107