diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..873ece4 --- /dev/null +++ b/default.nix @@ -0,0 +1,13 @@ +(import + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }).defaultNix diff --git a/flake.lock b/flake.lock index 75a1bfa..f5da24b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1653893745, @@ -17,11 +33,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1654641575, - "narHash": "sha256-iifJAJRvhVg7XOPKGgjGN48r4GGSGyQZzkdAj84ocYA=", + "lastModified": 1655319683, + "narHash": "sha256-oeaucIu0Re7du7AGP1Y+yPqRghO+WyC6DagqaDpI7do=", "owner": "nixos", "repo": "nixpkgs", - "rev": "93109b6d7905559f3de76522bc1b1749e411354c", + "rev": "9e74ccc250321dea913219f9ce4ed2cdbdeecfde", "type": "github" }, "original": { @@ -33,6 +49,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index ad27b9f..b5218cb 100644 --- a/flake.nix +++ b/flake.nix @@ -4,16 +4,21 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; flake-utils.url = "github:numtide/flake-utils"; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; }; - outputs = { self, nixpkgs, flake-utils }: + outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in { packages.workon = pkgs.buildGoModule { - name = "workon"; - src = self; + pname = "workon"; + version = "0.2.0"; + src = ./.; vendorSha256 = "sha256-ia0Z9yz2LrRAd9huncFtl/a6R3/gRpqbg6TdnauvEmQ="; }; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..9eb132a --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +(import + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }).shellNix