feat: use fenix for cargo, add dynamic linking and pkg-config paths
This commit is contained in:
39
nix/flake.lock
generated
39
nix/flake.lock
generated
@@ -81,6 +81,27 @@
|
|||||||
},
|
},
|
||||||
"parent": []
|
"parent": []
|
||||||
},
|
},
|
||||||
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1768632427,
|
||||||
|
"narHash": "sha256-Y6kP10exkn5UiK9ead2Gky8TFsFZSsyT4f69DMKm0Wo=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"rev": "edd560269f0d9ad75bd3da292ce4d9d27efdd22a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -189,6 +210,7 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"custom-fonts": "custom-fonts",
|
"custom-fonts": "custom-fonts",
|
||||||
|
"fenix": "fenix",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixos-wsl": "nixos-wsl",
|
"nixos-wsl": "nixos-wsl",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
@@ -197,6 +219,23 @@
|
|||||||
"status-bar": "status-bar"
|
"status-bar": "status-bar"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1768468158,
|
||||||
|
"narHash": "sha256-DfifO/Se9ogmp5rxe/OwmRIz20/w6BsbWC1s4kL1Bzc=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "adbff8baedae53f9955fe60c0d470ecd77b4f548",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
url = "github:Mic92/sops-nix";
|
url = "github:Mic92/sops-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fenix = {
|
||||||
|
url = "github:nix-community/fenix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
gnumake
|
gnumake
|
||||||
watchman
|
watchman
|
||||||
bat
|
bat
|
||||||
rustup
|
|
||||||
emote
|
emote
|
||||||
pkg-config
|
pkg-config
|
||||||
openssl
|
openssl
|
||||||
|
|||||||
@@ -21,5 +21,6 @@
|
|||||||
./dns.nix
|
./dns.nix
|
||||||
./mounts.nix
|
./mounts.nix
|
||||||
./nfs-mesh.nix
|
./nfs-mesh.nix
|
||||||
|
./rust.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
41
nix/modules/rust.nix
Normal file
41
nix/modules/rust.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.rust = {
|
||||||
|
enable = lib.mkEnableOption "enable rust" // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.rust.enable {
|
||||||
|
nixpkgs.overlays = [ inputs.fenix.overlays.default ];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
(pkgs.fenix.stable.withComponents [
|
||||||
|
"cargo"
|
||||||
|
"clippy"
|
||||||
|
"rust-src"
|
||||||
|
"rustc"
|
||||||
|
"rustfmt"
|
||||||
|
])
|
||||||
|
openssl
|
||||||
|
pkgconf
|
||||||
|
];
|
||||||
|
environment.variables = {
|
||||||
|
PKG_CONFIG_PATH =
|
||||||
|
with pkgs;
|
||||||
|
lib.makeSearchPath "/lib/pkgconfig" [
|
||||||
|
openssl.dev
|
||||||
|
];
|
||||||
|
LD_LIBRARY_PATH = "/run/current-system/sw/share/nix-ld/lib";
|
||||||
|
};
|
||||||
|
programs.nix-ld.libraries = with pkgs; [
|
||||||
|
openssl
|
||||||
|
zlib
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user