✨ add darawin flakes
This commit is contained in:
parent
8bb6ffce43
commit
860435e50d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/.direnv
|
||||
/result
|
22
flake.lock
generated
22
flake.lock
generated
@ -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",
|
||||
|
21
flake.nix
21
flake.nix
@ -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 = {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user