diff options
author | Franck Cuny <franck@fcuny.net> | 2024-12-08 13:58:02 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2024-12-08 15:35:17 -0800 |
commit | 52ac07299f2342afe0c309f3b8be3ea05c7549ff (patch) | |
tree | bad76e67ba8a1f9301eb87a8c5e66c8a5a260e76 /flake.nix | |
parent | add targets to create virtual machines (diff) | |
download | world-52ac07299f2342afe0c309f3b8be3ea05c7549ff.tar.gz |
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.
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 47 |
1 files changed, 24 insertions, 23 deletions
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; + }; }; } |