aboutsummaryrefslogtreecommitdiff
path: root/modules/flake
diff options
context:
space:
mode:
Diffstat (limited to 'modules/flake')
-rw-r--r--modules/flake/darwin.nix22
-rw-r--r--modules/flake/home.nix22
-rw-r--r--modules/flake/nixos.nix45
-rw-r--r--modules/flake/systems.nix9
4 files changed, 98 insertions, 0 deletions
diff --git a/modules/flake/darwin.nix b/modules/flake/darwin.nix
new file mode 100644
index 0000000..84eb74d
--- /dev/null
+++ b/modules/flake/darwin.nix
@@ -0,0 +1,22 @@
+{ inputs, config, self, ... }:
+
+{
+ flake.darwinConfigurations = {
+ lilith = inputs.nix-darwin.lib.darwinSystem {
+ system = "aarch64-darwin";
+ specialArgs = { inherit inputs; host = "lilith"; };
+ modules = [
+ inputs.home-manager.darwinModules.home-manager
+ {
+ home-manager.extraSpecialArgs = { inherit inputs; };
+ home-manager.sharedModules = [ config.flake.homeModules.default ];
+ }
+ (self + /hosts/lilith/configuration.nix)
+ {
+ nixpkgs.config.allowUnfree = true;
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ }
+ ];
+ };
+ };
+}
diff --git a/modules/flake/home.nix b/modules/flake/home.nix
new file mode 100644
index 0000000..288b558
--- /dev/null
+++ b/modules/flake/home.nix
@@ -0,0 +1,22 @@
+{ inputs, self, ... }:
+
+let
+ inherit (inputs.nixpkgs) lib;
+ import-tree = inputs.import-tree.withLib lib;
+
+ homeModuleFiles = import-tree.leafs (self + /modules/home);
+in
+{
+ imports = [
+ inputs.home-manager.flakeModules.home-manager
+ ];
+
+ flake.homeModules = {
+ default = {
+ imports = homeModuleFiles ++ [
+ inputs.nixcord.homeModules.nixcord
+ inputs.spicetify-nix.homeManagerModules.spicetify
+ ];
+ };
+ };
+}
diff --git a/modules/flake/nixos.nix b/modules/flake/nixos.nix
new file mode 100644
index 0000000..efc6d15
--- /dev/null
+++ b/modules/flake/nixos.nix
@@ -0,0 +1,45 @@
+{ inputs, config, self, ... }:
+
+let
+ inherit (inputs.nixpkgs) lib;
+ import-tree = inputs.import-tree.withLib lib;
+
+ # Use import-tree.leafs to get list of NixOS module paths
+ nixosModuleFiles = import-tree.leafs (self + /modules/nixos);
+
+ # Common NixOS modules for all hosts
+ commonNixosModules = nixosModuleFiles ++ [
+ {
+ nixpkgs.config.allowUnfree = true;
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ }
+ ];
+
+ # Home-manager modules for hosts that use it
+ homeManagerModules = [
+ inputs.home-manager.nixosModules.home-manager
+ {
+ home-manager.extraSpecialArgs = { inherit inputs; };
+ home-manager.sharedModules = [ config.flake.homeModules.default ];
+ }
+ ];
+in
+{
+ flake.nixosConfigurations = {
+ adam = lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = { inherit inputs; host = "adam"; };
+ modules = commonNixosModules ++ homeManagerModules ++ [
+ (self + /hosts/adam/configuration.nix)
+ ];
+ };
+
+ sachiel = lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = { inherit inputs; host = "sachiel"; };
+ modules = commonNixosModules ++ [
+ (self + /hosts/sachiel/configuration.nix)
+ ];
+ };
+ };
+}
diff --git a/modules/flake/systems.nix b/modules/flake/systems.nix
new file mode 100644
index 0000000..e66e2e1
--- /dev/null
+++ b/modules/flake/systems.nix
@@ -0,0 +1,9 @@
+{ ... }:
+
+{
+ # Define systems for perSystem (even if we don't use it much)
+ systems = [
+ "x86_64-linux"
+ "aarch64-darwin"
+ ];
+}