1
0
Fork 0

Add flake.nix

This commit is contained in:
clerie 2022-12-31 01:01:22 +01:00
parent 37d100c720
commit 48dcaa93e8
2 changed files with 64 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1672350804,
"narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View File

@ -0,0 +1,37 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }: {
packages.x86_64-linux = let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
in {
nixos-exporter = pkgs.rustPlatform.buildRustPackage rec {
pname = "nixos-exporter";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
default = self.packages.x86_64-linux.nixos-exporter;
};
apps.x86_64-linux = {
nixos-exporter = {
type = "app";
program = self.packages.x86_64-linux.nixos-exporter + "/bin/nixos-exporter";
};
default = self.apps.x86_64-linux.nixos-exporter;
};
hydraJobs = {
inherit (self)
packages;
};
};
}