Replace shell.nix and defualt.nix with flakes
This commit is contained in:
parent
56da46578d
commit
8b19fa92c0
22
default.nix
22
default.nix
|
@ -1,22 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
with pkgs;
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
name = "rustybar";
|
||||
version = "0.1";
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
RUSTC_BOOTSTRAP = 1;
|
||||
doCheck = false;
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ dbus ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/mildlyfunctionalgays/rustybar";
|
||||
description = "swaybar/i3bar command in Rust";
|
||||
maintainers = with maintainers; [ artemist ];
|
||||
license = with licenses; [ mit ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
43
flake.lock
Normal file
43
flake.lock
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1637186689,
|
||||
"narHash": "sha256-NU7BhgnwA/3ibmCeSzFK6xGi+Bari9mPfn+4cBmyEjw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7fad01d9d5a3f82081c00fb57918d64145dc904c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1637014545,
|
||||
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
45
flake.nix
Normal file
45
flake.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
description = "sway/i3bar command in Rust";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils }:
|
||||
let
|
||||
supportedSystems = nixpkgs.lib.platforms.unix;
|
||||
in
|
||||
utils.lib.eachSystem supportedSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
rec {
|
||||
packages.rustybar = with pkgs; rustPlatform.buildRustPackage rec {
|
||||
name = "rustybar";
|
||||
version = "0.1";
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
RUSTC_BOOTSTRAP = 1;
|
||||
doCheck = false;
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ dbus ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/mildlyfunctionalgays/rustybar";
|
||||
description = "swaybar/i3bar command in Rust";
|
||||
maintainers = with maintainers; [ artemist ];
|
||||
license = with licenses; [ mit ];
|
||||
platforms = supportedSystems;
|
||||
};
|
||||
};
|
||||
defaultPackage = packages.rustybar;
|
||||
|
||||
apps.rustybar = utils.lib.mkApp { drv = packages.rustybar; };
|
||||
defaultApp = apps.rustybar;
|
||||
|
||||
devShells.rustybar = with pkgs; mkShell {
|
||||
packages = [ pkgconfig dbus rustup ];
|
||||
};
|
||||
devShell = devShells.rustybar;
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue