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("nix/config.h")
|
||||||
.flag("-idirafter")
|
.flag("-idirafter")
|
||||||
.flag(hacky_include.path().to_str().unwrap())
|
.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");
|
.compile("nixbinding");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=src/nix_store/bindings");
|
println!("cargo:rerun-if-changed=src/nix_store/bindings");
|
||||||
|
|
|
@ -14,7 +14,7 @@ use std::str::FromStr;
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub use attic::cache::{CacheName, CacheNamePattern};
|
pub use attic::cache::{CacheName};
|
||||||
|
|
||||||
/// A reference to a cache.
|
/// A reference to a cache.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
14
crane.nix
14
crane.nix
|
@ -62,10 +62,8 @@ let
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "attic";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
# See comment in `attic/build.rs`
|
||||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# See comment in `attic-tests`
|
# See comment in `attic-tests`
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
@ -135,17 +133,15 @@ let
|
||||||
|
|
||||||
nativeBuildInputs = nativeBuildInputs ++ [ jq ];
|
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;
|
doCheck = true;
|
||||||
|
|
||||||
buildPhaseCargoCommand = "";
|
buildPhaseCargoCommand = "";
|
||||||
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
|
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
|
||||||
doInstallCargoArtifacts = false;
|
doInstallCargoArtifacts = false;
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -53,11 +53,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702539185,
|
"lastModified": 1711401922,
|
||||||
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
|
"narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
|
"rev": "07262b18b97000d16a4bdb003418bd2fb067a932",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -69,11 +69,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702780907,
|
"lastModified": 1711460390,
|
||||||
"narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=",
|
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f",
|
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -130,6 +130,9 @@
|
||||||
NIX_PATH = "nixpkgs=${pkgs.path}";
|
NIX_PATH = "nixpkgs=${pkgs.path}";
|
||||||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
|
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include";
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "dev";
|
ATTIC_DISTRIBUTOR = "dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -199,10 +199,16 @@ in
|
||||||
ProtectKernelTunables = true;
|
ProtectKernelTunables = true;
|
||||||
ProtectProc = "invisible";
|
ProtectProc = "invisible";
|
||||||
ProtectSystem = "strict";
|
ProtectSystem = "strict";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 10;
|
||||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
|
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
|
||||||
RestrictNamespaces = true;
|
RestrictNamespaces = true;
|
||||||
RestrictRealtime = true;
|
RestrictRealtime = true;
|
||||||
RestrictSUIDSGID = 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";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
# See comment in `attic/build.rs`
|
||||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Recursive Nix is not stable yet
|
# Recursive Nix is not stable yet
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
Loading…
Reference in a new issue