nixos-anywhere/flake.nix

43 lines
1.6 KiB
Nix
Raw Permalink Normal View History

2022-12-09 16:04:16 +03:00
{
description = "A universal nixos installer, just needs ssh access to the target system";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; };
disko = { url = "github:nix-community/disko/master"; inputs.nixpkgs.follows = "nixpkgs"; };
# used for testing
2023-06-11 14:08:38 +03:00
nixos-2305.url = "github:NixOS/nixpkgs/release-23.05";
nixos-images.url = "github:nix-community/nixos-images";
2023-05-07 21:20:49 +03:00
nixos-images.inputs.nixos-unstable.follows = "nixpkgs";
2023-06-11 14:08:38 +03:00
nixos-images.inputs.nixos-2305.follows = "nixos-2305";
2023-01-12 05:34:12 +03:00
# used for development
2023-05-07 21:20:49 +03:00
treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
};
2022-12-09 16:04:16 +03:00
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
imports = [
./src/flake-module.nix
./tests/flake-module.nix
./docs/flake-module.nix
2023-01-12 05:34:12 +03:00
inputs.treefmt-nix.flakeModule
2022-12-21 21:34:34 +03:00
];
2023-01-12 05:34:12 +03:00
perSystem = { config, ... }: {
treefmt = {
projectRootFile = "flake.nix";
programs.mdsh.enable = true;
2023-01-12 05:34:12 +03:00
programs.nixpkgs-fmt.enable = true;
programs.shellcheck.enable = true;
programs.shfmt.enable = true;
2023-05-14 15:08:40 +03:00
programs.prettier.enable = true;
2023-05-14 15:12:42 +03:00
settings.formatter.prettier.options = [ "--prose-wrap" "always" ];
2023-01-12 05:34:12 +03:00
settings.formatter.shellcheck.options = [ "-s" "bash" ];
};
formatter = config.treefmt.build.wrapper;
};
2022-12-09 16:04:16 +03:00
};
}