summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-11 18:55:44 -0700
committerFuwn <[email protected]>2024-09-11 18:55:44 -0700
commitd375a65b2bb88643ecff38214e935a64e1ed2db9 (patch)
tree3ea9ba7eb3020ab115fbf9ae8ad69a5c9b9f9b54
parentbump: justfile (diff)
downloadnixos-config-d375a65b2bb88643ecff38214e935a64e1ed2db9.tar.xz
nixos-config-d375a65b2bb88643ecff38214e935a64e1ed2db9.zip
flake: flake-parts
-rw-r--r--flake.lock27
-rw-r--r--flake.nix135
2 files changed, 97 insertions, 65 deletions
diff --git a/flake.lock b/flake.lock
index fa77ecd..6a1d357 100644
--- a/flake.lock
+++ b/flake.lock
@@ -195,7 +195,9 @@
},
"flake-parts": {
"inputs": {
- "nixpkgs-lib": "nixpkgs-lib"
+ "nixpkgs-lib": [
+ "nixpkgs"
+ ]
},
"locked": {
"lastModified": 1725234343,
@@ -213,6 +215,24 @@
},
"flake-parts_2": {
"inputs": {
+ "nixpkgs-lib": "nixpkgs-lib"
+ },
+ "locked": {
+ "lastModified": 1725234343,
+ "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "flake-parts_3": {
+ "inputs": {
"nixpkgs-lib": [
"omnix",
"nixpkgs"
@@ -676,7 +696,7 @@
},
"nix-gaming": {
"inputs": {
- "flake-parts": "flake-parts",
+ "flake-parts": "flake-parts_2",
"nixpkgs": [
"nixpkgs"
],
@@ -908,7 +928,7 @@
"cachix-push": "cachix-push",
"cargo-doc-live": "cargo-doc-live",
"devour-flake": "devour-flake",
- "flake-parts": "flake-parts_2",
+ "flake-parts": "flake-parts_3",
"nix": "nix",
"nixpkgs": [
"nixpkgs"
@@ -1032,6 +1052,7 @@
"root": {
"inputs": {
"chaotic": "chaotic",
+ "flake-parts": "flake-parts",
"home-manager": "home-manager_2",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
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
+ ;
+ };
};
- };
+ };
};
}