Compare commits

..

4 Commits

Author SHA1 Message Date
6d78bc9517 Updated dependencies 2024-08-02 18:29:38 +01:00
a9a06cd03d Switch to crane over cargo2nix 2024-08-02 18:26:30 +01:00
6794f6c238 Update dependencies 2024-07-27 11:22:49 +01:00
d57fc51bbc Update dependencies 2024-06-26 22:21:14 +01:00
7 changed files with 928 additions and 2605 deletions

3
.envrc
View File

@@ -1,2 +1 @@
watch_file Cargo.nix use flake . --override-input rootdir "file+file://"<(printf %s "$PWD")
use flake

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/target /target
/result-bin /result
/.direnv/ /.direnv/
/.devenv/

913
Cargo.lock generated

File diff suppressed because it is too large Load Diff

1996
Cargo.nix

File diff suppressed because it is too large Load Diff

View File

@@ -8,17 +8,20 @@ authors = ["Jack O'Sullivan <j@ckos.ie>"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
clap = { version = "4.4.4", features = ["derive"] } clap = { version = "4.5", features = ["derive"] }
env_logger = "0.11.0" env_logger = "0.11"
fuser = { version = "0.14.0", optional = true } fuser = { version = "0.14", optional = true }
libc = { version = "0.2.148", optional = true } libc = { version = "0.2", optional = true }
log = "0.4.20" log = "0.4"
prost = "0.12.1" prost = "0.13"
prost-build = "0.12.1" quinn = "0.11"
quinn = "0.10.2" rcgen = "0.13"
signal-hook = "0.3.17" signal-hook = "0.3"
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
[build-dependencies]
prost-build = "0.13"
[features] [features]
default = ["client"] default = ["client"]
client = ["dep:libc", "dep:fuser"] client = ["dep:libc", "dep:fuser"]

487
flake.lock generated
View File

@@ -1,48 +1,127 @@
{ {
"nodes": { "nodes": {
"cargo2nix": { "cachix": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "devenv": "devenv_2",
"flake-utils": "flake-utils", "flake-compat": [
"nixpkgs": "nixpkgs", "devenv",
"rust-overlay": "rust-overlay" "flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"pre-commit-hooks": [
"devenv",
"pre-commit-hooks"
]
}, },
"locked": { "locked": {
"lastModified": 1705129117, "lastModified": 1712055811,
"narHash": "sha256-LgdDHibvimzYhxBK3kxCk2gAL7k4Hyigl5KI0X9cijA=", "narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=",
"owner": "cargo2nix", "owner": "cachix",
"repo": "cargo2nix", "repo": "cachix",
"rev": "ae19a9e1f8f0880c088ea155ab66cee1fa001f59", "rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "cargo2nix", "owner": "cachix",
"repo": "cargo2nix", "repo": "cachix",
"type": "github" "type": "github"
} }
}, },
"devshell": { "crane": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1705332421, "lastModified": 1721842668,
"narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "narHash": "sha256-k3oiD2z2AAwBFLa4+xfU+7G5fisRXfkvrMTCJrjZzXo=",
"owner": "numtide", "owner": "ipetkov",
"repo": "devshell", "repo": "crane",
"rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "rev": "529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "ipetkov",
"repo": "devshell", "repo": "crane",
"type": "github"
}
},
"devenv": {
"inputs": {
"cachix": "cachix",
"flake-compat": "flake-compat_2",
"nix": "nix_2",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1722605649,
"narHash": "sha256-T5dzUFRb2ocZ+LB2qBZufewdUFQs0pB4fnLKIWBLd9Y=",
"owner": "cachix",
"repo": "devenv",
"rev": "a07842582c030fdf2ccf07d3b1402b2a46908856",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"devenv_2": {
"inputs": {
"flake-compat": [
"devenv",
"cachix",
"flake-compat"
],
"nix": "nix",
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix",
"pre-commit-hooks": [
"devenv",
"cachix",
"pre-commit-hooks"
]
},
"locked": {
"lastModified": 1708704632,
"narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=",
"owner": "cachix",
"repo": "devenv",
"rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "python-rewrite",
"repo": "devenv",
"type": "github" "type": "github"
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@@ -63,11 +142,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1704982712, "lastModified": 1719994518,
"narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "07f6395285469419cf9d078f59b5b49993198c00", "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -81,11 +160,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1689068808,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -99,11 +178,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1710146030,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -112,79 +191,112 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": { "gitignore": {
"inputs": { "inputs": {
"systems": "systems_3" "nixpkgs": [
"devenv",
"pre-commit-hooks",
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1681202837, "lastModified": 1709087332,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "gitignore.nix",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401", "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "gitignore.nix",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688870561,
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix_2": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression_2"
},
"locked": {
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1705099185, "lastModified": 1692808169,
"narHash": "sha256-SxJenKtvcrKJd0TyJQMO3p6VA7PEp+vmMnmlKFzWMNs=", "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2bce5ccff0ad7abda23e8bb56434b6877a446694",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1703961334,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1706173671,
"narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4fddc9be4eaf195d631333908f2a454b03628ee5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -194,51 +306,181 @@
"type": "github" "type": "github"
} }
}, },
"root": { "nixpkgs-lib": {
"inputs": { "locked": {
"cargo2nix": "cargo2nix", "lastModified": 1719876945,
"devshell": "devshell", "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"flake-parts": "flake-parts", "type": "tarball",
"nixpkgs": "nixpkgs_2", "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
"rust-overlay": "rust-overlay_2" },
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
} }
}, },
"rust-overlay": { "nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-regression_2": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1722040881,
"narHash": "sha256-NMDotPxtCNvmRnUo/YuxNOpN8+UMONBlNBnRFsGHADQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "48bacf585a51d953def8bff32087970f273052e2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": "flake-utils",
"cargo2nix", "nix-github-actions": "nix-github-actions",
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"cargo2nix", "devenv",
"cachix",
"devenv",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1705112162, "lastModified": 1692876271,
"narHash": "sha256-IAM0+Uijh/fwlfoeDrOwau9MxcZW3zeDoUHc6Z3xfqM=", "narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=",
"owner": "oxalica", "owner": "nix-community",
"repo": "rust-overlay", "repo": "poetry2nix",
"rev": "9e0af26ffe52bf955ad5575888f093e41fba0104", "rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oxalica", "owner": "nix-community",
"repo": "rust-overlay", "repo": "poetry2nix",
"type": "github" "type": "github"
} }
}, },
"rust-overlay_2": { "pre-commit-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1713775815,
"narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"crane": "crane",
"devenv": "devenv",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_2",
"rootdir": "rootdir",
"rust-overlay": "rust-overlay"
}
},
"rootdir": {
"flake": false,
"locked": {
"narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=",
"type": "file",
"url": "file:///dev/null"
},
"original": {
"type": "file",
"url": "file:///dev/null"
}
},
"rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1706235145, "lastModified": 1722046723,
"narHash": "sha256-3jh5nahTlcsX6QFcMPqxtLn9p9CgT9RSce5GLqjcpi4=", "narHash": "sha256-G7/gHz8ORRvHd1/RIURrdcswKRPe9K0FsIYR4v5jSWo=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "3a57c4e29cb2beb777b2e6ae7309a680585b8b2f", "rev": "56baac5e6b2743d4730e664ea64f6d8a2aad0fbb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -276,21 +518,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

108
flake.nix
View File

@@ -2,46 +2,60 @@
inputs = { inputs = {
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
cargo2nix.url = "github:cargo2nix/cargo2nix"; crane.url = "github:ipetkov/crane";
devshell.url = "github:numtide/devshell"; crane.inputs.nixpkgs.follows = "nixpkgs";
devshell.inputs.nixpkgs.follows = "nixpkgs"; devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
rootdir = {
url = "file+file:///dev/null";
flake = false;
};
}; };
outputs = inputs@{ nixpkgs, flake-parts, rust-overlay, cargo2nix, devshell, ... }: outputs =
inputs@{
nixpkgs, flake-parts, rust-overlay, crane,
devenv,
rootdir,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ imports = [
inputs.flake-parts.flakeModules.easyOverlay inputs.flake-parts.flakeModules.easyOverlay
devshell.flakeModule devenv.flakeModule
]; ];
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
perSystem = { inputs', system, pkgs, config, ... }:
debug = true;
perSystem = { inputs', system, lib, pkgs, config, ... }:
let let
binlessFuse = pkgs.fuse3.overrideAttrs (old: { inherit (lib) genAttrs;
postFixup = old.postFixup + ''
rm -r "$out"/{,s}bin rustToolchain' = ps: ps.rust-bin.stable."1.80.0".default;
''; rustToolchain = rustToolchain' pkgs;
}); craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain';
rustPkgs = pkgs.rustBuilder.makePackageSet {
rustToolchain = pkgs.rust-bin.stable."1.75.0".default; src = craneLib.cleanCargoSource ./.;
packageFun = import ./Cargo.nix; commonArgs = {
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [ inherit src;
(pkgs.rustBuilder.rustLib.makeOverride { strictDeps = true;
name = "fuser";
overrideAttrs = drv: { nativeBuildInputs = with pkgs; [
propagatedBuildInputs = drv.propagatedBuildInputs ++ [ pkg-config
binlessFuse ];
]; buildInputs = with pkgs; [
}; fuse3
})
]; ];
}; };
# Build *just* the cargo dependencies, so we can reuse
# all of that work when running in CI
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in in
{ {
_module.args.pkgs = import nixpkgs { _module.args.pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
devshell.overlays.default
cargo2nix.overlays.default
rust-overlay.overlays.default rust-overlay.overlays.default
]; ];
}; };
@@ -50,25 +64,39 @@
inherit (config.packages) quicfs; inherit (config.packages) quicfs;
}; };
packages = rec { packages = rec {
quicfs = (rustPkgs.workspace.quicfs { }).bin; quicfs = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts;
});
default = quicfs; default = quicfs;
}; };
devshells.default = { devenv.shells.default = devenvArgs:
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ]; let
language.c = with pkgs; rec { cfg = devenvArgs.config;
compiler = gcc;
libraries = [ rootdirOpt =
binlessFuse let
rootFileContent = builtins.readFile rootdir.outPath;
in
pkgs.lib.mkIf (rootFileContent != "") rootFileContent;
in
{
devenv.root = rootdirOpt;
packages = with pkgs; [
fuse3
cargo-outdated
]; ];
includes = libraries;
languages = {
c.enable = true;
rust = {
enable = true;
channel = "nixpkgs";
# HACK: This devenv module expects each component in a separate package,
# but rust-overlay isn't really set up that way
toolchain = genAttrs cfg.languages.rust.components (_: rustToolchain);
};
}; };
packagesFrom = [
(rustPkgs.workspaceShell { })
];
packages = [
inputs'.cargo2nix.packages.default
pkgs.cargo-outdated
];
}; };
}; };
}; };