From 74c256ca04c8d2cfaea6408f0836d876485f8d3b Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 21 Jul 2023 13:58:49 +0200 Subject: [PATCH 1/3] nixosModules.installer: move into packages --- flake-parts/packages.nix | 13 ++++++++----- flake.nix | 7 ------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/flake-parts/packages.nix b/flake-parts/packages.nix index f8ce8a7..8ae436a 100644 --- a/flake-parts/packages.nix +++ b/flake-parts/packages.nix @@ -1,8 +1,11 @@ -{ self, ... }: { +{ self, lib, ... }: { flake.packages.x86_64-linux = { - inherit - (self.nixosConfigurations.installer.config.formats) - install-iso - ; + install-iso = (lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.installer + self.inputs.nixos-generators.nixosModules.all-formats + ]; + }).config.formats.install-iso; }; } diff --git a/flake.nix b/flake.nix index 8e4ddfe..9344ec6 100644 --- a/flake.nix +++ b/flake.nix @@ -21,13 +21,6 @@ ./pkgs/clan-cli/flake-module.nix ]; flake = { - nixosConfigurations.installer = lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - config.flake.nixosModules.installer - inputs.nixos-generators.nixosModules.all-formats - ]; - }; nixosModules = { installer = { imports = [ From ddaf55fd08cafe659b18f4a9e33e1de74d0fa4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jul 2023 14:00:52 +0200 Subject: [PATCH 2/3] flake: only expose nixpkgs-cached architectures --- flake.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9344ec6..3f0d862 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,12 @@ outputs = inputs @ { flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ lib, config, ... }: { - systems = lib.systems.flakeExposed; + systems = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; imports = [ ./flake-parts/packages.nix ./flake-parts/formatting.nix From 0b654c7434703ee2726153a325a42ff81a22a783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jul 2023 14:01:56 +0200 Subject: [PATCH 3/3] apply treefmt --- flake.nix | 2 +- pkgs/clan-cli/tests/test_cli.py | 7 +++++-- templates/python-project/tests/test_cli.py | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 3f0d862..888582a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ }; outputs = inputs @ { flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } ({ lib, config, ... }: { + flake-parts.lib.mkFlake { inherit inputs; } ({ ... }: { systems = [ "x86_64-linux" "aarch64-linux" diff --git a/pkgs/clan-cli/tests/test_cli.py b/pkgs/clan-cli/tests/test_cli.py index 4d6a440..2028602 100644 --- a/pkgs/clan-cli/tests/test_cli.py +++ b/pkgs/clan-cli/tests/test_cli.py @@ -1,10 +1,13 @@ import sys -import clan_cli import pytest +import clan_cli -def test_no_args(capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None: + +def test_no_args( + capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch +) -> None: monkeypatch.setattr(sys, "argv", [""]) clan_cli.main() captured = capsys.readouterr() diff --git a/templates/python-project/tests/test_cli.py b/templates/python-project/tests/test_cli.py index 8855774..6c6f124 100644 --- a/templates/python-project/tests/test_cli.py +++ b/templates/python-project/tests/test_cli.py @@ -11,7 +11,9 @@ def test_no_args(capsys: pytest.CaptureFixture) -> None: assert captured.out.startswith("usage:") -def test_version(capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None: +def test_version( + capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch +) -> None: monkeypatch.setattr(sys, "argv", ["", "--version"]) my_tool.my_cli() captured = capsys.readouterr()