feat: initial working state
This commit is contained in:
commit
b76036038e
8 changed files with 1538 additions and 0 deletions
65
flake.nix
Normal file
65
flake.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
systems.url = "github:nix-systems/default-linux";
|
||||
naersk.url = "github:nix-community/naersk";
|
||||
niri-flake.url = "github:sodiboo/niri-flake";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs:
|
||||
with inputs;
|
||||
let
|
||||
getPackages = builtins.attrValues;
|
||||
forAllSystems =
|
||||
function: nixpkgs.lib.genAttrs (import systems) (system: function nixpkgs.legacyPackages.${system});
|
||||
deps = forAllSystems (pkgs: {
|
||||
naersk = pkgs.callPackages naersk { };
|
||||
build = getPackages {
|
||||
inherit (pkgs)
|
||||
cargo
|
||||
rustc
|
||||
pkg-config
|
||||
systemdLibs
|
||||
;
|
||||
};
|
||||
dev = getPackages {
|
||||
inherit (pkgs)
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
clippy
|
||||
;
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with deps.${pkgs.system}; build ++ dev;
|
||||
RUST_SRC_DIR = "${pkgs.rustPlatform.rustLibSrc}";
|
||||
RUST_LOG = "debug";
|
||||
shellHook = ''
|
||||
cp -R ${niri-flake.inputs.niri-unstable} niri/
|
||||
'';
|
||||
};
|
||||
});
|
||||
packages = forAllSystems (pkgs: {
|
||||
unstable = deps.${pkgs.system}.naersk.buildPackage {
|
||||
src = ./.;
|
||||
RUSTFLAGS = "--cfg tokio_unstable";
|
||||
preConfigure = ''
|
||||
cp -R ${niri-flake.inputs.niri-unstable} niri/
|
||||
'';
|
||||
};
|
||||
stable = deps.${pkgs.system}.naersk.buildPackage {
|
||||
src = ./.;
|
||||
RUSTFLAGS = "--cfg tokio_unstable";
|
||||
preBuild = ''
|
||||
cp -R ${niri-flake.inputs.niri-stable} niri/
|
||||
'';
|
||||
};
|
||||
default = self.packages.${pkgs.system}.unstable;
|
||||
});
|
||||
# TODO make module that compiles based on niri version
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue