From c77f30372eb1fdd138b24fd201a88a9d644b1db9 Mon Sep 17 00:00:00 2001 From: Ethan Reece Date: Sat, 28 Jun 2025 04:05:43 -0500 Subject: [PATCH] Init flake --- .gitignore | 1 + Justfile | 5 ++ flake.lock | 69 ++++++++++++++++++++++ flake.nix | 42 +++++++++++++ home/home.nix | 60 +++++++++++++++++++ hosts/Ethans-MacBook-Air/configuration.nix | 28 +++++++++ 6 files changed, 205 insertions(+) create mode 100644 .gitignore create mode 100644 Justfile create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/home.nix create mode 100644 hosts/Ethans-MacBook-Air/configuration.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..973f9e4 --- /dev/null +++ b/Justfile @@ -0,0 +1,5 @@ +default: build system +system: + sudo ./result/sw/bin/darwin-rebuild switch --flake . +build: + nix build .#darwinConfigurations.Ethans-MacBook-Air.system diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..19c53f4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,69 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750973805, + "narHash": "sha256-BZXgag7I0rnL/HMHAsBz3tQrfKAibpY2vovexl2lS+Y=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "080e8b48b0318b38143d5865de9334f46d51fce3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750618568, + "narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1751083014, + "narHash": "sha256-JXvmXZfENnpo6U6wR7/0Wd7v411E2ugCFXYRREii4Pw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "499e024bffc54a2e180f7958ba1bb3771af58ce8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..43ac7c0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "Nix configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + + nix-darwin.url = "github:lnl7/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs @ { self, ... }: let + nixpkgsConfig = { + config.allowUnfree = true; + }; + in { + darwinConfigurations = let + inherit (inputs.nix-darwin.lib) darwinSystem; + in { + Ethans-MacBook-Air = darwinSystem { + system = "aarch64-darwin"; + + specialArgs = { inherit inputs; }; + + modules = [ + ./hosts/Ethans-MacBook-Air/configuration.nix + inputs.home-manager.darwinModules.home-manager + { + nixpkgs = nixpkgsConfig; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.ethanreece = import ./home/home.nix; + } + ]; + }; + }; + }; +} + diff --git a/home/home.nix b/home/home.nix new file mode 100644 index 0000000..51c1c1c --- /dev/null +++ b/home/home.nix @@ -0,0 +1,60 @@ +{ pkgs, ... }: + +{ + home = { + stateVersion = "23.11"; + packages = with pkgs; [ + htop + curl + coreutils + appcleaner + nil + grandperspective + iterm2 + ]; + shell = { + enableNushellIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + }; + }; + + programs = { + helix = { + enable = true; + defaultEditor = true; + }; + nushell = { + enable = true; + + }; + starship = { + enable = true; + enableFishIntegration = true; + enableNushellIntegration = true; + enableZshIntegration = true; + }; + git = { + enable = true; + delta = { + enable = true; + }; + signing = { + format = "openpgp"; + signByDefault = true; + }; + userEmail = "git@ethanreece.com"; + userName = "Ethan Reece"; + }; + }; + + services = { + gpg-agent = { + enable = true; + enableFishIntegration = true; + enableNushellIntegration = true; + enableZshIntegration = true; + }; + }; +} + diff --git a/hosts/Ethans-MacBook-Air/configuration.nix b/hosts/Ethans-MacBook-Air/configuration.nix new file mode 100644 index 0000000..5ac109a --- /dev/null +++ b/hosts/Ethans-MacBook-Air/configuration.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +# _: + +{ + system = { + stateVersion = 6; + primaryUser = "ethanreece"; + }; + + users.users.ethanreece = { + name = "ethanreece"; + home = "/Users/ethanreece"; + shell = pkgs.nushell; + }; + + nix.extraOptions = '' + auto-optimise-store = true + experimental-features = nix-command flakes + extra-platforms = x86_64-darwin aarch64-darwin + ''; + + programs = { + fish.enable = true; + zsh.enable = true; + }; + + home-manager.backupFileExtension = "backup"; +}