Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
5d913f70
Unverified
Commit
5d913f70
authored
2 years ago
by
Yusuf Bera Ertan
Browse files
Options
Downloads
Patches
Plain Diff
build(nix): fix flake builds
parent
d68dad58
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
flake.lock
+344
-28
344 additions, 28 deletions
flake.lock
flake.nix
+53
-71
53 additions, 71 deletions
flake.nix
with
398 additions
and
100 deletions
Cargo.toml
+
1
−
1
View file @
5d913f70
...
@@ -12,7 +12,7 @@ edition = "2021"
...
@@ -12,7 +12,7 @@ edition = "2021"
# When changing this, change the hash near the text "THE rust-version HASH" in
# When changing this, change the hash near the text "THE rust-version HASH" in
# `/flake.nix` too. If you don't have Nix installed or otherwise don't know how
# `/flake.nix` too. If you don't have Nix installed or otherwise don't know how
# to do this, ping `@charles:computer.surgery` in the matrix room.
# to do this, ping `@charles:computer.surgery` in the matrix room.
rust-version
=
"1.64"
rust-version
=
"1.64
.0
"
# 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
...
...
This diff is collapsed.
Click to expand it.
flake.lock
+
344
−
28
View file @
5d913f70
{
{
"nodes": {
"nodes": {
"alejandra": {
"inputs": {
"fenix": "fenix",
"flakeCompat": "flakeCompat",
"nixpkgs": [
"d2n",
"nixpkgs"
]
},
"locked": {
"lastModified": 1658427149,
"narHash": "sha256-ToD/1z/q5VHsLMrS2h96vjJoLho59eNRtknOUd19ey8=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "f5a22afd2adfb249b4e68e0b33aa1f0fb73fb1be",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"repo": "alejandra",
"type": "github"
}
},
"all-cabal-json": {
"flake": false,
"locked": {
"lastModified": 1665552503,
"narHash": "sha256-r14RmRSwzv5c+bWKUDaze6pXM7nOsiz1H8nvFHJvufc=",
"owner": "nix-community",
"repo": "all-cabal-json",
"rev": "d7c0434eebffb305071404edcf9d5cd99703878e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "hackage",
"repo": "all-cabal-json",
"type": "github"
}
},
"crane": {
"flake": false,
"locked": {
"lastModified": 1670900067,
"narHash": "sha256-VXVa+KBfukhmWizaiGiHRVX/fuk66P8dgSFfkVN4/MY=",
"owner": "ipetkov",
"repo": "crane",
"rev": "59b31b41a589c0a65e4a1f86b0e5eac68081468b",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"d2n": {
"inputs": {
"alejandra": "alejandra",
"all-cabal-json": "all-cabal-json",
"crane": "crane",
"devshell": "devshell",
"flake-parts": "flake-parts",
"flake-utils-pre-commit": "flake-utils-pre-commit",
"ghc-utils": "ghc-utils",
"gomod2nix": "gomod2nix",
"mach-nix": "mach-nix",
"nix-pypi-fetcher": "nix-pypi-fetcher",
"nixpkgs": [
"nixpkgs"
],
"poetry2nix": "poetry2nix",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1674848374,
"narHash": "sha256-1+xlsmUWzpptK8mLjznwqOLogeicLkxB8tV6XUZbobc=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "d91e7381fa303be02f70e472207e05b26ce35b41",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "dream2nix",
"type": "github"
}
},
"devshell": {
"flake": false,
"locked": {
"lastModified": 1663445644,
"narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=",
"owner": "numtide",
"repo": "devshell",
"rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"fenix": {
"fenix": {
"inputs": {
"inputs": {
"nixpkgs": [
"nixpkgs": [
"d2n",
"alejandra",
"nixpkgs"
"nixpkgs"
],
],
"rust-analyzer-src": "rust-analyzer-src"
"rust-analyzer-src": "rust-analyzer-src"
},
},
"locked": {
"locked": {
"lastModified": 16
71776618
,
"lastModified": 16
57607339
,
"narHash": "sha256-
myjhExbKIzZy+kqqFyqvX59KErqYZVNTPsCfgByTOKo
=",
"narHash": "sha256-
HaqoAwlbVVZH2n4P3jN2FFPMpVuhxDy1poNOR7kzODc
=",
"owner": "nix-community",
"owner": "nix-community",
"repo": "fenix",
"repo": "fenix",
"rev": "
64d1607710b99e72d9afb2cde11bd1c2cea7cb91
",
"rev": "
b814c83d9e6aa5a28d0cf356ecfdafb2505ad37d
",
"type": "github"
"type": "github"
},
},
"original": {
"original": {
...
@@ -21,13 +127,31 @@
...
@@ -21,13 +127,31 @@
"type": "github"
"type": "github"
}
}
},
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1668450977,
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"flake-utils": {
"locked": {
"locked": {
"lastModified": 16
67395993
,
"lastModified": 16
59877975
,
"narHash": "sha256-
nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA
=",
"narHash": "sha256-
zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc
=",
"owner": "numtide",
"owner": "numtide",
"repo": "flake-utils",
"repo": "flake-utils",
"rev": "
5aed5285a952e0b949eb3ba02c12fa4fcfef535f
",
"rev": "
c0e246b9b83f637f4681389ecabcb2681b4f3af0
",
"type": "github"
"type": "github"
},
},
"original": {
"original": {
...
@@ -36,57 +160,228 @@
...
@@ -36,57 +160,228 @@
"type": "github"
"type": "github"
}
}
},
},
"naersk": {
"flake-utils-pre-commit": {
"inputs": {
"locked": {
"nixpkgs": [
"lastModified": 1644229661,
"nixpkgs"
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
]
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakeCompat": {
"flake": false,
"locked": {
"locked": {
"lastModified": 16
71096816
,
"lastModified": 16
50374568
,
"narHash": "sha256-
ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg
=",
"narHash": "sha256-
Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E
=",
"owner": "
nix-community
",
"owner": "
edolstra
",
"repo": "
naersk
",
"repo": "
flake-compat
",
"rev": "
d998160d6a076cfe8f9741e56aeec7e267e3e114
",
"rev": "
b4a34015c698c7793d592d66adbab377907a2be8
",
"type": "github"
"type": "github"
},
},
"original": {
"original": {
"owner": "nix-community",
"owner": "edolstra",
"repo": "naersk",
"repo": "flake-compat",
"type": "github"
}
},
"ghc-utils": {
"flake": false,
"locked": {
"lastModified": 1662774800,
"narHash": "sha256-1Rd2eohGUw/s1tfvkepeYpg8kCEXiIot0RijapUjAkE=",
"ref": "refs/heads/master",
"rev": "bb3a2d3dc52ff0253fb9c2812bd7aa2da03e0fea",
"revCount": 1072,
"type": "git",
"url": "https://gitlab.haskell.org/bgamari/ghc-utils"
},
"original": {
"type": "git",
"url": "https://gitlab.haskell.org/bgamari/ghc-utils"
}
},
"gomod2nix": {
"flake": false,
"locked": {
"lastModified": 1627572165,
"narHash": "sha256-MFpwnkvQpauj799b4QTBJQFEddbD02+Ln5k92QyHOSk=",
"owner": "tweag",
"repo": "gomod2nix",
"rev": "67f22dd738d092c6ba88e420350ada0ed4992ae8",
"type": "github"
},
"original": {
"owner": "tweag",
"repo": "gomod2nix",
"type": "github"
}
},
"mach-nix": {
"flake": false,
"locked": {
"lastModified": 1634711045,
"narHash": "sha256-m5A2Ty88NChLyFhXucECj6+AuiMZPHXNbw+9Kcs7F6Y=",
"owner": "DavHau",
"repo": "mach-nix",
"rev": "4433f74a97b94b596fa6cd9b9c0402104aceef5d",
"type": "github"
},
"original": {
"id": "mach-nix",
"type": "indirect"
}
},
"nix-pypi-fetcher": {
"flake": false,
"locked": {
"lastModified": 1669065297,
"narHash": "sha256-UStjXjNIuIm7SzMOWvuYWIHBkPUKQ8Id63BMJjnIDoA=",
"owner": "DavHau",
"repo": "nix-pypi-fetcher",
"rev": "a9885ac6a091576b5195d547ac743d45a2a615ac",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "nix-pypi-fetcher",
"type": "github"
"type": "github"
}
}
},
},
"nixpkgs": {
"nixpkgs": {
"locked": {
"locked": {
"lastModified": 1671780662,
"lastModified": 1674641431,
"narHash": "sha256-Tsc64sN8LLHa7eqDZVVeubI8CyqIjs9l5tQ5EeRlgvM=",
"narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1665349835,
"narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1672350804,
"narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=",
"owner": "NixOS",
"owner": "NixOS",
"repo": "nixpkgs",
"repo": "nixpkgs",
"rev": "
339063a22409514cb2baea677b329e618faa6a08
",
"rev": "
677ed08a50931e38382dbef01cba08a8f7eac8f6
",
"type": "github"
"type": "github"
},
},
"original": {
"original": {
"dir": "lib",
"owner": "NixOS",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"repo": "nixpkgs",
"type": "github"
"type": "github"
}
}
},
},
"parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1674771137,
"narHash": "sha256-Zpk1GbEsYrqKmuIZkx+f+8pU0qcCYJoSUwNz1Zk+R00=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7c7a8bce3dffe71203dcd4276504d1cb49dfe05f",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"poetry2nix": {
"flake": false,
"locked": {
"lastModified": 1666918719,
"narHash": "sha256-BkK42fjAku+2WgCOv2/1NrPa754eQPV7gPBmoKQBWlc=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "289efb187123656a116b915206e66852f038720e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "1.36.0",
"repo": "poetry2nix",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-utils": [
"d2n",
"flake-utils-pre-commit"
],
"nixpkgs": [
"d2n",
"nixpkgs"
]
},
"locked": {
"lastModified": 1646153636,
"narHash": "sha256-AlWHMzK+xJ1mG267FdT8dCq/HvLCA6jwmx2ZUy5O8tY=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "b6bc0b21e1617e2b07d8205e7fae7224036dfa4b",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"root": {
"inputs": {
"inputs": {
"
fenix": "fenix
",
"
d2n": "d2n
",
"
flake-utils": "flake-util
s",
"
nixpkgs": "nixpkg
s",
"
naersk": "naersk
",
"
parts": "parts
",
"
nixpkgs": "nixpkgs
"
"
rust-overlay": "rust-overlay
"
}
}
},
},
"rust-analyzer-src": {
"rust-analyzer-src": {
"flake": false,
"flake": false,
"locked": {
"locked": {
"lastModified": 16
7175013
9,
"lastModified": 16
5755728
9,
"narHash": "sha256-
xbL8BZU87rHfQkF3tuFXduNGPW8fDwFI+0fFmRJx66E
=",
"narHash": "sha256-
PRW+nUwuqNTRAEa83SfX+7g+g8nQ+2MMbasQ9nt6+UM
=",
"owner": "rust-lang",
"owner": "rust-lang",
"repo": "rust-analyzer",
"repo": "rust-analyzer",
"rev": "
a06525517b0b69cd97f2c39a4012d96f44bf0776
",
"rev": "
caf23f29144b371035b864a1017dbc32573ad56d
",
"type": "github"
"type": "github"
},
},
"original": {
"original": {
...
@@ -95,6 +390,27 @@
...
@@ -95,6 +390,27 @@
"repo": "rust-analyzer",
"repo": "rust-analyzer",
"type": "github"
"type": "github"
}
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1674786480,
"narHash": "sha256-n25V3Ug/dJewbJaxj1gL0cUMBdOonrVkIQCHd9yHHvw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "296dd673b46aaebe1c8355f1848ceb7c905dda35",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
}
},
},
"root": "root",
"root": "root",
...
...
This diff is collapsed.
Click to expand it.
flake.nix
+
53
−
71
View file @
5d913f70
{
{
inputs
=
{
inputs
.
nixpkgs
.
url
=
"github:nixos/nixpkgs/nixos-unstable"
;
nixpkgs
.
url
=
"github:NixOS/nixpkgs"
;
inputs
.
d2n
.
url
=
"github:nix-community/dream2nix"
;
flake-utils
.
url
=
"github:numtide/flake-utils"
;
inputs
.
d2n
.
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
inputs
.
parts
.
url
=
"github:hercules-ci/flake-parts"
;
fenix
=
{
inputs
.
rust-overlay
.
url
=
"github:oxalica/rust-overlay"
;
url
=
"github:nix-community/fenix"
;
inputs
.
rust-overlay
.
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
};
outputs
=
inp
:
naersk
=
{
inp
.
parts
.
lib
.
mkFlake
{
inputs
=
inp
;}
{
url
=
"github:nix-community/naersk"
;
systems
=
[
"x86_64-linux"
];
inputs
.
nixpkgs
.
follows
=
"nixpkgs"
;
imports
=
[
inp
.
d2n
.
flakeModuleBeta
];
};
perSystem
=
{
};
config
,
system
,
outputs
=
pkgs
,
{
self
...
,
nixpkgs
}:
let
,
flake-utils
cargoToml
=
builtins
.
fromTOML
(
builtins
.
readFile
./Cargo.toml
);
pkgsWithToolchain
=
pkgs
.
appendOverlays
[
inp
.
rust-overlay
.
overlays
.
default
];
,
fenix
,
naersk
toolchains
=
pkgsWithToolchain
.
rust-bin
.
stable
.
"
${
cargoToml
.
package
.
rust-version
}
"
;
}:
flake-utils
.
lib
.
eachDefaultSystem
(
system
:
# toolchain to use when building conduit, includes only cargo and rustc to reduce closure size
let
buildToolchain
=
toolchains
.
minimal
;
pkgs
=
nixpkgs
.
legacyPackages
.
${
system
};
# toolchain to use in development shell
# the "default" component set of toolchain adds rustfmt, clippy etc.
# Nix-accessible `Cargo.toml`
devToolchain
=
toolchains
.
default
.
override
{
cargoToml
=
builtins
.
fromTOML
(
builtins
.
readFile
./Cargo.toml
);
extensions
=
[
"rust-src"
];
};
# The Rust toolchain to use
toolchain
=
fenix
.
packages
.
${
system
}
.
toolchainOf
{
# flake outputs for conduit project
# Use the Rust version defined in `Cargo.toml`
conduitOutputs
=
config
.
dream2nix
.
outputs
.
conduit
;
channel
=
cargoToml
.
package
.
rust-version
;
in
{
dream2nix
.
inputs
.
conduit
=
{
# THE rust-version HASH
source
=
inp
.
self
;
sha256
=
"sha256-8len3i8oTwJSOJZMosGGXHBL5BVuGQnWOT2St5YAUFU="
;
projects
.
conduit
=
{
name
=
"conduit"
;
subsystem
=
"rust"
;
translator
=
"cargo-lock"
;
};
packageOverrides
=
{
"^.*"
.
set-toolchain
.
overrideRustToolchain
=
_
:
{
cargo
=
buildToolchain
;
rustc
=
buildToolchain
;
};
};
};
devShells
.
conduit
=
conduitOutputs
.
devShells
.
conduit
.
overrideAttrs
(
old
:
{
# export default crate sources for rust-analyzer to read
RUST_SRC_PATH
=
"
${
devToolchain
}
/lib/rustlib/src/rust/library"
;
nativeBuildInputs
=
(
old
.
nativeBuildInputs
or
[])
++
[
devToolchain
];
});
devShells
.
default
=
config
.
devShells
.
conduit
;
};
};
};
builder
=
(
pkgs
.
callPackage
naersk
{
inherit
(
toolchain
)
rustc
cargo
;
})
.
buildPackage
;
in
{
packages
.
default
=
builder
{
src
=
./.
;
nativeBuildInputs
=
(
with
pkgs
.
rustPlatform
;
[
bindgenHook
]);
};
devShells
.
default
=
pkgs
.
mkShell
{
# Rust Analyzer needs to be able to find the path to default crate
# sources, and it can read this environment variable to do so
RUST_SRC_PATH
=
"
${
toolchain
.
rust-src
}
/lib/rustlib/src/rust/library"
;
# Development tools
nativeBuildInputs
=
(
with
pkgs
.
rustPlatform
;
[
bindgenHook
])
++
(
with
toolchain
;
[
cargo
clippy
rust-src
rustc
rustfmt
]);
};
checks
=
{
packagesDefault
=
self
.
packages
.
${
system
}
.
default
;
devShellsDefault
=
self
.
devShells
.
${
system
}
.
default
;
};
});
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment