diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-01 22:40:13 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-01 22:40:13 +0100 |
commit | de71260bbfbde953b2293bb0333dad0d5f9328cb (patch) | |
tree | 58eac9183d53a3e23f2db2ac826b83a8aecc252a /flake.nix | |
parent | 0ef8313a67866fc172ed93aa3df5e1fb2e672f86 (diff) | |
download | bottin-de71260bbfbde953b2293bb0333dad0d5f9328cb.tar.gz bottin-de71260bbfbde953b2293bb0333dad0d5f9328cb.zip |
Make repo a Nix flake
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d4a4a28 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Bottin is a LDAP server that uses Consul's key-value store as a storage backend"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs/0244e143dc943bcf661fdaf581f01eb0f5000fcf"; + inputs.gomod2nix.url = "github:tweag/gomod2nix/40d32f82fc60d66402eb0972e6e368aeab3faf58"; + + outputs = { self, nixpkgs, gomod2nix }: + let + pkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ + (self: super: { + gomod = super.callPackage "${gomod2nix}/builder/" { }; + }) + ]; + }; + bottin = pkgs.gomod.buildGoApplication { + pname = "bottin-bin"; + version = "0.1.0"; + src = builtins.filterSource + (path: type: (builtins.match ".*/test/.*\\.(go|sum|mod)" path) == null) + ./.; + modules = ./gomod2nix.toml; + + CGO_ENABLED=0; + + meta = with pkgs.lib; { + description = "A cloud-native LDAP server backed by a Consul datastore"; + homepage = "https://git.deuxfleurs.fr/Deuxfleurs/bottin"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; + }; + in + { + packages.x86_64-linux.bottin = bottin; + packages.x86_64-linux.default = self.packages.x86_64-linux.bottin; + }; +} |