Compare commits
66
Commits
static
...
edd232e6be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edd232e6be
|
||
|
|
8ebed5d954
|
||
|
|
491340bf93
|
||
|
|
a765e2074c
|
||
|
|
f1a178b329
|
||
|
|
033811d35b
|
||
|
|
d3fc1ff511
|
||
|
|
b493b18e5e
|
||
|
|
445cfec422
|
||
|
|
b5478e2f9d
|
||
|
|
c6a08cb43a
|
||
|
|
d74de8b58c
|
||
|
|
12adcfed1c
|
||
|
|
e325cff1be
|
||
|
|
24c8eef831
|
||
|
|
91507f173d
|
||
|
|
354443653f
|
||
|
|
745547bd2a
|
||
|
|
c41912da8f
|
||
|
|
134385bc53
|
||
|
|
263faa78c4
|
||
|
|
5db0125c8a
|
||
|
|
f8b57a1708
|
||
|
|
9224f30970
|
||
|
|
397a5c8fc3
|
||
|
|
eabc84c914
|
||
|
|
51f1b9ea7d
|
||
|
|
d47b6f7d7d
|
||
|
|
7debc16e21
|
||
|
|
d29c5b67d4
|
||
|
|
3018e057d7
|
||
|
|
50898e30aa
|
||
|
|
ce9475e001
|
||
|
|
a37e25329a
|
||
|
|
3975092d67
|
||
|
|
a2c2b2a2e5
|
||
|
|
0c0c94e4bf
|
||
|
|
a659a07637
|
||
|
|
60531ed270
|
||
|
|
e6e62a375c
|
||
|
|
58ade9d886
|
||
|
|
eb2bdc2d33
|
||
|
|
c4fb365814
|
||
|
|
b4383e0d19
|
||
|
|
e57b3e6937
|
||
|
|
0938c76f1b
|
||
|
|
2e02f82ae2
|
||
|
|
2c380eaf10
|
||
|
|
76061f4919
|
||
|
|
159daf0630
|
||
|
|
82419c57ad
|
||
|
|
6df89b4b06
|
||
|
|
3fabad4344
|
||
|
|
616a81d29d
|
||
|
|
5a1da34702
|
||
|
|
8b813e6345
|
||
|
|
080cd5b1cc
|
||
|
|
28a2a91d93
|
||
|
|
f878110e49
|
||
|
|
a57b0f2fef
|
||
|
|
0160a8aa80
|
||
|
|
3b688fd5a2
|
||
|
|
0ee7266b3d
|
||
|
|
ecb0dc092e | ||
|
|
97248c0da3
|
||
|
|
7819928be2
|
@@ -0,0 +1,19 @@
|
|||||||
|
name: Nix Flake Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v26
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
- name: Run nix flake check
|
||||||
|
run: nix flake check
|
||||||
@@ -6,3 +6,6 @@ result
|
|||||||
|
|
||||||
# nix pre-commit autogenerated by devShell
|
# nix pre-commit autogenerated by devShell
|
||||||
/.pre-commit-config.yaml
|
/.pre-commit-config.yaml
|
||||||
|
|
||||||
|
# agy sessions
|
||||||
|
.antigravitycli
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
# AGENTS.md
|
||||||
|
|
||||||
|
Repository of personal dotfiles managed via Nix (home-manager, nix-darwin, NixOS) + GNU Stow for legacy config files.
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
flake.nix — Flake entrypoint: home/darwin/nixos configurations
|
||||||
|
hosts/ — Per-machine config files
|
||||||
|
deimos/ — Linux server (NixOS machine + home-manager user)
|
||||||
|
mars/ — macOS laptop (nix-darwin machine + home-manager user)
|
||||||
|
common/home.nix — Per-user git config shared across hosts
|
||||||
|
modules/ — Reusable exported modules
|
||||||
|
home/*.nix — Shared home-manager modules (common, linux-headless, mac-portable)
|
||||||
|
nixos/*.nix — NixOS modules (linux-headless, linux-lxc, jailed-agy)
|
||||||
|
darwin/*.nix — nix-darwin modules (mac-portable)
|
||||||
|
migrated/ — Raw dotfiles (.zshrc, .vimrc) managed by BOTH stow and home-manager
|
||||||
|
legacy/ — Non-Nix config files managed purely via `stow legacy`
|
||||||
|
```
|
||||||
|
|
||||||
|
## Key Conventions
|
||||||
|
|
||||||
|
### Flake inputs span multiple Nix versions
|
||||||
|
|
||||||
|
The flake uses two nixpkgs sources: `nixpkgs` (nixos-unstable) for Linux, and `nixpkgs-mars` (nixpkgs-26.05-darwin) for macOS. The `darwin`, `home-manager-mars`, and `nix-homebrew` inputs all follow `-mars`. When the darwin-specific inputs are eventually dropped, the flake can be simplified (see comment at `flake.nix:52`).
|
||||||
|
|
||||||
|
### Dual-dotfile management
|
||||||
|
|
||||||
|
The `migrated/` and `legacy/` directories use GNU Stow to symlink files into `$HOME`. Home-manager also sources `migrated/.zshrc` and `migrated/.vimrc` at runtime via path detection — it checks for a local checkout first (`~/dotfiles/migrated/...`) before falling back to the Nix-built path. This allows live editing without rebuilding.
|
||||||
|
|
||||||
|
### Module resolution
|
||||||
|
|
||||||
|
Host-level files import shared modules in a chain rather than flat-merging:
|
||||||
|
|
||||||
|
- `hosts/<name>/home.nix` → imports `hosts/common/home.nix` at minimum
|
||||||
|
- `modules/home/linux-headless.nix` and `mac-portable.nix` both import `modules/home/common.nix`
|
||||||
|
|
||||||
|
### Secrets via `identities` input
|
||||||
|
|
||||||
|
The `fw_nix` input (`futureware-tech/nix`) provides an `identities` module used across all configurations. It exposes:
|
||||||
|
|
||||||
|
- `identities.users.${user}.sign.<keyname>.publicKey` — SSH signing keys
|
||||||
|
- `identities.getAccessKeys { user = ...; }` — authorized_keys for login
|
||||||
|
- `identities.getSigningEntries {}` — git signers file entries
|
||||||
|
|
||||||
|
These are passed via `specialArgs.primaryUser` and the `fw_nix.nixosModules.identities` import. Any host config that touches SSH keys or git signing depends on this.
|
||||||
|
|
||||||
|
### SOPS / AGE encryption
|
||||||
|
|
||||||
|
Secrets are encrypted with AGE using hardware-backed identities (Apple Secure Enclave, Yubikey). The identities file lives at `~/.config/sops/age/keys.txt` (Linux) or `~/Library/Application Support/sops/age/keys.txt` (macOS). Decryption only works on the hardware device; the identity files themselves are not sensitive.
|
||||||
|
|
||||||
|
### Jailed AGY wrapper
|
||||||
|
|
||||||
|
The `jailed-agy.nix` module wraps `antigravity-cli` in a sandbox via `jail.nix`. It's highly custom: sets up local pip/ruby/gem paths, forwards Nix vars, bind-mounts Nix store for `nix-shell`, and blocks root. If you need to add tools or adjust the jail, modify the combinator list there.
|
||||||
|
|
||||||
|
### macOS SSH agent is Secretive
|
||||||
|
|
||||||
|
On Mars (macOS), `SSH_AUTH_SOCK` points to the Secretive app socket manually (not a generic ssh-agent). This was a deliberate tradeoff: `ssh-agent-mux` doesn't work well with Secretive + YubiKey agent together. Commit signing keys use the `key::` SSH URI format (`gpg.format = "ssh"`).
|
||||||
|
|
||||||
|
### stateVersion immutability
|
||||||
|
|
||||||
|
Both `modules/nixos/linux-headless.nix` and `modules/darwin/mac-portable.nix` have `"Never change"` comments next to `system.stateVersion`. Do not modify these.
|
||||||
|
|
||||||
|
## Essential Commands
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| -------------------------------------------- | ----------------------------------------------------------------- |
|
||||||
|
| `nix flake check` | Run pre-commit hooks (nixfmt, dead code checks via git-hooks.nix) |
|
||||||
|
| `nix develop` | Enter dev shell with pre-commit hook packages available |
|
||||||
|
| `home-manager switch --flake .#artem@deimos` | Apply home-manager config for deimos (Linux) |
|
||||||
|
| `home-manager switch --flake .#artem@mars` | Apply home-manager config for mars (macOS) |
|
||||||
|
| `darwin-rebuild switch --flake .#mars` | Apply nix-darwin config for mars |
|
||||||
|
| `nixos-rebuild switch --flake .#deimos` | Apply NixOS config for deimos |
|
||||||
|
| `stow legacy` | Symlink non-Nix configs from `legacy/` into `$HOME` |
|
||||||
|
|
||||||
|
### Pre-commit exclusions
|
||||||
|
|
||||||
|
The git-hooks.nix pre-commit check explicitly excludes `migrated/` and `legacy/` paths. Formatting tools only run on `.nix` files in `hosts/`, `modules/`, `flake.nix`, etc.
|
||||||
|
|
||||||
|
## Gotchas
|
||||||
|
|
||||||
|
- **Unused `with pkgs`** — `modules/nixos/linux-headless.nix:14` has an unnecessary `with pkgs; [...]` that nixd warns about but is left as-is since the `[` immediately after it makes the block valid. Consider removing when editing that file.
|
||||||
|
- **SSH_AUTH_SOCK in tmux** — The tmux config hardcodes `SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock`. On Linux this is a socket symlinked by home-manager; on macOS Secretive provides it. Changing this path breaks SSH inside tmux.
|
||||||
|
- **Home-assistant sshfs mount** — The deimos home config mounts a remote Home Assistant directory via sshfs. The `umount.fuse.sshfs` wrapper script in `linux-headless.nix` is required because of SUID restrictions on fusermount.
|
||||||
|
- **Direnv + nix-direnv** — Enabled globally; `.envrc` files use `use flake` to enter dev shells automatically.
|
||||||
|
- **Zsh loads from file, not Nix attrSet** — The `.zshrc` is sourced as a raw file path (not via `programs.zsh.initExtra`). Modifications to zsh behavior may need to go in either the Nix config (`initContent`) or the raw `migrated/.zshrc` depending on whether you want persistence outside Nix.
|
||||||
Generated
+98
-106
@@ -3,16 +3,16 @@
|
|||||||
"brew-src": {
|
"brew-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778146321,
|
"lastModified": 1785710351,
|
||||||
"narHash": "sha256-HeBwuJmuBioZHyZqDOcf7W/xsMFupSD583v6I5Cl7a8=",
|
"narHash": "sha256-DTL5T9+HlblsnXCEdxRpEo/2NBHD3t48BS7r+PTf090=",
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"rev": "af835384ac574f76025adb38b292b04cecee1f1f",
|
"rev": "7b0f22a4ab77567edef114c8dfc423fb96e2fbaa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"ref": "5.1.10",
|
"ref": "6.0.15",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -20,19 +20,20 @@
|
|||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs-mars"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777780666,
|
"lastModified": 1783744694,
|
||||||
"narHash": "sha256-8wURyQMdDkGUarSTKOGdCuFfYiwa3HbzwscUfn3STDE=",
|
"narHash": "sha256-2cp6N3rrwnGYLTx9l6N+NI+kwrCWxvJUbj5WJhvB29A=",
|
||||||
"owner": "nix-darwin",
|
"owner": "nix-darwin",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "8c62fba0854ba15c8917aed18894dbccb48a3777",
|
"rev": "c3e90c89649b07d1a96e4b9dd6cd0d6e44b91a74",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-darwin",
|
"owner": "nix-darwin",
|
||||||
|
"ref": "nix-darwin-26.05",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -69,21 +70,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_3"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681202837,
|
"lastModified": 1772408722,
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -96,11 +97,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778705491,
|
"lastModified": 1783867522,
|
||||||
"narHash": "sha256-LOZbixhLsv2QbUbqH+I06eRMAI7FBDDkGoMWH523OkE=",
|
"narHash": "sha256-rJUjsQbVFWWFQ7Xwt69Ad76v7OIpDXbqzW25d+I2BBs=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "b6fb4221bd5f54bc427de84230e0c95952399c21",
|
"rev": "e132e29c641ee55aba9ad08507ace53e19cf2b3e",
|
||||||
"revCount": 25,
|
"revCount": 47,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/futureware-tech/nix.git"
|
"url": "https://github.com/futureware-tech/nix.git"
|
||||||
},
|
},
|
||||||
@@ -112,18 +113,17 @@
|
|||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"fw_nix",
|
"fw_nix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778507602,
|
"lastModified": 1783008725,
|
||||||
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
|
"narHash": "sha256-jGiy6+sxjNWXSjp25uoJuNfyH9zBK1PEDY0lVoL4ibQ=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
|
"rev": "bca82caa46d5ec0f5d422c61fb1e30bc51313cbe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -135,17 +135,16 @@
|
|||||||
"git-hooks_2": {
|
"git-hooks_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
"gitignore": "gitignore_2",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778507602,
|
"lastModified": 1784288435,
|
||||||
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
|
"narHash": "sha256-ReRHaLgr/uVqdD8afFSn+myXIfpHeOhP0yYe0TJqAA8=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
|
"rev": "43b3c1ab9d40fb1dbb008f451988a91e375825e9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -154,49 +153,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"fw_nix",
|
|
||||||
"git-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"git-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -204,11 +160,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778503501,
|
"lastModified": 1786031233,
|
||||||
"narHash": "sha256-08L/X4/do7nET4rzidJ76eV/1r+mB7DchVpdPypsghc=",
|
"narHash": "sha256-TIDlLTLI1/pB7IqgjzcKQjpODQsZE2oII4XGG9B6KjI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "85ba629c79449badf4338117c27f0ee92b4b9f1a",
|
"rev": "7834e82588860aaf780cec1366524456a70898d7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -217,13 +173,34 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"home-manager-mars": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-mars"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785119570,
|
||||||
|
"narHash": "sha256-Rgs2xKnGLFWQscxUaXX07oyZeuMDOHEbqDOsgliLFGM=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "d4fd24667c8cbef124bb70a20380cab75ec8474d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-26.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"jail-nix": {
|
"jail-nix": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772137954,
|
"lastModified": 1776230864,
|
||||||
"narHash": "sha256-h4MGNbOo7L3RHi4uNFmsg5g17/DHXEfnv/xiG6BrNFQ=",
|
"narHash": "sha256-YsEjjdOsGEzTeD+iT7ONh071BqWAOQWpzYVei3okAXE=",
|
||||||
"owner": "~alexdavid",
|
"owner": "~alexdavid",
|
||||||
"repo": "jail.nix",
|
"repo": "jail.nix",
|
||||||
"rev": "42b355c38ca63dab4904acc5c0d95f17954a8c9b",
|
"rev": "404e7da9da5ab9aa643666682b2ba1312fa5fbe8",
|
||||||
"type": "sourcehut"
|
"type": "sourcehut"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -237,11 +214,11 @@
|
|||||||
"brew-src": "brew-src"
|
"brew-src": "brew-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778332591,
|
"lastModified": 1786217209,
|
||||||
"narHash": "sha256-ctJ3ADtugrnbMfMBobA645gCqXVIyHnsCNMkVaIuSiM=",
|
"narHash": "sha256-rusAj5QBnbSwXG6csns6dwxTeCOGRcj08VmlnhUQ6ZY=",
|
||||||
"owner": "zhaofengli",
|
"owner": "zhaofengli",
|
||||||
"repo": "nix-homebrew",
|
"repo": "nix-homebrew",
|
||||||
"rev": "7d0038b5bb60568ec41f5f4ef5067cd221ca7c0d",
|
"rev": "486357ea434dc0061ea52121ff99b1d33096c811",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -252,11 +229,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777954456,
|
"lastModified": 1786106723,
|
||||||
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
"narHash": "sha256-zDSUbpoeo/9ZmD2+wXnzxoo1+uhL8vxc0b8yuYMKYq0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
"rev": "f13ff45afd1bb73e640eaa08a7066dbed07e3238",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -266,15 +243,48 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772328832,
|
||||||
|
"narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-mars": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785067121,
|
||||||
|
"narHash": "sha256-rdJdWxAcg5fnntU4DjPivPdVEN4F+VJavw+UWpEMeUI=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "329c3d2af6d1b618705150ea39f72c15eb4e613e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-26.05-darwin",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"fw_nix": "fw_nix",
|
"fw_nix": "fw_nix",
|
||||||
"git-hooks": "git-hooks_2",
|
"git-hooks": "git-hooks_2",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"home-manager-mars": "home-manager-mars",
|
||||||
"jail-nix": "jail-nix",
|
"jail-nix": "jail-nix",
|
||||||
"nix-homebrew": "nix-homebrew",
|
"nix-homebrew": "nix-homebrew",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-mars": "nixpkgs-mars",
|
||||||
"systems": "systems_2",
|
"systems": "systems_2",
|
||||||
"vscode-server": "vscode-server"
|
"vscode-server": "vscode-server"
|
||||||
}
|
}
|
||||||
@@ -309,34 +319,16 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vscode-server": {
|
"vscode-server": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-parts": "flake-parts"
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770124655,
|
"lastModified": 1784312229,
|
||||||
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=",
|
"narHash": "sha256-2uHCSUw341o3my1R0U0YCfbnMEazylxb58evWsjGL50=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-vscode-server",
|
"repo": "nixos-vscode-server",
|
||||||
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0",
|
"rev": "2f984dfbe7e5271b5c413d3e734374cc1306c921",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -3,22 +3,24 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nixpkgs-mars.url = "github:nixos/nixpkgs/nixpkgs-26.05-darwin";
|
||||||
systems.url = "github:nix-systems/default";
|
systems.url = "github:nix-systems/default";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
vscode-server = {
|
home-manager-mars = {
|
||||||
url = "github:nix-community/nixos-vscode-server";
|
url = "github:nix-community/home-manager/release-26.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs-mars";
|
||||||
};
|
};
|
||||||
|
vscode-server.url = "github:nix-community/nixos-vscode-server";
|
||||||
fw_nix = {
|
fw_nix = {
|
||||||
url = "git+https://github.com/futureware-tech/nix.git";
|
url = "git+https://github.com/futureware-tech/nix.git";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:nix-darwin/nix-darwin";
|
url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs-mars";
|
||||||
};
|
};
|
||||||
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
||||||
git-hooks = {
|
git-hooks = {
|
||||||
@@ -39,23 +41,33 @@
|
|||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
trustedSSHKeys = [
|
homeManagerUser = "artem";
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxRBsFGa8OFbviYDGSAKLgfm/K2XUxvCo+31FW37yab artem"
|
|
||||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPAtIXXHm58julnr7S0xzBTM1jN5JkKxOL4JpuWDOa2jAAAABHNzaDo= office-dock-usb-a"
|
|
||||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHY1xx0huqV6Mcc2WngYDabITeNUbGamJ8//206MxxVTAAAABHNzaDo= keychain-usb-c"
|
|
||||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHzY2eOz+JdaKOpIgZbF5FsZzQy0l8vPJjAQdTpBFGsoAAAABHNzaDo= safe"
|
|
||||||
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJg7zQ4H0LQeQcILZBwCzQ+MYKtCgKm7HPe9oFeoyprKZXAvpm+HDHtaYdU39JF9f+nvRztzXuMhgETAQMAQCkc= fingerprint@macbook"
|
|
||||||
];
|
|
||||||
eachSystem = nixpkgs.lib.genAttrs (import systems);
|
eachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||||
|
nixpkgsFor = system: if system == "x86_64-darwin" then inputs.nixpkgs-mars else nixpkgs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
checks = eachSystem (system: {
|
checks = eachSystem (system: {
|
||||||
pre-commit-check = inputs.git-hooks.lib.${system}.run (
|
pre-commit-check =
|
||||||
{
|
let
|
||||||
src = ./.;
|
# Once x86_64-darwin is removed and we are back to a single nixpkgs
|
||||||
}
|
# version, this can be simplified to:
|
||||||
// inputs.fw_nix.lib.pre-commit
|
# gitHooksLib = inputs.git-hooks.lib.${system}
|
||||||
);
|
gitHooksLib = import "${inputs.git-hooks}/nix" {
|
||||||
|
nixpkgs = nixpkgsFor system;
|
||||||
|
inherit system;
|
||||||
|
isFlakes = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
gitHooksLib.run (
|
||||||
|
{
|
||||||
|
src = ./.;
|
||||||
|
excludes = [
|
||||||
|
"^migrated/"
|
||||||
|
"^legacy/"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// inputs.fw_nix.lib.pre-commit
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
homeModules = {
|
homeModules = {
|
||||||
@@ -68,69 +80,84 @@
|
|||||||
nixosModules = {
|
nixosModules = {
|
||||||
linux-headless = import ./modules/nixos/linux-headless.nix;
|
linux-headless = import ./modules/nixos/linux-headless.nix;
|
||||||
linux-lxc = import ./modules/nixos/linux-lxc.nix;
|
linux-lxc = import ./modules/nixos/linux-lxc.nix;
|
||||||
|
jailed-agy = import ./modules/nixos/jailed-agy.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations."artem@deimos" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."${homeManagerUser}@deimos" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = import nixpkgs {
|
||||||
extraSpecialArgs.primaryUser = "artem";
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
extraSpecialArgs.primaryUser = homeManagerUser;
|
||||||
modules = [
|
modules = [
|
||||||
|
inputs.fw_nix.nixosModules.identities
|
||||||
vscode-server.homeModules.default
|
vscode-server.homeModules.default
|
||||||
self.homeModules.linux-headless
|
self.homeModules.linux-headless
|
||||||
./hosts/deimos/home.nix
|
./hosts/deimos/home.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations."artem@mars" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."${homeManagerUser}@mars" =
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
|
inputs.home-manager-mars.lib.homeManagerConfiguration
|
||||||
extraSpecialArgs = {
|
{
|
||||||
primaryUser = "artem";
|
pkgs = import inputs.nixpkgs-mars {
|
||||||
inherit trustedSSHKeys;
|
system = "x86_64-darwin";
|
||||||
};
|
config.allowDeprecatedx86_64Darwin = true;
|
||||||
modules = [
|
};
|
||||||
self.homeModules.mac-portable
|
extraSpecialArgs = {
|
||||||
./hosts/mars/home.nix
|
primaryUser = homeManagerUser;
|
||||||
];
|
};
|
||||||
};
|
modules = [
|
||||||
|
inputs.fw_nix.nixosModules.identities
|
||||||
|
self.homeModules.mac-portable
|
||||||
|
./hosts/mars/home.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
darwinConfigurations.mars = darwin.lib.darwinSystem {
|
darwinConfigurations.mars = darwin.lib.darwinSystem {
|
||||||
system = "x86_64-darwin";
|
system = "x86_64-darwin";
|
||||||
specialArgs.primaryUser = "artem";
|
specialArgs.primaryUser = homeManagerUser;
|
||||||
modules = [
|
modules = [
|
||||||
|
inputs.fw_nix.nixosModules.identities
|
||||||
self.darwinModules.mac-portable
|
self.darwinModules.mac-portable
|
||||||
inputs.fw_nix.nixosModules.tools
|
inputs.fw_nix.nixosModules.nix-gc
|
||||||
inputs.fw_nix.nixosModules.nix-settings
|
inputs.fw_nix.nixosModules.nix-settings
|
||||||
|
inputs.fw_nix.nixosModules.tools
|
||||||
inputs.fw_nix.nixosModules.futureware
|
inputs.fw_nix.nixosModules.futureware
|
||||||
inputs.nix-homebrew.darwinModules.nix-homebrew
|
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||||
./hosts/mars/darwin.nix
|
./hosts/mars/darwin.nix
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowDeprecatedx86_64Darwin = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.deimos =
|
nixosConfigurations.deimos = nixpkgs.lib.nixosSystem {
|
||||||
let
|
system = "x86_64-linux";
|
||||||
system = "x86_64-linux";
|
specialArgs = {
|
||||||
in
|
primaryUser = homeManagerUser;
|
||||||
nixpkgs.lib.nixosSystem {
|
inherit (inputs) jail-nix;
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit trustedSSHKeys;
|
|
||||||
inherit (inputs) jail-nix;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
self.nixosModules.linux-headless
|
|
||||||
self.nixosModules.linux-lxc
|
|
||||||
inputs.fw_nix.nixosModules.nix-gc
|
|
||||||
inputs.fw_nix.nixosModules.nix-settings
|
|
||||||
inputs.fw_nix.nixosModules.tools
|
|
||||||
inputs.fw_nix.nixosModules.sshd
|
|
||||||
inputs.fw_nix.nixosModules.futureware
|
|
||||||
./hosts/deimos/nixos.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
modules = [
|
||||||
|
inputs.fw_nix.nixosModules.identities
|
||||||
|
self.nixosModules.linux-headless
|
||||||
|
self.nixosModules.linux-lxc
|
||||||
|
self.nixosModules.jailed-agy
|
||||||
|
inputs.fw_nix.nixosModules.nix-gc
|
||||||
|
inputs.fw_nix.nixosModules.nix-settings
|
||||||
|
inputs.fw_nix.nixosModules.tools
|
||||||
|
inputs.fw_nix.nixosModules.sshd
|
||||||
|
inputs.fw_nix.nixosModules.futureware
|
||||||
|
./hosts/deimos/nixos.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
devShells = eachSystem (
|
devShells = eachSystem (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import (nixpkgsFor system) {
|
||||||
|
inherit system;
|
||||||
|
config.allowDeprecatedx86_64Darwin = true;
|
||||||
|
};
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook enabledPackages;
|
inherit (self.checks.${system}.pre-commit-check) shellHook enabledPackages;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
identities,
|
||||||
|
primaryUser,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
user = identities.users.${primaryUser};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
signing = {
|
||||||
|
# Will be available on remote machines via SSH agent (Secretive).
|
||||||
|
key = "key::" + user.sign."sign@mars".publicKey;
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
settings.user = {
|
||||||
|
name = "Artem Sheremet";
|
||||||
|
inherit (user) email;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+31
-8
@@ -1,5 +1,18 @@
|
|||||||
_: {
|
{
|
||||||
home.homeDirectory = "/home/artem";
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
utils = import "${pkgs.path}/nixos/lib/utils.nix" { inherit lib pkgs config; };
|
||||||
|
haremote-path = "${config.home.homeDirectory}/src/haremote";
|
||||||
|
haremote-unit = utils.escapeSystemdPath haremote-path;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../common/home.nix
|
||||||
|
];
|
||||||
|
|
||||||
services.vscode-server.enable = true;
|
services.vscode-server.enable = true;
|
||||||
services.vscode-server.installPath = [
|
services.vscode-server.installPath = [
|
||||||
@@ -7,17 +20,27 @@ _: {
|
|||||||
"$HOME/.antigravity-server"
|
"$HOME/.antigravity-server"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.mounts.home-artem-src-haremote = {
|
home.packages = with pkgs; [
|
||||||
|
sshfs
|
||||||
|
nixd
|
||||||
|
home-assistant-cli
|
||||||
|
yt-dlp
|
||||||
|
attic-client
|
||||||
|
opencode
|
||||||
|
crush
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.user.mounts."${haremote-unit}" = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Mount ~/src/haremote";
|
Description = "Mount ${haremote-path}";
|
||||||
After = [ "network-online.target" ];
|
After = [ "network-online.target" ];
|
||||||
Wants = [ "network-online.target" ];
|
Wants = [ "network-online.target" ];
|
||||||
};
|
};
|
||||||
Mount = {
|
Mount = {
|
||||||
What = "root@homeassistant.home.arpa:/homeassistant";
|
What = "root@homeassistant.home.arpa:/homeassistant";
|
||||||
Where = "/home/artem/src/haremote";
|
Where = haremote-path;
|
||||||
Type = "fuse.sshfs";
|
Type = "fuse.sshfs";
|
||||||
Options = "reconnect,ServerAliveInterval=15,uid=1000,gid=1000,IdentityAgent=/home/artem/.ssh/ssh_auth_sock";
|
Options = "reconnect,ServerAliveInterval=15,uid=1000,gid=1000,IdentityAgent=${config.home.homeDirectory}/.ssh/ssh_auth_sock";
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "default.target" ];
|
WantedBy = [ "default.target" ];
|
||||||
@@ -26,8 +49,8 @@ _: {
|
|||||||
|
|
||||||
programs.zsh.loginExtra = ''
|
programs.zsh.loginExtra = ''
|
||||||
if [ -n "$SSH_AUTH_SOCK" ]; then
|
if [ -n "$SSH_AUTH_SOCK" ]; then
|
||||||
mkdir -p ~/src/haremote
|
mkdir -p ${haremote-path}
|
||||||
[ -z "$(ls -A ~/src/haremote 2>/dev/null)" ] && systemctl --user restart home-artem-src-haremote.mount
|
[ -z "$(ls -A ${haremote-path} 2>/dev/null)" ] && systemctl --user restart ${haremote-unit}.mount
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-57
@@ -1,78 +1,28 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
trustedSSHKeys,
|
identities,
|
||||||
jail-nix,
|
primaryUser,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
jail = jail-nix.lib.init pkgs;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
users.users.artem = {
|
users.users.${primaryUser} = {
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel"
|
"wheel"
|
||||||
"docker"
|
"docker"
|
||||||
|
"kvm"
|
||||||
];
|
];
|
||||||
openssh.authorizedKeys.keys = trustedSSHKeys;
|
openssh.authorizedKeys.keys = identities.getAccessKeys { user = primaryUser; };
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
linger = true; # Keep sshfs mounted even on logout.
|
linger = true; # Keep sshfs mounted even on logout.
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
nixpkgs.config.allowUnfree = true;
|
||||||
# TODO: move below into hosts/deimos/home.nix
|
|
||||||
sshfs
|
|
||||||
nixd
|
|
||||||
home-assistant-cli
|
|
||||||
yt-dlp
|
|
||||||
|
|
||||||
# jailed-gemini --yolo
|
programs.fuse.enable = true; # for ~/src/haremote mount
|
||||||
(jail "jailed-gemini" pkgs.gemini-cli (
|
|
||||||
with jail.combinators;
|
|
||||||
[
|
|
||||||
network
|
|
||||||
time-zone
|
|
||||||
no-new-session
|
|
||||||
mount-cwd
|
|
||||||
|
|
||||||
(readwrite (noescape "~/.gemini"))
|
|
||||||
# The above is a stow-controlled symlink to the following.
|
|
||||||
(readwrite (noescape "~/dotfiles/legacy/.gemini"))
|
|
||||||
|
|
||||||
(add-pkg-deps (
|
|
||||||
with pkgs;
|
|
||||||
[
|
|
||||||
bashInteractive
|
|
||||||
curl
|
|
||||||
wget
|
|
||||||
jq
|
|
||||||
git
|
|
||||||
which
|
|
||||||
ripgrep
|
|
||||||
gnugrep
|
|
||||||
gnused
|
|
||||||
gawkInteractive
|
|
||||||
ps
|
|
||||||
findutils
|
|
||||||
gzip
|
|
||||||
unzip
|
|
||||||
gnutar
|
|
||||||
diffutils
|
|
||||||
coreutils
|
|
||||||
procps
|
|
||||||
|
|
||||||
python3
|
|
||||||
esphome
|
|
||||||
|
|
||||||
nix
|
|
||||||
]
|
|
||||||
))
|
|
||||||
]
|
|
||||||
))
|
|
||||||
];
|
|
||||||
|
|
||||||
# For building RPi configs. Extra steps are handled by the host (nas).
|
# For building RPi configs. Extra steps are handled by the host (nas).
|
||||||
# https://discuss.linuxcontainers.org/t/systemd-binfmt-service-is-masked/21566/4
|
# https://discuss.linuxcontainers.org/t/systemd-binfmt-service-is-masked/21566/4
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
_: {
|
_: {
|
||||||
homebrew.casks = [
|
homebrew.casks = [
|
||||||
"bambu-studio"
|
"bambu-studio"
|
||||||
|
|
||||||
|
# Not available in nixpkgs-26.05, and latest doesn't support x86_64-darwin
|
||||||
|
"antigravity-cli"
|
||||||
|
];
|
||||||
|
homebrew.brews = [
|
||||||
|
"libimobiledevice"
|
||||||
|
"ideviceinstaller"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-2
@@ -2,10 +2,15 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
trustedSSHKeys,
|
identities,
|
||||||
|
primaryUser,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common/home.nix
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
dosbox-staging # dosbox appears broken on darwin
|
dosbox-staging # dosbox appears broken on darwin
|
||||||
|
|
||||||
@@ -19,7 +24,11 @@
|
|||||||
|
|
||||||
home.activation.setupAuthorizedKeys = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.setupAuthorizedKeys = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
run install -m 0600 -D \
|
run install -m 0600 -D \
|
||||||
${pkgs.writeText "keys" (builtins.concatStringsSep "\n" trustedSSHKeys)} \
|
${
|
||||||
|
pkgs.writeText "keys" (
|
||||||
|
builtins.concatStringsSep "\n" (identities.getAccessKeys { user = primaryUser; })
|
||||||
|
)
|
||||||
|
} \
|
||||||
${config.home.homeDirectory}/.ssh/ephemeral_sshd/authorized_keys
|
${config.home.homeDirectory}/.ssh/ephemeral_sshd/authorized_keys
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://charm.land/crush.json",
|
||||||
|
"experimental": { "openTelemetry": false },
|
||||||
|
"share": "disabled",
|
||||||
|
"autoupdate": false,
|
||||||
|
"disabled_providers": ["crush", "exa"],
|
||||||
|
"providers": {
|
||||||
|
"local-ollama": {
|
||||||
|
"type": "openai-compat",
|
||||||
|
"base_url": "http://ollama.home.arpa:11434/v1",
|
||||||
|
"api_key": "ollama",
|
||||||
|
"model_overrides": {
|
||||||
|
"gemma4-1gpu": {
|
||||||
|
"context_window": 48000,
|
||||||
|
"tools": true
|
||||||
|
},
|
||||||
|
"qwen3.6-1gpu": {
|
||||||
|
"context_window": 128000,
|
||||||
|
"tools": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model": "local-ollama/qwen3.6-200k",
|
||||||
|
"compaction": {
|
||||||
|
"auto": true,
|
||||||
|
"prune": true,
|
||||||
|
"threshold": 0.75,
|
||||||
|
"preserve_recent_tokens": 8192,
|
||||||
|
"reserved": 16384
|
||||||
|
},
|
||||||
|
"tool_output": {
|
||||||
|
"max_bytes": 16384,
|
||||||
|
"max_lines": 200
|
||||||
|
},
|
||||||
|
"agent": {
|
||||||
|
"build": {
|
||||||
|
"steps": 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp": {
|
||||||
|
"nix": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"github:utensils/mcp-nixos",
|
||||||
|
"--"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gitea": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"nixpkgs#gitea-mcp-server",
|
||||||
|
"--"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ha": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"shell",
|
||||||
|
"nixpkgs#uv",
|
||||||
|
"nixpkgs#python3",
|
||||||
|
"--command",
|
||||||
|
"uv",
|
||||||
|
"tool",
|
||||||
|
"run",
|
||||||
|
"ha-mcp"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"UV_PYTHON_DOWNLOADS": "never",
|
||||||
|
"UV_PYTHON_PREFERENCE": "system"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://opencode.ai/config.json",
|
||||||
|
|
||||||
|
// "take me offline" block
|
||||||
|
"experimental": { "openTelemetry": false },
|
||||||
|
"share": "disabled",
|
||||||
|
"autoupdate": false,
|
||||||
|
"disabled_providers": ["opencode", "exa"],
|
||||||
|
|
||||||
|
"provider": {
|
||||||
|
"local-ollama": {
|
||||||
|
"npm": "@ai-sdk/openai-compatible",
|
||||||
|
"name": "Ollama",
|
||||||
|
"options": {
|
||||||
|
"baseURL": "http://ollama.home.arpa:11434/v1",
|
||||||
|
"apiKey": "ollama"
|
||||||
|
},
|
||||||
|
"models": {
|
||||||
|
"gemma4-1gpu": {
|
||||||
|
"limit": {
|
||||||
|
"context": 48000,
|
||||||
|
"output": 8192
|
||||||
|
},
|
||||||
|
"tools": true
|
||||||
|
},
|
||||||
|
"qwen3.6-1gpu": {
|
||||||
|
"limit": {
|
||||||
|
"context": 128000,
|
||||||
|
"output": 8192
|
||||||
|
},
|
||||||
|
"tools": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// "model": "local-ollama/qwen2.5-coder:14b",
|
||||||
|
"model": "local-ollama/qwen3.6-200k",
|
||||||
|
"compaction": {
|
||||||
|
"auto": true,
|
||||||
|
"prune": true,
|
||||||
|
"threshold": 0.75,
|
||||||
|
"preserve_recent_tokens": 8192,
|
||||||
|
"reserved": 16384
|
||||||
|
},
|
||||||
|
"tool_output": {
|
||||||
|
"max_bytes": 16384,
|
||||||
|
"max_lines": 200
|
||||||
|
},
|
||||||
|
"agent": {
|
||||||
|
"build": {
|
||||||
|
"steps": 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp": {
|
||||||
|
"nix": {
|
||||||
|
"type": "local",
|
||||||
|
"command": [
|
||||||
|
"nix",
|
||||||
|
"run",
|
||||||
|
"github:utensils/mcp-nixos",
|
||||||
|
"--"
|
||||||
|
],
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"gitea": {
|
||||||
|
"type": "local",
|
||||||
|
"command": [
|
||||||
|
"nix",
|
||||||
|
"run",
|
||||||
|
"nixpkgs#gitea-mcp-server",
|
||||||
|
"--"
|
||||||
|
],
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"ha": {
|
||||||
|
"type": "local",
|
||||||
|
"command": [
|
||||||
|
"nix",
|
||||||
|
"shell",
|
||||||
|
"nixpkgs#uv",
|
||||||
|
"nixpkgs#python3",
|
||||||
|
"--command",
|
||||||
|
"uv",
|
||||||
|
"tool",
|
||||||
|
"run",
|
||||||
|
"ha-mcp"
|
||||||
|
],
|
||||||
|
"environment": {
|
||||||
|
"UV_PYTHON_DOWNLOADS": "never",
|
||||||
|
"UV_PYTHON_PREFERENCE": "system"
|
||||||
|
},
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"nix": {
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"github:utensils/mcp-nixos",
|
||||||
|
"--"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gitea": {
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"nixpkgs#gitea-mcp-server",
|
||||||
|
"--"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ha": {
|
||||||
|
"command": "nix",
|
||||||
|
"args": [
|
||||||
|
"shell",
|
||||||
|
"nixpkgs#uv",
|
||||||
|
"nixpkgs#python3",
|
||||||
|
"--command",
|
||||||
|
"uv",
|
||||||
|
"tool",
|
||||||
|
"run",
|
||||||
|
"ha-mcp"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"UV_PYTHON_DOWNLOADS": "never",
|
||||||
|
"UV_PYTHON_PREFERENCE": "system"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"mcpServers": {
|
|
||||||
"nix": {
|
|
||||||
"command": "nix",
|
|
||||||
"args": [
|
|
||||||
"run",
|
|
||||||
"github:utensils/mcp-nixos",
|
|
||||||
"--"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ha": {
|
|
||||||
"url": "${HASS_SERVER}/mcp_server/sse",
|
|
||||||
"headers": {
|
|
||||||
"Authorization": "Bearer ${HASS_TOKEN}"
|
|
||||||
},
|
|
||||||
"timeout": 5000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"security": {
|
|
||||||
"auth": {
|
|
||||||
"selectedType": "oauth-personal"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"general": {
|
|
||||||
"sessionRetention": {
|
|
||||||
"warningAcknowledged": true,
|
|
||||||
"enabled": true,
|
|
||||||
"maxAge": "30d"
|
|
||||||
},
|
|
||||||
"preferredEditor": "vim"
|
|
||||||
},
|
|
||||||
"model": {
|
|
||||||
"name": "auto-gemini-3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
[color]
|
|
||||||
ui = auto
|
|
||||||
[alias]
|
|
||||||
co = checkout
|
|
||||||
st = status
|
|
||||||
di = diff -w --no-prefix
|
|
||||||
df = diff
|
|
||||||
dc = diff --cached
|
|
||||||
ci = commit
|
|
||||||
br = branch
|
|
||||||
lg = log -p --decorate=full --show-signature
|
|
||||||
lol = log --graph --decorate=full --pretty=oneline --abbrev-commit
|
|
||||||
lola = log --graph --decorate=full --pretty=oneline --abbrev-commit --all
|
|
||||||
ls = ls-files
|
|
||||||
# Show files ignored by git:
|
|
||||||
ign = ls-files -o -i --exclude-standard
|
|
||||||
[apply]
|
|
||||||
whitespace = nowarn
|
|
||||||
[push]
|
|
||||||
default = tracking
|
|
||||||
[rebase]
|
|
||||||
stat = yes
|
|
||||||
[format]
|
|
||||||
pretty = fuller
|
|
||||||
[fetch]
|
|
||||||
prune = yes
|
|
||||||
[credential "https://source.developers.google.com"]
|
|
||||||
helper = gcloud.sh
|
|
||||||
[core]
|
|
||||||
autocrlf = input
|
|
||||||
[branch]
|
|
||||||
# 0 times I wanted this when doing "git checkout".
|
|
||||||
autoSetupMerge = false
|
|
||||||
# Set up new branches in a way that "git pull" does a rebase by default.
|
|
||||||
autoSetupRebase = always
|
|
||||||
|
|
||||||
# Commit signing, currently using ssh@mars -- to be switched to sign@mars after 2026-05-15
|
|
||||||
[gpg]
|
|
||||||
format = ssh
|
|
||||||
[commit]
|
|
||||||
gpgsign = true
|
|
||||||
[user]
|
|
||||||
signingkey = key::ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNwSX/Ib6kNzgRKqWfcb3HsAQQo++Gt9KeXSvP6NDk6YQPjDsi+//IiBovgLjQ34El+x8l8y3aYhfIGlCyX7aOM= sign@mars
|
|
||||||
name = Artem Sheremet
|
|
||||||
email = dot.doom@gmail.com
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
Host *
|
|
||||||
# Share SSH connection.
|
|
||||||
# If disabling, consider impact on ssh agent forwarding in screen
|
|
||||||
# sessions (see .ssh/rc file).
|
|
||||||
ControlMaster auto
|
|
||||||
ControlPath ~/.ssh/ctl/%r@%h:%p
|
|
||||||
ControlPersist 10m
|
|
||||||
# When a shared connection is broken (remote reboot), detect it faster.
|
|
||||||
ServerAliveInterval 11
|
|
||||||
ServerAliveCountMax 2
|
|
||||||
|
|
||||||
ConnectTimeout 10
|
|
||||||
AddKeysToAgent yes
|
|
||||||
|
|
||||||
#Host custom-host-with-xorg
|
|
||||||
# HostName custom-hostname
|
|
||||||
# User crate
|
|
||||||
# ForwardX11 yes
|
|
||||||
# ForwardX11Trusted yes
|
|
||||||
|
|
||||||
#Host always-changing-keys-dont-care
|
|
||||||
# StrictHostKeyChecking no
|
|
||||||
# UserKnownHostsFile=/dev/null
|
|
||||||
|
|
||||||
Include config.d/*
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# When SSH-ing with agent forwarding enabled, this variable is set by sshd
|
|
||||||
# itself. However, an existing screen session that we attach to will not have
|
|
||||||
# its SSH_AUTH_SOCK environment variable updated, so we hardcode this path in
|
|
||||||
# .screenrc and create a symlink to keep it alive.
|
|
||||||
#
|
|
||||||
# It WILL break if two sessions are opened to a machine, and a newer one is
|
|
||||||
# terminated. ControlMaster in .ssh/config solves this problem by sharing the
|
|
||||||
# connection (and as a result, sharing SSH agent socket).
|
|
||||||
[ -n "$SSH_AUTH_SOCK" ] && ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
|
||||||
@@ -35,6 +35,9 @@ if exists("+undofile")
|
|||||||
" Enable the persistent undo file(s)
|
" Enable the persistent undo file(s)
|
||||||
set undodir=~/.vim/undo
|
set undodir=~/.vim/undo
|
||||||
set undofile
|
set undofile
|
||||||
|
if !isdirectory(expand(&undodir))
|
||||||
|
call mkdir(expand(&undodir), "p")
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set switchbuf+=usetab " Switch to existing tab; open a new tab for the new buf
|
set switchbuf+=usetab " Switch to existing tab; open a new tab for the new buf
|
||||||
|
|||||||
+46
-2
@@ -62,7 +62,6 @@ alias grep='grep --line-buffered --color=auto'
|
|||||||
alias ipt='iptables -nvL --line-numbers'
|
alias ipt='iptables -nvL --line-numbers'
|
||||||
alias ip6t='ip6tables -nvL --line-numbers'
|
alias ip6t='ip6tables -nvL --line-numbers'
|
||||||
alias tcpdump='tcpdump -l'
|
alias tcpdump='tcpdump -l'
|
||||||
alias ag='ag -C 2 --noaffinity --pager="$PAGER" --smart-case'
|
|
||||||
alias mysql='mysql --select_limit=1000'
|
alias mysql='mysql --select_limit=1000'
|
||||||
alias logcat='adb logcat -v "color printable usec year zone" -T 10'
|
alias logcat='adb logcat -v "color printable usec year zone" -T 10'
|
||||||
alias readelf='readelf -W'
|
alias readelf='readelf -W'
|
||||||
@@ -81,6 +80,10 @@ starttransfer: %{time_starttransfer} | \
|
|||||||
total: %{time_total} | \
|
total: %{time_total} | \
|
||||||
size: %{size_download}\n"'
|
size: %{size_download}\n"'
|
||||||
|
|
||||||
|
rg() {
|
||||||
|
command rg -C 2 --smart-case --pretty "$@" | pager
|
||||||
|
}
|
||||||
|
|
||||||
# nix-deploy # current host
|
# nix-deploy # current host
|
||||||
# nix-deploy nas # deploy nas
|
# nix-deploy nas # deploy nas
|
||||||
# nix-deploy test secondary # deploy secondary but do not add to boot
|
# nix-deploy test secondary # deploy secondary but do not add to boot
|
||||||
@@ -125,7 +128,22 @@ nix-deploy() {
|
|||||||
cmd=(nixos-rebuild)
|
cmd=(nixos-rebuild)
|
||||||
command -v nixos-rebuild >/dev/null 2>&1 || cmd=(nix run "nixpkgs#nixos-rebuild" --)
|
command -v nixos-rebuild >/dev/null 2>&1 || cmd=(nix run "nixpkgs#nixos-rebuild" --)
|
||||||
|
|
||||||
"${cmd[@]}" "$action" --flake ".#$config" --target-host "$target" --sudo "$@" |& nom
|
nix build ".#nixosConfigurations.$config.config.system.build.toplevel" \
|
||||||
|
--out-link "result.$config" "$@" |& nom
|
||||||
|
local build_status=$pipestatus[1]
|
||||||
|
if (( build_status != 0 )); then
|
||||||
|
return $build_status
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$action" != "build" ]]; then
|
||||||
|
# Bypass nixos-rebuild self-update check which errors in
|
||||||
|
# flake-only setups when --store-path is used.
|
||||||
|
_NIXOS_REBUILD_REEXEC=1 "${cmd[@]}" "$action" \
|
||||||
|
--store-path "$(readlink -f "result.$config")" \
|
||||||
|
--target-host "$target" \
|
||||||
|
--sudo \
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
myip() {
|
myip() {
|
||||||
@@ -148,6 +166,32 @@ colordiff() {
|
|||||||
cat "$file2" | git diff --no-prefix $gitarg --no-index "$file1" -
|
cat "$file2" | git diff --no-prefix $gitarg --no-index "$file1" -
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osh() {
|
||||||
|
local DEST="$1"
|
||||||
|
local PARENT_PID=$$
|
||||||
|
|
||||||
|
_osh_ensure_ssh() {
|
||||||
|
ssh -A -o ServerAliveInterval=2 -o ServerAliveCountMax=3 -o ControlPersist=yes "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Authenticate in foreground first to ensure Touch ID doesn't conflict with mosh
|
||||||
|
_osh_ensure_ssh "$DEST" true
|
||||||
|
|
||||||
|
(
|
||||||
|
while kill -0 $PARENT_PID 2>/dev/null; do
|
||||||
|
# Avoid using TTY as that will instantly suspend the loop
|
||||||
|
_osh_ensure_ssh -n -q -o BatchMode=yes "$DEST" "sleep 2592000"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
) &
|
||||||
|
local loop_pid=$!
|
||||||
|
|
||||||
|
# Allow mosh reuse of our master session.
|
||||||
|
mosh --experimental-remote-ip=remote "$@"
|
||||||
|
|
||||||
|
kill $loop_pid 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
alias backup-home-explore='eval "ncdu $(grep -A1 -- --exclude $HOME/bin/backup-home | tr -d \|)"'
|
alias backup-home-explore='eval "ncdu $(grep -A1 -- --exclude $HOME/bin/backup-home | tr -d \|)"'
|
||||||
|
|
||||||
# stderr redirect for if direnv is missing
|
# stderr redirect for if direnv is missing
|
||||||
|
|||||||
+104
-7
@@ -1,24 +1,77 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
identities,
|
||||||
primaryUser,
|
primaryUser,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
home.username = primaryUser;
|
home.username = primaryUser;
|
||||||
home.packages = with pkgs; [
|
|
||||||
stow
|
nixpkgs.config.allowUnfree = true;
|
||||||
wget
|
home.packages =
|
||||||
gemini-cli
|
with pkgs;
|
||||||
silver-searcher
|
[
|
||||||
yubikey-manager
|
stow
|
||||||
];
|
wget
|
||||||
|
yubikey-manager
|
||||||
|
]
|
||||||
|
++ lib.optional (pkgs ? antigravity-cli) antigravity-cli;
|
||||||
|
|
||||||
home.activation.stowLegacy = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.stowLegacy = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
if [ -d "$HOME/dotfiles/legacy" ]; then
|
if [ -d "$HOME/dotfiles/legacy" ]; then
|
||||||
run ${pkgs.stow}/bin/stow -d $HOME/dotfiles -t $HOME legacy
|
run ${pkgs.stow}/bin/stow -d $HOME/dotfiles -t $HOME legacy
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
home.activation.report-changes = lib.hm.dag.entryAnywhere ''
|
||||||
|
# oldGenPath can be undefined with home-manager used as part of NixOS config
|
||||||
|
if [ -n "''${oldGenPath+x}" ]; then
|
||||||
|
${pkgs.nvd}/bin/nvd diff $oldGenPath $newGenPath
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
alias = {
|
||||||
|
co = "checkout";
|
||||||
|
st = "status";
|
||||||
|
di = "diff -w --no-prefix";
|
||||||
|
df = "diff";
|
||||||
|
dc = "diff --cached";
|
||||||
|
ci = "commit";
|
||||||
|
br = "branch";
|
||||||
|
lg = "log -p --decorate=full --show-signature";
|
||||||
|
lol = "log --graph --decorate=full --pretty=oneline --abbrev-commit";
|
||||||
|
lola = "log --graph --decorate=full --pretty=oneline --abbrev-commit --all";
|
||||||
|
ls = "ls-files";
|
||||||
|
# Show files ignored by git:
|
||||||
|
ign = "ls-files -o -i --exclude-standard";
|
||||||
|
};
|
||||||
|
|
||||||
|
color.ui = "auto";
|
||||||
|
apply.whitespace = "nowarn";
|
||||||
|
push.default = "tracking";
|
||||||
|
rebase.stat = "yes";
|
||||||
|
format.pretty = "fuller";
|
||||||
|
fetch.prune = "yes";
|
||||||
|
core.autocrlf = "input";
|
||||||
|
branch = {
|
||||||
|
# 0 times I wanted this when doing "git checkout".
|
||||||
|
autoSetupMerge = false;
|
||||||
|
# Set up new branches in a way that "git pull" does a rebase by default.
|
||||||
|
autoSetupRebase = "always";
|
||||||
|
};
|
||||||
|
gpg.format = "ssh";
|
||||||
|
gpg.ssh.allowedSignersFile = "${pkgs.writeText "allowed_signers" (
|
||||||
|
lib.concatStringsSep "\n" (identities.getSigningEntries { })
|
||||||
|
)}";
|
||||||
|
credential."https://source.developers.google.com".helper = "gcloud.sh";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
initContent = ''
|
initContent = ''
|
||||||
@@ -137,5 +190,49 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
enableDefaultConfig = false;
|
||||||
|
includes = [ "config.d/*" ];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
"*" = {
|
||||||
|
# Share SSH connection.
|
||||||
|
# If disabling, consider impact on ssh agent forwarding in screen
|
||||||
|
# sessions (see .ssh/rc file).
|
||||||
|
ControlMaster = "auto";
|
||||||
|
ControlPath = "~/.ssh/ctl/%r@%h:%p";
|
||||||
|
ControlPersist = "10m";
|
||||||
|
|
||||||
|
# When a shared connection is broken (remote reboot), detect it faster.
|
||||||
|
ServerAliveInterval = 11;
|
||||||
|
ServerAliveCountMax = 2;
|
||||||
|
|
||||||
|
ConnectTimeout = 10;
|
||||||
|
AddKeysToAgent = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file = {
|
||||||
|
".ssh/rc" = {
|
||||||
|
executable = true;
|
||||||
|
text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# When SSH-ing with agent forwarding enabled, this variable is set by sshd
|
||||||
|
# itself. However, an existing screen session that we attach to will not have
|
||||||
|
# its SSH_AUTH_SOCK environment variable updated, so we hardcode this path in
|
||||||
|
# .screenrc and create a symlink to keep it alive.
|
||||||
|
#
|
||||||
|
# It WILL break if two sessions are opened to a machine, and a newer one is
|
||||||
|
# terminated. ControlMaster in .ssh/config solves this problem by sharing the
|
||||||
|
# connection (and as a result, sharing SSH agent socket).
|
||||||
|
[ -n "$SSH_AUTH_SOCK" ] && ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
".ssh/ctl/.keep".text = "";
|
||||||
|
};
|
||||||
|
|
||||||
home.stateVersion = "25.11"; # never modify
|
home.stateVersion = "25.11"; # never modify
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
TripleClickSelectsFullWrappedLines = true;
|
TripleClickSelectsFullWrappedLines = true;
|
||||||
WordChars = "/-._~";
|
WordChars = "/-._~";
|
||||||
PromptOnQuit = false;
|
PromptOnQuit = false;
|
||||||
|
|
||||||
|
# Use system browser to open links.
|
||||||
|
NoSyncBrowserUpsell = 1;
|
||||||
|
NoSyncBrowserUpsell_selection = 1;
|
||||||
};
|
};
|
||||||
home.file."Library/Application Support/iTerm2/DynamicProfiles/nix-profile.json".text =
|
home.file."Library/Application Support/iTerm2/DynamicProfiles/nix-profile.json".text =
|
||||||
builtins.toJSON
|
builtins.toJSON
|
||||||
@@ -47,6 +51,7 @@
|
|||||||
|
|
||||||
Columns = 160;
|
Columns = 160;
|
||||||
Rows = 45;
|
Rows = 45;
|
||||||
|
"Scrollback Lines" = 1000000;
|
||||||
|
|
||||||
# For tmux selection and moving borders.
|
# For tmux selection and moving borders.
|
||||||
"Mouse Reporting" = true;
|
"Mouse Reporting" = true;
|
||||||
@@ -73,6 +78,10 @@
|
|||||||
export SSH_AUTH_SOCK=~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
|
export SSH_AUTH_SOCK=~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
# TODO: defaults read NSGlobalDomain
|
||||||
|
# https://nix-darwin.github.io/nix-darwin/manual/index.html
|
||||||
|
# -> set system.defaults.NSGlobalDomain
|
||||||
|
# or system.defaults.CustomSystemPreferences
|
||||||
|
|
||||||
programs.vscode.enable = true;
|
programs.vscode.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
jail-nix,
|
||||||
|
primaryUser,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
jail = jail-nix.lib.init pkgs;
|
||||||
|
allPackages =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
bashInteractive
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
jq
|
||||||
|
git
|
||||||
|
which
|
||||||
|
ripgrep
|
||||||
|
gnugrep
|
||||||
|
gnused
|
||||||
|
gawkInteractive
|
||||||
|
ps
|
||||||
|
findutils
|
||||||
|
gzip
|
||||||
|
unzip
|
||||||
|
gnutar
|
||||||
|
diffutils
|
||||||
|
coreutils
|
||||||
|
procps
|
||||||
|
|
||||||
|
python3
|
||||||
|
python3Packages.pip
|
||||||
|
esphome
|
||||||
|
|
||||||
|
ruby
|
||||||
|
go
|
||||||
|
gcc
|
||||||
|
gnumake
|
||||||
|
pkg-config
|
||||||
|
|
||||||
|
nix
|
||||||
|
]
|
||||||
|
++ config.programs.jailed-agy.extraPackages;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.jailed-agy = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable the jailed-agy wrapper.";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraPackages = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [ ];
|
||||||
|
description = "Extra packages to append to the jailed-agy environment.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.programs.jailed-agy.enable {
|
||||||
|
environment.systemPackages = [
|
||||||
|
(jail "jailed-agy" pkgs.antigravity-cli (
|
||||||
|
with jail.combinators;
|
||||||
|
[
|
||||||
|
network
|
||||||
|
time-zone
|
||||||
|
no-new-session
|
||||||
|
mount-cwd
|
||||||
|
|
||||||
|
# Enforce that the wrapper is not run as root/privileged user
|
||||||
|
(add-runtime ''
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
echo "Error: jailed-agy must not be run as root/privileged user!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'')
|
||||||
|
|
||||||
|
# Automatically append --dangerously-skip-permissions to agy invocation
|
||||||
|
(set-argv [
|
||||||
|
"--dangerously-skip-permissions"
|
||||||
|
(noescape "\"$@\"")
|
||||||
|
])
|
||||||
|
|
||||||
|
(readwrite (noescape "~/.gemini"))
|
||||||
|
# The above is a stow-controlled symlink to the following.
|
||||||
|
(readwrite (noescape "~/dotfiles/legacy/.gemini"))
|
||||||
|
|
||||||
|
# Enable easy installation of pip packages in the current directory.
|
||||||
|
(set-env "PYTHONPATH" (noescape "\"$PWD/.pip-packages\""))
|
||||||
|
(set-env "PIP_TARGET" (noescape "\"$PWD/.pip-packages\""))
|
||||||
|
(set-env "PIP_CACHE_DIR" (noescape "\"$PWD/.pip-cache\""))
|
||||||
|
(set-env "PIP_BREAK_SYSTEM_PACKAGES" "1")
|
||||||
|
|
||||||
|
# Enable easy installation and persistence of RubyGems in the current directory.
|
||||||
|
(set-env "GEM_HOME" (noescape "\"$PWD/.gem\""))
|
||||||
|
|
||||||
|
# Enable easy installation and persistence of Go modules and caches in the current directory.
|
||||||
|
(set-env "GOPATH" (noescape "\"$PWD/.go\""))
|
||||||
|
(set-env "GOCACHE" (noescape "\"$PWD/.go-cache\""))
|
||||||
|
|
||||||
|
# Preconfigure compiler and linker flags dynamically for all jail packages.
|
||||||
|
# This allows compiling Ruby gems (e.g. ffi, which requires libffi) and Go packages
|
||||||
|
# (e.g. YubiKey plugins, which require pcsclite) out-of-the-box.
|
||||||
|
(set-env "PKG_CONFIG_PATH" (
|
||||||
|
lib.concatStringsSep ":" (map (pkg: "${pkg.dev or pkg}/lib/pkgconfig") allPackages)
|
||||||
|
))
|
||||||
|
(set-env "NIX_CFLAGS_COMPILE" (
|
||||||
|
lib.concatStringsSep " " (map (pkg: "-isystem ${pkg.dev or pkg}/include") allPackages)
|
||||||
|
))
|
||||||
|
(set-env "NIX_LDFLAGS" (
|
||||||
|
lib.concatStringsSep " " (map (pkg: "-L${pkg.out or pkg}/lib") allPackages)
|
||||||
|
))
|
||||||
|
|
||||||
|
# Mount system and user profiles so their packages are automatically available at runtime
|
||||||
|
(try-ro-bind "/run/current-system/sw" "/run/current-system/sw")
|
||||||
|
(try-ro-bind "/etc/profiles/per-user/${primaryUser}" "/etc/profiles/per-user/${primaryUser}")
|
||||||
|
|
||||||
|
# Mount Nix files and directories to support nix-shell and Nix operations in jail
|
||||||
|
(try-ro-bind "/nix/store" "/nix/store")
|
||||||
|
(try-ro-bind "/nix/var/nix/daemon-socket" "/nix/var/nix/daemon-socket")
|
||||||
|
(try-ro-bind "/nix/var/nix/profiles" "/nix/var/nix/profiles")
|
||||||
|
(try-ro-bind "/etc/nix" "/etc/nix")
|
||||||
|
(try-ro-bind "/etc/static" "/etc/static")
|
||||||
|
|
||||||
|
# Forward Nix environment variables
|
||||||
|
(try-fwd-env "NIX_REMOTE")
|
||||||
|
(try-fwd-env "NIX_PATH")
|
||||||
|
(try-fwd-env "NIX_SSL_CERT_FILE")
|
||||||
|
|
||||||
|
(add-pkg-deps allPackages)
|
||||||
|
|
||||||
|
# Prepend local project binary directories, system, and user bin paths to the jail's PATH.
|
||||||
|
# Note: We place this after `add-pkg-deps` so that local paths take highest precedence.
|
||||||
|
# We use explicit double quotes to allow bash to expand $PWD at runtime and handle spaces.
|
||||||
|
(
|
||||||
|
state:
|
||||||
|
state
|
||||||
|
// {
|
||||||
|
env = state.env // {
|
||||||
|
PATH =
|
||||||
|
if state.env ? PATH && state.env.PATH != "" then
|
||||||
|
"\"\$PWD/.gem/bin:\$PWD/.go/bin:\$PWD/.pip-packages/bin:/run/current-system/sw/bin:/etc/profiles/per-user/${primaryUser}/bin:${state.env.PATH}\""
|
||||||
|
else
|
||||||
|
"\"\$PWD/.gem/bin:\$PWD/.go/bin:\$PWD/.pip-packages/bin:/run/current-system/sw/bin:/etc/profiles/per-user/${primaryUser}/bin\"";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
# Create /etc/zshrc that loads the nix environment.
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
modulesPath,
|
modulesPath,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
for item in \
|
for item in \
|
||||||
"mkdir -p:/var/lib/nixos" \
|
"mkdir -p:/var/lib/nixos" \
|
||||||
"mkdir -p:/var/lib/systemd" \
|
"mkdir -p:/var/lib/systemd" \
|
||||||
|
"mkdir -p:/var/lib/docker" \
|
||||||
"touch:/etc/machine-id" \
|
"touch:/etc/machine-id" \
|
||||||
"touch:/etc/ssh/ssh_host_ed25519_key" \
|
"touch:/etc/ssh/ssh_host_ed25519_key" \
|
||||||
; do
|
; do
|
||||||
@@ -72,4 +74,7 @@
|
|||||||
capabilities = "cap_net_raw+p";
|
capabilities = "cap_net_raw+p";
|
||||||
source = "${pkgs.iputils.out}/bin/ping";
|
source = "${pkgs.iputils.out}/bin/ping";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Our VMs usually have sufficient RAM, prefer to extend SSD lifetime.
|
||||||
|
boot.tmp.useTmpfs = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user