16 files changed
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,8 @@
members = ["crates/*", "cmds/*"]
resolver = "2"
package.version = "0.1.0"
+package.edition = "2021"
+package.rust-version = "1.82.0"
[workspace.dependencies]
nixlike = { path = "./crates/nixlike" }
--- a/cmds/fleet/Cargo.toml
+++ b/cmds/fleet/Cargo.toml
@@ -3,7 +3,8 @@
description = "NixOS configuration management"
version = "0.2.0"
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
-edition = "2021"
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
nixlike.workspace = true
--- a/cmds/generator-helper/Cargo.toml
+++ b/cmds/generator-helper/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "fleet-generator-helper"
-edition = "2021"
version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
age.workspace = true
--- a/cmds/generator-helper/src/main.rs
+++ b/cmds/generator-helper/src/main.rs
@@ -234,8 +234,8 @@
let recipients = load_identities()?;
write_private(&recipients, &output, stdin(), encoding)?;
}
- Opts::Generate(gen) => {
- match gen {
+ Opts::Generate(generate) => {
+ match generate {
Generate::Ed25519 {
public,
private,
--- a/cmds/install-secrets/Cargo.toml
+++ b/cmds/install-secrets/Cargo.toml
@@ -1,8 +1,8 @@
[package]
name = "fleet-install-secrets"
version = "0.1.0"
-edition = "2021"
-rust-version = "1.77.2"
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
clap.workspace = true
--- a/cmds/terraform-provider-fleet/Cargo.toml
+++ b/cmds/terraform-provider-fleet/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "terraform-provider-fleet"
-edition = "2021"
version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
anyhow.workspace = true
--- a/crates/better-command/Cargo.toml
+++ b/crates/better-command/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "better-command"
version = "0.1.0"
-edition = "2021"
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
regex = "1.10"
--- a/crates/fleet-base/Cargo.toml
+++ b/crates/fleet-base/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "fleet-base"
-edition = "2021"
version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
age.workspace = true
--- a/crates/fleet-shared/Cargo.toml
+++ b/crates/fleet-shared/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "fleet-shared"
-edition = "2021"
version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
base64 = "0.22.1"
--- a/crates/nix-eval/Cargo.toml
+++ b/crates/nix-eval/Cargo.toml
@@ -1,8 +1,9 @@
[package]
name = "nix-eval"
-edition = "2021"
version.workspace = true
build = "build.rs"
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
anyhow.workspace = true
--- a/crates/nix-native-eval/Cargo.toml
+++ b/crates/nix-native-eval/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "nix-native-eval"
-edition = "2021"
version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
anyhow.workspace = true
--- a/crates/nixlike/Cargo.toml
+++ b/crates/nixlike/Cargo.toml
@@ -1,7 +1,8 @@
[package]
name = "nixlike"
version = "0.1.0"
-edition = "2021"
+edition.workspace = true
+rust-version.workspace = true
[dependencies]
thiserror.workspace = true
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
- "lastModified": 1731098351,
- "narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=",
+ "lastModified": 1739936662,
+ "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28",
+ "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",
"type": "github"
},
"original": {
@@ -22,11 +22,11 @@
]
},
"locked": {
- "lastModified": 1730504689,
- "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
+ "lastModified": 1738453229,
+ "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
- "rev": "506278e768c2a08bec68eb62932193e341f55c90",
+ "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
@@ -37,16 +37,16 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1731873344,
- "narHash": "sha256-bKfFggwcvvh9gmOsaMCXKVAGBfXCZZ6QrxLq9Nb1/vw=",
+ "lastModified": 1740339700,
+ "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "39e98fadd66c2564ac85b1f65bab89e044302c62",
+ "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195",
"type": "github"
},
"original": {
"owner": "nixos",
- "ref": "master",
+ "ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
@@ -56,7 +56,8 @@
"crane": "crane",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
- "rust-overlay": "rust-overlay"
+ "rust-overlay": "rust-overlay",
+ "shelly": "shelly"
}
},
"rust-overlay": {
@@ -66,11 +67,11 @@
]
},
"locked": {
- "lastModified": 1731820690,
- "narHash": "sha256-/hHFMTD+FGURXZ4JtfXoIgpy87zL505pVi6AL76Wc+U=",
+ "lastModified": 1740277845,
+ "narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "bbab2ab9e1932133b1996baa1dc00fefe924ca81",
+ "rev": "f933070c29f9c1c5457447a51903f27f76ebb519",
"type": "github"
},
"original": {
@@ -78,6 +79,21 @@
"repo": "rust-overlay",
"type": "github"
}
+ },
+ "shelly": {
+ "locked": {
+ "lastModified": 1737089050,
+ "narHash": "sha256-SQ22z9L7fSC8FWNIlImpKeBGBUPoWpsTy9uc75o7uK0=",
+ "owner": "CertainLach",
+ "repo": "shelly",
+ "rev": "b5fa6bb56dcd1541ec399ceab1e95a74872ecd34",
+ "type": "github"
+ },
+ "original": {
+ "owner": "CertainLach",
+ "repo": "shelly",
+ "type": "github"
+ }
}
},
"root": "root",
2 description = "NixOS configuration management";2 description = "NixOS configuration management";
33
4 inputs = {4 inputs = {
5 nixpkgs.url = "github:nixos/nixpkgs/master";5 nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
6 rust-overlay = {6 rust-overlay = {
7 url = "github:oxalica/rust-overlay";7 url = "github:oxalica/rust-overlay";
8 inputs.nixpkgs.follows = "nixpkgs";8 inputs.nixpkgs.follows = "nixpkgs";
12 inputs.nixpkgs-lib.follows = "nixpkgs";12 inputs.nixpkgs-lib.follows = "nixpkgs";
13 };13 };
14 crane.url = "github:ipetkov/crane";14 crane.url = "github:ipetkov/crane";
15 shelly.url = "github:CertainLach/shelly";
15 };16 };
16 outputs = inputs:17 outputs =
18 inputs:
17 inputs.flake-parts.lib.mkFlake {19 inputs.flake-parts.lib.mkFlake
20 {
18 inherit inputs;21 inherit inputs;
19 } {22 }
23 {
24 imports = [ inputs.shelly.flakeModule ];
20 flake = rec {25 flake = rec {
21 lib =26 lib =
22 (import ./lib {27 (import ./lib {
45 {
39 fleetConfigurations = {46 fleetConfigurations = {
40 version = 1;47 version = 1;
41 doc = ''48 doc = ''
42 The `fleetConfigurations` flake output defines fleet cluster configurations.49 The `fleetConfigurations` flake output defines fleet cluster configurations.
43 '';50 '';
44 inventory = output: {51 inventory = output: {
45 children =52 children = mapAttrs (configName: cluster: {
46 mapAttrs (configName: cluster: {
95 111
96 checks = let112 checks =
113 let
114 nixpkgsCraneLib = inputs.crane.mkLib pkgs;
97 packages = pkgs.callPackages ./pkgs {115 packages = pkgs.callPackages ./pkgs {
98 inherit craneLib;116 craneLib = nixpkgsCraneLib;
99 };117 };
100 prefixAttrs = prefix: attrs:118 prefixAttrs =
119 prefix: attrs:
106 })125 }) attrs;
107 attrs;
108 in126 in
109 127
128
110 (prefixAttrs "nixpkgs-" (removeAttrs packages ["fleet"]));129 (prefixAttrs "nixpkgs-" {
130 inherit (packages) fleet-install-secrets;
131 });
111 132
112 133
113 devShells = lib.mkIf deployerSystem {134 shelly.shells.default = lib.mkIf deployerSystem {
114 default = craneLib.devShell {135 factory = craneLib.devShell;
115 packages = with pkgs; [136 packages = with pkgs; [
116 rust137 rust
117 alejandra138 alejandra
128 rustPlatform.bindgenHook149 rustPlatform.bindgenHook
129 nixVersions.nix_2_22150 nixVersions.nix_2_22
130 ];151 ];
131 env.PROTOC = "${pkgs.protobuf}/bin/protoc";152 environment.PROTOC = "${pkgs.protobuf}/bin/protoc";
132 };
133 };153 };
134 formatter = pkgs.alejandra;154 formatter = pkgs.alejandra;
135 };155 };
--- a/lib/flakePart.nix
+++ b/lib/flakePart.nix
@@ -65,11 +65,12 @@
else data;
nixpkgs.buildUsing = mkOptionDefault bootstrapNixpkgs;
nixpkgs.overlays = [
- (final: prev:
- import ../pkgs {
+ (final: prev: {
+ inherit (import ../pkgs {
inherit (prev) callPackage;
craneLib = crane.mkLib prev;
- })
+ }) fleet-install-secrets;
+ })
];
};
}
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,3 @@
[toolchain]
-channel = "nightly-2024-11-12"
+channel = "1.85.0"
components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]