disko/flake.nix

55 lines
1.9 KiB
Nix
Raw Normal View History

2022-08-17 15:53:51 +03:00
{
2022-12-09 16:22:45 +03:00
description = "Disko - declarative disk partitioning";
2022-08-17 15:53:51 +03:00
2022-12-23 19:25:47 +03:00
# FIXME: in future we don't want lock here to give precedence to a USB live-installer's registry,
# but garnix currently does not allow this.
#inputs.nixpkgs.url = "nixpkgs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2022-08-17 15:53:51 +03:00
2022-12-09 16:22:45 +03:00
outputs = { self, nixpkgs, ... }: let
supportedSystems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
2022-10-23 13:29:30 +03:00
nixosModules.disko = import ./module.nix;
2022-08-17 15:53:51 +03:00
lib = import ./. {
inherit (nixpkgs) lib;
};
2022-12-09 16:22:45 +03:00
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
disko = pkgs.callPackage ./package.nix {};
2023-01-15 23:34:52 +03:00
disko-doc = pkgs.callPackage ./doc.nix { };
2022-12-09 16:22:45 +03:00
default = self.packages.${system}.disko;
2023-01-23 12:49:01 +03:00
# The way bcachefs support is maintained in nixpkgs is prone to breakage.
# That's why we need to maintain a fork here:
# https://github.com/NixOS/nixpkgs/issues/212086
linux-bcachefs = pkgs.callPackage ./linux-testing-bcachefs.nix {};
});
legacyPackages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
2023-01-23 12:49:01 +03:00
linuxPackages_bcachefs = pkgs.linuxPackagesFor self.packages.${pkgs.system}.linux-bcachefs;
2022-12-09 16:22:45 +03:00
});
# TODO: disable bios-related tests on aarch64...
2023-01-10 10:05:45 +03:00
# Run checks: nix flake check -L
2022-12-09 16:22:45 +03:00
checks = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
2023-01-10 10:05:45 +03:00
nixosTests = import ./tests {
2022-08-25 16:16:26 +03:00
inherit pkgs;
2022-08-17 15:53:51 +03:00
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
2023-01-10 10:05:45 +03:00
};
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
cd ${./.}
shellcheck disk-deactivate/disk-deactivate disko
touch $out
'';
in
nixosTests // { inherit shellcheck; });
2022-08-17 15:53:51 +03:00
};
}