mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 06:28:11 +09:00
Compare commits
132
Commits
403971eef6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08210abf01 | ||
|
|
eadfa9b331 | ||
|
|
0f3b6c59a2 | ||
|
|
c6fe17de3f | ||
|
|
ac60dc343b | ||
|
|
ebef49064c | ||
|
|
691926aa4f | ||
|
|
37e2184d36 | ||
|
|
52e5fcd47f | ||
|
|
fe785b1fc3 | ||
|
|
b8532ff1b4 | ||
|
|
3a20fe9a09 | ||
|
|
ef7ff60537 | ||
|
|
53f4d2475b | ||
|
|
7d670b03b2 | ||
|
|
2d9154614b | ||
|
|
56bc3161d7 | ||
|
|
10f4d99cb7 | ||
|
|
12badacf46 | ||
|
|
937be12e33 | ||
|
|
8761cbfe40 | ||
|
|
e789b5a16f | ||
|
|
008f704b23 | ||
|
|
11c1e24ccd | ||
|
|
ad8337bfbb | ||
|
|
cf23e1ef63 | ||
|
|
4652d911ee | ||
|
|
c7db764fe2 | ||
|
|
63f49d58f8 | ||
|
|
8189373575 | ||
|
|
d4721d1d22 | ||
|
|
cc3798a7b2 | ||
|
|
0ff78c6848 | ||
|
|
c53a0c0bed | ||
|
|
e3d61e8b6d | ||
|
|
fda29cd08d | ||
|
|
db0a440da4 | ||
|
|
76f5dce9c0 | ||
|
|
3b61457718 | ||
|
|
c9f1584797 | ||
|
|
d51948c307 | ||
|
|
9a38e9f614 | ||
|
|
2cb7e76ca1 | ||
|
|
749410e032 | ||
|
|
d43f19c20a | ||
|
|
32a3067cb0 | ||
|
|
6e60bd8886 | ||
|
|
bcf7ef56cf | ||
|
|
63e2008423 | ||
|
|
3b8147ff46 | ||
|
|
c84f257149 | ||
|
|
6347292c1d | ||
|
|
2a82433754 | ||
|
|
847ee17b29 | ||
|
|
95f74aabcd | ||
|
|
717572ae24 | ||
|
|
8086c9a7f3 | ||
|
|
eba23455d4 | ||
|
|
b3b1031364 | ||
|
|
366ff54403 | ||
|
|
456e9946f4 | ||
|
|
c104404e5b | ||
|
|
cb41932fec | ||
|
|
fa4b7ca404 | ||
|
|
847d33e83b | ||
|
|
b2c700e1e4 | ||
|
|
c1540d8764 | ||
|
|
5b8c3b1415 | ||
|
|
6743569789 | ||
|
|
70253fc451 | ||
|
|
5107b80173 | ||
|
|
2bdea522cb | ||
|
|
c113d0d46d | ||
|
|
fa50be8feb | ||
|
|
33ebef4a1e | ||
|
|
94048ef8d5 | ||
|
|
c7627fa1b0 | ||
|
|
d68da620ac | ||
|
|
5f0df47775 | ||
|
|
119342e564 | ||
|
|
1f066e8937 | ||
|
|
0a440e3da8 | ||
|
|
bdf93ac6bb | ||
|
|
9ae5da4d30 | ||
|
|
872436b170 | ||
|
|
c14325e29c | ||
|
|
45bc66e25f | ||
|
|
78ee2d41ec | ||
|
|
0b1ae13048 | ||
|
|
458b0a2cdb | ||
|
|
01179f3dc6 | ||
|
|
42949fc06c | ||
|
|
a7f514c0f9 | ||
|
|
9bed1c3e25 | ||
|
|
791b6baa83 | ||
|
|
349f49e496 | ||
|
|
3166c12448 | ||
|
|
4c459e4aa7 | ||
|
|
9b9141dd84 | ||
|
|
16e3fda275 | ||
|
|
ca36b07839 | ||
|
|
5ebcbb4abf | ||
|
|
f8fd8a3d99 | ||
|
|
16742d2fd7 | ||
|
|
15da7affaa | ||
|
|
548647fec7 | ||
|
|
bcbd08c225 | ||
|
|
a0ae83d24e | ||
|
|
33e09f8e93 | ||
|
|
eff32fddcd | ||
|
|
8ce3a6082a | ||
|
|
a8246261ad | ||
|
|
8b51b5c55f | ||
|
|
e24d85da56 | ||
|
|
01ead9a385 | ||
|
|
328f11d0ed | ||
|
|
d877ffc76c | ||
|
|
fe40adaeee | ||
|
|
991dde5305 | ||
|
|
96ce4d768c | ||
|
|
30b1480e50 | ||
|
|
71011d7bd1 | ||
|
|
9cced59e58 | ||
|
|
20a601402e | ||
|
|
1b4a5fa5a2 | ||
|
|
5fb55f2e6a | ||
|
|
2a3f7ee6ff | ||
|
|
247db71f2d | ||
|
|
a44a83a587 | ||
|
|
1f1d46ea2a | ||
|
|
29c4815b88 | ||
|
|
28a46d9990 |
@@ -30,3 +30,4 @@
|
||||
!/modules/
|
||||
|
||||
!/tests/
|
||||
!/skills/
|
||||
|
||||
@@ -24,6 +24,11 @@ makes any statement here stale, update `AGENTS.md` in the same change.
|
||||
| `overlays/` | Package replacements and additions |
|
||||
| `shells/` | Development shells |
|
||||
| `flake/` | Supporting flake outputs such as formatters, checks, and Git hooks |
|
||||
| `skills/` | Repository-specific Codex workflows that enforce this contract for recurring changes |
|
||||
|
||||
Before adding or materially extending an application or service, read and
|
||||
follow `skills/add-application-or-service/SKILL.md`. `AGENTS.md` remains the
|
||||
authoritative contract when the skill and repository ever disagree.
|
||||
|
||||
Use **unit** as the generic internal term for a Registry-managed component and
|
||||
**profile** for a unit that composes multiple units. Do not introduce a
|
||||
@@ -346,6 +351,7 @@ modules/profiles/
|
||||
├── base/
|
||||
├── interface/
|
||||
│ ├── cli/
|
||||
│ ├── minimal/
|
||||
│ ├── gui/
|
||||
│ ├── macos/
|
||||
│ ├── linux-desktop/
|
||||
@@ -362,8 +368,14 @@ modules/profiles/
|
||||
│ ├── desktop/
|
||||
│ └── vm/
|
||||
├── workload/
|
||||
│ ├── camera/
|
||||
│ ├── deploy-rs-target/
|
||||
│ ├── development/
|
||||
│ ├── game/
|
||||
│ ├── machine-learning/
|
||||
│ ├── network-lab/
|
||||
│ ├── personal/
|
||||
│ ├── photography/
|
||||
│ ├── server/
|
||||
│ └── remote-access/
|
||||
└── security/
|
||||
@@ -384,16 +396,21 @@ The profile layers have these responsibilities:
|
||||
- `base` contains only invariants required by every supported host. It includes
|
||||
`systems.nix` and the universal Atuin, tealdeer, trippy, and xh CLI tools;
|
||||
optional secrets, interface, hardware, and workloads do not belong there.
|
||||
- `interface` describes how the host is operated. `interface.cli` is shared by
|
||||
NixOS and macOS and includes `tio`. `interface.gui` owns cross-platform
|
||||
graphical interface applications such as Vicinae. `interface.macos` owns the
|
||||
macOS Finder, Dock, trackpad, and shared default preferences and includes
|
||||
`interface.gui`.
|
||||
- `interface` describes how the host is operated. `interface.minimal` is shared
|
||||
by NixOS and macOS and provides the remote-administration CLI baseline,
|
||||
including SSH, Nano, htop, Git, Zellij, and Zsh. `interface.cli` includes that
|
||||
baseline and adds the full interactive command-line environment, including
|
||||
the configured Neovim, Yazi, and `tio`. `interface.gui` owns
|
||||
cross-platform graphical interface applications such as Vicinae.
|
||||
`interface.macos` owns the macOS Finder, Dock, trackpad, and shared default
|
||||
preferences and includes `interface.gui`.
|
||||
`interface.linux-desktop` owns the common labwc/niri desktop selection,
|
||||
including Ghostty and Nautilus, and also includes `interface.gui`. Labwc and
|
||||
niri remain independently selectable and do not imply CLI or personal
|
||||
workloads.
|
||||
- `platform` describes NixOS foundations and physical or virtual form factors.
|
||||
`platform.nixos` selects the shared network foundation and `services.clatd`;
|
||||
VM, laptop, and desktop platform profiles inherit both.
|
||||
macOS does not need an empty symmetric platform profile.
|
||||
- `workload` describes optional host uses. `workload.development` and
|
||||
`workload.personal` are cross-platform profiles, not `*-linux` variants.
|
||||
@@ -533,9 +550,26 @@ A host registry may use a specification like this:
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.cli"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.remote-access"
|
||||
"workload.deploy-rs-target"
|
||||
];
|
||||
};
|
||||
|
||||
netsrv-01 = {
|
||||
system = "x86_64-linux";
|
||||
stateVersion = "26.05";
|
||||
user = "moons";
|
||||
path = ./netsrv-01;
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.remote-access"
|
||||
"workload.deploy-rs-target"
|
||||
"workload.server"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -547,7 +581,7 @@ A host registry may use a specification like this:
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.cli"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.server"
|
||||
];
|
||||
@@ -597,7 +631,9 @@ A host registry may use a specification like this:
|
||||
"security.secrets"
|
||||
"security.secure-boot"
|
||||
"security.tpm-storage"
|
||||
"workload.camera"
|
||||
"workload.development"
|
||||
"workload.network-lab"
|
||||
"workload.personal"
|
||||
];
|
||||
};
|
||||
@@ -619,7 +655,10 @@ A host registry may use a specification like this:
|
||||
"security.tpm-storage"
|
||||
"workload.development"
|
||||
"workload.game"
|
||||
"workload.machine-learning"
|
||||
"workload.network-lab"
|
||||
"workload.personal"
|
||||
"workload.photography"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -642,14 +681,22 @@ A host registry may use a specification like this:
|
||||
```
|
||||
|
||||
The current role assignment is intentional: nix-example is the development VM;
|
||||
ops is the remote-access VM with host-specific static networking;
|
||||
internal-app-01 is the container server VM; and installer builds the minimal
|
||||
installation ISO without Home Manager. x1g9 is a full NixOS desktop with niri,
|
||||
ops is the minimal-interface remote-access VM with host-specific static
|
||||
networking; netsrv-01 is the deploy-rs-managed container server VM;
|
||||
internal-app-01 is the minimal-interface container server VM;
|
||||
nix-builder is the minimal-interface remote Nix build VM with dedicated build
|
||||
and store disks; and installer builds the minimal installation ISO without Home
|
||||
Manager. x1g9 is a full NixOS desktop with niri,
|
||||
labwc, ly, the shared Linux desktop applications, and the personal workload.
|
||||
x1g13 is the secure NixOS development and personal ThinkPad, with the same
|
||||
desktop sessions plus Tailscale client, SOPS, Secure Boot, and TPM-backed disk
|
||||
unlock. galleria is the Intel/NVIDIA physical desktop shared with Windows; it
|
||||
uses dedicated NixOS partitions, LUKS, Secure Boot, and TPM-backed disk unlock.
|
||||
It selects `workload.photography` for AI-enabled darktable. The application
|
||||
chooses CUDA support from the NVIDIA hardware unit's enable state and keeps
|
||||
the default CUDA targets, including RTX 3060 Ti support, to reuse binary caches.
|
||||
galleria and x1g13 select `workload.network-lab` for containerlab, Docker, and
|
||||
the NanoKVM-USB desktop client with serial-port access.
|
||||
m2 is the daily-use macOS development and personal machine with the macOS
|
||||
interface defaults. Keep the desktop sessions independently selectable, and
|
||||
keep the development and personal profiles usable across NixOS and Darwin.
|
||||
@@ -682,6 +729,15 @@ configuration fragments. For example:
|
||||
|
||||
```text
|
||||
hosts/
|
||||
├── nix-builder/
|
||||
│ ├── disko.nix
|
||||
│ ├── hardware-configuration.nix
|
||||
│ └── nixos.nix
|
||||
├── netsrv-01/
|
||||
│ ├── disko.nix
|
||||
│ ├── hardware-configuration.nix
|
||||
│ ├── networking.nix
|
||||
│ └── nixos.nix
|
||||
├── installer/
|
||||
│ └── nixos.nix
|
||||
├── internal-app-01/
|
||||
@@ -711,12 +767,15 @@ hosts/
|
||||
```
|
||||
|
||||
`hosts/x1g9/nixos.nix` explicitly loads `hardware-configuration.nix` with the
|
||||
normal top-level Nix module `imports`. `hosts/x1g13/nixos.nix` loads its
|
||||
generated hardware configuration and host-local `disko.nix` the same way. Do
|
||||
not confuse these host imports with the prohibition on top-level `imports` in
|
||||
unit configuration fragments. `hosts/galleria/disko.nix` manages only the two
|
||||
dedicated NixOS partitions by PARTUUID and deliberately excludes the Windows
|
||||
disk, Windows partitions, and the Windows EFI System Partition.
|
||||
normal top-level Nix module `imports`. `hosts/nix-builder/nixos.nix` and
|
||||
`hosts/x1g13/nixos.nix` load their generated hardware configuration and
|
||||
host-local `disko.nix` the same way. The nix-builder Disko definition mounts its
|
||||
existing VM filesystems by stable QEMU SCSI IDs and does not take destructive
|
||||
ownership of them. Do not confuse these host imports with the prohibition on
|
||||
top-level `imports` in unit configuration fragments. `hosts/galleria/disko.nix`
|
||||
manages only the two dedicated NixOS partitions by PARTUUID and deliberately
|
||||
excludes the Windows disk, Windows partitions, and the Windows EFI System
|
||||
Partition.
|
||||
|
||||
Derive the system class from the host's `system`:
|
||||
|
||||
@@ -819,8 +878,9 @@ For profile changes, additionally:
|
||||
`homebrew.casks` selection as well as module evaluation.
|
||||
- Preserve the intended host roles: nix-example remains the development VM;
|
||||
ops remains the statically networked remote-access VM; internal-app-01 remains
|
||||
the container server VM; installer remains the Home Manager-free installation
|
||||
ISO; x1g9 provides niri, labwc, ly, and the personal application set; x1g13
|
||||
the container server VM; netsrv-01 remains the deploy-rs-managed container
|
||||
server VM; installer remains the Home Manager-free installation ISO; x1g9
|
||||
provides niri, labwc, ly, and the personal application set; x1g13
|
||||
additionally provides the development, Tailscale client, secrets, Secure Boot,
|
||||
and TPM storage roles; galleria remains the Intel/NVIDIA dual-boot desktop
|
||||
with LUKS, Secure Boot, and TPM storage; m2 remains the daily-use development
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
# NixOSインストール手順(SOPSなし・ディスク暗号化なし)
|
||||
|
||||
この手順は、SOPSによるシークレット管理とLUKSによるディスク暗号化を
|
||||
使用しないホスト向けの、独立したインストール手順である。
|
||||
|
||||
SOPSとディスク暗号化を使用する場合は、[暗号化ありの手順](install.md)を参照。
|
||||
|
||||
## 事前準備
|
||||
|
||||
1. [ISOビルド](iso-build.md)を参照してISOを作成
|
||||
2. USBに書き込んで対象マシンでブート
|
||||
|
||||
## ネットワーク接続
|
||||
|
||||
### 有線LAN
|
||||
|
||||
DHCPで自動設定される。
|
||||
|
||||
### Wi-Fi(有線が使えない場合)
|
||||
|
||||
```bash
|
||||
nmcli device wifi connect <SSID> --ask
|
||||
```
|
||||
|
||||
## SSH接続
|
||||
|
||||
コンソールに表示されたIPアドレスに接続:
|
||||
|
||||
```bash
|
||||
ssh root@<ip-address>
|
||||
```
|
||||
|
||||
## インストール手順
|
||||
|
||||
### 1. dotfilesのクローン
|
||||
|
||||
```bash
|
||||
git clone [email protected]:moons-14/dotfiles.git ~/dotfiles
|
||||
cd ~/dotfiles
|
||||
```
|
||||
|
||||
### 2. ホスト設定の作成
|
||||
|
||||
`hosts/<hostname>/nixos.nix`を作成し、`hosts/default.nix`にホストと使用する
|
||||
プロファイルを登録する。ホスト固有の設定だけをホストディレクトリに置き、
|
||||
再利用可能な設定は適切なunitまたはprofileに置く。
|
||||
|
||||
### 3. インストール先ディスクの確認
|
||||
|
||||
```bash
|
||||
lsblk -o NAME,PATH,SIZE,MODEL,SERIAL,TYPE,FSTYPE,MOUNTPOINTS
|
||||
ls -l /dev/disk/by-id/
|
||||
```
|
||||
|
||||
以降の操作では指定したディスクの既存データが消去される。対象を必ず確認し、
|
||||
可能であれば`/dev/sda`や`/dev/nvme0n1`ではなく、安定した
|
||||
`/dev/disk/by-id/...`パスを使用する。
|
||||
|
||||
### 4. Disko設定の作成
|
||||
|
||||
`hosts/<hostname>/disko.nix`を作成する:
|
||||
|
||||
```nix
|
||||
_:
|
||||
{
|
||||
disko.enableConfig = true;
|
||||
|
||||
disko.devices.disk.main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/<target-disk>";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
`<target-disk>`を手順3で確認した実際のディスクIDに置き換える。指定した
|
||||
ディスクの既存データは消去される。
|
||||
|
||||
### 5. パーティション作成とマウント
|
||||
|
||||
```bash
|
||||
disko --mode destroy,format,mount hosts/<hostname>/disko.nix
|
||||
```
|
||||
|
||||
Diskoの実行結果を確認する:
|
||||
|
||||
```bash
|
||||
findmnt /mnt
|
||||
findmnt /mnt/boot
|
||||
```
|
||||
|
||||
### 6. ハードウェア設定の生成
|
||||
|
||||
```bash
|
||||
nixos-generate-config --no-filesystems --root /mnt --show-hardware-config \
|
||||
> ~/dotfiles/hosts/<hostname>/hardware-configuration.nix
|
||||
```
|
||||
|
||||
### 7. ホストモジュールから設定を読み込む
|
||||
|
||||
`hosts/<hostname>/nixos.nix`で、生成したハードウェア設定とDisko設定を読み込む:
|
||||
|
||||
```nix
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./disko.nix
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### 8. NixOSインストール
|
||||
|
||||
```bash
|
||||
nixos-install --flake ~/dotfiles#<hostname>
|
||||
```
|
||||
|
||||
SOPSを使用しないため、age鍵の登録、シークレットの再暗号化、SSHホストキーの
|
||||
事前生成とコピーは不要である。OpenSSHを有効にしたホストでは、SSHホストキーは
|
||||
通常の初回起動時に生成される。
|
||||
|
||||
### 9. 再起動
|
||||
|
||||
```bash
|
||||
reboot
|
||||
```
|
||||
|
||||
## インストール後の確認
|
||||
|
||||
- 正しいディスクから起動できるか
|
||||
- `/`と`/boot`が意図したファイルシステムからマウントされているか
|
||||
- ネットワークと、設定している場合はSSH接続が利用できるか
|
||||
+32
-44
@@ -1,4 +1,10 @@
|
||||
# NixOSインストール手順
|
||||
# NixOSインストール手順(SOPS・ディスク暗号化あり)
|
||||
|
||||
この手順は、SOPSによるシークレット管理とLUKSによるディスク暗号化を
|
||||
使用するホスト向けである。
|
||||
|
||||
どちらも使用しない場合は、
|
||||
[SOPSなし・ディスク暗号化なしの手順](install-simple.md)を参照。
|
||||
|
||||
## 事前準備
|
||||
|
||||
@@ -83,54 +89,36 @@ sops updatekeys secrets/hosts/<hostname>/*.yaml
|
||||
|
||||
新しいホスト用の`hosts/<hostname>/disko.nix`を作成。
|
||||
|
||||
#### シンプル構成(暗号化なし)
|
||||
|
||||
```nix
|
||||
_:
|
||||
{
|
||||
disko.enableConfig = true;
|
||||
|
||||
disko.devices.disk.main = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
#### LUKS暗号化 + btrfs
|
||||
|
||||
`hosts/x1g13/disko.nix`を参照。
|
||||
LUKS暗号化とbtrfsの構成は`hosts/x1g13/disko.nix`を参照。
|
||||
|
||||
### 7. ディスクのパーティション
|
||||
|
||||
```bash
|
||||
cd ~/dotfiles
|
||||
nix run github:nix-community/disko -- --mode disko hosts/<hostname>/disko.nix
|
||||
disko --mode destroy,format,mount hosts/<hostname>/disko.nix
|
||||
```
|
||||
|
||||
### 8. ホストキーのコピー
|
||||
### 8. ハードウェア設定の生成
|
||||
|
||||
対象マシンのハードウェア設定を生成し、新しいホストのディレクトリへ直接保存:
|
||||
|
||||
```bash
|
||||
nixos-generate-config --no-filesystems --root /mnt --show-hardware-config \
|
||||
> ~/dotfiles/hosts/<hostname>/hardware-configuration.nix
|
||||
```
|
||||
|
||||
`hosts/<hostname>/nixos.nix`から生成した設定とDisko設定を読み込む:
|
||||
|
||||
```nix
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./disko.nix
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### 9. ホストキーのコピー
|
||||
|
||||
```bash
|
||||
mkdir -p /mnt/etc/ssh
|
||||
@@ -138,13 +126,13 @@ cp /tmp/ssh_host_ed25519_key* /mnt/etc/ssh/
|
||||
chmod 600 /mnt/etc/ssh/ssh_host_ed25519_key
|
||||
```
|
||||
|
||||
### 9. NixOSインストール
|
||||
### 10. NixOSインストール
|
||||
|
||||
```bash
|
||||
nixos-install --flake ~/dotfiles#<hostname>
|
||||
```
|
||||
|
||||
### 10. 再起動
|
||||
### 11. 再起動
|
||||
|
||||
```bash
|
||||
reboot
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
# iOS Simulator 初期セットアップ
|
||||
|
||||
この手順は `m2` の macOS 環境で、stable Xcode と最新の stable iOS Simulator Runtime を使える状態にするためのもの。
|
||||
|
||||
## 前提
|
||||
|
||||
- `m2` が `workload.development` profile を有効にしていること
|
||||
- Mac App Store に Apple Account でサインイン済みであること
|
||||
- dotfiles を最新化していること
|
||||
|
||||
Xcode 本体は `applications.xcode` が Mac App Store 版を管理する。Simulator Runtime は Apple が管理する mutable state のため、Nix store には入れず専用 dev shell から導入する。
|
||||
|
||||
## 1. macOS 設定を反映する
|
||||
|
||||
リポジトリ直下で nix-darwin の設定を反映する。
|
||||
|
||||
```bash
|
||||
sudo darwin-rebuild switch --flake .#m2
|
||||
```
|
||||
|
||||
これにより `/Applications/Xcode.app` に stable Xcode がインストールされる。
|
||||
|
||||
Xcode のインストールで Mac App Store の認証エラーになる場合は、App Store を一度開いてサインイン状態を確認してから再実行する。
|
||||
|
||||
## 2. iOS Simulator Runtime を導入する
|
||||
|
||||
初回セットアップは次の1コマンドで行う。
|
||||
|
||||
```bash
|
||||
nix develop .#ios -c ios-simulator-install
|
||||
```
|
||||
|
||||
`ios-simulator-install` は次を順に実行する。
|
||||
|
||||
1. `/Applications/Xcode.app` が存在することを確認
|
||||
2. `xcode-select` の Developer Directory を stable Xcode に切り替え
|
||||
3. Xcode の first-launch components を導入
|
||||
4. 利用可能な新しい hardware support components を確認
|
||||
5. 選択中の Xcode に対応する最新の iOS Simulator Runtime をダウンロードしてインストール
|
||||
6. Xcode のバージョンとインストール済み Simulator Runtime を表示
|
||||
|
||||
途中で `sudo` の認証を求められる場合がある。
|
||||
|
||||
## 3. インストールを確認する
|
||||
|
||||
```bash
|
||||
xcodebuild -version
|
||||
xcode-select -p
|
||||
xcrun simctl list runtimes
|
||||
xcrun simctl list devices available
|
||||
```
|
||||
|
||||
`xcode-select -p` は次を指していること。
|
||||
|
||||
```text
|
||||
/Applications/Xcode.app/Contents/Developer
|
||||
```
|
||||
|
||||
`xcrun simctl list runtimes` に iOS runtime が表示されればセットアップ完了。
|
||||
|
||||
## 4. Simulator を起動する
|
||||
|
||||
```bash
|
||||
open -a Simulator
|
||||
```
|
||||
|
||||
Simulator の Device メニューから、インストール済み runtime で利用可能な iPhone を選択する。
|
||||
|
||||
## Runtime の更新
|
||||
|
||||
Xcode を stable の新しいバージョンへ更新した後は、同じコマンドを再実行する。
|
||||
|
||||
```bash
|
||||
nix develop .#ios -c ios-simulator-install
|
||||
```
|
||||
|
||||
Xcode の選択、first-launch components、hardware support、iOS Simulator Runtime の状態をまとめて更新できる。
|
||||
|
||||
## トラブルシューティング
|
||||
|
||||
### Xcode が見つからない
|
||||
|
||||
次のエラーが出る場合、先に nix-darwin の設定を反映する。
|
||||
|
||||
```text
|
||||
Xcode is not installed at /Applications/Xcode.app.
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo darwin-rebuild switch --flake .#m2
|
||||
```
|
||||
|
||||
### Simulator Runtime が見えない
|
||||
|
||||
まず runtime 一覧を確認する。
|
||||
|
||||
```bash
|
||||
xcrun simctl list runtimes
|
||||
```
|
||||
|
||||
iOS runtime がない場合は再度インストーラーを実行する。
|
||||
|
||||
```bash
|
||||
nix develop .#ios -c ios-simulator-install
|
||||
```
|
||||
|
||||
### Command Line Tools 側を参照している
|
||||
|
||||
```bash
|
||||
xcode-select -p
|
||||
```
|
||||
|
||||
が `/Library/Developer/CommandLineTools` を指している場合でも、`ios-simulator-install` が `/Applications/Xcode.app/Contents/Developer` へ切り替える。
|
||||
|
||||
手動で直す場合は次を実行する。
|
||||
|
||||
```bash
|
||||
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
|
||||
```
|
||||
+72
-12
@@ -1,26 +1,86 @@
|
||||
# カスタムISOビルド
|
||||
# カスタムインストーラー ISO
|
||||
|
||||
`hosts/installer` から、NixOS 26.05 ベースの `x86_64-linux` 用インストーラー
|
||||
ISO を作成する。installer ホストは Home Manager を使用せず、`base` プロファイルと
|
||||
ホスト固有のインストール支援設定だけを含む。
|
||||
|
||||
## ビルド
|
||||
|
||||
flake 対応の Nix が利用できる環境で、リポジトリのルートから実行する。
|
||||
`x86_64-linux` 以外のマシンで実行する場合は、対応する Linux リモートビルダーが
|
||||
必要になる。
|
||||
|
||||
```bash
|
||||
nix build .#nixosConfigurations.installer.config.system.build.isoImage
|
||||
```
|
||||
|
||||
## ISO書き込み
|
||||
生成された ISO は次の場所にある。
|
||||
|
||||
```text
|
||||
result/iso/nixos-minimal-*-x86_64-linux.iso
|
||||
```
|
||||
|
||||
ファイル名に含まれる NixOS のバージョンとリビジョンは、`flake.lock` の更新に応じて
|
||||
変わる。生成物を確認するには次を実行する。
|
||||
|
||||
```bash
|
||||
# USBデバイスの確認
|
||||
lsblk
|
||||
ls -lh result/iso/*.iso
|
||||
sha256sum result/iso/*.iso
|
||||
```
|
||||
|
||||
# 書き込み(/dev/sdXは実際のデバイスに置き換える)
|
||||
sudo dd if=./result/nixos-minimal-*.iso of=/dev/sdX bs=4M status=progress
|
||||
## USB メモリへの書き込み
|
||||
|
||||
書き込み先はパーティション(例: `/dev/sdX1`)ではなく、USB デバイス全体
|
||||
(例: `/dev/sdX`)を指定する。この操作は指定したデバイスの内容を上書きするため、
|
||||
サイズ、モデル、マウント先を確認する。
|
||||
|
||||
```bash
|
||||
lsblk -p -o NAME,SIZE,TYPE,MODEL,MOUNTPOINTS
|
||||
```
|
||||
|
||||
USB のマウント済みパーティションをアンマウントしてから、`/dev/sdX` と
|
||||
`/dev/sdX1` を確認した実際のデバイス名に置き換えて書き込む。パーティションが
|
||||
複数ある場合は、それぞれをアンマウントする。
|
||||
|
||||
```bash
|
||||
sudo umount /dev/sdX1
|
||||
sudo dd if=result/iso/nixos-minimal-*-x86_64-linux.iso \
|
||||
of=/dev/sdX bs=4M conv=fsync status=progress
|
||||
sync
|
||||
```
|
||||
|
||||
## ISOの特徴
|
||||
書き込み完了後、USB を安全に取り外して対象マシンから起動する。
|
||||
|
||||
- SSH鍵認証でrootログイン可能
|
||||
- 有線LANはDHCPで自動設定
|
||||
- WiFiは`nmcli`で手動設定可能
|
||||
- disko/sops/ageなどのツールを内蔵
|
||||
- ブート時にIPアドレスとヘルプを表示
|
||||
## 起動後の接続
|
||||
|
||||
有線 LAN は DHCP で自動設定される。Wi-Fi を使用する場合は、インストーラーの
|
||||
コンソールで NetworkManager を使って接続する。
|
||||
|
||||
```bash
|
||||
nmcli device wifi list
|
||||
nmcli device wifi connect <SSID> --ask
|
||||
```
|
||||
|
||||
起動時にコンソールへ IPv4 アドレスと簡易ヘルプが表示される。表示されたアドレスへ
|
||||
登録済みの SSH 鍵で接続する。
|
||||
|
||||
```bash
|
||||
ssh root@<ip-address>
|
||||
```
|
||||
|
||||
root のパスワードログインとキーボード対話認証は無効で、
|
||||
`hosts/installer/nixos.nix` に登録された公開鍵だけが利用できる。
|
||||
以降の作業は、構成に応じて次の手順を参照する:
|
||||
|
||||
- [SOPSなし・ディスク暗号化なし](install-simple.md)
|
||||
- [SOPS・ディスク暗号化あり](install.md)
|
||||
|
||||
## ISO に含まれる主な設定とツール
|
||||
|
||||
- Nix flakes と `nix-command`
|
||||
- NetworkManager、OpenSSH、起動時の IP アドレス表示
|
||||
- `disko`、`parted`、`cryptsetup`、`btrfs-progs`、`efibootmgr`
|
||||
- `sops`、`age`、`ssh-to-age`
|
||||
- `age-plugin-yubikey`、`yubikey-manager`、`pcsc-tools` と `pcscd`
|
||||
- `sbctl`、`tpm2-tools`
|
||||
- `git`、`rsync`、`vim`、`wget`、`curl`、`jq`、`pciutils`、`util-linux`
|
||||
|
||||
Generated
+747
-258
File diff suppressed because it is too large
Load Diff
@@ -91,6 +91,13 @@
|
||||
url = "github:ilysenko/codex-desktop-linux";
|
||||
};
|
||||
|
||||
codex-session-usage.url = "github:moons-14/codex-session-usage";
|
||||
|
||||
skills = {
|
||||
url = "github:mattpocock/skills";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Index / Search
|
||||
nix-index-database = {
|
||||
url = "github:nix-community/nix-index-database";
|
||||
@@ -104,6 +111,10 @@
|
||||
url = "github:nix-community/browser-previews";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nani-translate-linux.url = "git+https://github.com/zunoser/nani-translate-linux.git";
|
||||
|
||||
containerlab.url = "github:srl-labs/containerlab";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
||||
+17
-8
@@ -1,15 +1,14 @@
|
||||
{
|
||||
nix-example = {
|
||||
nix-builder = {
|
||||
system = "x86_64-linux";
|
||||
stateVersion = "26.05";
|
||||
user = "moons";
|
||||
path = ./nix-example;
|
||||
path = ./nix-builder;
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.cli"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.development"
|
||||
"workload.remote-access"
|
||||
];
|
||||
};
|
||||
@@ -22,22 +21,25 @@
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.cli"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.remote-access"
|
||||
"workload.deploy-rs-target"
|
||||
];
|
||||
};
|
||||
|
||||
internal-app-01 = {
|
||||
netsrv-01 = {
|
||||
system = "x86_64-linux";
|
||||
stateVersion = "26.05";
|
||||
user = "moons";
|
||||
path = ./internal-app-01;
|
||||
path = ./netsrv-01;
|
||||
|
||||
profiles = [
|
||||
"base"
|
||||
"interface.cli"
|
||||
"interface.minimal"
|
||||
"platform.vm"
|
||||
"workload.remote-access"
|
||||
"workload.deploy-rs-target"
|
||||
"workload.server"
|
||||
];
|
||||
};
|
||||
@@ -89,8 +91,10 @@
|
||||
"security.tpm-storage"
|
||||
"workload.development"
|
||||
"workload.game"
|
||||
"workload.network-lab"
|
||||
"workload.personal"
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
galleria = {
|
||||
@@ -104,6 +108,7 @@
|
||||
"interface.cli"
|
||||
"interface.labwc"
|
||||
"interface.niri"
|
||||
"networking.tailscale-client"
|
||||
"platform.intel-nvidia-desktop"
|
||||
"security.secrets"
|
||||
"security.secure-boot"
|
||||
@@ -111,7 +116,11 @@
|
||||
"security.fingerprint"
|
||||
"workload.development"
|
||||
"workload.game"
|
||||
"workload.machine-learning"
|
||||
"workload.network-lab"
|
||||
"workload.personal"
|
||||
"workload.photography"
|
||||
"workload.camera"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
# This desktop is permanently connected to AC power.
|
||||
systemd.user.services.swayidle.Service.Environment = [
|
||||
"SWAYIDLE_ASSUME_AC=1"
|
||||
];
|
||||
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
boot.initrd.luks.devices.cryptroot.device =
|
||||
"/dev/disk/by-partuuid/04295552-cbb8-4511-ac1e-1171ec20f8d1";
|
||||
|
||||
# Keep Windows data and recovery partitions out of UDisks-based file
|
||||
# managers. The shared EFI System Partition stays available as /boot.
|
||||
services.udev.extraRules = ''
|
||||
ENV{ID_PART_ENTRY_UUID}=="0480f887-d1f9-489d-b8fe-78549ced1938", ENV{UDISKS_IGNORE}="1"
|
||||
ENV{ID_PART_ENTRY_UUID}=="6c70041b-3f65-4eb1-8b08-18ed20001877", ENV{UDISKS_IGNORE}="1"
|
||||
'';
|
||||
|
||||
environment.systemPackages = with inputs.browser-previews.packages.${pkgs.system}; [
|
||||
google-chrome-beta
|
||||
];
|
||||
|
||||
+19
-24
@@ -31,6 +31,7 @@
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIKhxDkucmeCor6CKoXAua7DgDSzuXrZOtpdkyzQxz5+aAAAABHNzaDo= moons@moons14.com"
|
||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIN6hZJyng/5LgFKPjR6uZAd/00UkO0vN0uQOoIvfSELdAAAABHNzaDo= moons@moons14.com"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPLwReAiwhXoO34S2+MrvqUhi8IWp4IzUq4OSp3niJdq"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
@@ -75,6 +76,12 @@
|
||||
║ ║
|
||||
║ Installation Workflow: ║
|
||||
║ ║
|
||||
║ Choose a guide after cloning: ║
|
||||
║ Simple: docs/install-simple.md ║
|
||||
║ SOPS + LUKS: docs/install.md ║
|
||||
║ ║
|
||||
║ The workflow below is for SOPS + LUKS: ║
|
||||
║ ║
|
||||
║ 1. Clone dotfiles: ║
|
||||
║ git clone git@github.com:moons-14/dotfiles.git ~/dotfiles║
|
||||
║ ║
|
||||
@@ -102,37 +109,25 @@
|
||||
║ # See hosts/x1g13/disko.nix for reference ║
|
||||
║ ║
|
||||
║ 7. Partition disk with disko: ║
|
||||
║ nix run github:nix-community/disko -- \ ║
|
||||
║ --mode disko hosts/<host>/disko.nix ║
|
||||
║ disko --mode destroy,format,mount \ ║
|
||||
║ hosts/<host>/disko.nix ║
|
||||
║ ║
|
||||
║ 8. Copy host key to installed system: ║
|
||||
║ 8. Generate hardware configuration: ║
|
||||
║ nixos-generate-config --no-filesystems --root /mnt \ ║
|
||||
║ --show-hardware-config > \ ║
|
||||
║ ~/dotfiles/hosts/<host>/hardware-configuration.nix ║
|
||||
║ # Import hardware-configuration.nix and disko.nix ║
|
||||
║ # from hosts/<host>/nixos.nix ║
|
||||
║ ║
|
||||
║ 9. Copy host key to installed system: ║
|
||||
║ mkdir -p /mnt/etc/ssh ║
|
||||
║ cp /tmp/ssh_host_ed25519_key* /mnt/etc/ssh/ ║
|
||||
║ chmod 600 /mnt/etc/ssh/ssh_host_ed25519_key ║
|
||||
║ ║
|
||||
║ 9. Install NixOS: ║
|
||||
║ 10. Install NixOS: ║
|
||||
║ nixos-install --flake ~/dotfiles#<host> ║
|
||||
║ ║
|
||||
║ Disko Configuration Examples: ║
|
||||
║ ║
|
||||
║ Simple (no encryption): ║
|
||||
║ disko.devices.disk.main = { ║
|
||||
║ type = "disk"; ║
|
||||
║ device = "/dev/sda"; ║
|
||||
║ content = { ║
|
||||
║ type = "gpt"; ║
|
||||
║ partitions = { ║
|
||||
║ ESP = { size = "512M"; type = "EF00"; ║
|
||||
║ content = { type = "filesystem"; ║
|
||||
║ format = "vfat"; mountpoint = "/boot"; }; }; ║
|
||||
║ root = { size = "100%"; ║
|
||||
║ content = { type = "filesystem"; ║
|
||||
║ format = "ext4"; mountpoint = "/"; }; }; ║
|
||||
║ }; ║
|
||||
║ }; ║
|
||||
║ }; ║
|
||||
║ ║
|
||||
║ LUKS + btrfs (see hosts/x1g13/disko.nix): ║
|
||||
║ LUKS + btrfs (see hosts/x1g13/disko.nix): ║
|
||||
║ - Use partuuid for device path ║
|
||||
║ - Set askPassword = true for LUKS ║
|
||||
║ - Configure btrfs subvolumes ║
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Do not modify this file! It was generated by `nixos-generate-config` and may
|
||||
# be overwritten by future invocations.
|
||||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/1b12ab98-2537-4207-a3f4-bb8ba7b53b00";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/8365-C778";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
_: {
|
||||
disko.enableConfig = true;
|
||||
|
||||
disko.devices.disk.main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# QEMU hardware baseline. Replace this with the output of
|
||||
# `nixos-generate-config` after provisioning the VM if its hardware differs.
|
||||
{
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
networking = {
|
||||
interfaces = {
|
||||
ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.65.11";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens19 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.66.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens20 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.77.21";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
defaultGateway = {
|
||||
address = "10.50.66.1";
|
||||
interface = "ens19";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./disko.nix
|
||||
./networking.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
_:
|
||||
let
|
||||
osDisk = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
|
||||
in
|
||||
{
|
||||
disko.enableConfig = true;
|
||||
|
||||
# The VM disks already contain live filesystems. Model each existing
|
||||
# filesystem without giving Disko ownership of their partitioning or data.
|
||||
disko.devices.disk = {
|
||||
boot = {
|
||||
type = "disk";
|
||||
device = "${osDisk}-part1";
|
||||
destroy = false;
|
||||
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
root = {
|
||||
type = "disk";
|
||||
device = "${osDisk}-part2";
|
||||
destroy = false;
|
||||
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
|
||||
nix-build = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1";
|
||||
destroy = false;
|
||||
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/var/lib/nix-build";
|
||||
mountOptions = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
|
||||
nix-store = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi2";
|
||||
destroy = false;
|
||||
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/nix/store";
|
||||
mountOptions = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/nix/store".neededForBoot = true;
|
||||
nix.settings.build-dir = "/var/lib/nix-build";
|
||||
services.fstrim.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
primaryUser,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
homeDirectory = "/home/${primaryUser}";
|
||||
fleetDirectory = "${homeDirectory}/srv/nix-fleet";
|
||||
stateDirectory = "/var/lib/nix-fleet";
|
||||
sourceDirectory = "${stateDirectory}/source";
|
||||
|
||||
git = "${pkgs.git}/bin/git";
|
||||
nix = "${config.nix.package}/bin/nix";
|
||||
rsync = "${pkgs.rsync}/bin/rsync";
|
||||
|
||||
cleanCheckoutConditions = [
|
||||
"${git} -C ${fleetDirectory} diff --quiet"
|
||||
"${git} -C ${fleetDirectory} diff --cached --quiet"
|
||||
];
|
||||
in
|
||||
{
|
||||
systemd.services.nix-fleet-converge = {
|
||||
description = "Update inputs, build the fleet, and deploy changed hosts";
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
environment = {
|
||||
HOME = homeDirectory;
|
||||
NIX_CONFIG = ''
|
||||
accept-flake-config = true
|
||||
max-jobs = 4
|
||||
cores = 3
|
||||
'';
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = primaryUser;
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5min";
|
||||
StateDirectory = "nix-fleet";
|
||||
StateDirectoryMode = "0750";
|
||||
WorkingDirectory = stateDirectory;
|
||||
UMask = "0077";
|
||||
ExecCondition = cleanCheckoutConditions;
|
||||
EnvironmentFile = "${fleetDirectory}/.env";
|
||||
|
||||
# Work in a disposable copy so updating the dotfiles lock never dirties
|
||||
# the operator's nix-fleet checkout.
|
||||
ExecStart = [
|
||||
"${git} -C ${fleetDirectory} pull --ff-only"
|
||||
"${rsync} --archive --delete --exclude=.git/ --exclude=.direnv/ --exclude=.env --exclude=result --exclude=result-* ${fleetDirectory}/ ${sourceDirectory}/"
|
||||
"${nix} flake update --flake ${sourceDirectory} dotfiles"
|
||||
"${nix} run ${sourceDirectory}#converge -- ${sourceDirectory} ${stateDirectory}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.nix-fleet-converge = {
|
||||
description = "Periodically converge the NixOS fleet";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "2min";
|
||||
OnUnitInactiveSec = "5min";
|
||||
RandomizedDelaySec = "30s";
|
||||
Persistent = true;
|
||||
Unit = "nix-fleet-converge.service";
|
||||
};
|
||||
};
|
||||
|
||||
# Only an actual successful deployment touches gc-request. This starts the
|
||||
# builder's root nh-clean unit; remote host stores are never cleaned here.
|
||||
systemd.paths.nix-fleet-gc = {
|
||||
description = "Garbage-collect superseded fleet builds on nix-builder";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
pathConfig = {
|
||||
PathChanged = "${stateDirectory}/gc-request";
|
||||
Unit = "nh-clean.service";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
nix.settings = {
|
||||
build-dir = "/var/lib/nix-build";
|
||||
|
||||
secret-key-files = [
|
||||
"/var/lib/secrets/nix-cache-signing-key"
|
||||
];
|
||||
|
||||
auto-optimise-store = lib.mkForce false;
|
||||
keep-outputs = false;
|
||||
keep-derivations = true;
|
||||
};
|
||||
|
||||
services.harmonia.cache = {
|
||||
enable = true;
|
||||
|
||||
signKeyPaths = [
|
||||
"/var/lib/secrets/nix-cache-signing-key"
|
||||
];
|
||||
|
||||
settings = {
|
||||
bind = "[::]:5000";
|
||||
priority = 30;
|
||||
workers = 4;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
5000
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
networking = {
|
||||
interfaces = {
|
||||
ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.65.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens19 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.77.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens20 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.68.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
defaultGateway = {
|
||||
address = "10.50.68.1";
|
||||
interface = "ens20";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
imports = [
|
||||
./fleet-automation.nix
|
||||
./disko.nix
|
||||
./hardware-configuration.nix
|
||||
./harmonia.nix
|
||||
./networking.nix
|
||||
];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
# Do not modify this file! It was generated by `nixos-generate-config` and may
|
||||
# be overwritten by future invocations.
|
||||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/8f0eaec6-5dc9-4821-aa8d-fb6809b5a5bf";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/201C-961B";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
_: {
|
||||
disko.enableConfig = true;
|
||||
|
||||
disko.devices.disk.main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,8 +1,16 @@
|
||||
# Do not modify this file! It was generated by `nixos-generate-config` and may
|
||||
# be overwritten by future invocations.
|
||||
{ lib, modulesPath, ... }:
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
@@ -16,21 +24,5 @@
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/69fa2193-1e4f-438a-8898-5de8a3f36e5b";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D09B-4277";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
networking = {
|
||||
interfaces = {
|
||||
ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.65.100";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens19 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.80.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens20 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.77.20";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
defaultGateway = {
|
||||
address = "10.50.80.1";
|
||||
interface = "ens19";
|
||||
};
|
||||
};
|
||||
}
|
||||
+5
-49
@@ -1,51 +1,7 @@
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
|
||||
interfaces = {
|
||||
ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.128.20";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens19 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.7.101";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
ens20 = {
|
||||
useDHCP = false;
|
||||
ipv4.routes = [
|
||||
{
|
||||
address = "10.50.64.0";
|
||||
prefixLength = 24;
|
||||
via = "10.50.82.1";
|
||||
}
|
||||
];
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.50.82.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
defaultGateway = {
|
||||
address = "10.50.128.1";
|
||||
interface = "ens18";
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./networking.nix
|
||||
./disko.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
homebrew.casks = [ "activitywatch" ];
|
||||
|
||||
launchd.agents.activitywatch = {
|
||||
command = "/usr/bin/open -gja ActivityWatch";
|
||||
serviceConfig.RunAtLoad = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.activitywatch = {
|
||||
enable = true;
|
||||
|
||||
watchers.aw-awatcher = {
|
||||
package = pkgs.awatcher;
|
||||
executable = "awatcher";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
description = "ActivityWatch automated time tracker";
|
||||
}
|
||||
@@ -1,9 +1,37 @@
|
||||
_: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
chrome = pkgs.google-chrome.overrideAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
|
||||
|
||||
postFixup = (old.postFixup or "") + ''
|
||||
wrapProgram $out/bin/google-chrome-stable \
|
||||
--set LIBVA_DRIVER_NAME nvidia \
|
||||
--set NVD_BACKEND direct
|
||||
'';
|
||||
});
|
||||
|
||||
features = [
|
||||
"MiddleClickAutoscroll"
|
||||
"AcceleratedVideoDecoder"
|
||||
"AcceleratedVideoDecodeLinuxGL"
|
||||
"PlatformHEVCDecoderSupport"
|
||||
]
|
||||
++ lib.optional config.my.hardwares.nvidia.enable "VaapiOnNvidiaGPUs";
|
||||
in
|
||||
{
|
||||
programs.google-chrome = {
|
||||
enable = true;
|
||||
package = if config.my.hardwares.nvidia.enable then chrome else pkgs.google-chrome;
|
||||
|
||||
commandLineArgs = [
|
||||
"--enable-features=MiddleClickAutoscroll"
|
||||
"--enable-features=${lib.concatStringsSep "," features}"
|
||||
"--use-gl=angle"
|
||||
"--use-angle=gl"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
_: {
|
||||
description = "Codex Desktop for Linux";
|
||||
|
||||
includes = [ "applications.codex" ];
|
||||
|
||||
imports.nixos = [
|
||||
inputs.codex-desktop-linux.nixosModules.default
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,15 +4,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.codexDesktopLinux = {
|
||||
enable = true;
|
||||
cliPackage = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex;
|
||||
remoteControl.enable = true;
|
||||
remoteMobileControl.enable = true;
|
||||
computerUseUi.enable = false;
|
||||
linuxFeatures = [
|
||||
"appshots"
|
||||
"open-target-discovery"
|
||||
];
|
||||
};
|
||||
environment.systemPackages = [
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.chatgpt
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
codexSessionUsage = inputs.codex-session-usage.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
in
|
||||
{
|
||||
home.packages = [ codexSessionUsage ];
|
||||
|
||||
xdg.dataFile = {
|
||||
"vicinae/scripts/codex-session-usage/start" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!${lib.getExe pkgs.bash}
|
||||
# @vicinae.schemaVersion 1
|
||||
# @vicinae.title Start Codex Session Usage
|
||||
# @vicinae.description Start the local Codex session usage dashboard
|
||||
# @vicinae.mode compact
|
||||
# @vicinae.icon 📊
|
||||
# @vicinae.argument1 { "type": "text", "placeholder": "Port (optional)", "optional": true }
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
exec ${lib.getExe codexSessionUsage} start
|
||||
fi
|
||||
|
||||
if [[ "$1" =~ ^[0-9]+$ ]] && (( 10#$1 >= 1 && 10#$1 <= 65535 )); then
|
||||
exec ${lib.getExe codexSessionUsage} start --port "$1"
|
||||
fi
|
||||
|
||||
printf '%s\n' 'Port must be an integer between 1 and 65535.' >&2
|
||||
exit 2
|
||||
'';
|
||||
};
|
||||
|
||||
"vicinae/scripts/codex-session-usage/stop" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!${lib.getExe pkgs.bash}
|
||||
# @vicinae.schemaVersion 1
|
||||
# @vicinae.title Stop Codex Session Usage
|
||||
# @vicinae.description Stop the local Codex session usage dashboard
|
||||
# @vicinae.mode compact
|
||||
# @vicinae.icon 📊
|
||||
|
||||
exec ${lib.getExe codexSessionUsage} stop
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
model = "gpt-5.6-sol"
|
||||
model_reasoning_effort = "medium"
|
||||
|
||||
approval_policy = "on-request"
|
||||
approvals_reviewer = "auto_review"
|
||||
sandbox_mode = "workspace-write"
|
||||
web_search = "cached"
|
||||
|
||||
[sandbox_workspace_write]
|
||||
network_access = false
|
||||
|
||||
[projects."/home/moons/dotfiles"]
|
||||
trust_level = "trusted"
|
||||
@@ -1,6 +1,36 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex
|
||||
];
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
configDirectory =
|
||||
if config.home.preferXdgDirectories then
|
||||
"${config.xdg.configHome}/codex"
|
||||
else
|
||||
"${config.home.homeDirectory}/.codex";
|
||||
configFile = "${configDirectory}/config.toml";
|
||||
in
|
||||
{
|
||||
programs.codex = {
|
||||
enable = true;
|
||||
package = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex;
|
||||
|
||||
skills = {
|
||||
grilling = inputs.skills + "/skills/productivity/grilling";
|
||||
};
|
||||
};
|
||||
|
||||
# Keep the repository copy as an initial value. Codex may mutate the live
|
||||
# file between activations; each Home Manager switch resets it from here.
|
||||
home.activation.resetCodexConfig = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
${pkgs.coreutils}/bin/mkdir -p ${lib.escapeShellArg configDirectory}
|
||||
${pkgs.coreutils}/bin/install -m 0600 ${./config.toml} ${lib.escapeShellArg configFile}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
description = "Container-based networking labs";
|
||||
|
||||
includes = [ "services.docker" ];
|
||||
|
||||
imports.nixos = [ inputs.containerlab.nixosModules.default ];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
primaryUser,
|
||||
}:
|
||||
{
|
||||
programs.containerlab.enable = true;
|
||||
|
||||
users.users.${primaryUser}.extraGroups = [ "clab_admins" ];
|
||||
|
||||
programs.containerlab.package =
|
||||
inputs.containerlab.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs
|
||||
(_old: {
|
||||
vendorHash = "sha256-xp6YIoqJdUu1zEzw7s7+lh8iGJD4THokF5NPbxLH6zc=";
|
||||
});
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
inputs,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
# Keep default CUDA targets so dependencies match the CUDA binary cache.
|
||||
config = pkgs.config // {
|
||||
cudaSupport = osConfig.my.hardwares.nvidia.enable;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
(unstable.darktable.override {
|
||||
withAi = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -1,6 +1,15 @@
|
||||
_: {
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in
|
||||
{
|
||||
programs.vesktop = {
|
||||
enable = true;
|
||||
package = unstable.vesktop;
|
||||
|
||||
settings = {
|
||||
discordBranch = "stable";
|
||||
@@ -16,6 +25,10 @@ _: {
|
||||
|
||||
openLinksWithElectron = false;
|
||||
|
||||
# Keep WebRTC on the public interface selected by the default route.
|
||||
# Secondary private interfaces can otherwise stall voice at DTLS.
|
||||
webRTCIPHandlingPolicy = "default_public_interface_only";
|
||||
|
||||
spellCheckLanguages = [
|
||||
"ja-JP"
|
||||
"en-US"
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
|
||||
services.hazkey.enable = true;
|
||||
services.hazkey = {
|
||||
enable = true;
|
||||
server.package =
|
||||
inputs.nix-hazkey.packages.${pkgs.stdenv.hostPlatform.system}.hazkey-server.override
|
||||
{ enableVulkan = true; };
|
||||
};
|
||||
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.ffmpeg ];
|
||||
}
|
||||
@@ -6,6 +6,7 @@ _: {
|
||||
theme = "dracula";
|
||||
background-blur-radius = 20;
|
||||
background-opacity = 0.9;
|
||||
background-opacity-cells = true;
|
||||
font-family = "BlexMono Nerd Font Mono";
|
||||
mouse-hide-while-typing = true;
|
||||
window-decoration = "auto";
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{ inputs, system, ... }: {
|
||||
programs.ghostty = {
|
||||
systemd.enable = true;
|
||||
# Labwc's Close action correctly targets one xdg-toplevel, but Ghostty's
|
||||
# systemd service runs every window in one GTK single-instance process.
|
||||
# If that process exits while handling the request, every Ghostty window
|
||||
# disappears together. Keep each launcher invocation independent instead.
|
||||
systemd.enable = false;
|
||||
package = inputs.ghostty.packages.${system}.default;
|
||||
|
||||
settings.gtk-single-instance = false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@ in
|
||||
|
||||
ignores = [
|
||||
".direnv/"
|
||||
".envrc"
|
||||
"!.envrc.example"
|
||||
];
|
||||
|
||||
signing = {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.htop ];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.python314Packages.huggingface-hub ];
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
screenshot = import ./screenshot.nix { inherit pkgs; };
|
||||
|
||||
systemctl = lib.getExe' pkgs.systemd "systemctl";
|
||||
|
||||
keybind = key: actionAttrs: {
|
||||
@@ -62,8 +60,6 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [ screenshot ];
|
||||
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
# NixOS owns the package so Home Manager only generates the user config.
|
||||
@@ -106,8 +102,6 @@ in
|
||||
(action "W-q" "Close")
|
||||
(action "W-f" "ToggleMaximize")
|
||||
(action "W-c" "Iconify")
|
||||
(action "W-Tab" "NextWindow")
|
||||
(action "W-S-Tab" "PreviousWindow")
|
||||
(action "W-Up" "Lower")
|
||||
(action "W-Down" "Raise")
|
||||
(action "W-Left" "NextWindow")
|
||||
@@ -117,9 +111,9 @@ in
|
||||
(snapToEdge "W-C-Up" "up")
|
||||
(snapToEdge "W-C-Down" "down")
|
||||
(confirmAction "W-S-e" "Exit labwc?" "Exit")
|
||||
(execute "Print" "labwc-screenshot region")
|
||||
(execute "C-Print" "labwc-screenshot output")
|
||||
(execute "A-Print" "labwc-screenshot all")
|
||||
(execute "Print" "screenshot region")
|
||||
(execute "C-Print" "screenshot output")
|
||||
(execute "A-Print" "screenshot all")
|
||||
|
||||
# spawn applications (sync with niri modules/applications/niri/home.nix)
|
||||
(execute "W-t" "ghostty")
|
||||
@@ -127,7 +121,10 @@ in
|
||||
(execute "W-s" "noctalia msg panel-toggle launcher")
|
||||
(execute "W-e" "nautilus --new-window")
|
||||
(execute "W-l" "loginctl lock-session")
|
||||
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
|
||||
(execute "W-v" "vicinae vicinae://launch/clipboard/history")
|
||||
(execute "W-j" "nani-translate-primary")
|
||||
(execute "W-S-j" "nani-translate-ocr")
|
||||
(execute "W-C-j" "${lib.getExe' pkgs.xdg-utils "xdg-open"} naniapp://translate")
|
||||
(execute "W-space" "ghostty +toggle-quick-terminal")
|
||||
(execute "W-p" "wdisplays")
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
description = "labwc Wayland stacking compositor";
|
||||
|
||||
includes = [ "systems.wayland" ];
|
||||
includes = [
|
||||
"systems.wayland"
|
||||
"applications.screenshot"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in
|
||||
{
|
||||
programs.labwc = {
|
||||
enable = true;
|
||||
package = unstable.labwc;
|
||||
};
|
||||
|
||||
xdg.portal.config.labwc.default = [
|
||||
"wlr"
|
||||
"gtk"
|
||||
];
|
||||
|
||||
# xdg-desktop-portal-wlr implements screencasting for wlroots compositors.
|
||||
# Keep it with Labwc: Niri uses xdg-desktop-portal-gnome instead.
|
||||
xdg.portal.wlr = {
|
||||
enable = true;
|
||||
settings.screencast = {
|
||||
chooser_type = "dmenu";
|
||||
chooser_cmd = "${pkgs.fuzzel}/bin/fuzzel --dmenu";
|
||||
};
|
||||
};
|
||||
|
||||
# NixOS decides whether a graphical session manages graphical-session.target
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "labwc-screenshot";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
xdg-user-dirs
|
||||
];
|
||||
|
||||
text = ''
|
||||
mode="''${1:-region}"
|
||||
|
||||
pictures_dir="$(xdg-user-dir PICTURES)"
|
||||
if [[ -z "$pictures_dir" ]]; then
|
||||
pictures_dir="$HOME/Pictures"
|
||||
fi
|
||||
|
||||
output_dir="$pictures_dir/Screenshots"
|
||||
output_file="$output_dir/Screenshot from $(date '+%Y-%m-%d %H-%M-%S').png"
|
||||
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
case "$mode" in
|
||||
region)
|
||||
geometry="$(slurp)" || exit 0
|
||||
grim -g "$geometry" "$output_file"
|
||||
;;
|
||||
|
||||
output)
|
||||
geometry="$(slurp -o)" || exit 0
|
||||
grim -g "$geometry" "$output_file"
|
||||
;;
|
||||
|
||||
all)
|
||||
grim "$output_file"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown screenshot mode: $mode" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
wl-copy --type image/png < "$output_file"
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
homebrew = {
|
||||
enable = true;
|
||||
casks = [ "nani" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
tessdataBest = pkgs.runCommand "tessdata-best-jpn-eng-chi-sim" { } ''
|
||||
mkdir -p "$out"
|
||||
ln -s ${
|
||||
pkgs.fetchurl {
|
||||
url = "https://github.com/tesseract-ocr/tessdata_best/raw/main/jpn.traineddata";
|
||||
hash = "sha256-Nr35rII/WRHmJMMNBVPokLirx8MaZbPvFNqUNljEC3k=";
|
||||
}
|
||||
} "$out/jpn.traineddata"
|
||||
ln -s ${
|
||||
pkgs.fetchurl {
|
||||
url = "https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata";
|
||||
hash = "sha256-goCu0Hgv4nJXpo6hD+fvMkyg+Nhb0v0UXRwrVgvLZro=";
|
||||
}
|
||||
} "$out/eng.traineddata"
|
||||
ln -s ${
|
||||
pkgs.fetchurl {
|
||||
url = "https://github.com/tesseract-ocr/tessdata_best/raw/main/chi_sim.traineddata";
|
||||
hash = "sha256-T+8tEwbI6HYW1NPkxsZ/r11EvjNCKQz48vD246p+c1s=";
|
||||
}
|
||||
} "$out/chi_sim.traineddata"
|
||||
'';
|
||||
|
||||
tesseract = pkgs.tesseract5.override {
|
||||
tessdata = tessdataBest;
|
||||
};
|
||||
|
||||
naniTranslatePrimary = pkgs.writeShellApplication {
|
||||
name = "nani-translate-primary";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
jq
|
||||
wl-clipboard
|
||||
xdg-utils
|
||||
];
|
||||
|
||||
text = ''
|
||||
selected_text="$(wl-paste --primary --no-newline)" || exit 0
|
||||
[ -n "$selected_text" ] || exit 0
|
||||
encoded_text="$(printf '%s' "$selected_text" | jq -sRr @uri)"
|
||||
exec xdg-open "naniapp://translate?source=$encoded_text"
|
||||
'';
|
||||
};
|
||||
|
||||
naniTranslateOcr = pkgs.writeShellApplication {
|
||||
name = "nani-translate-ocr";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
grim
|
||||
jq
|
||||
slurp
|
||||
tesseract
|
||||
xdg-utils
|
||||
];
|
||||
|
||||
text = ''
|
||||
geometry="$(slurp)" || exit 0
|
||||
captured_text="$(
|
||||
grim -g "$geometry" - \
|
||||
| tesseract stdin stdout -l jpn+eng+chi_sim --oem 1 --psm 6
|
||||
)"
|
||||
[ -n "$captured_text" ] || exit 0
|
||||
encoded_text="$(printf '%s' "$captured_text" | jq -sRr @uri)"
|
||||
exec xdg-open "naniapp://translate?source=$encoded_text"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.naniTranslateLinux.enable = true;
|
||||
|
||||
xdg.mimeApps.defaultApplications."x-scheme-handler/naniapp" = "nani.desktop";
|
||||
|
||||
home.packages = [
|
||||
naniTranslatePrimary
|
||||
naniTranslateOcr
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
description = "Nani Translate application";
|
||||
|
||||
imports.home = [
|
||||
inputs.nani-translate-linux.homeManagerModules.default
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.nano ];
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
description = "Sipeed NanoKVM-USB desktop client";
|
||||
|
||||
includes = [ "services.nanokvm-usb" ];
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
pname = "nanokvm-usb";
|
||||
version = "1.1.4";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/sipeed/NanoKVM-USB/releases/download/v${version}/NanoKVM-USB-${version}-linux-x86_64.AppImage";
|
||||
hash = "sha256-00MT4U2afv0qt3xFVhLr0SSmS2cLrKBlmfzqYEFuaVc=";
|
||||
};
|
||||
|
||||
appimageContents = pkgs.appimageTools.extractType2 {
|
||||
inherit pname src version;
|
||||
};
|
||||
|
||||
nanokvm-usb = pkgs.appimageTools.wrapType2 {
|
||||
inherit pname src version;
|
||||
|
||||
meta = {
|
||||
description = "Sipeed NanoKVM-USB desktop client";
|
||||
homepage = "https://github.com/sipeed/NanoKVM-USB";
|
||||
license = pkgs.lib.licenses.gpl3Only;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "nanokvm-usb";
|
||||
};
|
||||
};
|
||||
|
||||
desktopItem = pkgs.makeDesktopItem {
|
||||
name = pname;
|
||||
desktopName = "NanoKVM-USB";
|
||||
comment = "NanoKVM-USB Desktop";
|
||||
exec = "nanokvm-usb --no-sandbox %U";
|
||||
icon = "${appimageContents}/nanokvm-usb.png";
|
||||
categories = [ "Utility" ];
|
||||
startupWMClass = "NanoKVM-USB";
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
nanokvm-usb
|
||||
desktopItem
|
||||
];
|
||||
}
|
||||
@@ -25,6 +25,7 @@ in
|
||||
systemd.user.sessionVariables.NAUTILUS_4_EXTENSION_DIR = nautilusExtensionDir;
|
||||
|
||||
xdg.dataFile."nautilus-python/extensions/open-in-editor.py".text = ''
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from gi.repository import GObject, Nautilus
|
||||
@@ -75,6 +76,12 @@ in
|
||||
|
||||
return paths
|
||||
|
||||
@staticmethod
|
||||
def get_working_directory(paths):
|
||||
path = paths[0]
|
||||
|
||||
return path if os.path.isdir(path) else os.path.dirname(path)
|
||||
|
||||
@staticmethod
|
||||
def launch(_item, command):
|
||||
subprocess.Popen(
|
||||
@@ -101,6 +108,22 @@ in
|
||||
|
||||
items.append(item)
|
||||
|
||||
item = Nautilus.MenuItem(
|
||||
name=f"OpenInEditor::{context}::ghostty",
|
||||
label="Ghostty で開く",
|
||||
)
|
||||
|
||||
item.connect(
|
||||
"activate",
|
||||
self.launch,
|
||||
[
|
||||
"${lib.getExe pkgs.ghostty}",
|
||||
f"--working-directory={self.get_working_directory(paths)}",
|
||||
],
|
||||
)
|
||||
|
||||
items.append(item)
|
||||
|
||||
return items
|
||||
|
||||
def get_file_items(self, files):
|
||||
@@ -139,14 +162,6 @@ in
|
||||
"file://${config.home.homeDirectory}/Desktop Desktop"
|
||||
"file://${config.home.homeDirectory}/Pictures Pictures"
|
||||
"file://${config.home.homeDirectory}/Downloads Downloads"
|
||||
"file://${config.home.homeDirectory}/projects projects"
|
||||
"file://${config.home.homeDirectory}/Projects Projects"
|
||||
];
|
||||
|
||||
home.activation.createProjectsDirectory = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
$DRY_RUN_CMD mkdir -p "$HOME/projects"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,4 +5,38 @@
|
||||
NH_FLAKE = "${config.home.homeDirectory}/dotfiles";
|
||||
NH_SHOW_ACTIVATION_LOGS = "1";
|
||||
};
|
||||
|
||||
programs.zsh.initContent = ''
|
||||
export SUDO_PROMPT=$'\a[sudo] authenticate for %u: '
|
||||
|
||||
nh() {
|
||||
local notify=false
|
||||
local argument
|
||||
|
||||
case "$1:$2" in
|
||||
os:switch | os:build) notify=true ;;
|
||||
esac
|
||||
|
||||
for argument in "$@"; do
|
||||
if [[ "$argument" == "--update" ]]; then
|
||||
notify=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
command nh "$@"
|
||||
local status=$?
|
||||
|
||||
if [[ "$notify" == true ]]; then
|
||||
printf '\a'
|
||||
if ((status == 0)); then
|
||||
print -P "%F{green}nh completed%f"
|
||||
else
|
||||
print -P "%F{red}nh failed (exit $status)%f"
|
||||
fi
|
||||
fi
|
||||
|
||||
return "$status"
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# niri のデフォルトキーバインド。編集しないこと。
|
||||
{
|
||||
"Mod+Shift+Slash".action.show-hotkey-overlay = { };
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ in
|
||||
|
||||
binds = keybindings // {
|
||||
# niri window or focus move
|
||||
"Mod+MouseMiddle".action.toggle-window-floating = [ ];
|
||||
|
||||
"Mod+Shift+Left" = {
|
||||
action.focus-monitor-left = [ ];
|
||||
hotkey-overlay.title = "Focus Monitor Left";
|
||||
@@ -24,6 +26,18 @@ in
|
||||
hotkey-overlay.title = "Focus Monitor Down";
|
||||
};
|
||||
|
||||
# Use the modifier combinations in the opposite direction from Niri's defaults.
|
||||
"Mod+WheelScrollDown".action.focus-column-right = [ ];
|
||||
"Mod+WheelScrollUp".action.focus-column-left = [ ];
|
||||
"Mod+Shift+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-down = [ ];
|
||||
};
|
||||
"Mod+Shift+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-up = [ ];
|
||||
};
|
||||
|
||||
"Mod+Shift+Ctrl+Left" = {
|
||||
action.move-window-to-monitor-left = [ ];
|
||||
hotkey-overlay.title = "Move Window to Monitor Left";
|
||||
@@ -41,6 +55,19 @@ in
|
||||
hotkey-overlay.title = "Move Window to Monitor Down";
|
||||
};
|
||||
|
||||
"Print".action.spawn = [
|
||||
"screenshot"
|
||||
"region"
|
||||
];
|
||||
"Ctrl+Print".action.spawn = [
|
||||
"screenshot"
|
||||
"output"
|
||||
];
|
||||
"Alt+Print".action.spawn = [
|
||||
"screenshot"
|
||||
"all"
|
||||
];
|
||||
|
||||
# spawn applications (sync with labwc modules/applications/labwc/home.nix)
|
||||
"Mod+T" = {
|
||||
action.spawn = "ghostty";
|
||||
@@ -79,10 +106,28 @@ in
|
||||
"Mod+V" = {
|
||||
action.spawn = [
|
||||
"vicinae"
|
||||
"vicinae://launch/clipboard/history?toggle=true"
|
||||
"vicinae://launch/clipboard/history"
|
||||
];
|
||||
hotkey-overlay.title = "Clipboard History";
|
||||
};
|
||||
"Mod+J" = {
|
||||
repeat = false;
|
||||
action.spawn = [ "nani-translate-primary" ];
|
||||
hotkey-overlay.title = "Translate Primary Selection";
|
||||
};
|
||||
"Mod+Shift+J" = {
|
||||
repeat = false;
|
||||
action.spawn = [ "nani-translate-ocr" ];
|
||||
hotkey-overlay.title = "OCR and Translate with Nani";
|
||||
};
|
||||
"Mod+Ctrl+J" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
(lib.getExe' pkgs.xdg-utils "xdg-open")
|
||||
"naniapp://translate"
|
||||
];
|
||||
hotkey-overlay.title = "Open Nani Translate";
|
||||
};
|
||||
"Mod+Space" = {
|
||||
action.spawn = [
|
||||
"ghostty"
|
||||
@@ -94,7 +139,6 @@ in
|
||||
action.spawn = "wdisplays";
|
||||
hotkey-overlay.title = "Display Settings: wdisplays";
|
||||
};
|
||||
|
||||
# Function keys (sync with labwc modules/applications/labwc/home.nix)
|
||||
"XF86AudioRaiseVolume".action.spawn = [
|
||||
"noctalia"
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
{
|
||||
description = "niri Wayland compositor";
|
||||
|
||||
includes = [ "systems.wayland" ];
|
||||
includes = [
|
||||
"systems.wayland"
|
||||
"applications.screenshot"
|
||||
];
|
||||
|
||||
imports = {
|
||||
nixos = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ lib, pkgs }:
|
||||
let
|
||||
version = "0.46.0";
|
||||
version = "0.56.0";
|
||||
architecture =
|
||||
if pkgs.stdenv.hostPlatform.isx86_64 then
|
||||
"x86_64"
|
||||
@@ -10,8 +10,8 @@ let
|
||||
throw "CodexBar CLI is only packaged for x86_64-linux and aarch64-linux";
|
||||
hash =
|
||||
{
|
||||
x86_64 = "sha256-yMrOpu1WIv2sGVgvY9qf2XCoX2AXMSqR2b8bQDRU6os=";
|
||||
aarch64 = "sha256-pCp3NOlxFN6zeH67W04WGSPbUae+ktzR5vEunWqu00g=";
|
||||
x86_64 = "sha256-hzCnAyiizm8ZDfE1ONEP6S2Pdnskclm+XdDBBhEYVqE=";
|
||||
aarch64 = "sha256-vfcgDEFpORPymcRYmlqvsjhV4pU7lNC8Vd9FDPI9UjM=";
|
||||
}
|
||||
.${architecture};
|
||||
in
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -41,6 +42,8 @@ in
|
||||
programs.noctalia = {
|
||||
enable = true;
|
||||
|
||||
package = inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
|
||||
systemd.enable = true;
|
||||
|
||||
settings = {
|
||||
@@ -154,7 +157,7 @@ in
|
||||
network-connection = {
|
||||
type = "custom_button";
|
||||
glyph = "access-point";
|
||||
actions.left = "nm-connection-editor";
|
||||
actions.left = "exec nm-connection-editor";
|
||||
};
|
||||
tray = {
|
||||
type = "tray";
|
||||
@@ -171,10 +174,11 @@ in
|
||||
"org.gnome.Nautilus"
|
||||
"org.gnome.TextEditor"
|
||||
"com.mitchellh.ghostty"
|
||||
"thunderbird"
|
||||
"google-chrome"
|
||||
"code"
|
||||
"dev.zed.Zed"
|
||||
"codex-desktop.desktop"
|
||||
"chatgpt"
|
||||
"vesktop"
|
||||
];
|
||||
show_all_outputs = true;
|
||||
@@ -193,7 +197,7 @@ in
|
||||
};
|
||||
|
||||
wallpaper = {
|
||||
enabled = true;
|
||||
enabled = lib.mkDefault true;
|
||||
directory = "~/.wallpapers";
|
||||
fill_mode = "crop";
|
||||
automation = {
|
||||
|
||||
@@ -2,5 +2,19 @@
|
||||
{
|
||||
home.packages = [
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.opencode
|
||||
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode
|
||||
];
|
||||
|
||||
home.file.".omo/omo.jsonc".text = builtins.toJSON {
|
||||
agents = {
|
||||
sisyphus.model = "openai/gpt-5.6-sol";
|
||||
hephaestus.model = "openai/gpt-5.6-terra";
|
||||
prometheus.model = "openai/gpt-5.6-terra";
|
||||
oracle.model = "openai/gpt-5.6-terra";
|
||||
momus.model = "openai/gpt-5.6-terra";
|
||||
librarian.model = "openai/gpt-5.6-luna";
|
||||
explore.model = "openai/gpt-5.6-luna";
|
||||
atlas.model = "openai/gpt-5.6-luna";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "screenshot";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
xdg-user-dirs
|
||||
];
|
||||
|
||||
text = ''
|
||||
mode="''${1:-region}"
|
||||
|
||||
pictures_dir="$(xdg-user-dir PICTURES)"
|
||||
if [[ -z "$pictures_dir" ]]; then
|
||||
pictures_dir="$HOME/Pictures"
|
||||
fi
|
||||
|
||||
output_dir="$pictures_dir/Screenshots"
|
||||
output_file="$output_dir/Screenshot from $(date '+%Y-%m-%d %H-%M-%S').png"
|
||||
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
case "$mode" in
|
||||
region)
|
||||
geometry="$(slurp)" || exit 0
|
||||
grim -g "$geometry" "$output_file"
|
||||
;;
|
||||
|
||||
output)
|
||||
geometry="$(slurp -o)" || exit 0
|
||||
grim -g "$geometry" "$output_file"
|
||||
;;
|
||||
|
||||
all)
|
||||
grim "$output_file"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown screenshot mode: $mode" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
wl-copy --type image/png < "$output_file"
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
description = "Wayland screenshot command";
|
||||
}
|
||||
@@ -13,10 +13,6 @@ lib.mkMerge [
|
||||
User = "git";
|
||||
AddKeysToAgent = "no";
|
||||
};
|
||||
"*.sfc.wide.ad.jp" = {
|
||||
identityFile = "~/.ssh/id_ed25519_sk_rk";
|
||||
identitiesOnly = true;
|
||||
};
|
||||
"*" = {
|
||||
AddKeysToAgent = "no";
|
||||
SetEnv.TERM = "xterm-256color";
|
||||
@@ -24,9 +20,27 @@ lib.mkMerge [
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
Match exec "test -n \"$SSH_AUTH_SOCK\" && test -S \"$SSH_AUTH_SOCK\""
|
||||
IdentityAgent $SSH_AUTH_SOCK
|
||||
|
||||
Match exec "test -S %d/.1password/agent.sock"
|
||||
IdentityAgent %d/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
|
||||
home.activation.generateSshKey = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
key="$HOME/.ssh/id_ed25519"
|
||||
if [ ! -f "$key" ]; then
|
||||
umask 077
|
||||
mkdir -p "$HOME/.ssh"
|
||||
${pkgs.openssh}/bin/ssh-keygen -t ed25519 -N "" -f "$key" \
|
||||
-C "moons@$(${pkgs.hostname}/bin/hostname || echo host)"
|
||||
echo "Generated SSH key at $key"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.thunderbird = {
|
||||
enable = true;
|
||||
package = pkgs.thunderbird;
|
||||
|
||||
languagePacks = [ "ja" ];
|
||||
|
||||
policies = {
|
||||
DisableTelemetry = true;
|
||||
DisableAppUpdate = true;
|
||||
InAppNotification_Disabled = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
"mailnews.start_page.enabled" = false;
|
||||
"mail.shell.checkDefaultClient" = false;
|
||||
};
|
||||
|
||||
profiles.default = {
|
||||
isDefault = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
_: {
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
|
||||
defaultApplications = {
|
||||
"x-scheme-handler/mailto" = "thunderbird.desktop";
|
||||
"message/rfc822" = "thunderbird.desktop";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -10,6 +10,8 @@ in
|
||||
programs.vicinae = {
|
||||
enable = true;
|
||||
|
||||
enableChromeIntegration = false;
|
||||
|
||||
settings = {
|
||||
font.size = 11;
|
||||
close_on_focus_loss = true;
|
||||
|
||||
@@ -8,9 +8,6 @@ let
|
||||
in
|
||||
{
|
||||
programs.vicinae = {
|
||||
|
||||
package = pkgs.vicinae;
|
||||
|
||||
systemd = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
homebrew = {
|
||||
enable = true;
|
||||
masApps = {
|
||||
Xcode = 497799835;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.yt-dlp ];
|
||||
}
|
||||
@@ -4,8 +4,12 @@
|
||||
extensions = [
|
||||
"catppuccin"
|
||||
"nix"
|
||||
"dockerfile"
|
||||
"terraform"
|
||||
];
|
||||
mutableUserSettings = false;
|
||||
mutableUserKeymaps = false;
|
||||
userKeymaps = import ./keymaps.nix;
|
||||
|
||||
userSettings = {
|
||||
agent = {
|
||||
@@ -36,6 +40,9 @@
|
||||
light = "Catppuccin Latte";
|
||||
dark = "Catppuccin Mocha";
|
||||
};
|
||||
edit_predictions = {
|
||||
provider = "copilot";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
context = "Editor && vim_mode == normal";
|
||||
bindings = {
|
||||
# This selected native-equivalent subset preserves Zed's Vim defaults for
|
||||
# K, gd, grr, gri, gra, gO, ]d, [d, zM, zR, [b, and ]b.
|
||||
"g r t" = "editor::GoToTypeDefinition";
|
||||
"space space" = "pane::AlternateFile";
|
||||
"space r n" = "editor::Rename";
|
||||
"space c a" = "editor::ToggleCodeActions";
|
||||
"space c f" = "editor::Format";
|
||||
"space d l" = "editor::Hover";
|
||||
"space e" = "project_panel::Toggle";
|
||||
"space t t" = "terminal_panel::Toggle";
|
||||
"space b c" = "pane::CloseActiveItem";
|
||||
"space f f" = "file_finder::Toggle";
|
||||
"space f g" = "pane::DeploySearch";
|
||||
"space f b" = "tab_switcher::ToggleAll";
|
||||
"space f s" = "outline::Toggle";
|
||||
"space f shift-s" = "project_symbols::Toggle";
|
||||
"space x x" = "diagnostics::Deploy";
|
||||
};
|
||||
}
|
||||
{
|
||||
# Keep normal-mode editor navigation out of terminals and other panels.
|
||||
context = "Editor && vim_mode == normal && !menu";
|
||||
bindings = {
|
||||
"ctrl-h" = "workspace::ActivatePaneLeft";
|
||||
"ctrl-j" = "workspace::ActivatePaneDown";
|
||||
"ctrl-k" = "workspace::ActivatePaneUp";
|
||||
"ctrl-l" = "workspace::ActivatePaneRight";
|
||||
"ctrl-left" = "workspace::ActivatePaneLeft";
|
||||
"ctrl-down" = "workspace::ActivatePaneDown";
|
||||
"ctrl-up" = "workspace::ActivatePaneUp";
|
||||
"ctrl-right" = "workspace::ActivatePaneRight";
|
||||
};
|
||||
}
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
modesetting.enable = true;
|
||||
open = true;
|
||||
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
kernelSuspendNotifier = true;
|
||||
};
|
||||
powerManagement.enable = true;
|
||||
|
||||
moduleParams.nvidia.NVreg_TemporaryFilePath = "/var/tmp";
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ required on every supported host.
|
||||
| Profile | Supported host class |
|
||||
| ------------------------------------ | --------------------------------------------- |
|
||||
| `base` | NixOS, macOS |
|
||||
| `interface.minimal` | NixOS, macOS with Home Manager |
|
||||
| `interface.cli` | NixOS, macOS with Home Manager |
|
||||
| `interface.gui` | NixOS, macOS with Home Manager |
|
||||
| `interface.macos` | macOS |
|
||||
@@ -36,10 +37,15 @@ required on every supported host.
|
||||
| `platform.laptop` | Physical NixOS laptop |
|
||||
| `platform.thinkpad-x1` | Intel ThinkPad X1 running NixOS |
|
||||
| `platform.vm` | UEFI QEMU NixOS guest with NFS client support |
|
||||
| `workload.deploy-rs-target` | NixOS |
|
||||
| `workload.development` | NixOS, macOS with Home Manager |
|
||||
| `workload.game` | NixOS, macOS |
|
||||
| `workload.machine-learning` | NixOS with Home Manager |
|
||||
| `workload.network-lab` | NixOS |
|
||||
| `workload.personal` | NixOS, macOS with Home Manager |
|
||||
| `workload.photography` | NixOS with Home Manager |
|
||||
| `workload.remote-access` | NixOS, macOS |
|
||||
| `workload.camera` | NixOS |
|
||||
| `workload.server` | NixOS, macOS with Home Manager |
|
||||
| `networking.tailscale-client` | NixOS, macOS |
|
||||
| `networking.tailscale-subnet-router` | NixOS |
|
||||
@@ -58,11 +64,40 @@ selects labwc. A daily-use macOS development machine can combine
|
||||
`interface.macos`, `workload.development`, and `workload.personal`. Hardware
|
||||
support does not implicitly select an interface or workload.
|
||||
|
||||
`platform.nixos` selects the shared network foundation and the clatd service.
|
||||
VM, laptop, and desktop platform profiles inherit both.
|
||||
|
||||
`interface.minimal` provides SSH client access and key generation, Nano, htop,
|
||||
btop, fastfetch, unzip, wget, Direnv, Git, GnuPG, nh, Zellij, and Zsh for remote
|
||||
administration. `interface.cli` includes that baseline and adds the configured
|
||||
Neovim, Yazi, and the remaining interactive command-line tools.
|
||||
|
||||
`workload.machine-learning` provides the Hugging Face Hub CLI for hosts used
|
||||
to download and publish machine learning models and datasets.
|
||||
|
||||
`workload.network-lab` provides containerlab using its upstream NixOS module,
|
||||
the Docker service, and the NanoKVM-USB desktop client with serial-port access.
|
||||
It is selected by galleria and x1g13.
|
||||
|
||||
`workload.photography` provides darktable with AI support from the locked
|
||||
unstable package set. Its ONNX Runtime uses CUDA when the NVIDIA hardware unit
|
||||
is enabled, and CPU inference otherwise. Keep the default CUDA capabilities
|
||||
and forward compatibility to reuse the CUDA binary cache; these targets include
|
||||
galleria's RTX 3060 Ti. OpenCL drivers remain owned by hardware units.
|
||||
|
||||
`workload.deploy-rs-target` enables OpenSSH and provisions the `nixdeploy`
|
||||
service account with the narrowly scoped passwordless commands required for
|
||||
deploy-rs activation and rollback confirmation.
|
||||
|
||||
`workload.personal` provides Pear Desktop on both NixOS and macOS. Home Manager
|
||||
enables performance improvements, synced lyrics, tracker blocking, the album
|
||||
color theme, and custom output-device selection while preserving user-owned
|
||||
settings such as the selected device.
|
||||
|
||||
`workload.personal` provides ActivityWatch for local activity tracking. On
|
||||
NixOS, its server and Wayland-compatible watcher run as Home Manager user
|
||||
services. On macOS, the Homebrew cask starts at login.
|
||||
|
||||
On NixOS, `workload.game` provides Steam with Valve Proton and Proton-GE,
|
||||
Protontricks, Wayland-compatible Steam Input, GameMode, Gamescope, and MangoHud.
|
||||
Enabling Steam also activates the 32-bit graphics and PipeWire support required
|
||||
|
||||
@@ -8,36 +8,21 @@
|
||||
dust
|
||||
eza
|
||||
fd
|
||||
fastfetch
|
||||
fzf
|
||||
htop
|
||||
jq
|
||||
lsof
|
||||
nurl
|
||||
ripgrep
|
||||
tio
|
||||
unrar
|
||||
unzip
|
||||
wget
|
||||
traceroute
|
||||
tcpdump
|
||||
iw
|
||||
nmap
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
lm_sensors
|
||||
psmisc
|
||||
strace
|
||||
];
|
||||
|
||||
home.activation.generateSshKey = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
key="$HOME/.ssh/id_ed25519"
|
||||
if [ ! -f "$key" ]; then
|
||||
umask 077
|
||||
mkdir -p "$HOME/.ssh"
|
||||
${pkgs.openssh}/bin/ssh-keygen -t ed25519 -N "" -f "$key" \
|
||||
-C "moons@$(${pkgs.hostname}/bin/hostname || echo host)"
|
||||
echo "Generated SSH key at $key"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,17 +2,10 @@
|
||||
description = "Cross-platform interactive command-line environment";
|
||||
|
||||
includes = [
|
||||
"applications.btop"
|
||||
"applications.direnv"
|
||||
"applications.git"
|
||||
"applications.gnupg"
|
||||
"applications.nh"
|
||||
"profiles.interface.minimal"
|
||||
"applications.nix-index"
|
||||
"applications.ssh"
|
||||
"applications.vim"
|
||||
"applications.yazi"
|
||||
"applications.zellij"
|
||||
"applications.zoxide"
|
||||
"applications.zsh"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
alacritty
|
||||
grim
|
||||
slurp
|
||||
wf-recorder
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.playerctl
|
||||
];
|
||||
|
||||
xdg.userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
@@ -13,5 +15,6 @@
|
||||
publicShare = "$HOME/Public";
|
||||
templates = "$HOME/Templates";
|
||||
videos = "$HOME/Videos";
|
||||
projects = "$HOME/Projects";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
"applications.gtk"
|
||||
"applications.loupe"
|
||||
"applications.nautilus"
|
||||
"applications.nani"
|
||||
"applications.papers"
|
||||
"applications.qalculate-gtk"
|
||||
"applications.resources"
|
||||
"applications.vlc"
|
||||
"hardwares.graphics"
|
||||
"services.gvfs"
|
||||
"services.evremap"
|
||||
"services.polkit-gnome"
|
||||
"systems.audio"
|
||||
"systems.fonts"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
fastfetch
|
||||
unzip
|
||||
wget
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
description = "Minimal cross-platform command-line environment for remote administration";
|
||||
|
||||
includes = [
|
||||
"applications.btop"
|
||||
"applications.direnv"
|
||||
"applications.git"
|
||||
"applications.gnupg"
|
||||
"applications.htop"
|
||||
"applications.nano"
|
||||
"applications.nh"
|
||||
"applications.ssh"
|
||||
"applications.zellij"
|
||||
"applications.zsh"
|
||||
];
|
||||
}
|
||||
@@ -2,8 +2,6 @@
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
alacritty
|
||||
grim
|
||||
slurp
|
||||
wf-recorder
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# every system sleep path; screen blanking while locked is handled by
|
||||
# services.swayidle in the graphical session.
|
||||
systemd.sleep.settings.Sleep = {
|
||||
AllowSuspend = true;
|
||||
AllowHibernation = false;
|
||||
AllowHybridSleep = false;
|
||||
AllowSuspendThenHibernate = false;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
description = "Foundation shared by all NixOS platforms";
|
||||
|
||||
includes = [
|
||||
"services.clatd"
|
||||
"services.kmscon"
|
||||
"systems.disko"
|
||||
"systems.boot.base"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
description = "Camera capture and virtual camera tools";
|
||||
|
||||
includes = [ "systems.boot.v4l2loopback" ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
gphoto2
|
||||
ffmpeg
|
||||
v4l-utils
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
description = "NixOS deploy-rs deployment target";
|
||||
|
||||
includes = [
|
||||
"services.openssh"
|
||||
"users.nixdeploy"
|
||||
];
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
bind
|
||||
bun
|
||||
nil
|
||||
python312
|
||||
python314
|
||||
uv
|
||||
];
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"applications.claude"
|
||||
"applications.codex"
|
||||
"applications.codex-desktop"
|
||||
"applications.codex-session-usage"
|
||||
"applications.docker"
|
||||
"applications.drawio"
|
||||
"applications.ghostty"
|
||||
@@ -13,6 +14,7 @@
|
||||
"applications.java"
|
||||
"applications.opencode"
|
||||
"applications.vscode"
|
||||
"applications.xcode"
|
||||
"applications.zed"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
description = "Machine learning tools";
|
||||
|
||||
includes = [ "applications.huggingface-cli" ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
description = "Network lab and hardware console environment";
|
||||
|
||||
includes = [
|
||||
"applications.containerlab"
|
||||
"applications.nanokvm-usb"
|
||||
];
|
||||
}
|
||||
@@ -3,13 +3,18 @@
|
||||
|
||||
includes = [
|
||||
"applications.1password"
|
||||
"applications.activitywatch"
|
||||
"applications.chrome"
|
||||
"applications.discord"
|
||||
"applications.ffmpeg"
|
||||
"applications.gnome-text-editor"
|
||||
"applications.kde"
|
||||
"applications.moonlight"
|
||||
"applications.slack"
|
||||
"applications.zoom"
|
||||
"applications.obs"
|
||||
"applications.nani"
|
||||
"applications.thunderbird"
|
||||
"applications.yt-dlp"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
description = "RAW photo development and editing";
|
||||
|
||||
includes = [ "applications.darktable" ];
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user