difftreelog
chore update flake
in: trunk
16 files changed
Cargo.tomldiffbeforeafterboth--- 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" }
cmds/fleet/Cargo.tomldiffbeforeafterboth--- 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
cmds/generator-helper/Cargo.tomldiffbeforeafterboth--- 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
cmds/generator-helper/src/main.rsdiffbeforeafterboth--- 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,
cmds/install-secrets/Cargo.tomldiffbeforeafterboth--- 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
cmds/terraform-provider-fleet/Cargo.tomldiffbeforeafterboth--- 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
crates/better-command/Cargo.tomldiffbeforeafterboth--- 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"
crates/fleet-base/Cargo.tomldiffbeforeafterboth--- 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
crates/fleet-shared/Cargo.tomldiffbeforeafterboth--- 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"
crates/nix-eval/Cargo.tomldiffbeforeafterboth--- 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
crates/nix-native-eval/Cargo.tomldiffbeforeafterboth--- 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
crates/nixlike/Cargo.tomldiffbeforeafterboth--- 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
flake.lockdiffbeforeafterboth2 "nodes": {2 "nodes": {3 "crane": {3 "crane": {4 "locked": {4 "locked": {5 "lastModified": 1731098351,5 "lastModified": 1739936662,6 "narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=",6 "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",7 "owner": "ipetkov",7 "owner": "ipetkov",8 "repo": "crane",8 "repo": "crane",9 "rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28",9 "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",10 "type": "github"10 "type": "github"11 },11 },12 "original": {12 "original": {22 ]22 ]23 },23 },24 "locked": {24 "locked": {25 "lastModified": 1730504689,25 "lastModified": 1738453229,26 "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",26 "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",27 "owner": "hercules-ci",27 "owner": "hercules-ci",28 "repo": "flake-parts",28 "repo": "flake-parts",29 "rev": "506278e768c2a08bec68eb62932193e341f55c90",29 "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",30 "type": "github"30 "type": "github"31 },31 },32 "original": {32 "original": {37 },37 },38 "nixpkgs": {38 "nixpkgs": {39 "locked": {39 "locked": {40 "lastModified": 1731873344,40 "lastModified": 1740339700,41 "narHash": "sha256-bKfFggwcvvh9gmOsaMCXKVAGBfXCZZ6QrxLq9Nb1/vw=",41 "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=",42 "owner": "nixos",42 "owner": "nixos",43 "repo": "nixpkgs",43 "repo": "nixpkgs",44 "rev": "39e98fadd66c2564ac85b1f65bab89e044302c62",44 "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195",45 "type": "github"45 "type": "github"46 },46 },47 "original": {47 "original": {48 "owner": "nixos",48 "owner": "nixos",49 "ref": "master",49 "ref": "release-24.11",50 "repo": "nixpkgs",50 "repo": "nixpkgs",51 "type": "github"51 "type": "github"52 }52 }56 "crane": "crane",56 "crane": "crane",57 "flake-parts": "flake-parts",57 "flake-parts": "flake-parts",58 "nixpkgs": "nixpkgs",58 "nixpkgs": "nixpkgs",59 "rust-overlay": "rust-overlay"59 "rust-overlay": "rust-overlay",60 "shelly": "shelly"60 }61 }61 },62 },62 "rust-overlay": {63 "rust-overlay": {66 ]67 ]67 },68 },68 "locked": {69 "locked": {69 "lastModified": 1731820690,70 "lastModified": 1740277845,70 "narHash": "sha256-/hHFMTD+FGURXZ4JtfXoIgpy87zL505pVi6AL76Wc+U=",71 "narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",71 "owner": "oxalica",72 "owner": "oxalica",72 "repo": "rust-overlay",73 "repo": "rust-overlay",73 "rev": "bbab2ab9e1932133b1996baa1dc00fefe924ca81",74 "rev": "f933070c29f9c1c5457447a51903f27f76ebb519",74 "type": "github"75 "type": "github"75 },76 },76 "original": {77 "original": {77 "owner": "oxalica",78 "owner": "oxalica",78 "repo": "rust-overlay",79 "repo": "rust-overlay",79 "type": "github"80 "type": "github"80 }81 }81 }82 },83 "shelly": {84 "locked": {85 "lastModified": 1737089050,86 "narHash": "sha256-SQ22z9L7fSC8FWNIlImpKeBGBUPoWpsTy9uc75o7uK0=",87 "owner": "CertainLach",88 "repo": "shelly",89 "rev": "b5fa6bb56dcd1541ec399ceab1e95a74872ecd34",90 "type": "github"91 },92 "original": {93 "owner": "CertainLach",94 "repo": "shelly",95 "type": "github"96 }97 }82 },98 },83 "root": "root",99 "root": "root",84 "version": 7100 "version": 7flake.nixdiffbeforeafterboth--- a/flake.nix
+++ b/flake.nix
@@ -2,7 +2,7 @@
description = "NixOS configuration management";
inputs = {
- nixpkgs.url = "github:nixos/nixpkgs/master";
+ nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
@@ -12,126 +12,146 @@
inputs.nixpkgs-lib.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
+ shelly.url = "github:CertainLach/shelly";
};
- outputs = inputs:
- inputs.flake-parts.lib.mkFlake {
- inherit inputs;
- } {
- flake = rec {
- lib =
- (import ./lib {
- inherit (inputs.nixpkgs) lib;
- })
- // {
- fleetConfiguration = throw "function-based interface is deprecated, use flake-parts syntax instead";
+ outputs =
+ inputs:
+ inputs.flake-parts.lib.mkFlake
+ {
+ inherit inputs;
+ }
+ {
+ imports = [ inputs.shelly.flakeModule ];
+ flake = rec {
+ lib =
+ (import ./lib {
+ inherit (inputs.nixpkgs) lib;
+ })
+ // {
+ fleetConfiguration = throw "function-based interface is deprecated, use flake-parts syntax instead";
+ };
+ flakeModules.default = import ./lib/flakePart.nix {
+ inherit (inputs) crane;
};
- flakeModules.default = import ./lib/flakePart.nix {
- inherit (inputs) crane;
- };
- flakeModule = flakeModules.default;
+ flakeModule = flakeModules.default;
- fleetModules.tf = ./modules/extras/tf.nix;
+ fleetModules.tf = ./modules/extras/tf.nix;
- # To be used with https://github.com/NixOS/nix/pull/8892
- schemas = let
- inherit (inputs.nixpkgs.lib) mapAttrs;
- in {
- fleetConfigurations = {
- version = 1;
- doc = ''
- The `fleetConfigurations` flake output defines fleet cluster configurations.
- '';
- inventory = output: {
- children =
- mapAttrs (configName: cluster: {
- what = "fleet cluster configuration";
+ # To be used with https://github.com/NixOS/nix/pull/8892
+ schemas =
+ let
+ inherit (inputs.nixpkgs.lib) mapAttrs;
+ in
+ {
+ fleetConfigurations = {
+ version = 1;
+ doc = ''
+ The `fleetConfigurations` flake output defines fleet cluster configurations.
+ '';
+ inventory = output: {
+ children = mapAttrs (configName: cluster: {
+ what = "fleet cluster configuration";
- children =
- mapAttrs (hostName: host: {
+ children = mapAttrs (hostName: host: {
what = "host [${host.system}]";
- })
- cluster.config.hosts;
- # It is possible to implement this inventory right now, but I want to
- # get rid of `fleet.nix` file in the future.
- # children.secrets = { };
- })
- output;
+ }) cluster.config.hosts;
+ # It is possible to implement this inventory right now, but I want to
+ # get rid of `fleet.nix` file in the future.
+ # children.secrets = { };
+ }) output;
+ };
+ };
};
- };
};
- };
- # Supported and tested list of deployment targets.
- systems = ["x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux"];
- perSystem = {
- config,
- system,
- pkgs,
- ...
- }: let
- inherit (lib.attrsets) mapAttrs';
- inherit (lib.lists) elem;
- # Can also be built for darwin, through it is not usual to deploy nixos systems from macos machines.
- # I have no hardware for such testing, thus only adding machines I actually have and use.
- #
- # It is not possible to deploy any host from armv6/armv7 hardware, and I don't think it even makes sense.
- deployerSystems = ["aarch64-linux" "x86_64-linux"];
- deployerSystem = elem system deployerSystems;
- lib = pkgs.lib;
- rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
- craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rust;
- in {
- _module.args.pkgs = import inputs.nixpkgs {
- inherit system;
- overlays = [(inputs.rust-overlay.overlays.default)];
- };
- # Reference fleet package should be built with nightly rust, specified in rust-toolchain.toml.
- packages = lib.mkIf deployerSystem (let
- packages = pkgs.callPackages ./pkgs {
- inherit craneLib;
- };
- in
- packages // {default = packages.fleet;});
- # fleet-install-secrets will not be built normally, because they are not ran directly by user most of the time.
- # checks there build packages for default nixpkgs rustPlatform packages.
- checks = let
- packages = pkgs.callPackages ./pkgs {
- inherit craneLib;
- };
- prefixAttrs = prefix: attrs:
- mapAttrs' (name: value: {
- name = "${prefix}${name}";
- value = value.overrideAttrs (prev: {
- pname = "${prefix}${prev.pname}";
+ # Supported and tested list of deployment targets.
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "armv7l-linux"
+ "armv6l-linux"
+ ];
+ perSystem =
+ {
+ config,
+ system,
+ pkgs,
+ ...
+ }:
+ let
+ inherit (lib.attrsets) mapAttrs';
+ inherit (lib.lists) elem;
+ # Can also be built for darwin, through it is not usual to deploy nixos systems from macos machines.
+ # I have no hardware for such testing, thus only adding machines I actually have and use.
+ #
+ # It is not possible to deploy any host from armv6/armv7 hardware, and I don't think it even makes sense.
+ deployerSystems = [
+ "aarch64-linux"
+ "x86_64-linux"
+ ];
+ deployerSystem = elem system deployerSystems;
+ lib = pkgs.lib;
+ rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
+ craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rust;
+ in
+ {
+ _module.args.pkgs = import inputs.nixpkgs {
+ inherit system;
+ overlays = [ (inputs.rust-overlay.overlays.default) ];
+ };
+ # Reference fleet package should be built with nightly rust, specified in rust-toolchain.toml.
+ packages = lib.mkIf deployerSystem (
+ let
+ packages = pkgs.callPackages ./pkgs {
+ inherit craneLib;
+ };
+ in
+ packages // { default = packages.fleet; }
+ );
+ # fleet-install-secrets will not be built normally, because they are not ran directly by user most of the time.
+ # checks there build packages for default nixpkgs rustPlatform packages.
+ checks =
+ let
+ nixpkgsCraneLib = inputs.crane.mkLib pkgs;
+ packages = pkgs.callPackages ./pkgs {
+ craneLib = nixpkgsCraneLib;
+ };
+ prefixAttrs =
+ prefix: attrs:
+ mapAttrs' (name: value: {
+ name = "${prefix}${name}";
+ value = value.overrideAttrs (prev: {
+ pname = "${prefix}${prev.pname}";
+ });
+ }) attrs;
+ in
+ # fleet-install-secrets is installed to remote systems, thus needs to work
+ # with rust in nixpkgs.
+ (prefixAttrs "nixpkgs-" {
+ inherit (packages) fleet-install-secrets;
});
- })
- attrs;
- in
- # `fleet` crate wants nightly rust, also little sense of supporting it on stable nixpkgs.
- (prefixAttrs "nixpkgs-" (removeAttrs packages ["fleet"]));
- # TODO: It should be possible to move lib.mkIf to default attribute, instead of disabling the whole
- # devShells block, yet nix flake check fails here, due to no default shell found. It is nix or flake-parts bug?
- devShells = lib.mkIf deployerSystem {
- default = craneLib.devShell {
- packages = with pkgs; [
- rust
- alejandra
- cargo-edit
- cargo-udeps
- cargo-fuzz
- cargo-watch
- cargo-outdated
+ # TODO: It should be possible to move lib.mkIf to default attribute, instead of disabling the whole
+ # devShells block, yet nix flake check fails here, due to no default shell found. It is nix or flake-parts bug?
+ shelly.shells.default = lib.mkIf deployerSystem {
+ factory = craneLib.devShell;
+ packages = with pkgs; [
+ rust
+ alejandra
+ cargo-edit
+ cargo-udeps
+ cargo-fuzz
+ cargo-watch
+ cargo-outdated
- pkg-config
- openssl
- bacon
- nil
- rustPlatform.bindgenHook
- nixVersions.nix_2_22
- ];
- env.PROTOC = "${pkgs.protobuf}/bin/protoc";
+ pkg-config
+ openssl
+ bacon
+ nil
+ rustPlatform.bindgenHook
+ nixVersions.nix_2_22
+ ];
+ environment.PROTOC = "${pkgs.protobuf}/bin/protoc";
+ };
+ formatter = pkgs.alejandra;
};
- };
- formatter = pkgs.alejandra;
};
- };
}
lib/flakePart.nixdiffbeforeafterboth--- 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;
+ })
];
};
}
rust-toolchain.tomldiffbeforeafterboth--- 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"]