- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
{
description = "web frontend for git";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import nixpkgs { inherit system; };
}
);
in
{
packages = forAllSystems (
{ system, pkgs }: {
legit = pkgs.callPackage ./. { };
default = self.packages.${system}.legit;
testing = pkgs.callPackage ./nix/test-server.nix { };
}
);
homeManagerModules.default = import ./nix/home-manager-module.nix self;
nixosModules.default = import ./nix/nixos-module.nix self;
apps = forAllSystems (
{ system, pkgs }: {
k6 = {
type = "app";
program = pkgs.lib.getExe pkgs.k6;
};
dprint = {
type = "app";
program = pkgs.lib.getExe pkgs.dprint;
};
}
);
formatter = forAllSystems (
{ system, pkgs }:
pkgs.buildFHSEnv {
name = "fhs-dprint";
targetPkgs =
pkgs: with pkgs; [
# Formatter frontend.
# https://dprint.dev/
dprint
# > Official formatter for Nix code
# https://github.com/NixOS/nixfmt
nixfmt
# For "gofmt" command.
go
];
runScript = "dprint fmt";
}
);
devShells = forAllSystems (
{ system, pkgs }: {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
go
gopls
];
};
debug = pkgs.mkShell {
# https://github.com/go-delve/delve/issues/3085
hardeningDisable = [ "fortify" ];
packages = with pkgs; [
go
delve
];
};
# For those who don't have podman on system.
podman = pkgs.callPackage ./nix/devshell-podman.nix { };
}
);
nixosConfigurations =
let
system = "x86_64-linux";
in
{
soft-legit = nixpkgs.lib.nixosSystem {
inherit system;
pkgs = import nixpkgs { inherit system; };
modules = [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
./nix/nixos-configuration-soft-legit.nix
self.nixosModules.default
];
};
soft-legit-hm = nixpkgs.lib.nixosSystem {
inherit system;
pkgs = import nixpkgs { inherit system; };
modules = [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
./nix/nixos-configuration-soft-legit-hm.nix
({ ... }: { home-manager.extraSpecialArgs.legit = self; })
];
};
};
};
}