Skip to content

Commit

Permalink
feat(nix): remove nix modules, bump version and format nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
akshettrj committed Nov 25, 2024
1 parent cf79538 commit c3e75b9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 218 deletions.
35 changes: 24 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,29 @@
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, gomod2nix, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{
self,
nixpkgs,
flake-utils,
gomod2nix,
nix-filter,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default ];
inherit system;
overlays = [ gomod2nix.overlays.default ];
};
in
with pkgs; {
with pkgs;
rec {

devShells.default = mkShell {
name = "watgbridge-dev";
Expand All @@ -34,6 +43,11 @@
hardeningDisable = [ "fortify" ];
};

apps.default = {
type = "app";
program = "${packages.default}/bin/watgbridge";
};

packages = rec {
watgbridge = (pkgs.callPackage ./nix/pkgs/watgbridge-dev.nix { inherit nix-filter; });
default = watgbridge;
Expand All @@ -43,14 +57,13 @@
watgbridge = (pkgs.callPackage ./nix/pkgs/watgbridge-dev.nix { inherit nix-filter; });
};

nixosModules.default = import ./nix/modules/nixos self;
homeManagerModules.default = import ./nix/modules/home-manager self;

}
);

nixConfig = {
extra-substituters = [ "https://watgbridge.cachix.org" ];
extra-trusted-public-keys = [ "watgbridge.cachix.org-1:KSfgmbSBvXQTpUnoCj21vST7zgwpy3SbNfk0/nesR1Y=" ];
extra-trusted-public-keys = [
"watgbridge.cachix.org-1:KSfgmbSBvXQTpUnoCj21vST7zgwpy3SbNfk0/nesR1Y="
];
};
}
92 changes: 0 additions & 92 deletions nix/modules/commonOptions.nix

This file was deleted.

74 changes: 0 additions & 74 deletions nix/modules/home-manager/default.nix

This file was deleted.

25 changes: 0 additions & 25 deletions nix/modules/nixos/default.nix

This file was deleted.

26 changes: 10 additions & 16 deletions nix/pkgs/watgbridge-dev.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{ lib
, buildGoApplication
, enableFfmpeg ? true
, enableLibWebPTools ? true
, ffmpeg
, libwebp
, nix-filter
{
lib,
buildGoApplication,
nix-filter,
}:

let
Expand All @@ -28,22 +25,19 @@ let
];
};

in buildGoApplication rec {
in
buildGoApplication rec {
pname = "watgbridge";
version = "1.10.1";
version = "1.11.0";

pwd = localSrc;
src = localSrc;

buildInputs = [
] ++ lib.optionals enableFfmpeg [
ffmpeg
] ++ lib.optionals enableLibWebPTools [
libwebp
ldflags = [
"-s"
"-w"
];

ldflags = [ "-s" "-w" ];

meta = with lib; rec {
description = "A bridge between WhatsApp and Telegram written in Golang";
homepage = "https://github.com/watgbridge/watgbridge";
Expand Down

0 comments on commit c3e75b9

Please sign in to comment.