Compare commits
10 commits
e6bedf1869
...
4dbdbee457
Author | SHA1 | Date | |
---|---|---|---|
4dbdbee457 | |||
Winter Cute | 657db64e51 | ||
Winter Cute | 8e64f8ba45 | ||
Winter Cute | 60db437df0 | ||
6eabc3f02f | |||
8f5e3c1035 | |||
fbe252a5c2 | |||
a7c878bffc | |||
857c71671c | |||
Robin Appelman | c98be70263 |
|
@ -24,6 +24,9 @@ fn build_bridge() {
|
|||
.flag("nix/config.h")
|
||||
.flag("-idirafter")
|
||||
.flag(hacky_include.path().to_str().unwrap())
|
||||
// In Nix 2.19+, nix/args/root.hh depends on being able to #include "root.hh" (which is in its parent directory), for some reason
|
||||
.flag("-I")
|
||||
.flag(concat!(env!("NIX_INCLUDE_PATH"), "/nix"))
|
||||
.compile("nixbinding");
|
||||
|
||||
println!("cargo:rerun-if-changed=src/nix_store/bindings");
|
||||
|
|
|
@ -14,7 +14,7 @@ use std::str::FromStr;
|
|||
use anyhow::{anyhow, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub use attic::cache::{CacheName, CacheNamePattern};
|
||||
pub use attic::cache::{CacheName};
|
||||
|
||||
/// A reference to a cache.
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
14
crane.nix
14
crane.nix
|
@ -62,10 +62,8 @@ let
|
|||
|
||||
ATTIC_DISTRIBUTOR = "attic";
|
||||
|
||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
||||
};
|
||||
# See comment in `attic/build.rs`
|
||||
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||
|
||||
# See comment in `attic-tests`
|
||||
doCheck = false;
|
||||
|
@ -135,17 +133,15 @@ let
|
|||
|
||||
nativeBuildInputs = nativeBuildInputs ++ [ jq ];
|
||||
|
||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
buildPhaseCargoCommand = "";
|
||||
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
|
||||
doInstallCargoArtifacts = false;
|
||||
|
||||
# See comment in `attic/build.rs`
|
||||
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
|
|
12
flake.lock
12
flake.lock
|
@ -53,11 +53,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1702539185,
|
||||
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
|
||||
"lastModified": 1711401922,
|
||||
"narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
|
||||
"rev": "07262b18b97000d16a4bdb003418bd2fb067a932",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -69,11 +69,11 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1702780907,
|
||||
"narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=",
|
||||
"lastModified": 1711460390,
|
||||
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f",
|
||||
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -130,6 +130,9 @@
|
|||
NIX_PATH = "nixpkgs=${pkgs.path}";
|
||||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
|
||||
|
||||
# See comment in `attic/build.rs`
|
||||
NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include";
|
||||
|
||||
ATTIC_DISTRIBUTOR = "dev";
|
||||
};
|
||||
|
||||
|
|
|
@ -199,10 +199,16 @@ in
|
|||
ProtectKernelTunables = true;
|
||||
ProtectProc = "invisible";
|
||||
ProtectSystem = "strict";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 10;
|
||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictSUIDSGID = true;
|
||||
ReadWritePaths = let
|
||||
path = cfg.settings.storage.path;
|
||||
isDefaultStateDirectory = path == "/var/lib/atticd" || lib.hasPrefix "/var/lib/atticd/" path;
|
||||
in lib.optionals (cfg.settings.storage.type or "" == "local" && !isDefaultStateDirectory) [ path ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -49,10 +49,8 @@ in rustPlatform.buildRustPackage rec {
|
|||
|
||||
ATTIC_DISTRIBUTOR = "attic";
|
||||
|
||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
||||
};
|
||||
# See comment in `attic/build.rs`
|
||||
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||
|
||||
# Recursive Nix is not stable yet
|
||||
doCheck = false;
|
||||
|
|
Loading…
Reference in a new issue