Skip to content

Commit

Permalink
use flakeutils for proper systems management
Browse files Browse the repository at this point in the history
  • Loading branch information
ayys committed May 6, 2024
1 parent 3d677a9 commit 410ac6c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 17 deletions.
34 changes: 34 additions & 0 deletions flake.lock

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

43 changes: 26 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
{
description = "ayys's fork of st - the suckless simple terminal";

inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flakeutils.url = "github:numtide/flake-utils";
};

outputs =
{ self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
{
defaultPackage.x86_64-linux = pkgs.stdenv.mkDerivation {
name = "st";
src = ./.;
buildInputs = [
pkgs.gcc pkgs.pkg-config pkgs.xorg.libX11 pkgs.xorg.libXft pkgs.ncurses
];
buildPhase = ''
{ self, nixpkgs, flakeutils }:
flakeutils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
packages = rec {
st = pkgs.stdenv.mkDerivation {
name = "st";
src = ./.;
buildInputs = [
pkgs.gcc pkgs.pkg-config pkgs.xorg.libX11 pkgs.xorg.libXft pkgs.ncurses
];
buildPhase = ''
make
'';
installPhase = ''
installPhase = ''
TERMINFO="$out" make install DESTDIR="$out" PREFIX=""
'';
};

};
};
default = st;
};
apps = rec {
st = flakeutils.lib.mkApp { drv = self.packages.${system}.st; };
default = st;
};
}
);
}

0 comments on commit 410ac6c

Please sign in to comment.