Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
84ee10e688
8 changed files with 167 additions and 116 deletions
10
flake.nix
10
flake.nix
|
|
@ -82,14 +82,8 @@
|
||||||
|
|
||||||
inventory = {
|
inventory = {
|
||||||
machines = {
|
machines = {
|
||||||
moritz-desktop.tags = ["peer" "client" "worker"];
|
moritz-desktop.tags = ["peer"];
|
||||||
moritz-laptop.tags = ["peer" "client" "worker"];
|
moritz-laptop.tags = ["peer"];
|
||||||
moritz-server.tags = ["client" "worker"];
|
|
||||||
};
|
|
||||||
instances."remote-builders" = {
|
|
||||||
module.name = "remote-builders";
|
|
||||||
roles.client.tags.client = {};
|
|
||||||
roles.worker.tags.worker = {};
|
|
||||||
};
|
};
|
||||||
services.zerotier.default = {
|
services.zerotier.default = {
|
||||||
roles.peer.tags = [
|
roles.peer.tags = [
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
personal.contacts = true;
|
personal.contacts = true;
|
||||||
impermanence.enable = true;
|
impermanence.enable = true;
|
||||||
webis.enable = true;
|
webis.enable = true;
|
||||||
|
jujutsu.enable = true;
|
||||||
};
|
};
|
||||||
programs.prismlauncher.enable = true;
|
programs.prismlauncher.enable = true;
|
||||||
programs.aider.enable = true;
|
programs.aider.enable = true;
|
||||||
|
|
@ -47,37 +48,6 @@
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [9090];
|
networking.firewall.allowedTCPPorts = [9090];
|
||||||
|
|
||||||
# TODO: make this its own module!
|
|
||||||
home-manager.users.moritz.programs.jujutsu = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
user = {
|
|
||||||
email = "mail@moritzboeh.me";
|
|
||||||
name = "Moritz Böhme";
|
|
||||||
};
|
|
||||||
ui.paginate = "never";
|
|
||||||
ui.default-command = "log";
|
|
||||||
signing = {
|
|
||||||
behavior = "drop";
|
|
||||||
backend = "gpg";
|
|
||||||
key = "0x970C6E89EB0547A9";
|
|
||||||
};
|
|
||||||
git.sign-on-push = true;
|
|
||||||
aliases = {
|
|
||||||
tug = ["bookmark" "move" "--from" "closest_bookmark(@)" "--to" "closest_pushable(@)"];
|
|
||||||
mm-update = ["rebase" "--source" "closest_merge(@)" "--destination" "all:closest_merge(@)-"];
|
|
||||||
mm-rebase = ["rebase" "--source" "all:roots(trunk()..closest_merge(@))"];
|
|
||||||
};
|
|
||||||
revset-aliases = {
|
|
||||||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
|
||||||
"closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:'') & (~empty() | merges()) & ~private())";
|
|
||||||
"closest_merge(to)" = "heads(::to & merges())";
|
|
||||||
"private()" = "description(glob:'wip:*') | description(glob:'private:*')";
|
|
||||||
};
|
|
||||||
git.private-commits = "private()";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.moritz.services.kanshi.settings = [
|
home-manager.users.moritz.services.kanshi.settings = [
|
||||||
{
|
{
|
||||||
profile.name = "default";
|
profile.name = "default";
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
personal.contacts = true;
|
personal.contacts = true;
|
||||||
personal.calendar = true;
|
personal.calendar = true;
|
||||||
impermanence.enable = true;
|
impermanence.enable = true;
|
||||||
|
jujutsu.enable = true;
|
||||||
};
|
};
|
||||||
programs.aider.enable = true;
|
programs.aider.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
42
modules/moritz/profiles/jujutsu.nix
Normal file
42
modules/moritz/profiles/jujutsu.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
cfg = config.my.profiles.jujutsu;
|
||||||
|
in {
|
||||||
|
options.my.profiles.jujutsu.enable = mkEnableOption "jujutsu profile";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home-manager.users.moritz.programs.jujutsu = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
user = {
|
||||||
|
email = "mail@moritzboeh.me";
|
||||||
|
name = "Moritz Böhme";
|
||||||
|
};
|
||||||
|
ui.paginate = "never";
|
||||||
|
ui.default-command = "log";
|
||||||
|
signing = {
|
||||||
|
behavior = "drop";
|
||||||
|
backend = "gpg";
|
||||||
|
key = "0x970C6E89EB0547A9";
|
||||||
|
};
|
||||||
|
git.sign-on-push = true;
|
||||||
|
aliases = {
|
||||||
|
tug = ["bookmark" "move" "--from" "closest_bookmark(@)" "--to" "closest_pushable(@)"];
|
||||||
|
mm-update = ["rebase" "--source" "closest_merge(@)" "--destination" "all:closest_merge(@)-"];
|
||||||
|
mm-rebase = ["rebase" "--source" "all:roots(trunk()..closest_merge(@))"];
|
||||||
|
};
|
||||||
|
revset-aliases = {
|
||||||
|
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||||||
|
"closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:'') & (~empty() | merges()) & ~private())";
|
||||||
|
"closest_merge(to)" = "heads(::to & merges())";
|
||||||
|
"private()" = "description(glob:'wip:*') | description(glob:'private:*')";
|
||||||
|
};
|
||||||
|
git.private-commits = "private()";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -18,7 +18,6 @@ in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# set as default shell
|
# set as default shell
|
||||||
users.users.moritz.shell = pkgs.fish;
|
users.users.moritz.shell = pkgs.fish;
|
||||||
environment.systemPackages = with pkgs.fishPlugins; [fzf-fish pisces];
|
|
||||||
# needed for nix completions
|
# needed for nix completions
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
|
@ -26,17 +25,30 @@ in {
|
||||||
programs = {
|
programs = {
|
||||||
fish = {
|
fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [
|
plugins = let
|
||||||
{
|
mkDef = pkg: {
|
||||||
name = "fish-completion-sync";
|
name = pkg.pname;
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkg.src;
|
||||||
owner = "pfgray";
|
};
|
||||||
repo = "fish-completion-sync";
|
plugins = with pkgs.fishPlugins; [
|
||||||
rev = "ba70b6457228af520751eab48430b1b995e3e0e2";
|
sponge
|
||||||
sha256 = "sha256-JdOLsZZ1VFRv7zA2i/QEZ1eovOym/Wccn0SJyhiP9hI=";
|
pisces
|
||||||
};
|
colored-man-pages
|
||||||
}
|
done
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
map mkDef plugins
|
||||||
|
++ [
|
||||||
|
{
|
||||||
|
name = "fish-completion-sync";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "iynaix";
|
||||||
|
repo = "fish-completion-sync";
|
||||||
|
rev = "4f058ad2986727a5f510e757bc82cbbfca4596f0";
|
||||||
|
sha256 = "sha256-kHpdCQdYcpvi9EFM/uZXv93mZqlk1zCi2DRhWaDyK5g=";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
shellAbbrs = shellConfig.abbreviations;
|
shellAbbrs = shellConfig.abbreviations;
|
||||||
shellAliases = shellConfig.aliases;
|
shellAliases = shellConfig.aliases;
|
||||||
shellInit =
|
shellInit =
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
home-manager.users.moritz.programs.nixvim = {
|
||||||
|
extraPlugins = [pkgs.vimPlugins.tiny-inline-diagnostic-nvim];
|
||||||
|
extraConfigLuaPost = ''
|
||||||
|
require('tiny-inline-diagnostic').setup({
|
||||||
|
preset = "powerline",
|
||||||
|
options = {
|
||||||
|
throttle = 0,
|
||||||
|
multilines = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.diagnostic.config({ virtual_text = false })
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
6
templates/rust/.gitignore
vendored
6
templates/rust/.gitignore
vendored
|
|
@ -1,9 +1,5 @@
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/rust,direnv
|
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,direnv
|
|
||||||
|
|
||||||
### direnv ###
|
### direnv ###
|
||||||
.direnv
|
.direnv
|
||||||
.envrc
|
|
||||||
|
|
||||||
### Rust ###
|
### Rust ###
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
|
|
@ -20,5 +16,3 @@ target/
|
||||||
|
|
||||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||||
*.pdb
|
*.pdb
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/rust,direnv
|
|
||||||
|
|
|
||||||
|
|
@ -1,69 +1,90 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
crane.url = "github:ipetkov/crane";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
crane.inputs.nixpkgs.follows = "nixpkgs";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
fenix.url = "github:nix-community/fenix";
|
rust-overlay = {
|
||||||
fenix.inputs.nixpkgs.follows = "nixpkgs";
|
url = "github:oxalica/rust-overlay";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
};
|
||||||
|
# wild = {
|
||||||
|
# url = "github:davidlattimore/wild";
|
||||||
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = inputs:
|
||||||
crane,
|
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
flake-utils,
|
systems = ["x86_64-linux"];
|
||||||
nixpkgs,
|
perSystem = {
|
||||||
...
|
self',
|
||||||
} @ inputs:
|
pkgs,
|
||||||
flake-utils.lib.eachDefaultSystem (
|
system,
|
||||||
system: let
|
...
|
||||||
inherit (pkgs) lib;
|
}: let
|
||||||
pkgs = import nixpkgs {inherit system;};
|
runtimeDeps = with pkgs; [];
|
||||||
fenix = inputs.fenix.packages.${system};
|
buildDeps = with pkgs; [pkg-config rustPlatform.bindgenHook];
|
||||||
craneLib = crane.lib.${system}.overrideToolchain toolchain.toolchain;
|
devDeps = with pkgs; [];
|
||||||
mkSrc = extraPaths:
|
|
||||||
with lib.fileset; let
|
|
||||||
root = ./.;
|
|
||||||
rustFiles = fromSource (craneLib.cleanCargoSource root);
|
|
||||||
fileset = union rustFiles (unions extraPaths);
|
|
||||||
in
|
|
||||||
toSource {inherit root fileset;};
|
|
||||||
|
|
||||||
## Customize here ##
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
toolchain = fenix.complete; # or fenix.stable;
|
msrv = cargoToml.package.rust-version;
|
||||||
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
|
|
||||||
|
rustPackage = features:
|
||||||
|
(pkgs.makeRustPlatform {
|
||||||
|
cargo = pkgs.rust-bin.stable.latest.minimal;
|
||||||
|
rustc = pkgs.rust-bin.stable.latest.minimal;
|
||||||
|
}).buildRustPackage {
|
||||||
|
inherit (cargoToml.package) name version;
|
||||||
|
src = ./.;
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
buildFeatures = features;
|
||||||
|
buildInputs = runtimeDeps;
|
||||||
|
nativeBuildInputs = buildDeps;
|
||||||
|
# Uncomment if your cargo tests require networking or otherwise
|
||||||
|
# don't play nicely with the Nix build sandbox:
|
||||||
|
# doCheck = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkDevShell = rustc:
|
||||||
|
pkgs.mkShell.override {
|
||||||
|
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
|
||||||
|
# stdenv = pkgs.useWildLinker pkgs.stdenv;
|
||||||
|
} {
|
||||||
|
shellHook = ''
|
||||||
|
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
|
||||||
|
'';
|
||||||
|
buildInputs = runtimeDeps;
|
||||||
|
nativeBuildInputs = buildDeps ++ devDeps ++ [rustc];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
packages.default = craneLib.buildPackage {
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
inherit stdenv;
|
inherit system;
|
||||||
src = mkSrc [];
|
overlays = [
|
||||||
strictDeps = true;
|
(import inputs.rust-overlay)
|
||||||
buildInputs =
|
# inputs.wild.overlays.default
|
||||||
[
|
];
|
||||||
# Add additional build inputs here
|
|
||||||
]
|
|
||||||
++ lib.optionals pkgs.stdenv.isDarwin [
|
|
||||||
# Additional darwin specific inputs can be set here
|
|
||||||
pkgs.libiconv
|
|
||||||
];
|
|
||||||
# Additional environment variables can be set directly
|
|
||||||
# MY_CUSTOM_VAR = "some value";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default =
|
packages.default = self'.packages.example;
|
||||||
pkgs.mkShell.override {inherit stdenv;}
|
devShells.default = self'.devShells.nightly;
|
||||||
{
|
|
||||||
nativeBuildInputs = with pkgs;
|
packages.example = rustPackage "";
|
||||||
[
|
|
||||||
# Add additional build inputs here
|
devShells.nightly = let
|
||||||
]
|
nightly = (pkgs.rust-bin.selectLatestNightlyWith
|
||||||
++ (with toolchain; [
|
(toolchain: toolchain.default)).override {
|
||||||
cargo
|
extensions = ["rustc-codegen-cranelift-preview"];
|
||||||
clippy
|
|
||||||
rustfmt
|
|
||||||
rustc
|
|
||||||
fenix.rust-analyzer
|
|
||||||
]);
|
|
||||||
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
|
||||||
};
|
};
|
||||||
}
|
devShell = mkDevShell nightly;
|
||||||
);
|
in
|
||||||
|
devShell.overrideAttrs (old: {
|
||||||
|
shellHook =
|
||||||
|
old.shellHook or ""
|
||||||
|
+ ''
|
||||||
|
export RUSTFLAGS="-Zcodegen-backend=cranelift"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
devShells.stable = mkDevShell pkgs.rust-bin.stable.latest.default;
|
||||||
|
devShells.msrv = mkDevShell pkgs.rust-bin.stable.${msrv}.default;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue