-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (40 loc) · 1.59 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
45
46
47
48
49
{
# Description of the application
description = "A tool for viewing and editing your nix configuration as a tree";
# Importing nixpkgs (the package repository) and poetry for building the application
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
poetry2nix.url = "github:nix-community/poetry2nix";
};
outputs = { self, nixpkgs, poetry2nix }:
let
# Setting system to 64 bit linux
system = "x86_64-linux";
# Adding poetry to our nixpkgs, and setting the pkgs variable as this
pkgs = nixpkgs.legacyPackages.${system}.extend poetry2nix.overlays.default;
# Setting the lib variable (for licenses and maintainers)
lib = nixpkgs.lib;
# Extract mkPoetryApplication from mkPoetry2Nix for buikding our application
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
# The section that builds our application
defaultPackage.x86_64-linux = mkPoetryApplication {
type = "app";
# The project is found at the root of the repository
projectDir = ./.;
# To copy over the full options json
preInstall = ''
mkdir -p $out/data
cp ./data/options.json $out/data
'';
meta = {
description = "A tool for viewing and editing your nix configuration as a tree";
homepage = "https://github.com/max-amb/nix-tree";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ max-amb ];
platforms = lib.platforms.linux;
};
};
};
}