tangled
alpha
login
or
join now
nonbinary.computer
/
magic
3
fork
atom
this repo has no description
3
fork
atom
overview
issues
pulls
pipelines
init talk
authored by
Orual
and committed by
nonbinary.computer
2 weeks ago
55c738bf
+146
6 changed files
expand all
collapse all
unified
split
Cargo.toml
flake.nix
nix
modules
devshell.nix
pre-commit.nix
rust.nix
src
main.rs
+6
Cargo.toml
reviewed
···
1
1
+
[package]
2
2
+
name = "jacquard-talk"
3
3
+
version = "0.1.0"
4
4
+
edition = "2024"
5
5
+
6
6
+
[dependencies]
+31
flake.nix
reviewed
···
1
1
+
{
2
2
+
inputs = {
3
3
+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4
4
+
flake-parts.url = "github:hercules-ci/flake-parts";
5
5
+
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
6
6
+
systems.url = "github:nix-systems/default";
7
7
+
rust-flake.url = "github:juspay/rust-flake";
8
8
+
rust-flake.inputs.nixpkgs.follows = "nixpkgs";
9
9
+
#process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
10
10
+
#cargo-doc-live.url = "github:srid/cargo-doc-live";
11
11
+
12
12
+
# For cross-compilation
13
13
+
crane.url = "github:ipetkov/crane";
14
14
+
rust-overlay.url = "github:oxalica/rust-overlay";
15
15
+
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
16
16
+
17
17
+
git-hooks.url = "github:cachix/git-hooks.nix";
18
18
+
git-hooks.flake = false;
19
19
+
};
20
20
+
21
21
+
outputs = inputs:
22
22
+
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
23
23
+
systems = import inputs.systems;
24
24
+
25
25
+
# See ./nix/modules/*.nix for the modules that are imported here.
26
26
+
imports = with builtins;
27
27
+
map
28
28
+
(fn: ./nix/modules/${fn})
29
29
+
(attrNames (readDir ./nix/modules));
30
30
+
};
31
31
+
}
+34
nix/modules/devshell.nix
reviewed
···
1
1
+
{inputs, ...}: {
2
2
+
perSystem = {
3
3
+
config,
4
4
+
self',
5
5
+
pkgs,
6
6
+
lib,
7
7
+
...
8
8
+
}: {
9
9
+
devShells.default = pkgs.mkShell {
10
10
+
name = "jacquard-shell";
11
11
+
inputsFrom = [
12
12
+
self'.devShells.rust
13
13
+
config.pre-commit.devShell # See ./nix/modules/pre-commit.nix
14
14
+
];
15
15
+
packages = with pkgs; [
16
16
+
just
17
17
+
nixd # Nix language server
18
18
+
bacon
19
19
+
rust-analyzer
20
20
+
cargo-machete
21
21
+
cargo-semver-checks
22
22
+
cargo-binstall
23
23
+
cargo-dist
24
24
+
cargo-nextest
25
25
+
zip
26
26
+
atproto-goat
27
27
+
];
28
28
+
};
29
29
+
apps = {
30
30
+
default.program = "${self'.packages.jacquard-lexgen}/bin/lex-fetch";
31
31
+
lexgen.program = "${self'.packages.jacquard-lexgen}/bin/lex-fetch";
32
32
+
};
33
33
+
};
34
34
+
}
+14
nix/modules/pre-commit.nix
reviewed
···
1
1
+
{ inputs, ... }:
2
2
+
{
3
3
+
imports = [
4
4
+
(inputs.git-hooks + /flake-module.nix)
5
5
+
];
6
6
+
perSystem = { config, self', pkgs, lib, ... }: {
7
7
+
pre-commit.settings = {
8
8
+
hooks = {
9
9
+
nixpkgs-fmt.enable = true;
10
10
+
rustfmt.enable = true;
11
11
+
};
12
12
+
};
13
13
+
};
14
14
+
}
+58
nix/modules/rust.nix
reviewed
···
1
1
+
{inputs, ...}: {
2
2
+
imports = [
3
3
+
inputs.rust-flake.flakeModules.default
4
4
+
inputs.rust-flake.flakeModules.nixpkgs
5
5
+
# inputs.process-compose-flake.flakeModule
6
6
+
# inputs.cargo-doc-live.flakeModule
7
7
+
];
8
8
+
perSystem = {
9
9
+
config,
10
10
+
self',
11
11
+
pkgs,
12
12
+
lib,
13
13
+
...
14
14
+
}: let
15
15
+
inherit (pkgs.stdenv) isDarwin;
16
16
+
inherit (pkgs.darwin) apple_sdk;
17
17
+
18
18
+
# Common configuration for all crates
19
19
+
globalCrateConfig = {
20
20
+
crane.clippy.enable = false;
21
21
+
};
22
22
+
23
23
+
# Common build inputs for all crates
24
24
+
commonBuildInputs = with pkgs;
25
25
+
[
26
26
+
]
27
27
+
++ lib.optionals
28
28
+
isDarwin (
29
29
+
with apple_sdk.frameworks; [
30
30
+
IOKit
31
31
+
Security
32
32
+
SystemConfiguration
33
33
+
]
34
34
+
);
35
35
+
in {
36
36
+
rust-project = {
37
37
+
# Source filtering to avoid unnecessary rebuilds
38
38
+
src = lib.cleanSourceWith {
39
39
+
src = inputs.self;
40
40
+
filter = config.rust-project.crane-lib.filterCargoSources;
41
41
+
};
42
42
+
crates = {
43
43
+
"jacquard-talk" = {
44
44
+
imports = [globalCrateConfig];
45
45
+
autoWire = ["crate" "clippy"];
46
46
+
path = ./../../src;
47
47
+
crane = {
48
48
+
args = {
49
49
+
buildInputs = commonBuildInputs;
50
50
+
};
51
51
+
};
52
52
+
};
53
53
+
54
54
+
};
55
55
+
};
56
56
+
packages.default = self'.packages.jacquard-talk;
57
57
+
};
58
58
+
}
+3
src/main.rs
reviewed
···
1
1
+
fn main() {
2
2
+
println!("Hello, world!");
3
3
+
}