diff --git a/.gitmodules b/.gitmodules index 298ae81..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "home/nvim"] - path = home/nvim - url = https://github.com/michaelthomson0797/nvim.git diff --git a/flake.lock b/flake.lock index 249eaac..663937e 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,26 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709001452, + "narHash": "sha256-FnZ54wkil54hKvr1irdKic1TE27lHQI9dKQmOJRrtlU=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "6c06334f0843c7300d1678726bb607ce526f6b36", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1708296515, @@ -39,6 +59,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index ac34d5b..30e676c 100644 --- a/flake.nix +++ b/flake.nix @@ -3,23 +3,33 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-darwin = { + url = "github:LnL7/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = inputs@{ self, nixpkgs, home-manager, ... }: { + outputs = inputs@{ self, nixpkgs, home-manager, nix-darwin, ... }: { nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ - ./system + ./hosts/nixos/configuration.nix + ]; + }; + }; - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.mthomson = import ./home; - } + darwinConfigurations = { + macbook = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/macbook/configuration.nix ]; }; }; diff --git a/home/nvim b/home/nvim deleted file mode 160000 index ccd3d56..0000000 --- a/home/nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ccd3d56eb3097febe89dccbfa39be088386e85b3 diff --git a/hosts/macbook/configuration.nix b/hosts/macbook/configuration.nix new file mode 100644 index 0000000..00d1535 --- /dev/null +++ b/hosts/macbook/configuration.nix @@ -0,0 +1,25 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + inputs.home-manager.nixosModules.default + ]; + + environment.systemPackages = with pkgs; [ + hello + ]; + + home-manager = { + extraSpecialArgs = { inherit inputs; }; + useGlobalPkgs = true; + useUserPackages = true; + users = { + "mthomson" = import ./home.nix; + }; + }; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + nix.package = pkgs.nix; +} diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix new file mode 100644 index 0000000..eae7695 --- /dev/null +++ b/hosts/macbook/home.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../../modules/home-manager/wezterm + ]; + home.username = "mthomson"; + home.homeDirectory = "/Users/mthomson"; + home.stateVersion = "23.11"; + + home.packages = with pkgs; [ + hello + cowsay + ]; + + programs.home-manager.enable = true; + programs.git.enable = true; +} diff --git a/system/default.nix b/hosts/nixos/configuration.nix similarity index 59% rename from system/default.nix rename to hosts/nixos/configuration.nix index c469259..3b3a068 100644 --- a/system/default.nix +++ b/hosts/nixos/configuration.nix @@ -8,25 +8,26 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + inputs.home-manager.nixosModules.default ]; - # Bootloader. +# Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. +# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Enable networking - networking.networkmanager.enable = true; +# Enable networking + networking.networkmanager.enable = true; - # Set your time zone. +# Set your time zone. time.timeZone = "America/Toronto"; - # Select internationalisation properties. +# Select internationalisation properties. i18n.defaultLocale = "en_CA.UTF-8"; - # i3 relates stuff +# i3 relates stuff environment.pathsToLink = [ "/libexec" ]; services.xserver = { enable = true; @@ -47,11 +48,11 @@ package = pkgs.i3-gaps; extraPackages = with pkgs; [ dmenu - i3status - i3lock - i3blocks - feh - arandr + i3status + i3lock + i3blocks + feh + arandr ]; }; @@ -59,7 +60,7 @@ xkbVariant = ""; }; - # pipewire +# pipewire security.rtkit.enable = true; services.pipewire = { enable = true; @@ -68,7 +69,7 @@ pulse.enable = true; }; - # Define a user account. Don't forget to set a password with ‘passwd’. +# Define a user account. Don't forget to set a password with ‘passwd’. users.users.mthomson = { isNormalUser = true; description = "Michael Thomson"; @@ -76,32 +77,41 @@ packages = with pkgs; []; }; - # Allow unfree packages +# Allow unfree packages nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; environment.systemPackages = with pkgs; [ neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - git - curl + wget + git + curl ]; environment.variables.EDITOR = "nvim"; + home-manager = { + extraSpecialArgs = { inherit inputs; }; + useGlobalPkgs = true; + useUserPackages = true; + users = { + "mthomson" = import ./home.nix; + }; + }; + programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ - # Add any missing dynamic libraries for unpackaged programs - # here, NOT in environment.systemPackages +# Add any missing dynamic libraries for unpackaged programs +# here, NOT in environment.systemPackages ]; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). +# This value determines the NixOS release from which the default +# settings for stateful data, like file locations and database versions +# on your system were taken. It‘s perfectly fine and recommended to leave +# this value at the release version of the first install of this system. +# Before changing this value read the documentation for this option +# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/system/hardware-configuration.nix b/hosts/nixos/hardware-configuration.nix similarity index 100% rename from system/hardware-configuration.nix rename to hosts/nixos/hardware-configuration.nix diff --git a/home/default.nix b/hosts/nixos/home.nix similarity index 100% rename from home/default.nix rename to hosts/nixos/home.nix diff --git a/home/i3/config b/modules/home-manager/i3/config similarity index 100% rename from home/i3/config rename to modules/home-manager/i3/config diff --git a/home/i3/default.nix b/modules/home-manager/i3/default.nix similarity index 100% rename from home/i3/default.nix rename to modules/home-manager/i3/default.nix diff --git a/home/wezterm/default.nix b/modules/home-manager/wezterm/default.nix similarity index 93% rename from home/wezterm/default.nix rename to modules/home-manager/wezterm/default.nix index 3a7f820..705b8c1 100644 --- a/home/wezterm/default.nix +++ b/modules/home-manager/wezterm/default.nix @@ -6,7 +6,7 @@ extraConfig = '' return { color_scheme = 'catppuccin-frappe', - -- font = wezterm.font('PragmataPro Liga'), + font = wezterm.font('PragmataPro Liga'), font_size = 16, use_fancy_tab_bar = false, native_macos_fullscreen_mode = false, diff --git a/home/wezterm/wezterm.lua b/modules/home-manager/wezterm/wezterm.lua similarity index 100% rename from home/wezterm/wezterm.lua rename to modules/home-manager/wezterm/wezterm.lua