enforce new flake schema. formatting.
This commit is contained in:
parent
4b0a90e00d
commit
ecf5132cbb
121 changed files with 1606 additions and 1554 deletions
|
|
@ -2,13 +2,13 @@
|
|||
description = "MicroVM NixOS configurations";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
|
||||
microvm.url = "github:microvm-nix/microvm.nix";
|
||||
microvm.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
synix.url = "git+https://git.sid.ovh/sid/synix.git?ref=release-25.11";
|
||||
synix.imputs.nixpkgs.follows = "nixpkgs";
|
||||
synix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
@ -20,20 +20,22 @@
|
|||
let
|
||||
inherit (self) outputs;
|
||||
|
||||
supportedSystems = [
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
lib = nixpkgs.lib.extend (_final: _prev: inputs.synix.lib or { });
|
||||
|
||||
lib = nixpkgs.lib.extend (final: prev: inputs.synix.lib or { });
|
||||
inherit (lib.helpers) mkPkgs;
|
||||
|
||||
mkApp = program: description: {
|
||||
type = "app";
|
||||
inherit program;
|
||||
meta.description = description;
|
||||
};
|
||||
forAllSystems =
|
||||
function:
|
||||
lib.genAttrs systems (
|
||||
system:
|
||||
function (mkPkgs {
|
||||
inherit system;
|
||||
})
|
||||
);
|
||||
|
||||
mkNixosConfiguration =
|
||||
system: modules:
|
||||
|
|
@ -43,13 +45,20 @@
|
|||
inherit inputs outputs lib;
|
||||
};
|
||||
};
|
||||
|
||||
mkApp = program: description: {
|
||||
type = "app";
|
||||
inherit program;
|
||||
meta.description = description;
|
||||
};
|
||||
in
|
||||
{
|
||||
apps = forAllSystems (
|
||||
system:
|
||||
pkgs:
|
||||
let
|
||||
microvm = self.nixosConfigurations."microvm-${system}".config.microvm;
|
||||
inherit (nixpkgs.lib) getExe;
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
inherit (self.nixosConfigurations."microvm-${system}".config) microvm;
|
||||
inherit (pkgs.lib) getExe;
|
||||
in
|
||||
{
|
||||
rebuild = mkApp (getExe microvm.deploy.rebuild) "Rebuild the VM.";
|
||||
|
|
@ -57,34 +66,22 @@
|
|||
}
|
||||
);
|
||||
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
import ./pkgs { inherit pkgs; }
|
||||
);
|
||||
packages = forAllSystems (pkgs: import ./pkgs { inherit pkgs; });
|
||||
|
||||
overlays = import ./overlays { inherit (self) inputs; };
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
tmux
|
||||
];
|
||||
};
|
||||
# FIXME: `microvm.deploy.rebuild` does not seem to care about askpass
|
||||
# shellHook = ''
|
||||
# export SSH_ASKPASS="pass <SUDO_BUILD_HOST_PASSWORD>"
|
||||
# export SSH_ASKPASS_REQUIRE="force"
|
||||
# '';
|
||||
}
|
||||
);
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
tmux
|
||||
];
|
||||
};
|
||||
# FIXME: `microvm.deploy.rebuild` does not seem to care about askpass
|
||||
# shellHook = ''
|
||||
# export SSH_ASKPASS="pass <SUDO_BUILD_HOST_PASSWORD>"
|
||||
# export SSH_ASKPASS_REQUIRE="force"
|
||||
# '';
|
||||
});
|
||||
|
||||
nixosModules = import ./modules;
|
||||
|
||||
|
|
@ -92,5 +89,17 @@
|
|||
microvm-x86_64-linux = mkNixosConfiguration "x86_64-linux" [ ./config ];
|
||||
microvm-aarch64-linux = mkNixosConfiguration "aarch64-linux" [ ./config ];
|
||||
};
|
||||
|
||||
checks = forAllSystems (
|
||||
pkgs:
|
||||
let
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
in
|
||||
{
|
||||
inherit (inputs.synix.checks.${system}) pre-commit-check build-additions build-modifications;
|
||||
}
|
||||
);
|
||||
|
||||
inherit (inputs.synix) formatter;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue