diff --git a/darwin/configuration.nix b/darwin/configuration.nix new file mode 100644 index 00000000..db486b7c --- /dev/null +++ b/darwin/configuration.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: { + services.nix-daemon.enable = true; + nix = { + extraOptions = '' + experimental-features = nix-command flakes + ''; + package = pkgs.nixFlakes; + }; + environment.systemPackages = with pkgs; [ + awscli + ]; + system.stateVersion = 4; +} diff --git a/darwin/home-base.nix b/darwin/home-base.nix new file mode 100644 index 00000000..25fee15f --- /dev/null +++ b/darwin/home-base.nix @@ -0,0 +1,4 @@ +{ config, ... }: { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; +} diff --git a/darwin/home.nix b/darwin/home.nix new file mode 100644 index 00000000..68ddea43 --- /dev/null +++ b/darwin/home.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: { + home.packages = with pkgs; [ + ]; +} diff --git a/flake.lock b/flake.lock index a240836e..9e267175 100644 --- a/flake.lock +++ b/flake.lock @@ -86,11 +86,11 @@ }, "emacs-overlay": { "locked": { - "lastModified": 1649627566, - "narHash": "sha256-Y4YzRC1spD0fx2eypJfDdnmfsIsLLIg5Lx8QuQhkBwU=", + "lastModified": 1649647100, + "narHash": "sha256-JjIQlPUohatoXJWgC/QATwQ7GBf78fEOXiPm4WT7vIQ=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "d0381ae9f79f2a305b6003d0de15b431312c051a", + "rev": "4392b4c2b738c2447b796be2e27bb00d97aa0522", "type": "github" }, "original": { @@ -264,11 +264,11 @@ ] }, "locked": { - "lastModified": 1649392573, - "narHash": "sha256-dCPEJZzExz2+i7AjUuViZUgHC+JXDlBBG/IzuSYWCh8=", + "lastModified": 1649642044, + "narHash": "sha256-V9ZjTJcbDPgWG+H3rIC6XuPHZAPK1VupBbSsuDbptkQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "f911ebbec927e8e9b582f2e32e2b35f730074cfc", + "rev": "e39a9d0103e3b2e42059c986a8c633824b96c193", "type": "github" }, "original": { @@ -278,6 +278,26 @@ "type": "github" } }, + "home-manager-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs-darwin" + ] + }, + "locked": { + "lastModified": 1649642044, + "narHash": "sha256-V9ZjTJcbDPgWG+H3rIC6XuPHZAPK1VupBbSsuDbptkQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e39a9d0103e3b2e42059c986a8c633824b96c193", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1646131459, @@ -311,6 +331,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs-darwin" + ] + }, + "locked": { + "lastModified": 1648278671, + "narHash": "sha256-1WrR9ex+rKTjZtODNUZQhkWYUprtfOkjOyo9YWL2NMs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4fdbb8168f61d31d3f90bb0d07f48de709c4fe79", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-dns": { "inputs": { "flake-utils": "flake-utils_2", @@ -391,11 +432,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1649408932, - "narHash": "sha256-JhTW1OtS5fACcRXLqcTTQyYO5vLkO+bceCqeRms13SY=", + "lastModified": 1649497218, + "narHash": "sha256-groqC9m1P4hpnL6jQvZ3C8NEtduhdkvwGT0+0LUrcYw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "42948b300670223ca8286aaf916bc381f66a5313", + "rev": "fd364d268852561223a5ada15caad669fd72800e", "type": "github" }, "original": { @@ -405,6 +446,22 @@ "type": "github" } }, + "nixpkgs-darwin": { + "locked": { + "lastModified": 1649541905, + "narHash": "sha256-e8uePwD302weU4saoLg5uhb0yI5ZbHl/L49ncKejh5o=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "db81927829becddb57db2b3b3e34301ed4af8d0a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nose": { "flake": false, "locked": { @@ -423,11 +480,11 @@ }, "nur": { "locked": { - "lastModified": 1649634776, - "narHash": "sha256-EzjEH9w7zxFNqZR1CoYzRmx7QP09QML4eTpV+mEVt7c=", + "lastModified": 1649669925, + "narHash": "sha256-9NbeOUhAVsRhwN4YMtqJznYyO/1xSUgWfOCmOHg+vOQ=", "owner": "nix-community", "repo": "nur", - "rev": "dbcce784e210de2aa956d4245f505bd087671713", + "rev": "6902d2d240c9afbece10014e8df1ab3df453e509", "type": "github" }, "original": { @@ -542,11 +599,14 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils", "home-manager": "home-manager", + "home-manager-darwin": "home-manager-darwin", "impermanence": "impermanence", "katexprs": "katexprs", + "nix-darwin": "nix-darwin", "nix-dns": "nix-dns", "nix-doom-emacs": "nix-doom-emacs", "nixpkgs": "nixpkgs", + "nixpkgs-darwin": "nixpkgs-darwin", "nur": "nur", "tf-nix": "tf-nix", "trusted": "trusted" diff --git a/flake.nix b/flake.nix index f6e5b70a..66812573 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,11 @@ url = "github:kittywitch/anicca/main"; flake = false; }; + nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-21.11-darwin"; + nix-darwin.url = "github:lnl7/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs-darwin"; + home-manager-darwin.url = "github:nix-community/home-manager"; + home-manager-darwin.inputs.nixpkgs.follows = "nixpkgs-darwin"; nix-dns = { url = "github:kirelagin/nix-dns/master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -48,13 +53,23 @@ }; }; - outputs = { self, nixpkgs, flake-utils, ... }@inputs: - flake-utils.lib.eachDefaultSystem + outputs = { self, nixpkgs, flake-utils, nix-darwin, home-manager-darwin, ... }@inputs: { + darwinConfigurations."sumireko" = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + home-manager-darwin.darwinModules.home-manager + ./darwin/configuration.nix + ./darwin/home-base.nix + { home-manager.users.kat = import ./darwin/home.nix; } + ]; + }; + } // + (flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in { devShell = import ./devShell.nix { inherit inputs system; }; legacyPackages = import ./outputs.nix { inherit inputs system; }; } - ); + )); }