From f4dce4a0b48ea31e5de6a329912f0463ee518c6d Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Fri, 29 Mar 2024 18:15:04 +0000 Subject: [PATCH] okay let's see if darwin-configurations works --- .gitignore | 1 + darwin/maud/default.nix | 15 +++++++++++++++ flake.lock | 41 ++++++++++++++++++++++++++++++++--------- flake.nix | 32 ++++++++++++++++++++++++-------- 4 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 darwin/maud/default.nix diff --git a/.gitignore b/.gitignore index b2be92b..750baeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ result +result-* diff --git a/darwin/maud/default.nix b/darwin/maud/default.nix new file mode 100644 index 0000000..22c46da --- /dev/null +++ b/darwin/maud/default.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ ripgrep ]; + + services.nix-daemon.enable = true; + programs = { + fish.enable = true; + zsh.enable = true; + }; + + nix.settings.experimental-features = "nix-command flakes"; + + system.stateVersion = 4; + nixpkgs.hostPlatform = "x86_64-darwin"; +} diff --git a/flake.lock b/flake.lock index 0093f43..6805fb2 100644 --- a/flake.lock +++ b/flake.lock @@ -56,6 +56,26 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1711591334, + "narHash": "sha256-9d5ilxxq4CXw44eFw8VFrRneAKex7D8xjn95mwZjgf4=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "f0dd0838c3558b59dc3b726d8ab89f5b5e35c297", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "devshell": { "inputs": { "flake-utils": "flake-utils", @@ -375,11 +395,11 @@ "lix": { "flake": false, "locked": { - "lastModified": 1711639271, - "narHash": "sha256-SIdsZPOTKIkcTCm5e5bdIffC9UJygwQBEa4C55XUxJM=", + "lastModified": 1711732153, + "narHash": "sha256-edBKGW9NIEGwjLQjWxdig9eVms7NG/oBilI+7JixrpU=", "ref": "refs/heads/main", - "rev": "47b0967cd1a28b780558e9db403c8e28bae11a13", - "revCount": 15250, + "rev": "3754a2202b61aa59712baa3177a9bc18c2bb9e04", + "revCount": 15267, "type": "git", "url": "ssh://git@lix.systems/lix-project/lix" }, @@ -403,11 +423,11 @@ ] }, "locked": { - "lastModified": 1711647160, - "narHash": "sha256-I9WCwuRUU+LRBtcwLqCmfI2v1vbtXnfb6hxwT5mbEGc=", + "lastModified": 1711696613, + "narHash": "sha256-s7E5WBtEs91AkyzLpTCgFD3B5oAlfvCcqIhfAwUipVM=", "ref": "refs/heads/main", - "rev": "280c404856a313c83d4e8cc6d2d17d93e9b5363b", - "revCount": 32, + "rev": "9c691a41855d11d63ca9c1be12d8440577cb8782", + "revCount": 34, "type": "git", "url": "ssh://git@lix.systems/lix-project/nixos-module" }, @@ -491,7 +511,9 @@ "home-manager": [ "home-manager" ], - "nix-darwin": [], + "nix-darwin": [ + "darwin" + ], "nixpkgs": [ "nixpkgs" ], @@ -589,6 +611,7 @@ "root": { "inputs": { "artemist": "artemist", + "darwin": "darwin", "fonts": "fonts", "home-manager": "home-manager", "jovian": "jovian", diff --git a/flake.nix b/flake.nix index 497b7cd..70fb497 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.utils.follows = "utils"; }; + darwin = { + url = "github:lnl7/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; fonts = { url = "git+https://git.mildlyfunctional.gay/artemist/fonts.git"; inputs.artemist.follows = "artemist"; @@ -42,7 +46,7 @@ url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; - inputs.nix-darwin.follows = ""; + inputs.nix-darwin.follows = "darwin"; }; nix-index-database = { url = "github:nix-community/nix-index-database"; @@ -59,16 +63,16 @@ outputs = { self, - nixpkgs, + darwin, home-manager, - utils, + nixpkgs, nixvim, + utils, ... }@inputs: let - baseDir = ./system; lib = nixpkgs.lib; - makeSystem = + makeNixosSystem = module: lib.nixosSystem (rec { specialArgs = { @@ -79,11 +83,23 @@ { home-manager.extraSpecialArgs = specialArgs; } ] ++ [ module ]; }); + makeDarwinSystem = + module: + darwin.lib.darwinSystem rec { + specialArgs = { + inherit inputs; + }; + modules = [ + home-manager.darwinModules.home-manager + { home-manager.extraSpecialArgs = specialArgs; } + ] ++ [ module ]; + }; + makeConfigurations = + baseDir: make: lib.mapAttrs (name: _: make (baseDir + "/${name}")) (builtins.readDir baseDir); in { - nixosConfigurations = lib.mapAttrs (name: _: makeSystem (baseDir + "/${name}")) ( - builtins.readDir baseDir - ); + nixosConfigurations = makeConfigurations ./system makeNixosSystem; + darwinConfigurations = makeConfigurations ./darwin makeDarwinSystem; } // utils.lib.eachDefaultSystem ( system: