From fcaba5a3e9eceef239153c7f305f70a1830e65aa Mon Sep 17 00:00:00 2001 From: jolheiser Date: Wed, 5 Jul 2023 11:15:58 -0500 Subject: [PATCH] feat: tmpl Signed-off-by: jolheiser --- default.nix | 4 +--- flake.nix | 14 +++++++------- pkgs/example-package/default.nix | 9 --------- pkgs/tmpl/default.nix | 23 +++++++++++++++++++++++ 4 files changed, 31 insertions(+), 19 deletions(-) delete mode 100644 pkgs/example-package/default.nix create mode 100644 pkgs/tmpl/default.nix diff --git a/default.nix b/default.nix index d6497c9..973042a 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,5 @@ modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays - example-package = pkgs.callPackage ./pkgs/example-package { }; - # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; - # ... + tmpl = pkgs.callPackage ./pkgs/tmpl { }; } diff --git a/flake.nix b/flake.nix index 81a143f..52c3005 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "My personal NUR repository"; + description = "jolheiser personal NUR repository"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; outputs = { self, nixpkgs }: let @@ -12,11 +12,11 @@ "armv7l-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - in - { - legacyPackages = forAllSystems (system: import ./default.nix { - pkgs = import nixpkgs { inherit system; }; - }); - packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system}); + in { + legacyPackages = forAllSystems (system: + import ./default.nix { pkgs = import nixpkgs { inherit system; }; }); + packages = forAllSystems (system: + nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) + self.legacyPackages.${system}); }; } diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix deleted file mode 100644 index 41e22df..0000000 --- a/pkgs/example-package/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ stdenv }: - -stdenv.mkDerivation rec { - name = "example-package-${version}"; - version = "1.0"; - src = ./.; - buildPhase = "echo echo Hello World > example"; - installPhase = "install -Dm755 example $out"; -} diff --git a/pkgs/tmpl/default.nix b/pkgs/tmpl/default.nix new file mode 100644 index 0000000..beb9485 --- /dev/null +++ b/pkgs/tmpl/default.nix @@ -0,0 +1,23 @@ +{ buildGoModule, fetchFromGitea, lib, ... }: +buildGoModule rec { + pname = "tmpl"; + version = "0.3.1"; + + src = fetchFromGitea { + domain = "git.jojodev.com"; + owner = "jolheiser"; + repo = "tmpl"; + rev = "v${version}"; + sha256 = "sha256-2GThTkTSiPv4SiWmRC/acKQ7k5uqrQQRM56eOxWCg7Q="; + }; + + vendorSha256 = "sha256-PmguDbjTSz0jzj1pwUNZrO1aAFNkWSo/FAef29TjsGI="; + + ldflags = [ "-s" "-w" "-X=go.jolheiser.com/tmpl/cmd.Version=${version}" ]; + + meta = with lib; { + description = "Template automation for bootstrapping projects"; + homepage = "https://git.jojodev.com/jolheiser/tmpl"; + license = licenses.mit; + }; +}