disko/flake.nix

55 lines
1.9 KiB
Nix
Raw Normal View History

2022-08-17 12:53:51 +00:00
{
2022-12-09 13:22:45 +00:00
description = "Disko - declarative disk partitioning";
2022-08-17 12:53:51 +00:00
2022-12-23 16:25:47 +00: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 12:53:51 +00:00
2022-12-09 13:22:45 +00:00
outputs = { self, nixpkgs, ... }: let
supportedSystems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
2022-10-23 10:29:30 +00:00
nixosModules.disko = import ./module.nix;
2022-08-17 12:53:51 +00:00
lib = import ./. {
inherit (nixpkgs) lib;
};
2022-12-09 13:22:45 +00:00
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
disko = pkgs.callPackage ./package.nix {};
2023-01-15 20:34:52 +00:00
disko-doc = pkgs.callPackage ./doc.nix { };
2022-12-09 13:22:45 +00:00
default = self.packages.${system}.disko;
2023-01-23 09:49:01 +00: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 09:49:01 +00:00
linuxPackages_bcachefs = pkgs.linuxPackagesFor self.packages.${pkgs.system}.linux-bcachefs;
2022-12-09 13:22:45 +00:00
});
# TODO: disable bios-related tests on aarch64...
2023-01-10 07:05:45 +00:00
# Run checks: nix flake check -L
2022-12-09 13:22:45 +00:00
checks = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
2023-01-10 07:05:45 +00:00
nixosTests = import ./tests {
2022-08-25 13:16:26 +00:00
inherit pkgs;
2022-08-17 12:53:51 +00:00
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
2023-01-10 07:05:45 +00:00
};
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
cd ${./.}
shellcheck disk-deactivate/disk-deactivate disko
touch $out
'';
in
nixosTests // { inherit shellcheck; });
2022-08-17 12:53:51 +00:00
};
}