aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix51
1 files changed, 33 insertions, 18 deletions
diff --git a/flake.nix b/flake.nix
index 7c3b59d..dd9358e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,27 +4,42 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+ flake-parts = {
+ url = "github:hercules-ci/flake-parts";
+ inputs.nixpkgs-lib.follows = "nixpkgs";
+ };
};
- outputs = inputs: {
- nixosConfigurations.kassouni-net = inputs.nixpkgs.lib.nixosSystem {
- specialArgs = { inherit inputs; };
- modules = [ ./configuration.nix ];
- };
+ outputs = inputs@{ flake-parts, nixpkgs, ... }:
+ flake-parts.lib.mkFlake { inherit inputs; } {
+
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
- packages = builtins.mapAttrs (system: pkgs: rec {
- website = import ./nix/site.nix { inherit pkgs; };
- cgit-theme = import ./git/theme.nix { inherit pkgs; };
- default = website;
- }) inputs.nixpkgs.legacyPackages;
+ perSystem = { pkgs, ... }: {
+ packages = rec {
+ website = import ./nix/site.nix { inherit pkgs; };
+ cgit-theme = import ./git/theme.nix { inherit pkgs; };
+ default = website;
+ };
- devShells = builtins.mapAttrs (system: pkgs: {
- default = pkgs.mkShell {
- packages = with pkgs; [
- just
- zola
- ];
+ devShells.default = pkgs.mkShell {
+ packages = with pkgs; [
+ just
+ zola
+ ];
+ };
+
+ formatter = pkgs.nixfmt-tree;
};
- }) inputs.nixpkgs.legacyPackages;
- };
+
+ flake.nixosConfigurations.kassouni-net = nixpkgs.lib.nixosSystem {
+ specialArgs = { inherit inputs; };
+ modules = [ ./configuration.nix ];
+ };
+ };
}