Kieran's opinionated (and probably slightly dumb) nix config

feat: add darwin atalanta

dunkirk.sh cc30c989 10b2a294

verified
Changed files
+225 -5
machines
modules
home
+23 -2
README.md
···
├── dots # any config files that need to be symlinked go here, e.g. my hyprland config
│ └── wallpapers
├── machines
+
│ ├── atalanta # my macOS M4 machine
│ ├── ember # my dell r210 server (in my basement)
│ ├── moonlark # my framework 13
│ │ └── home
···
> [!WARNING]
> Also to note that this configuration will **not** work if you do not change any of the [secrets](./secrets) since they are encrypted.
-
You could either install a NixOS machine (rn there is just `moonlark`) or you can use the home-manager instructions
+
You could either install a NixOS machine (rn there is just `moonlark`), use the home-manager instructions, or use nix-darwin for macOS.
+
+
### macOS with nix-darwin
+
+
For macOS machines, you can use nix-darwin:
+
+
1. Install Nix using the determinate systems installer:
+
```bash
+
curl -fsSL https://install.determinate.systems/nix | sh -s -- install
+
```
+
+
2. Clone the repository:
+
```bash
+
git clone git@github.com:taciturnaxolotl/dots.git
+
cd dots
+
```
+
+
3. Apply the configuration:
+
```bash
+
darwin-rebuild switch --flake .#atalanta
+
```
### Home Manager
···
<details>
<summary>I've stuck the rest of the screenshots in a spoiler to preserve space</summary>
<br/>
-
+
**Last updated: 2024-12-27**
![the github page of this repo](.github/images/github.webp)
+22
flake.lock
···
"type": "github"
}
},
+
"nix-darwin": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1749744770,
+
"narHash": "sha256-MEM9XXHgBF/Cyv1RES1t6gqAX7/tvayBC1r/KPyK1ls=",
+
"owner": "nix-darwin",
+
"repo": "nix-darwin",
+
"rev": "536f951efb1ccda9b968e3c9dee39fbeb6d3fdeb",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-darwin",
+
"ref": "nix-darwin-25.05",
+
"repo": "nix-darwin",
+
"type": "github"
+
}
+
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
···
"home-manager": "home-manager_2",
"hyprland-contrib": "hyprland-contrib",
"import-tree": "import-tree",
+
"nix-darwin": "nix-darwin",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixpkgs": "nixpkgs_4",
"nixpkgs-unstable": "nixpkgs-unstable",
+20
flake.nix
···
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
+
# Nix-Darwin
+
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.05";
+
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
+
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
···
agenix,
home-manager,
nur,
+
nix-darwin,
...
}@inputs:
let
···
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
+
+
# Darwin configurations
+
# Available through 'darwin-rebuild switch --flake .#hostname'
+
darwinConfigurations = {
+
atalanta = nix-darwin.lib.darwinSystem {
+
system = "aarch64-darwin";
+
specialArgs = { inherit inputs outputs; };
+
modules = [
+
home-manager.darwinModules.home-manager
+
agenix.darwinModules.default
+
unstable-overlays
+
./machines/atalanta
+
];
+
};
+
};
};
}
+84
machines/atalanta/default.nix
···
+
{
+
inputs,
+
pkgs,
+
...
+
}: {
+
imports = [
+
./home-manager.nix
+
];
+
+
# Set host platform for Apple Silicon
+
nixpkgs = {
+
hostPlatform = "aarch64-darwin";
+
config = {
+
allowUnfree = true;
+
};
+
};
+
+
# Enable nix-darwin
+
nix.settings.experimental-features = [ "nix-command" "flakes" ];
+
+
# Set hostname
+
networking.hostName = "atalanta";
+
+
# Define user
+
users.users.kierank = {
+
name = "kierank";
+
home = "/Users/kierank";
+
};
+
+
system.primaryUser = "kierank";
+
+
ids.gids.nixbld = 350;
+
+
# Install packages
+
environment.systemPackages = [
+
# nix stuff
+
pkgs.nixd
+
pkgs.nil
+
pkgs.nixfmt-rfc-style
+
inputs.agenix.packages.aarch64-darwin.default
+
pkgs.lix
+
# dev_langs
+
pkgs.nodejs_22
+
pkgs.unstable.bun
+
pkgs.python3
+
pkgs.go
+
pkgs.gopls
+
pkgs.gotools
+
pkgs.go-tools
+
pkgs.gcc
+
pkgs.rustc
+
pkgs.cargo
+
pkgs.jdk23
+
pkgs.ruby
+
pkgs.cmake
+
pkgs.unstable.biome
+
pkgs.unstable.apktool
+
pkgs.nodePackages_latest.prisma
+
pkgs.unstable.zola
+
pkgs.mill
+
pkgs.clang
+
pkgs.clang-tools
+
pkgs.ninja
+
];
+
+
# import the secret
+
age.identityPaths = [
+
"/Users/kierank/.ssh/id_rsa"
+
];
+
age.secrets = {
+
wakatime = {
+
file = ../../secrets/wakatime.age;
+
path = "/Users/kierank/.wakatime.cfg";
+
owner = "kierank";
+
};
+
bluesky = {
+
file = ../../secrets/bluesky.age;
+
owner = "kierank";
+
};
+
};
+
+
# Used for backwards compatibility, please read the changelog before changing
+
system.stateVersion = 4;
+
}
+20
machines/atalanta/home-manager.nix
···
+
{
+
inputs,
+
outputs,
+
...
+
}: {
+
imports = [
+
# Import home-manager's Darwin module
+
inputs.home-manager.darwinModules.home-manager
+
];
+
+
home-manager = {
+
extraSpecialArgs = {
+
inherit inputs outputs;
+
};
+
users = {
+
# Import your home-manager configuration
+
kierank = import ./home;
+
};
+
};
+
}
+45
machines/atalanta/home/default.nix
···
+
{
+
inputs,
+
pkgs,
+
...
+
}:
+
{
+
imports = [
+
(inputs.import-tree ../../../modules/home)
+
];
+
+
nixpkgs.enable = true;
+
+
home = {
+
username = "kierank";
+
homeDirectory = "/Users/kierank";
+
packages = with pkgs; [
+
neofetch
+
inputs.nixvim.packages.${system}.default
+
vesktop
+
];
+
};
+
+
atelier = {
+
shell = {
+
enable = true;
+
};
+
terminal = {
+
ghostty = {
+
enable = true;
+
windowDecoration = true;
+
};
+
};
+
apps = {
+
irssi.enable = true;
+
spotify.enable = true;
+
crush.enable = true;
+
};
+
};
+
+
# Let Home Manager install and manage itself
+
programs.home-manager.enable = true;
+
+
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
+
home.stateVersion = "23.05";
+
}
+11 -3
modules/home/apps/ghostty.nix
···
-
{ lib, config, ... }:
+
{ lib, config, pkgs, ... }:
{
-
options.atelier.terminal.ghostty.enable = lib.mkEnableOption "Enable Ghostty terminal config";
+
options.atelier.terminal.ghostty = {
+
enable = lib.mkEnableOption "Enable Ghostty terminal config";
+
windowDecoration = lib.mkOption {
+
type = lib.types.bool;
+
default = false;
+
description = "Enable window decorations for Ghostty";
+
};
+
};
+
config = lib.mkIf config.atelier.terminal.ghostty.enable {
home.file.".config/ghostty/config".text = ''
foreground = "#a7b1d3"
mouse-hide-while-typing = true
resize-overlay = "never"
theme = "catppuccin-mocha"
-
window-decoration = false
+
window-decoration = ${if config.atelier.terminal.ghostty.windowDecoration then "true" else "false"}
window-padding-x = 12
window-padding-y = 12
keybind = ctrl+shift+w=close_surface