Generate Crate.nix on the fly
This commit is contained in:
parent
449a3912bd
commit
35a17a8862
@ -32,7 +32,7 @@ Run the daemons you need. At this moment, none of them accept any arguments.
|
||||
|
||||
## FIXME
|
||||
|
||||
1. Generate `Cargo.nix` on the fly
|
||||
1. ~~Generate `Cargo.nix` on the fly~~
|
||||
2. Bluetooth daemon doesn't actually work, since blurz doesn't allow to get the list of connected devices
|
||||
3. Need to figure out icons
|
||||
|
||||
|
35
flake.lock
generated
35
flake.lock
generated
@ -1,5 +1,38 @@
|
||||
{
|
||||
"nodes": {
|
||||
"crate2nix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1600641867,
|
||||
"narHash": "sha256-JMkuUewrguz/lsdS4UGP7oB3qXRDYhyfwUyZnhg41ug=",
|
||||
"owner": "balsoft",
|
||||
"repo": "crate2nix",
|
||||
"rev": "a8738225fa4ea4add60483b0ebaa55560e8c5722",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "balsoft",
|
||||
"ref": "balsoft/callcrate",
|
||||
"repo": "crate2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crates-io-index": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1600641984,
|
||||
"narHash": "sha256-u2juQ6LmitgAlj/lztMhjw6i0dIFEUdyVfYYIABWw90=",
|
||||
"owner": "rust-lang",
|
||||
"repo": "crates.io-index",
|
||||
"rev": "6adca9dd72305e56efc0bd516b6324d2542f71d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rust-lang",
|
||||
"repo": "crates.io-index",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1599773960,
|
||||
@ -17,6 +50,8 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"crate2nix": "crate2nix",
|
||||
"crates-io-index": "crates-io-index",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
25
flake.nix
25
flake.nix
@ -2,20 +2,35 @@
|
||||
# balsoft 2020
|
||||
|
||||
{
|
||||
inputs = { nixpkgs.url = "github:nixos/nixpkgs"; };
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
crate2nix = {
|
||||
type = "github";
|
||||
owner = "balsoft";
|
||||
repo = "crate2nix";
|
||||
ref = "balsoft/callcrate";
|
||||
flake = false;
|
||||
};
|
||||
crates-io-index = {
|
||||
url = "github:rust-lang/crates.io-index";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
description = "A collection of simple on-screen-display daemons";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs, crate2nix, crates-io-index }:
|
||||
let forAllSystems = f: builtins.mapAttrs (_: f) nixpkgs.legacyPackages;
|
||||
in {
|
||||
packages = forAllSystems (pkgs:
|
||||
let
|
||||
commonDeps = with pkgs; [ libnotify gdk_pixbuf glib ];
|
||||
|
||||
project = import ./Cargo.nix {
|
||||
inherit nixpkgs pkgs;
|
||||
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
||||
inherit (import crate2nix { inherit pkgs crates-io-index; }) callCrate;
|
||||
|
||||
project = callCrate {
|
||||
src = ./.;
|
||||
overrides.defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
||||
simple-osd-battery = oa: { buildInputs = commonDeps; };
|
||||
simple-osd-bluetooth = oa: {
|
||||
buildInputs = commonDeps
|
||||
|
Loading…
Reference in New Issue
Block a user