Files
divan-nixpkgs/flake.nix

41 lines
1.1 KiB
Nix

{
description = "DIvan package set";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
ponyfetch = {
url = "git+https://git.divan2000.su/DIvan2000/ponyfetch";
inputs.nixpkgs.follows = "nixpkgs";
};
terminal-oscilloscope = {
url = "git+https://git.divan2000.su/DIvan2000/terminal-oscilloscope";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
callPackage = pkgs.callPackage;
lib = nixpkgs.lib;
hasPackage = input:
input.packages ? ${system};
defaultPackage = input:
input.packages.${system}.default;
in {
packages = {
ponyfetch = inputs.ponyfetch.packages.${system}.default;
} // lib.optionalAttrs (hasPackage inputs.terminal-oscilloscope) {
terminal-oscilloscope = defaultPackage inputs.terminal-oscilloscope;
};
});
}