Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
clean up nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Aug 26, 2023
1 parent 1deb310 commit 3223679
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 143 deletions.
41 changes: 41 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
buildGoModule,
nix-filter,
lib,
...
}:
buildGoModule {
pname = "Hyprkeys";
version = "1.0.2";
src = nix-filter.lib {
root = ./.;
exclude = [
./README.md
./out.md
./out.json
./.github
];
};

ldflags = ["-s" "-w"];
vendorHash = "sha256-JFvC9V0xS8SZSdLsOtpyTrFzXjYAOaPQaJHdcnJzK3s=";

doCheck = true;

preFixup = ''
mkdir -p completions
$out/bin/hyprkeys completions zsh > completions/hyprkeys.zsh
$out/bin/hyprkeys completions bash > completions/hyprkeys.bash
$out/bin/hyprkeys completions fish > completions/hyprkeys.fish
installShellCompletion completions/*
'';

meta = with lib; {
description = "A simple, scriptable keybind retrieval utility for Hyprland.";
homepage = "/~https://github.com/hyprland-community/Hyprkeys";
maintainers = with maintainers; [NotAShelf];
mainProgram = "hyprkeys";
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
74 changes: 11 additions & 63 deletions flake.lock

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

43 changes: 25 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{
description = "Hyprkeys, a config inspection utility for Hyprland";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
description = "Hyprkeys - a keybind inspection utility for Hyprland";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
nix-filter.url = "github:numtide/nix-filter";
};

outputs = {
self,
nixpkgs,
flake-utils,
gomod2nix,
}: (
flake-utils.lib.eachDefaultSystem
(system: let
pkgs = import nixpkgs {
inherit system;
overlays = [gomod2nix.overlays.default];
nix-filter,
}: let
systems = ["x86_64-linux" "aarch64-linux"]; # we assume Hyprland only works on those two, for now
forEachSystem = nixpkgs.lib.genAttrs systems;

pkgsForEach = nixpkgs.legacyPackages;
in {
packages = forEachSystem (system: rec {
hyprkeys = pkgsForEach.${system}.callPackage ./default.nix {inherit nix-filter;};
default = hyprkeys;
});

devShells = forEachSystem (system: {
default = pkgsForEach.${system}.mkShell {
name = "hyprkeys-dev";
packages = with pkgsForEach.${system}; [go];
};
in {
packages.default = pkgs.callPackage ./nix {};
devShells.default = import ./nix/shell.nix {inherit pkgs;};
})
);
});

formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.alejandra);
};
}
29 changes: 0 additions & 29 deletions nix/default.nix

This file was deleted.

12 changes: 0 additions & 12 deletions nix/gomod2nix.toml

This file was deleted.

21 changes: 0 additions & 21 deletions nix/shell.nix

This file was deleted.

0 comments on commit 3223679

Please sign in to comment.