summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix135
1 files changed, 73 insertions, 62 deletions
diff --git a/flake.nix b/flake.nix
index 8ee4543..c8a66a1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,6 +5,11 @@
systems.url = "github:nix-systems/default";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
+ flake-parts = {
+ url = "github:hercules-ci/flake-parts";
+ inputs.nixpkgs-lib.follows = "nixpkgs";
+ };
+
omnix = {
url = "github:juspay/omnix";
inputs.nixpkgs.follows = "nixpkgs";
@@ -83,85 +88,91 @@
nur,
pre-commit-hooks,
chaotic,
+ flake-parts,
...
}@inputs:
let
inherit (self) outputs;
+
lib = nixpkgs.lib // home-manager.lib;
forAllSystems = lib.genAttrs (import systems);
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
secrets = builtins.fromTOML (builtins.readFile "${self}/secrets/secrets.toml");
system = builtins.currentSystem;
in
- {
- inherit lib;
-
- packages = forAllSystems (system: {
- default = home-manager.defaultPackage."${system}";
- });
-
- formatter = forAllSystems (system: {
- default = nixpkgs.legacyPackages."${system}".nixfmt-rfc-style;
- });
-
- checks = forAllSystems (system: {
- pre-commit-check = pre-commit-hooks.lib.${system}.run {
- src = ./.;
-
- hooks = {
- deadnix.enable = true;
- flake-checker.enable = true;
- nixfmt-rfc-style.enable = true;
- statix.enable = true;
+ flake-parts.lib.mkFlake { inherit inputs; } {
+ systems = builtins.attrNames (forAllSystems (system: system));
+
+ flake = {
+ inherit lib;
+
+ packages = forAllSystems (system: {
+ default = home-manager.defaultPackage."${system}";
+ });
+
+ formatter = forAllSystems (system: {
+ default = nixpkgs.legacyPackages."${system}".nixfmt-rfc-style;
+ });
+
+ checks = forAllSystems (system: {
+ pre-commit-check = pre-commit-hooks.lib.${system}.run {
+ src = ./.;
+
+ hooks = {
+ deadnix.enable = true;
+ flake-checker.enable = true;
+ nixfmt-rfc-style.enable = true;
+ statix.enable = true;
+ };
};
- };
- });
+ });
- devShells = forAllSystems (system: {
- default = nixpkgs.legacyPackages.${system}.mkShell {
- inherit (self.checks.${system}.pre-commit-check) shellHook;
- buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
- };
- });
-
- nixosConfigurations.kansai = lib.nixosSystem {
- specialArgs = {
- inherit inputs outputs secrets;
- };
-
- modules = [
- home-manager.nixosModule
- pia.nixosModule
- nix-index-database.nixosModules.nix-index
- nur.nixosModules.nur
- chaotic.nixosModules.default
- ./hosts/kansai
- ];
- };
+ devShells = forAllSystems (system: {
+ default = nixpkgs.legacyPackages.${system}.mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+ buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
+ };
+ });
- homeConfigurations.ebisu =
- let
- username = "ebisu";
- flakeDirectory = ".nixos-config";
- in
- home-manager.lib.homeManagerConfiguration {
- pkgs = nixpkgsFor."${system}";
+ nixosConfigurations.kansai = lib.nixosSystem {
+ specialArgs = {
+ inherit inputs outputs secrets;
+ };
modules = [
- ./home/${username}
- chaotic.homeManagerModules.default
+ home-manager.nixosModule
+ pia.nixosModule
+ nix-index-database.nixosModules.nix-index
+ nur.nixosModules.nur
+ chaotic.nixosModules.default
+ ./hosts/kansai
];
+ };
- extraSpecialArgs = {
- inherit
- inputs
- outputs
- self
- secrets
- username
- flakeDirectory
- ;
+ homeConfigurations.ebisu =
+ let
+ username = "ebisu";
+ flakeDirectory = ".nixos-config";
+ in
+ home-manager.lib.homeManagerConfiguration {
+ pkgs = nixpkgsFor."${system}";
+
+ modules = [
+ ./home/${username}
+ chaotic.homeManagerModules.default
+ ];
+
+ extraSpecialArgs = {
+ inherit
+ inputs
+ outputs
+ self
+ secrets
+ username
+ flakeDirectory
+ ;
+ };
};
- };
+ };
};
}