diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..d6f9967 --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742013980, + "narHash": "sha256-34YbfwABU5nb0F5eaaJE3ujldaNDhmyxw7CWqhXJV08=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "9175b4bb5f127fb7b5784b14f7e01abff24c378f", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1741865919, + "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..0b3db5c --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Example nix-darwin system flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:LnL7/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + # home-manager.url = "github:nix-community/home-manager/release-24.05"; + # home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ self, nix-darwin, nixpkgs }: + let + configuration = { pkgs, ... }: { + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = + with pkgs; [ + vim + typescript-language-server + (pkgs.lua5_1.withPackages (ps: with ps; [luarocks])) + ]; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + nix.settings.extra-platforms = "x86_64-darwin aarch64-darwin"; + + # Enable alternative shell support in nix-darwin. + # programs.fish.enable = true; + + # Set Git commit hash for darwin-version. + system.configurationRevision = self.rev or self.dirtyRev or null; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; + }; + in + { + # Build darwin flake using: + # $ darwin-rebuild build --flake .#simple + darwinConfigurations."macbook" = nix-darwin.lib.darwinSystem { + # system = "aarch64-darwin"; + modules = [ + # home-manager.darwinModules.home-manager + configuration + ]; + }; + }; +} diff --git a/nix/nix.conf b/nix/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/nix/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes