From d269da3f1573e7bb3012d2adc5d2d3f7426b4ca4 Mon Sep 17 00:00:00 2001 From: larstvei Date: Sun, 6 Oct 2024 23:53:03 +0200 Subject: [PATCH] Move to hosts --- flake.nix | 48 +++++++++++++------ .../darwin-m1/configuration.nix | 2 +- hosts/nixos-intel-mbp/configuration.nix | 26 ++++++++++ 3 files changed, 61 insertions(+), 15 deletions(-) rename modules/macos.nix => hosts/darwin-m1/configuration.nix (96%) create mode 100644 hosts/nixos-intel-mbp/configuration.nix diff --git a/flake.nix b/flake.nix index e4cdc66..8f404d8 100644 --- a/flake.nix +++ b/flake.nix @@ -17,28 +17,48 @@ }; outputs = - { darwin, home-manager, ... }@inputs: + { + darwin, + nixpkgs, + home-manager, + ... + }@inputs: + let + homeConfig = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.larstvei = { + imports = [ + { _module.args = inputs; } + ./modules/home.nix + ]; + }; + }; + }; + in { darwinConfigurations."larstvei-macbookpro" = darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ + ./hosts/darwin-m1/configuration.nix ./modules/core.nix - ./modules/macos.nix home-manager.darwinModule - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.larstvei = { - imports = [ - { _module.args = inputs; } # <- one could ask, why? - ./modules/home.nix - ]; - }; - }; - } + homeConfig + ]; + }; + + nixosConfigurations."larstvei-nixos" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; # Or "aarch64-linux" for ARM systems + + modules = [ + ./hosts/nixos-intel-mbp/configuration.nix + ./modules/core.nix + + home-manager.nixosModule + homeConfig ]; }; }; diff --git a/modules/macos.nix b/hosts/darwin-m1/configuration.nix similarity index 96% rename from modules/macos.nix rename to hosts/darwin-m1/configuration.nix index 6c4b19a..e8374f9 100644 --- a/modules/macos.nix +++ b/hosts/darwin-m1/configuration.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: { - fonts.packages = import ./fonts.nix { inherit pkgs; }; + fonts.packages = import ../../modules/fonts.nix { inherit pkgs; }; users.users."larstvei".home = "/Users/larstvei"; diff --git a/hosts/nixos-intel-mbp/configuration.nix b/hosts/nixos-intel-mbp/configuration.nix new file mode 100644 index 0000000..e09a41e --- /dev/null +++ b/hosts/nixos-intel-mbp/configuration.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: +{ + networking.hostName = "larstvei-nixos"; + + time.timeZone = "Europe/Oslo"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + supportedLocales = [ "en_US.UTF-8" "nb_NO.UTF-8" ]; + }; + + users.users.larstvei = { + isNormalUser = true; + home = "/home/larstvei"; + extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.fish; + }; + + services = { + # Enable NetworkManager + networkmanager.enable = true; + }; + + # System state version + system.stateVersion = lib.mkDefault "24.11"; +}