flake package

This commit is contained in:
Robin Appelman 2023-01-01 16:42:00 +01:00
commit 71c255ac45
4 changed files with 1116 additions and 87 deletions

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
/target
/Cargo.lock
.direnv

1084
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

103
flake.lock generated
View file

@ -1,40 +1,15 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"riff",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1662186434,
"narHash": "sha256-N867s0Z20q9LNirVftWoKAmkEARmmHXZHyRTEmekf94=",
"owner": "nix-community",
"repo": "fenix",
"rev": "e228867146581fa5e4be25dafc0dd68fdd22f0ad",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": [
"riff",
"nixpkgs"
]
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1662220400,
"narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=",
"lastModified": 1671096816,
"narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=",
"owner": "nix-community",
"repo": "naersk",
"rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3",
"rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114",
"type": "github"
},
"original": {
@ -44,6 +19,19 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1671883564,
"narHash": "sha256-C15oAtyupmLB3coZY7qzEHXjhtUx/+77olVdqVMruAg=",
"path": "/nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source",
"rev": "dac57a4eccf1442e8bf4030df6fcbb55883cb682",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1666014999,
"narHash": "sha256-gvKl8xlPJreezNG1NVTJv/HdGC69MSrM+IpCxS+eFvw=",
@ -58,66 +46,13 @@
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1662099760,
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "67e45078141102f45eff1589a831aeaa3182b41e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"riff": {
"inputs": {
"fenix": "fenix",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1665590088,
"narHash": "sha256-7mnx7J0AacL2P2mNuNNB+kKE7VR8nniVG+PSrwpZixE=",
"owner": "DeterminateSystems",
"repo": "riff",
"rev": "159e7c5b7ee3770828cc0c936d939de5d1b58f83",
"type": "github"
},
"original": {
"owner": "DeterminateSystems",
"repo": "riff",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"riff": "riff",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1662066014,
"narHash": "sha256-DE4FsE2sxd9nFtG+8+lnv/IBbtf+6rAlKjIdfpWN488=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "93c52e41ec0d297c7512adf5936d8c464c820618",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1659877975,

View file

@ -2,23 +2,34 @@
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/release-22.05";
riff.url = "github:DeterminateSystems/riff";
naersk.url = "github:nix-community/naersk";
};
outputs = {
self,
nixpkgs,
utils,
riff,
naersk,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = (import nixpkgs) {
inherit system;
};
naersk-lib = naersk.lib."${system}";
buildDependencies = with pkgs; [gcc pkg-config pcsclite xorg.libX11.dev];
in rec {
# `nix build`
packages.ykoauth-cli = naersk-lib.buildPackage {
pname = "ykoauth-cli";
root = ./.;
nativeBuildInputs = buildDependencies;
};
defaultPackage = packages.ykoauth-cli;
defaultApp = packages.ykoauth-cli;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [rustc cargo bacon cargo-edit cargo-outdated clippy gcc pkg-config pcsclite xorg.libX11.dev];
nativeBuildInputs = with pkgs; [rustc cargo bacon cargo-edit cargo-outdated clippy] ++ buildDependencies;
};
});
}