Initial nix-darwin config for mars

This commit is contained in:
2026-03-28 20:28:19 +01:00
parent bca195af38
commit a0e97dd1f5
3 changed files with 77 additions and 0 deletions

21
flake.lock generated
View File

@@ -1,5 +1,25 @@
{
"nodes": {
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1773000227,
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@@ -155,6 +175,7 @@
},
"root": {
"inputs": {
"darwin": "darwin",
"fw_nix": "fw_nix",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",

View File

@@ -20,6 +20,10 @@
url = "git+https://github.com/futureware-tech/nix.git";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:nix-darwin/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -28,6 +32,7 @@
nixpkgs,
home-manager,
vscode-server,
darwin,
...
}@inputs:
let
@@ -59,6 +64,28 @@
];
};
darwinConfigurations.mars = darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs.primaryUser = "artem";
modules = [
inputs.fw_nix.nixosModules.tools
inputs.fw_nix.nixosModules.nix-settings
inputs.fw_nix.nixosModules.futureware
({ lib, ... }: {
# TODO: find solution to these ugly workarounds
options.programs.htop = lib.mkOption {
type = lib.types.deferredModule;
default = { };
};
options.programs.git = lib.mkOption {
type = lib.types.deferredModule;
default = { };
};
})
./hosts/mars/darwin.nix
];
};
nixosConfigurations.deimos =
let
system = "x86_64-linux";

29
hosts/mars/darwin.nix Normal file
View File

@@ -0,0 +1,29 @@
{ pkgs, primaryUser, ... }:
{
nixpkgs.hostPlatform = "x86_64-darwin";
nixpkgs.config.allowUnfree = true;
system.primaryUser = primaryUser;
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true;
homebrew = {
enable = true;
onActivation = {
cleanup = "zap";
autoUpdate = true;
upgrade = true;
};
casks = [
"bambu-studio"
];
};
users.users."${primaryUser}" = {
name = primaryUser;
home = "/Users/${primaryUser}";
};
system.stateVersion = 6; # Never change.
}