Add flake.nix to root

This commit is contained in:
adisbladis 2020-10-29 13:56:41 +01:00
parent 69fbaaa458
commit 9f972211c7
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
4 changed files with 69 additions and 9 deletions

View file

@ -1,15 +1,10 @@
let { pkgs ? import <nixpkgs> { } }:
pkgs = import <nixpkgs> {
overlays = [
(self: super: {
buildGoApplication = super.callPackage ./builder { };
})
];
};
let
buildGoApplication = pkgs.buildGoApplication or pkgs.callPackage ./builder { };
inherit (pkgs) lib; inherit (pkgs) lib;
in pkgs.buildGoApplication { in buildGoApplication {
pname = "gomod2nix"; pname = "gomod2nix";
version = "0.1"; version = "0.1";
src = lib.cleanSource ./.; src = lib.cleanSource ./.;

43
flake.lock Normal file
View file

@ -0,0 +1,43 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1603758576,
"narHash": "sha256-xKFmWVx+rFInBao3gtmvXcd0LjHD1+0c1Ef5PJDrbuM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1dc37370c489b610f8b91d7fdd40633163ffbafd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1601282935,
"narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "588973065fce51f4763287f0fda87a174d78bf48",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

19
flake.nix Normal file
View file

@ -0,0 +1,19 @@
{
description = "Convert go.mod/go.sum to Nix packages";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; };
in {
overlay = final: prev: {
buildGoApplication = final.callPackage ./builder { };
};
defaultPackage = pkgs.callPackage ./default.nix { };
});
}

3
overlay.nix Normal file
View file

@ -0,0 +1,3 @@
self: super: {
buildGoApplication = self.callPackage ./builder { };
}