add darawin flakes

This commit is contained in:
James Walker 2022-05-31 10:38:16 -04:00
parent 8bb6ffce43
commit 860435e50d
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 45 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/.direnv
/result

22
flake.lock generated
View File

@ -1,5 +1,26 @@
{
"nodes": {
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1651916036,
"narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"deploy-rs": {
"inputs": {
"flake-compat": "flake-compat",
@ -181,6 +202,7 @@
},
"root": {
"inputs": {
"darwin": "darwin",
"deploy-rs": "deploy-rs",
"dotfiles": "dotfiles",
"flake-compat": "flake-compat_2",

View File

@ -7,6 +7,11 @@
flake-utils.url = "github:numtide/flake-utils";
deploy-rs.url = "github:serokell/deploy-rs";
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
@ -28,6 +33,7 @@
{ self
, nixpkgs
, deploy-rs
, darwin
, flake-utils
, home-manager
, sops-nix
@ -36,7 +42,6 @@
}@inputs:
let
mkSystem = hostName: system: modules:
nixpkgs.lib.nixosSystem {
system = system;
modules = [
@ -47,6 +52,17 @@
] ++ modules;
specialArgs = inputs;
};
mkDarwin = hostName: system: modules:
darwin.lib.darwinSystem {
system = system;
modules = [
home-manager.darwinModules.home-manager
({ config, ... }: {
networking.hostName = hostName;
})
] ++ modules;
specialArgs = inputs;
};
in
flake-utils.lib.eachDefaultSystem
(system:
@ -67,6 +83,9 @@
plato = mkSystem "plato" "x86_64-linux" [ ./hosts/plato/configuration.nix ];
socrates = mkSystem "socrates" "x86_64-linux" [ ./hosts/socrates/configuration.nix ];
};
darwinConfigurations = {
epicurus = mkDarwin "epicurus" "aarch64-darwin" [ ./hosts/epicurus/darwin-configuration.nix ];
};
deploy.nodes = {
agent = {

View File

@ -1,12 +1,6 @@
{ config, lib, pkgs, ... }:
let
dotfiles = builtins.fetchTarball
"https://github.com/walkah/dotfiles/archive/main.tar.gz";
in
{ config, lib, pkgs, dotfiles, ... }:
{
imports = [
<home-manager/nix-darwin>
./homebrew.nix
../../modules/builder
];
@ -33,7 +27,7 @@ in
nix = {
package = pkgs.nix;
trustedUsers = [ "root" "@wheel" ];
trustedUsers = [ "root" "@admin" ];
extraOptions = ''
extra-platforms = x86_64-darwin aarch64-darwin