Skip to content

Commit

Permalink
chore: clean flake
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed Jul 27, 2024
1 parent 74d7e79 commit c13ee57
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 49 deletions.
9 changes: 6 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{ system ? builtins.currentSystem
, nixpkgs ? import <nixpkgs> { inherit system; }
}:
{
system ? builtins.currentSystem,
nixpkgs ? import <nixpkgs> { inherit system; },
}:
rec {
nar-serve = nixpkgs.buildGoModule {
pname = "nar-serve";
version = "latest";
Expand All @@ -10,5 +11,7 @@
doCheck = false;
};

default = nar-serve;

devShell = import ./shell.nix { inherit nixpkgs; };
}
37 changes: 11 additions & 26 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 23 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{
description = "NAR serve";

inputs.flake-utils.url = "github:numtide/flake-utils";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
systems.url = "github:nix-systems/default";
};

outputs = { self, nixpkgs, flake-utils }:
outputs =
{
overlay = import ./overlay.nix;
}
//
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
packages = import ./. { nixpkgs = pkgs; };
defaultPackage = packages.nar-serve;
devShell = packages.devShell;
}
);
self,
nixpkgs,
systems,
}:
let
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in
{
overlays.default = import ./overlay.nix;

packages = eachSystem (pkgs: import ./. { nixpkgs = pkgs; });

formatter = eachSystem (pkgs: pkgs.nixfmt-rfc-style);

devShells = eachSystem (pkgs: {
default = self.packages.${pkgs.system}.devShell;
});
};
}
4 changes: 1 addition & 3 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
final: prev: {
nar-serve = import ./. { nixpkgs = final; };
}
final: prev: { nar-serve = import ./. { nixpkgs = final; }; }
5 changes: 3 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ system ? builtins.currentSystem
, nixpkgs ? import <nixpkgs> { inherit system; }
{
system ? builtins.currentSystem,
nixpkgs ? import <nixpkgs> { inherit system; },
}:
nixpkgs.mkShell {
buildInputs = with nixpkgs; [
Expand Down

0 comments on commit c13ee57

Please sign in to comment.