-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[𝚫] (penrose): moved to rust-stable from oxi's repo
- Loading branch information
1 parent
20ad27d
commit 3180401
Showing
2 changed files
with
129 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,72 @@ | ||
# Regernate Cargo2Nix: nix run github:cargo2nix/cargo2nix | ||
{ | ||
inputs = { | ||
cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0"; | ||
flake-utils.follows = "cargo2nix/flake-utils"; | ||
nixpkgs.follows = "cargo2nix/nixpkgs"; | ||
rust.url = "github:oxalica/rust-overlay"; | ||
rust-overlay.url = "github:oxalica/rust-overlay"; | ||
}; | ||
|
||
outputs = inputs: | ||
with inputs; | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [cargo2nix.overlays.default]; | ||
}; | ||
outputs = { | ||
self, | ||
cargo2nix, | ||
rust-overlay, | ||
nixpkgs, | ||
flake-utils, | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [cargo2nix.overlays.default rust-overlay.overlays.default]; | ||
}; | ||
|
||
rustPkgs = pkgs.rustBuilder.makePackageSet { | ||
rustChannel = "nightly"; | ||
packageFun = import ./default.nix; | ||
packageOverrides = pkgs: | ||
pkgs.rustBuilder.overrides.all | ||
++ [ | ||
(pkgs.rustBuilder.rustLib.makeOverride { | ||
name = "orcinus-wm"; | ||
overrideAttrs = drv: { | ||
propagatedNativeBuildInputs = | ||
drv.propagatedNativeBuildInputs | ||
or [] | ||
++ [ | ||
pkgs.xorg.libxcb | ||
pkgs.xorg.xmodmap | ||
]; | ||
}; | ||
}) | ||
]; | ||
}; | ||
|
||
workspaceShell = rustPkgs.workspaceShell { | ||
buildInputs = with pkgs; [ | ||
rust-analyzer | ||
xorg.libxcb | ||
xorg.xmodmap | ||
alejandra | ||
rustPkgs = pkgs.rustBuilder.makePackageSet { | ||
rustChannel = "stable"; | ||
rustVersion = "1.70.0"; | ||
packageFun = import ./default.nix; | ||
packageOverrides = pkgs: | ||
pkgs.rustBuilder.overrides.all | ||
++ [ | ||
(pkgs.rustBuilder.rustLib.makeOverride { | ||
name = "orcinus-wm"; | ||
overrideAttrs = drv: { | ||
propagatedNativeBuildInputs = | ||
drv.propagatedNativeBuildInputs | ||
or [] | ||
++ [ | ||
pkgs.xorg.libxcb | ||
pkgs.xorg.xmodmap | ||
]; | ||
}; | ||
}) | ||
]; | ||
}; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
rust-bin.stable.latest.default | ||
]; | ||
}; | ||
in rec { | ||
# Executed by `nix build` | ||
packages = { | ||
orcinusWM = (rustPkgs.workspace.orcinus-wm {}).bin; | ||
default = packages.orcinusWM; | ||
}; | ||
workspaceShell = rustPkgs.workspaceShell { | ||
buildInputs = with pkgs; [ | ||
rust-analyzer | ||
xorg.libxcb | ||
xorg.xmodmap | ||
alejandra | ||
]; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
rust-bin.stable.latest.default | ||
]; | ||
}; | ||
in rec { | ||
# Executed by `nix build` | ||
packages = { | ||
orcinusWM = (rustPkgs.workspace.orcinus-wm {}).bin; | ||
default = packages.orcinusWM; | ||
}; | ||
|
||
# Used by `nix develop` | ||
devShells.default = workspaceShell; | ||
# Used by `nix develop` | ||
devShells.default = workspaceShell; | ||
|
||
# Executed by `nix run` :TODO| xephyr script on run | ||
# apps.default = packages.orcinusWM; | ||
} | ||
); | ||
# Executed by `nix run` :TODO| xephyr script on run | ||
# apps.default = packages.orcinusWM; | ||
} | ||
); | ||
} |