2024-08-04 20:11:31 -06:00
|
|
|
{
|
|
|
|
description = "Example Darwin system flake";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
railbird-secrets = {
|
|
|
|
url = "git+ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git";
|
|
|
|
};
|
|
|
|
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
|
|
|
|
|
|
|
# Optional: Declarative tap management
|
|
|
|
homebrew-core = {
|
|
|
|
url = "github:homebrew/homebrew-core";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
homebrew-cask = {
|
|
|
|
url = "github:homebrew/homebrew-cask";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-08-13 21:32:27 -06:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2024-08-04 20:11:31 -06:00
|
|
|
};
|
|
|
|
|
2024-08-13 21:32:27 -06:00
|
|
|
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, ... }:
|
2024-08-04 20:11:31 -06:00
|
|
|
let
|
2024-08-15 03:15:58 -06:00
|
|
|
libDir = ../dotfiles/lib;
|
2024-08-04 20:11:31 -06:00
|
|
|
configuration = { pkgs, config, ... }: {
|
2024-08-15 03:15:58 -06:00
|
|
|
networking.hostName = "mac-demarco-mini";
|
|
|
|
imports = [ (import ./gitea-actions-runner.nix) ];
|
|
|
|
services.gitea-actions-runner = {
|
|
|
|
instances.nix = {
|
|
|
|
enable = true;
|
|
|
|
name = config.networking.hostName;
|
|
|
|
url = "https://dev.railbird.ai";
|
|
|
|
token = "kf8TgHEf2JwWiusV80ZWo3t7lkEyB1pVgqRdK5ES";
|
|
|
|
labels = [
|
|
|
|
"nix-darwin-${pkgs.system}:host"
|
|
|
|
"nix:host"
|
|
|
|
];
|
|
|
|
settings = {
|
|
|
|
cache = {
|
|
|
|
enabled = true;
|
|
|
|
};
|
|
|
|
container = {
|
|
|
|
workdir_parent = "/var/lib/gitea-runner/workspace";
|
|
|
|
};
|
|
|
|
host = {
|
|
|
|
workdir_parent = "/var/lib/gitea-runner/action-cache-dir";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
hostPackages = with pkgs; [
|
|
|
|
bash
|
|
|
|
direnv
|
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
gawk
|
|
|
|
git-lfs
|
|
|
|
nixFlakes
|
|
|
|
gitFull
|
|
|
|
gnused
|
|
|
|
nodejs
|
|
|
|
openssh
|
|
|
|
wget
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Create the necessary directories
|
|
|
|
system.activationScripts.giteaRunnerDirs = ''
|
|
|
|
mkdir -p /var/lib/gitea-runner/workspace
|
|
|
|
mkdir -p /var/lib/gitea-runner/action-cache-dir
|
|
|
|
chown -R kat:staff /var/lib/gitea-runner
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
launchd.daemons.gitea-runner-nix.serviceConfig.EnvironmentVariables = {
|
|
|
|
XDG_CONFIG_HOME = "/var/lib/gitea-runner";
|
|
|
|
XDG_CACHE_HOME = "/var/lib/gitea-runner/.cache";
|
|
|
|
};
|
|
|
|
nixpkgs.overlays = [(import ../nixos/overlay.nix)];
|
2024-08-04 20:11:31 -06:00
|
|
|
environment.systemPackages = with pkgs; [
|
2024-08-15 03:15:58 -06:00
|
|
|
python-with-my-packages
|
2024-08-04 20:11:31 -06:00
|
|
|
emacs
|
2024-08-13 21:32:27 -06:00
|
|
|
alejandra
|
|
|
|
cocoapods
|
2024-08-04 20:11:31 -06:00
|
|
|
gitFull
|
2024-08-13 21:32:27 -06:00
|
|
|
just
|
2024-08-15 03:15:58 -06:00
|
|
|
tmux
|
2024-08-04 20:11:31 -06:00
|
|
|
nodePackages.prettier
|
2024-08-13 21:32:27 -06:00
|
|
|
nodejs
|
|
|
|
ripgrep
|
|
|
|
slack
|
|
|
|
typescript
|
2024-08-04 20:11:31 -06:00
|
|
|
vim
|
2024-08-13 21:32:27 -06:00
|
|
|
yarn
|
2024-08-04 20:11:31 -06:00
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
|
|
# Auto upgrade nix package and the daemon service.
|
|
|
|
services.nix-daemon.enable = true;
|
|
|
|
launchd.user.envVariables.PATH = config.environment.systemPath;
|
|
|
|
|
|
|
|
programs.direnv.enable = true;
|
|
|
|
|
|
|
|
# Necessary for using flakes on this system.
|
|
|
|
nix.settings.experimental-features = "nix-command flakes";
|
|
|
|
|
|
|
|
|
|
|
|
# Set Git commit hash for darwin-version.
|
|
|
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
|
|
|
2024-08-15 03:15:58 -06:00
|
|
|
# Used for backwards compatibility, please read the changelog before changing
|
2024-08-04 20:11:31 -06:00
|
|
|
system.stateVersion = 4;
|
|
|
|
|
|
|
|
# The platform the configuration will be used on.
|
|
|
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
|
|
|
users.users.kat.openssh.authorizedKeys.keys = inputs.railbird-secrets.keys.kanivanKeys;
|
2024-08-13 21:32:27 -06:00
|
|
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2024-08-15 03:15:58 -06:00
|
|
|
|
|
|
|
users.users.kat = {
|
|
|
|
name = "kat";
|
|
|
|
home = "/Users/kat";
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
shellInit = ''
|
|
|
|
fpath+="${libDir}/functions"
|
|
|
|
for file in "${libDir}/functions/"*
|
|
|
|
do
|
|
|
|
autoload "''${file##*/}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
interactiveShellInit = ''
|
|
|
|
# eval "$(register-python-argcomplete prb)"
|
|
|
|
# eval "$(register-python-argcomplete prod-prb)"
|
|
|
|
# eval "$(register-python-argcomplete railbird)"
|
|
|
|
# [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
|
|
|
|
|
|
|
autoload -Uz bracketed-paste-magic
|
|
|
|
zle -N bracketed-paste bracketed-paste-magic
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.kat = {
|
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
home.stateVersion = "24.05";
|
|
|
|
};
|
2024-08-04 20:11:31 -06:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2024-08-15 03:15:58 -06:00
|
|
|
darwinConfigurations."mac-demarco-mini" = nix-darwin.lib.darwinSystem {
|
2024-08-04 20:11:31 -06:00
|
|
|
modules = [
|
2024-08-13 21:32:27 -06:00
|
|
|
home-manager.darwinModules.home-manager
|
2024-08-04 20:11:31 -06:00
|
|
|
configuration
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Expose the package set, including overlays, for convenience.
|
|
|
|
darwinPackages = self.darwinConfigurations."Kats-Mac-mini".pkgs;
|
|
|
|
};
|
|
|
|
}
|