Merge pull request #39 from tweag/dev-cleanup

Dev cleanup
This commit is contained in:
adisbladis 2022-05-26 18:49:55 +08:00 committed by GitHub
commit c88d540afd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 21 deletions

View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1648069223,
"narHash": "sha256-BXzQV8p/RR440EB9qY0ULYfTH0zSW1stjUCYeP4SF+E=",
"lastModified": 1653407748,
"narHash": "sha256-g9puJaILRTb9ttlLQ7IehpV7Wcy0n+vs8LOFu6ylQcM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d08ea2bd83abef174fb43cbfb8a856b8ef2ce26",
"rev": "5ce6597eca7d7b518c03ecda57d45f9404b5e060",
"type": "github"
},
"original": {
@ -24,11 +24,11 @@
},
"utils": {
"locked": {
"lastModified": 1648297722,
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"type": "github"
},
"original": {

View file

@ -7,10 +7,7 @@
outputs = { self, nixpkgs, utils }:
{
overlay = final: prev: {
buildGoApplication = final.callPackage ./builder { };
gomod2nix = final.callPackage ./default.nix { };
};
overlays.default = import ./overlay.nix;
} //
(utils.lib.eachDefaultSystem
(system:
@ -18,17 +15,13 @@
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlay
self.overlays.default
];
};
in
{
defaultPackage = pkgs.callPackage ./default.nix { };
devShell = with pkgs; mkShell {
buildInputs = [
gomod2nix
];
};
packages.default = pkgs.callPackage ./default.nix { };
devShells.default = import ./shell.nix { inherit pkgs; };
})
);
}

View file

@ -1,4 +1,4 @@
self: super: {
buildGoApplication = self.callPackage ./builder { };
gomod2nix = self.callPackage ./default.nix { };
final: prev: {
buildGoApplication = final.callPackage ./builder { };
gomod2nix = final.callPackage ./default.nix { };
}

View file

@ -1,4 +1,21 @@
{ pkgs ? import <nixpkgs> { } }:
{ pkgs ? (
let
inherit (builtins) fromJSON readFile;
flakeLock = fromJSON (readFile ./flake.lock);
locked = flakeLock.nodes.nixpkgs.locked;
nixpkgs = assert locked.type == "github"; builtins.fetchTarball {
url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz";
sha256 = locked.narHash;
};
in
import nixpkgs {
overlays = [
(import ./overlay.nix)
];
}
)
}:
let
pythonEnv = pkgs.python3.withPackages (_: [ ]);
@ -8,6 +25,7 @@ pkgs.mkShell {
pkgs.nix-prefetch-git
pkgs.nixpkgs-fmt
pkgs.go
pkgs.gomod2nix
pythonEnv
];
}