From 52ac07299f2342afe0c309f3b8be3ea05c7549ff Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 8 Dec 2024 13:58:02 -0800 Subject: refactor overall configuration The configuration of the various hosts and home-manager was becoming a bit complex for no valid reasons. Try to simplify this a bit. --- flake.nix | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 02a25cd..e82e17f 100644 --- a/flake.nix +++ b/flake.nix @@ -18,31 +18,32 @@ url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - devshell.url = "github:numtide/devshell"; - - # utils - futils.url = "github:numtide/flake-utils"; - flake-parts.url = "github:hercules-ci/flake-parts"; }; # Output config, or config for NixOS system - outputs = inputs: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - - systems = [ - "aarch64-darwin" - "x86_64-darwin" - - "aarch64-linux" - "x86_64-linux" - ]; - - imports = [ ./nix/flake/devshell.nix ./nix/flake/hosts.nix ]; + outputs = { nixpkgs, darwin, ... }@inputs: + let mkSystem = import ./nix/lib/mkSystem.nix { inherit nixpkgs inputs; }; + in { + nixosConfigurations.vm-aarch64 = mkSystem "vm-aarch64" { + system = "aarch64-linux"; + user = "fcuny"; + }; + + nixosConfigurations.vm-synology = mkSystem "vm-synology" { + system = "x86_64-linux"; + user = "fcuny"; + }; + + darwinConfigurations.macbook-air-m2 = mkSystem "macbook-air-m2" { + system = "aarch64-darwin"; + user = "fcuny"; + darwin = true; + }; + + darwinConfigurations.macbook-pro-intel = mkSystem "macbook-pro-intel" { + system = "x86_64-darwin"; + user = "fcuny"; + darwin = true; + }; }; } -- cgit 1.4.1