-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (36 loc) · 1.12 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
description = "A flake for nixpm, a script to manage system/user packages and Nix shell packages.";
# Declare inputs, primarily nixpkgs here
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Define the outputs, which include packages, apps, etc.
outputs = { self, nixpkgs }: {
# Define the packages for the x86_64-linux platform
packages.x86_64-linux = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{
# Package for nixpm
nixpm = pkgs.stdenv.mkDerivation {
pname = "nixpm"; # Name of the package
version = "1.0.7"; # Version of the package
src = ./.;
buildInputs = [ pkgs.makeWrapper ];
buildPhase = ''
mkdir -p $out/bin
'';
installPhase = ''
install -Dm755 nixpm.sh $out/bin/nixpm
'';
};
};
# Define the default package to be built
defaultPackage.x86_64-linux = self.packages.x86_64-linux.nixpm;
# Define the app
apps.x86_64-linux = {
nixpm = {
type = "app";
program = "${self.packages.x86_64-linux.nixpm}/bin/nixpm";
};
};
};
}