okay let's see if darwin-configurations works

This commit is contained in:
Artemis Tosini 2024-03-29 18:15:04 +00:00
parent c7b1179fb7
commit f4dce4a0b4
Signed by: artemist
SSH key fingerprint: SHA256:EsuWCwx6fjxxExxf65rX+ocQJJAdw4R1KarpFue6Uwc
4 changed files with 72 additions and 17 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
result
result-*

15
darwin/maud/default.nix Normal file
View file

@ -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";
}

View file

@ -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",

View file

@ -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: