Some checks failed
/ verify (push) Has been cancelled
This commit also adds the flake version to the justfile's version check.
99 lines
2.9 KiB
Nix
99 lines
2.9 KiB
Nix
{
|
|
description = "A non-linear writing instrument.";
|
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-26.05";
|
|
|
|
outputs = { nixpkgs, self }: let
|
|
name = "en";
|
|
version = "0.4.0-alpha";
|
|
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs {
|
|
inherit system;
|
|
});
|
|
|
|
in {
|
|
packages = forAllSystems (system: let
|
|
pkgs = nixpkgsFor.${system};
|
|
in {
|
|
default = pkgs.rustPlatform.buildRustPackage {
|
|
inherit name version;
|
|
src = ./.;
|
|
|
|
cargoHash =
|
|
"sha256-"
|
|
+ "em229cShq/IShRnxlp5mgcIu7pIOf0LflV8Pw0lLUEY=";
|
|
};
|
|
});
|
|
|
|
apps = forAllSystems (system: {
|
|
default = {
|
|
type = "app";
|
|
program =
|
|
"${self.packages.${system}.default}/bin/en";
|
|
};
|
|
});
|
|
|
|
devShells = forAllSystems (system:
|
|
let
|
|
pkgs = nixpkgsFor.${system};
|
|
sets = with pkgs; rec {
|
|
base = [
|
|
cargo-deny
|
|
cargo-llvm-cov
|
|
cargo-msrv
|
|
git
|
|
just
|
|
rustup
|
|
taplo
|
|
typos
|
|
];
|
|
cross = base ++ [
|
|
cargo-xwin
|
|
wine
|
|
];
|
|
dev = [
|
|
cargo-mutants
|
|
watchexec
|
|
];
|
|
edit = dev ++ [
|
|
neovim
|
|
tmux
|
|
];
|
|
};
|
|
in with sets; {
|
|
default = pkgs.mkShell { buildInputs = base; };
|
|
cross = pkgs.mkShell { buildInputs = cross; };
|
|
dev = pkgs.mkShell { buildInputs = base ++ dev; };
|
|
cross-dev = pkgs.mkShell { buildInputs = cross ++ dev; };
|
|
edit = pkgs.mkShell { buildInputs = edit; };
|
|
cross-edit = pkgs.mkShell { buildInputs = cross ++ edit; };
|
|
}
|
|
);
|
|
|
|
|
|
nixosModules.en = { config, lib, system, ... }: {
|
|
options.within.services.en.enable =
|
|
lib.mkEnableOption "enable en server";
|
|
|
|
config = lib.mkIf config.within.services.en.enable {
|
|
systemd.services.en = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
Restart = "always";
|
|
ExecStart =
|
|
"${self.packages."${system}".default}/bin/en";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
};
|
|
}
|