45 Commits
Author SHA1 Message Date
John Lancaster 4e5f1230ab host table 2026-07-01 22:40:04 -05:00
John Lancaster c3eeeb16f8 flake updates 2026-07-01 22:39:57 -05:00
John Lancaster 7556b13eb9 sublime fix 2026-07-01 22:35:55 -05:00
John Lancaster a72f34ab51 fix 2026-07-01 14:52:40 -05:00
John Lancaster 4e465b1846 allowing broken sublime 2026-07-01 14:35:58 -05:00
John Lancaster d2737a42e8 fix 2026-07-01 14:35:37 -05:00
John Lancaster a9ae07d5c1 zsh notes 2026-07-01 00:53:17 -05:00
John Lancaster f505100bb4 step ssh-host notes 2026-07-01 00:31:13 -05:00
John Lancaster aff22e3a0f soteria notes updates 2026-07-01 00:25:50 -05:00
John Lancaster b13b774738 consolidated options 2026-07-01 00:19:17 -05:00
John Lancaster 43fe37d4e2 soteria host notes 2026-07-01 00:03:48 -05:00
John Lancaster a98e637ce2 rename 2026-06-30 23:34:27 -05:00
John Lancaster 0e194e5d44 naming conventions 2026-06-30 23:31:11 -05:00
John Lancaster 68737a513f instructions files 2026-06-30 23:30:25 -05:00
John Lancaster e76fc00a98 hosts instructions 2026-06-30 23:08:46 -05:00
John Lancaster f22e8cb1d5 moved programs to desktop feature 2026-06-30 23:00:55 -05:00
John Lancaster bb06b848be audio module 2026-06-30 23:00:37 -05:00
John Lancaster 021ca1ba83 added steam to omen 2026-06-14 20:47:34 -05:00
John Lancaster 4bd11e1047 audio stuff in nixos-base 2026-06-14 20:47:22 -05:00
John Lancaster ff80098418 niri hotkey changes 2026-06-14 18:05:13 -05:00
John Lancaster 3265669503 security stuff in nixos-base 2026-06-14 18:04:27 -05:00
John Lancaster 7294e04ae2 onepassword module 2026-06-14 13:17:05 -05:00
John Lancaster 3e1d438453 desktop import 2026-06-14 12:50:36 -05:00
John Lancaster 2f653b95ce added websockets 2026-06-14 12:43:31 -05:00
John Lancaster 1c1515678a created nixos-base 2026-06-14 12:25:33 -05:00
John Lancaster ee4839877c null fixes 2026-06-14 11:31:33 -05:00
John Lancaster fc2325e70b fix 2026-06-14 11:21:01 -05:00
John Lancaster 2ae5eb9547 niri hotkeys 2026-06-14 11:15:27 -05:00
John Lancaster ba305e29fd WIP noctalia rendering 2026-06-14 10:58:26 -05:00
John Lancaster deda2c9bbc WIP greetd 2026-06-14 10:06:43 -05:00
John Lancaster 10c8c887db WIP greetd 2026-06-14 10:02:11 -05:00
John Lancaster 7b2dffbccf WIP niri greeter 2026-06-14 09:41:14 -05:00
John Lancaster 95f382107d separated wrapped nixGL packages 2026-06-14 08:37:30 -05:00
John Lancaster 3cd3099987 added greetd 2026-06-14 08:33:00 -05:00
John Lancaster 775543224e moved 2026-06-14 08:29:56 -05:00
John Lancaster aff608c1ce login stuff 2026-06-14 08:26:13 -05:00
John Lancaster ecb640fa45 undo 2026-06-14 08:11:55 -05:00
John Lancaster ceeba1c786 added spawn-at-startup command to niri 2026-06-14 08:09:18 -05:00
John Lancaster b8153f0ebc formatting 2026-06-14 07:52:17 -05:00
John Lancaster e9ec34f15c flake.lock update 2026-06-14 07:45:10 -05:00
John Lancaster 6c8ca29751 added john module 2026-06-13 10:46:29 -05:00
John Lancaster bcd07532db flake.lock update 2026-06-13 10:06:46 -05:00
John Lancaster 2861c460c2 ssh updates 2026-06-13 10:05:50 -05:00
John Lancaster 6e27e92f89 flake.lock update 2026-06-13 09:43:07 -05:00
John Lancaster 1002e6e0da wrapped versions of niri and noctalia 2026-06-13 09:27:01 -05:00
30 changed files with 962 additions and 642 deletions
@@ -0,0 +1,68 @@
# Host Naming Discrepancy Report
This report compares the current `modules/hosts` tree against the naming rules for new hosts in `hosts.instructions.md`.
## Rules Checked
- The host directory slug should be the canonical host identity.
- A directory-backed host should prefer `default.nix` as its main entrypoint.
- The canonical slug should line up with the primary `hostname` binding, `flake.nixosConfigurations.<slug>`, and `networking.hostName`.
- A host-local Home Manager module should use the same slug.
- A standalone Home Manager configuration should prefer the key `"<username>@<slug>"`.
- Host-local helper module names should be prefixed by the host slug.
## Summary
- Recently normalized: `john-kde`, `omen-nixos`.
- Hosts that fit the new rules closely: `janus`, `john-kde`, `omen-nixos`, `test-nix`.
- Hosts with notable discrepancies: `john-p14s`, `soteria`.
- Approved exception: `john-pc` directory uses immutable deployed slug `john-pc-ubuntu` for exported keys.
## Detailed Discrepancies
### `john-p14s`
- The main host export uses the canonical slug: `flake.nixosConfigurations.john-p14s`.
- The host-local helper modules are named `p14sConfiguration` and `p14sHardware`, which drop the `john-` prefix and therefore do not use the full host slug.
- `networking.hostname` uses the correct host value, but the option name differs from the dominant `networking.hostName` spelling used elsewhere in this tree.
### `john-pc`
- Approved exception for immutable deployed hostname:
- Directory slug is `john-pc`, but exported keys and hostname bindings intentionally use `john-pc-ubuntu`.
- `hostname` binding, `flake.modules.homeManager.<name>`, and `flake.homeConfigurations` are aligned to `john-pc-ubuntu`.
- Shared SSH alias intentionally remains `john-pc-ubuntu` in `modules/services/ssh.nix`.
### `omen-nixos`
- No active discrepancy after normalization:
- The directory slug, `flake.nixosConfigurations` key, host-local module keys, and `networking.hostName` are now aligned to `omen-nixos`.
### `john-kde`
- No active discrepancy after normalization:
- The directory slug, `hostname` binding, host-local Home Manager module key, and standalone Home Manager key are now aligned to `john-kde`.
### `soteria`
- Naming is mostly coherent across directory slug, `hostname`, `flake.nixosConfigurations.soteria`, and `flake.modules.homeManager.soteria`.
- The standalone Home Manager export is `flake.homeConfigurations.soteria`, which does not follow the preferred `"<username>@<slug>"` form.
- The main host entrypoint is `soteria.nix` instead of the preferred `default.nix`.
## No Discrepancy Found
### `janus`
- Directory slug, `hostname`, `flake.nixosConfigurations.janus`, and `networking.hostName` are aligned.
- The host-local helper module `janus-ca` is clearly prefixed by the host slug.
### `test-nix`
- The single-file host uses the same slug for the file stem, `hostname`, and `flake.nixosConfigurations.test-nix`.
- It does not define `networking.hostName`, but it does not contradict the slug anywhere else.
## Follow-up Candidates
- Rename `john-p14s` helper module keys to include the full host slug (`john-p14s-*`) if strict slug consistency is desired.
- Decide whether `soteria` should move to `default.nix` and whether its standalone Home Manager key should include `john@`.
- If `john-pc-ubuntu` ever becomes changeable, decide whether to rename the directory to match or keep this as a permanent exception.
@@ -0,0 +1,78 @@
---
description: "Use when defining or modifying hosts and host-local data under modules/hosts. Explains how this repo exports nixosConfigurations and homeConfigurations, when to create flake.modules.nixos or flake.modules.homeManager helpers, and how secrets, defaults, keys, and hardware files fit into a host definition."
applyTo: 'modules/hosts/**/*.nix, modules/hosts/**/secrets.yaml, modules/hosts/**/defaults.json, modules/hosts/**/fingerprint, modules/hosts/**/*.pub'
---
# Host Definitions
Host files under `modules/hosts` are flake entrypoints, not just loose Nix snippets. Because `modules` is auto-imported through `import-tree` and `flake-file`, files here usually export one or more of these attributes:
- `flake.nixosConfigurations.<name>` for a bootable NixOS machine or container.
- `flake.homeConfigurations.<name>` for a standalone Home Manager target.
- `flake.modules.nixos.<name>` or `flake.modules.homeManager.<name>` when a host is split into reusable host-local modules that are then assembled by a nearby entrypoint.
Follow the existing host patterns in this tree:
- Keep the host entrypoint file focused on composing modules into `nixosSystem` or `homeManagerConfiguration`.
- If a host has substantial machine-specific logic, put that logic in sibling files such as `configuration.nix` or `hardware.nix`, export them as `flake.modules.nixos.<name>`, and have the entrypoint import those modules.
- For Home Manager only hosts, define `flake.modules.homeManager.<name>` and then expose a matching `flake.homeConfigurations` entry.
- Prefer composing from shared modules in `self.modules.nixos` or `inputs.self.modules.homeManager` instead of re-implementing shared behavior inline.
Treat host-local data as part of the host definition:
- Keep hardware-specific settings in the host directory, typically in `hardware.nix`.
- Keep install-time or machine-specific configuration in the same host directory, typically in `configuration.nix`.
- Keep host-local secret references beside the host and wire them through `sops.defaultSopsFile` and `mysops.hostSecretFile` instead of pointing at unrelated locations.
- Preserve nearby auxiliary files such as `defaults.json`, fingerprints, public keys, and `secrets.yaml`; these are part of the host contract.
For host-adjacent data files:
- Keep `secrets.yaml` scoped to the host that consumes it; do not reuse another host's secret file as a shortcut.
- Treat files such as `defaults.json`, `fingerprint`, and `*.pub` as inputs consumed by the host module. Update references together with the data when changing paths or filenames.
- Avoid moving or renaming these files unless the corresponding Nix references are updated in the same change.
Naming in this tree is not perfectly uniform, so preserve existing interfaces unless the task is explicitly a rename:
- The directory name, exported flake key, and `networking.hostName` may differ.
- Some hosts export from `default.nix`, while others keep the main definition in a differently named file such as `soteria.nix`.
- Do not normalize names or move files just for consistency unless the user asks for that structural change.
Naming rules for new hosts:
- Treat the host directory name as the canonical host slug for new work.
- Prefer `modules/hosts/<slug>/default.nix` as the main entrypoint for a host directory.
- Use the same slug for the primary `hostname` binding, `flake.nixosConfigurations.<slug>`, and `networking.hostName` unless the task explicitly requires a different deployed hostname.
- If the host exports a host-local Home Manager module, name it `flake.modules.homeManager.<slug>`.
- For standalone Home Manager configurations, prefer `flake.homeConfigurations."<username>@<slug>"` so the exported key still carries the host slug.
- Name host-local helper modules with the same slug as a prefix, for example `flake.modules.nixos.<slug>-hardware` or `flake.modules.nixos.<slug>-configuration`, to make ownership obvious and avoid collisions with shared modules.
- Keep host-local secrets and auxiliary files under the same host slug directory. Do not point a new host at another host's path just because the contents are similar.
Allowed exception for immutable deployed hostnames:
- If the deployed hostname is externally constrained and cannot change, use that deployed hostname as the canonical slug for exported keys and `hostname` bindings, even if the directory name differs.
- In that case, keep the exception explicit in comments or reports so future cleanup work does not accidentally rename a live hostname contract.
When working in existing hosts that predate these rules:
- Preserve the current public names by default.
- If the user asks for a rename or cleanup, update the directory slug, exported flake keys, host-local module names, and `networking.hostName` together in one change so the host identity stays coherent.
Use nearby hosts as composition examples:
- `john-p14s` splits the reusable machine logic into `configuration.nix` and `hardware.nix`, exports `flake.modules.nixos.p14sConfiguration` and `flake.modules.nixos.p14sHardware`, and assembles them from `default.nix`.
- `janus` defines a host-local reusable module (`flake.modules.nixos.janus-ca`) in the same file that also exports the final `flake.nixosConfigurations.janus` host.
- `john-pc` is a Home Manager target, so it exports a `flake.modules.homeManager` module and a `flake.homeConfigurations` entry rather than a `nixosConfiguration`.
- `soteria` combines a NixOS host, a host-local Home Manager module, and host-local secrets in one host directory.
When adding or changing a host:
- Mirror the local style first. Small hosts may define the full configuration inline; larger hosts should split reusable modules out.
- Keep `let` bindings such as `username`, `hostname`, `flakeDir`, and package aliases near the top when the file already follows that pattern.
- Add shared behavior by importing existing modules, not by copying option blocks between hosts.
- If the change affects both system and Home Manager state for a host, update both sides in the same host area when that host already models both.
For reviews and answers, distinguish between these layers:
- host entrypoint wiring in `modules/hosts/...`
- reusable shared modules in `modules/nixos`, `modules/programs`, `modules/services`, and `modules/users`
- host-local modules exported from a host directory and then consumed by its entrypoint
@@ -0,0 +1,54 @@
---
description: "Use when defining or modifying reusable Nix modules outside modules/hosts. Covers flake.modules.nixos, flake.modules.homeManager, and flake.factory.user exports, and explains how shared modules differ from concrete host wiring."
applyTo: 'modules/nixos/**/*.nix, modules/users/**/*.nix, modules/features/**/*.nix, modules/programs/**/*.nix, modules/services/**/*.nix, modules/nix-tools/**/*.nix'
---
# Shared Modules
Files outside `modules/hosts` generally define reusable building blocks, not concrete machines. In this repo, those files usually export one of these surfaces:
- `flake.modules.nixos.<name>` for reusable NixOS modules.
- `flake.modules.homeManager.<name>` for reusable Home Manager modules.
- `config.flake.factory.user` for factories that generate per-user module sets.
- `flake.meta.*` when the file owns reusable metadata that other modules consume.
Keep the boundary between shared modules and hosts clear:
- Shared modules should not define `flake.nixosConfigurations.<name>` or `flake.homeConfigurations.<name>`; those belong in `modules/hosts`.
- Prefer generic options, imports, and composition over host-specific literals.
- If a setting only makes sense for one machine, keep it in that host directory instead of moving it into a shared module.
- When a host imports a shared module, treat the shared module as part of the stable interface that multiple hosts may depend on.
Follow the existing export patterns in this repo:
- Simple reusable modules may export a single module directly, such as `flake.modules.nixos.games`.
- Cross-cutting features often live under `modules/features` even when they export `flake.modules.nixos.*` or `flake.modules.homeManager.*`.
- Program and service integrations commonly export one or both module types from a single file.
- User definitions under `modules/users` may export metadata plus paired NixOS and Home Manager modules for the same user.
For user modules specifically:
- Keep reusable user facts under `flake.meta.users.<name>` when other modules need to reference them.
- Prefer deriving the NixOS side from `self.factory.user` when the file already follows that pattern.
- Keep the user-facing Home Manager module in `flake.modules.homeManager.<name>` and let the factory or host wire it into a concrete configuration.
- Put user-specific authorized keys, identity, and shared defaults here rather than duplicating them across hosts.
Design shared modules as composable interfaces:
- Import other shared modules instead of copying option blocks.
- Add options or parameters when behavior needs to vary between hosts.
- Avoid embedding host-specific paths, hostnames, addresses, or secret file locations unless the file is intentionally host-local.
- Preserve exported attribute names even when the filename is different. In this repo, the path is not always the public API name.
Use nearby files as examples:
- `modules/nixos/games.nix` is a minimal shared NixOS module with no host wiring.
- `modules/features/nixos-base.nix` defines a reusable base system module that other hosts import.
- `modules/users/john.nix` combines `flake.meta.users.john`, a reusable NixOS user module, and a reusable Home Manager user module built around the user factory.
- `modules/nix-tools/user.nix` defines the `flake.factory.user` helper that shared user modules build on.
For reviews and answers, separate these concerns clearly:
- reusable module API and option design in shared module directories
- concrete host assembly in `modules/hosts`
- whether a change increases reuse or accidentally pulls machine-specific behavior into a shared layer
@@ -0,0 +1,139 @@
---
description: "Use when modifying the Soteria host definition or host-local secrets under modules/hosts/soteria. Covers host wiring and SSH cert mechanics specific to Soteria."
name: "Soteria Host Instructions"
applyTo: "modules/hosts/soteria/**/*.nix, modules/hosts/soteria/secrets.yaml"
---
# Soteria Host Instructions
Use this instruction when changing Soteria host wiring in `modules/hosts/soteria`.
## Host Intent And Shape
- Treat Soteria as a NixOS service node for Forgejo, RESTic server, mTLS, and a paired Home Manager profile for `john`.
- Keep host identity aligned: `hostname = "soteria"`, `networking.hostName = hostname`, and `flake.nixosConfigurations."${hostname}"`.
- Keep host-local secrets in `modules/hosts/soteria/secrets.yaml` and wire with `sops.defaultSopsFile = ./secrets.yaml`.
- Keep host-specific Home Manager wiring in `flake.modules.homeManager.soteria`, and keep `mysops.hostSecretFile` pointing at the Soteria secrets file.
## Required Module Composition
When editing `modules/hosts/soteria/default.nix`, preserve this composition unless the task explicitly changes architecture:
- Import `nixos.step-ssh-host` to enable host SSH cert integration.
- Import `nixos.janus-ca` so Step client trust material and defaults remain available.
- Import `nixos.restic-server` so the RESTic REST server implementation lives in the shared module rather than inline host wiring.
- Keep `step-ssh-host.hostname = hostname;` so cert principals match host naming.
## SSH Cert Mechanics On Soteria
Soteria SSH certificate behavior is the result of multiple modules. Keep this flow intact:
1. `soteria/default.nix` imports `nixos.step-ssh-host` and sets `step-ssh-host.hostname = "soteria"` (via `hostname`).
2. `modules/services/step-ca/ssh-host.nix`:
- Enables `ssh.certificates.enable = true`.
- Requires `sops.secrets."janus/admin_jwk"` (provisioner credential) from Soteria's `secrets.yaml`.
- Defines cert paths at `/etc/ssh/ssh_host_ed25519_key` and `/etc/ssh/ssh_host_ed25519_key-cert.pub`.
- Exposes `ssh-host-cert-renew` and `ssh-host-cert-check` helper binaries.
- Schedules `step-ssh-host-renew.timer` every 4h with jitter.
3. `modules/services/ssh.nix` consumes `ssh.certificates.enable` and configures OpenSSH to:
- Set `TrustedUserCAKeys = /etc/ssh/ssh_user_ca.pub`.
- Set `HostCertificate = /etc/ssh/ssh_host_ed25519_key-cert.pub`.
- Install the trusted user CA file into `/etc/ssh/ssh_user_ca.pub`.
4. `nixos.janus-ca` provides Step CA trust bootstrapping (`/etc/step-ca/defaults.json` and linked root CA material), allowing Step CLI operations to trust and reach the CA endpoint.
Current implementation note:
- `step-ssh-host-renew.service` currently checks renewal state via `step ssh needs-renewal` and logs status. It does not directly invoke `ssh-host-cert-renew` in the service script. Preserve this behavior unless the task explicitly asks to change renewal execution semantics.
## SOPS/Secrets Mechanics On Soteria
Soteria secret handling spans host-local secrets, NixOS secret materialization, and Home Manager secret tooling. Keep this flow intact:
1. `modules/hosts/soteria/default.nix` imports `nixos.mysops` and sets `sops.defaultSopsFile = ./secrets.yaml`.
2. The SOPS file `modules/hosts/soteria/secrets.yaml` is the canonical encrypted source for this host's system secrets.
3. Shared modules imported by Soteria declare required secret entries under `sops.secrets` and consume them through `config.sops.secrets.<name>.path`:
- `modules/services/step-ca/ssh-host.nix` declares and consumes `janus/admin_jwk` as the Step provisioner password file.
- `modules/features/forgejo.nix` declares and consumes `forgejo/secret_key`, `forgejo/internal_token`, `forgejo/jwt_secret`, and `forgejo/lfs_jwt_secret`.
4. Secret ownership is module-defined and must stay aligned with service users:
- Forgejo secrets are owned by `config.services.forgejo.user`.
- Step SSH provisioner secret is locked to root ownership and `0400` mode.
5. `flake.modules.homeManager.soteria` imports `homeManager.mysops` and sets `mysops.hostSecretFile` to the same Soteria host secret file path. This drives helper tooling such as `edit-secrets` while Home Manager keeps its own default SOPS context from `modules/programs/sops.nix`.
Current implementation note:
- `restic_password` exists in `modules/hosts/soteria/secrets.yaml`, but it is not currently consumed by the Soteria NixOS module graph.
- Changing, deleting, or renaming seemingly unused keys in `secrets.yaml` should be treated as a compatibility change and confirmed by the task.
## Restic REST Server On Soteria
Soteria's RESTic REST server is implemented by the shared `nixos.restic-server` module and configured by host-local `resticServer` values. Trace it this way:
1. `modules/hosts/soteria/default.nix` imports `nixos.restic-server` and configures the host-local `resticServer` option set with:
- `enable = true`
- `dataDir = "/mnt/restic"`
- `privateRepos = true`
- `listenAddress = "0.0.0.0:8000"`
- `tls.certFile = config.mtls.certFile`
- `tls.keyFile = config.mtls.keyFile`
2. `modules/features/restic.nix` maps those `resticServer` options into `services.restic.server` and appends TLS flags when both TLS paths are set.
3. The shared module keeps the server base behavior in one place:
- `services.restic.server.enable = true`
- `services.restic.server.dataDir = cfg.dataDir`
- `services.restic.server.listenAddress = cfg.listenAddress`
- `services.restic.server.privateRepos = cfg.privateRepos`
- `services.restic.server.extraFlags = cfg.extraFlags ++ tlsFlags`
4. `modules/features/restic.nix` also opens the matching TCP port through `networking.firewall.allowedTCPPorts`, deriving it from `resticServer.listenAddress`.
5. The mTLS renewal hook includes `restic-rest-server.service` in `mtls.renew.reloadUnits`, so certificate rotation reloads the REST server alongside Forgejo.
6. `loginText.extraServiceStatus` exposes the running unit as `restic-rest-server.service`, which is the service name to keep in mind for status and reload behavior.
### Storage Location
- Soteria explicitly sets `resticServer.dataDir = "/mnt/restic"`.
- The shared module maps that value into `services.restic.server.dataDir`, so `/mnt/restic` is now the intended repository storage location for this host.
- The shared module also derives the firewall port from `resticServer.listenAddress`, so Soteria no longer needs a separate `networking.firewall.allowedTCPPorts = [ 8000 ]` line.
- If storage needs to move later, change the `resticServer.dataDir` input or the shared module contract, not ad hoc service cleanup logic.
- `privateRepos = true` constrains repo exposure behavior, but it does not define storage location by itself.
Current implementation note:
- The REST server is TLS-protected but currently passed `--no-auth`, so client access control relies on transport/security model rather than rest-server password auth.
- The shared module default listen address is not Soteria's deployed value; Soteria deliberately overrides it to `0.0.0.0:8000` in the host.
## Forgejo Implementation On Soteria
Soteria's Forgejo setup is split between host-local option values and the shared `nixos.forgejo` module. Trace it this way:
1. `modules/hosts/soteria/default.nix` imports `nixos.forgejo` and enables it with:
- `forgejo.enable = true`
- `forgejo.root_url = "https://forgejo.john-stream.com"`
- `forgejo.https = true`
- `forgejo.port = 443`
2. `modules/features/forgejo.nix` defines `forgejo.port` as the controlling option for the web listener. Its default is `3000`, but Soteria overrides it to `443`.
3. The shared module wires that option into multiple places:
- `services.forgejo.settings.server.HTTP_PORT = cfg.port`
- `networking.firewall.allowedTCPPorts = [ cfg.port ]` when `openFirewall = true`
- If `cfg.port < 1024`, the Forgejo systemd unit gets `CAP_NET_BIND_SERVICE` so it can bind a privileged port.
4. HTTPS on Soteria is terminated directly by Forgejo using mTLS-managed files:
- `services.forgejo.settings.server.PROTOCOL = "https"`
- `KEY_FILE = config.mtls.keyFile`
- `CERT_FILE = config.mtls.certFile`
### Storage Locations
- This repo does not override Forgejo's primary state directory in the Soteria host or in `modules/features/forgejo.nix`.
- That means Forgejo storage follows the underlying NixOS `services.forgejo` defaults, exposed in this config as `config.services.forgejo.stateDir`.
- PostgreSQL storage is also left at the underlying module default and is referenced as `config.services.postgresql.dataDir`.
- The cleanup helpers in `modules/features/forgejo.nix` confirm these are the intended storage anchors because they remove exactly `config.services.forgejo.stateDir` and `config.services.postgresql.dataDir`.
- Forgejo backup dumps are generated by `forgejo-dump.service` using `--work-path ${config.services.forgejo.dump.backupDir}`, so dump staging/output follows the Forgejo module's backup directory setting rather than a Soteria-specific path override.
Current implementation note:
- If you need to change Forgejo storage location on Soteria, do it by setting the underlying Forgejo or PostgreSQL service directory options explicitly, not by changing cleanup scripts alone.
- If you need to change the external Forgejo endpoint, update `forgejo.root_url`, `forgejo.port`, and the Soteria mTLS SAN list together.
## Change Safety Rules
- Do not rename the secret key `janus/admin_jwk` without updating all consumers.
- Do not change SSH host key/cert filenames unless OpenSSH `HostKey`/`HostCertificate` paths are updated together.
- If changing hostnames or domains, update cert principals in `step-ssh-host` and corresponding SSH client targets together.
- If adding or removing `nixos.step-ssh-host`, explain impact on SSH cert issuance, renewal, and trust in the change summary.
@@ -0,0 +1,54 @@
---
description: "Use when modifying modules/services/step-ca/ssh-host.nix. Covers Step SSH host certificate wiring, secret key contract, and host-side expectations required by consumers."
name: "Step SSH Host Module Instructions"
applyTo: "modules/services/step-ca/ssh-host.nix"
---
# Step SSH Host Module Instructions
Use this instruction when changing the shared NixOS module in modules/services/step-ca/ssh-host.nix.
## Module Contract
- Keep this module reusable across hosts; do not hard-code host-local file paths beyond SSH system paths under /etc/ssh.
- Preserve the option interface unless the task explicitly changes it:
- step-ssh-host.hostname (required host identity used for cert principals)
- step-ssh-host.provisioner (default: "admin")
- Keep imports = [ inputs.self.modules.nixos.ssh ] so OpenSSH host certificate settings stay composed through the shared SSH module.
## Secret Key Contract
- This module currently consumes `config.sops.secrets."janus/admin_jwk"` as the Step provisioner password file.
- Treat `janus/admin_jwk` as a public contract key name for current consumers. If you rename it, update all consumers and host secret files in the same change.
- Keep secret permissions strict (root ownership and 0400 mode).
- Do not assume a local sops file path in this module. The consuming host must define sops.defaultSopsFile.
## Host Expectations
When this module is enabled by a host, the host is expected to provide:
- A working Step trust/bootstrap path (for example via janus-ca or equivalent trust material).
- `sops.defaultSopsFile` containing `janus.admin_jwk` (or equivalent if contract is intentionally changed everywhere).
- `step-ssh-host.hostname` matching deployed host identity and DNS naming expectations.
## SSH Certificate Paths And Principals
- Preserve the default host key path contract at `/etc/ssh/ssh_host_ed25519_key` unless task scope requires coordinated changes.
- Keep host certificate path aligned to `${sshKeyPath}-cert.pub`.
- Keep principal issuance based on hostname and hostname.john-stream.com unless domain policy is intentionally migrated.
- If changing key/cert filenames or principal naming, update `modules/services/ssh.nix` integration and host rollout notes in the same change.
## Renewal Behavior
- Maintain timer/service cadence unless explicitly requested:
- timer OnUnitActiveSec = 4h
- randomized delay enabled
- Keep explicit handling for step ssh needs-renewal return codes to avoid silent failures.
- If changing renewal semantics, document whether the service now only checks state or also performs certificate issuance.
## Validation Checklist
After editing this module, validate at least one consuming host with:
1. nix eval .#nixosConfigurations.janus.config.system.build.toplevel.drvPath
2. nix build .#nixosConfigurations.janus.config.system.build.toplevel --no-link --dry-run
@@ -0,0 +1,65 @@
---
description: "Use when modifying jsl-zsh, home-manager programs.zsh settings, or shell-tools wiring. Explains when to use wrapped jsl-zsh versus pkgs.zsh and how shell-tools composes into user and host configs."
applyTo: 'modules/programs/zsh.nix, modules/features/shell-tools.nix, modules/users/**/*.nix, modules/nix-tools/user.nix, modules/services/ssh.nix, modules/hosts/**/*.nix'
---
# jsl-zsh and shell-tools wiring
This repo intentionally uses two zsh variants for different layers:
- `pkgs.zsh` is the base system shell used for user login shell declarations.
- `inputs.self.packages.<system>.jsl-zsh` is the wrapped interactive shell used by Home Manager and remote shell entrypoints.
Treat these as distinct roles, not interchangeable defaults.
## Canonical definitions
The canonical wrapped shell is defined in `modules/programs/zsh.nix`:
- `perSystem.packages.jsl-zsh` wraps zsh via `wrapperModules.zsh.apply`.
- Wrapper settings, aliases, history behavior, devenv hook, and extra package PATH come from this package definition.
- `binName = "jsl-zsh"` is part of the external contract; keep it stable unless performing an explicit repo-wide rename.
The Home Manager zsh module in the same file is the canonical consumer:
- `flake.modules.homeManager.zsh` sets `programs.zsh.package` to `self.packages.<system>.jsl-zsh`.
- Keep Home Manager interactive zsh bound to the wrapped package, not plain `pkgs.zsh`.
## shell-tools composition
`modules/features/shell-tools.nix` is a composition module, not just a package list:
- `flake.modules.homeManager.shell-tools` imports `homeManager.zsh` and `homeManager.files`.
- It adds the wrapped `shell-tools` package to `home.packages`.
- `home.shell.enableShellIntegration = true` is expected to stay with this module.
If a user module imports `homeManager.shell-tools` (for example `modules/users/john.nix`), that user already receives the Home Manager zsh wiring transitively.
## System-layer expectations
`modules/nix-tools/user.nix` keeps system login semantics separate from Home Manager interactive behavior:
- `users.users.<name>.shell = pkgs.zsh` remains the login shell declaration.
- `programs.zsh.enable = true` enables system zsh support.
- `environment.shells` includes both `${lib.getExe pkgs.zsh}` and `${lib.getExe self.packages.<system>.jsl-zsh}` so wrapped shell paths are recognized when needed.
Do not replace login shell declarations with `jsl-zsh` unless the task is explicitly changing system login policy.
## Host and SSH usage contracts
Hosts may include `selfPkgs.jsl-zsh` in `environment.systemPackages` or `home.packages` so the wrapped shell is available directly.
`modules/services/ssh.nix` includes host entries that use `RemoteCommand = "~/.nix-profile/bin/jsl-zsh"` (and commented variants). This path-level usage means:
- keep the wrapper executable name stable (`jsl-zsh`),
- update SSH remote command references in the same change if shell invocation paths are changed.
## Change guidelines
When editing this area:
- Keep wrapper behavior changes in `packages.jsl-zsh` focused and centralized.
- Keep Home Manager zsh package selection pointed at wrapped `jsl-zsh`.
- Keep system login shell semantics (`pkgs.zsh`) and interactive wrapper semantics (`jsl-zsh`) separated unless intentionally redesigning both layers.
- If modifying `shell-tools`, verify it still composes zsh and tool packages for users importing the module.
- If changing executable names or invocation paths, update all dependent consumers (including SSH remote commands and host package lists) in one coherent change.
+12
View File
@@ -16,6 +16,18 @@ nix flake show --all-systems
nix run nixpkgs#nh home switch -- --configuration john@john-pc-ubuntu .
```
## Host Intent
| Host key | Type | Intent | Entrypoint |
| -------- | ---- | ------ | ---------- |
| `janus` | NixOS (LXC) | Base homelab/service host with local step-ca trust bootstrap (`janus-ca`) and mTLS support. | `modules/hosts/janus/default.nix` |
| `john-kde` | Home Manager (generic Linux) | KDE-focused user environment profile for `john` with desktop + docker + step client tooling. | `modules/hosts/john-kde/default.nix` |
| `john-p14s` | NixOS (laptop) | Main ThinkPad P14s NixOS workstation using hardware presets and desktop/dev modules. | `modules/hosts/john-p14s/default.nix` |
| `john-pc-ubuntu` | Home Manager (generic Linux) | Ubuntu-hosted home profile for `john`, includes desktop/dev tooling and restic backup client settings. | `modules/hosts/john-pc/default.nix` |
| `omen-nixos` | NixOS | Omen machine wired through shared `omen-nixos` + `john` modules. | `modules/hosts/omen-nixos/default.nix` |
| `soteria` | NixOS + Home Manager | Service node running Forgejo + restic server with mTLS and host-local secrets. | `modules/hosts/soteria/soteria.nix` |
| `test-nix` | NixOS (LXC) | Minimal sandbox/test target for validating module composition and remote push/switch flows. | `modules/hosts/test-nix.nix` |
## Layout
- Everything under `./modules` gets auto-imported by `import-tree`
Generated
+36 -383
View File
@@ -1,99 +1,6 @@
{
"nodes": {
"cachix": {
"inputs": {
"devenv": [
"devenv"
],
"flake-compat": [
"devenv",
"flake-compat"
],
"git-hooks": [
"devenv",
"git-hooks"
],
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1777487137,
"narHash": "sha256-TuvKVBX60mqyMT6OB5JqVEh1YIWtFMR/igLCaCdC9tw=",
"owner": "cachix",
"repo": "cachix",
"rev": "a66a440c321d35f7193472c317f42a55ccd1cb93",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "latest",
"repo": "cachix",
"type": "github"
}
},
"crate2nix": {
"flake": false,
"locked": {
"lastModified": 1772186516,
"narHash": "sha256-8s28pzmQ6TOIUzznwFibtW1CMieMUl1rYJIxoQYor58=",
"owner": "rossng",
"repo": "crate2nix",
"rev": "ba5dd398e31ee422fbe021767eb83b0650303a6e",
"type": "github"
},
"original": {
"owner": "rossng",
"repo": "crate2nix",
"rev": "ba5dd398e31ee422fbe021767eb83b0650303a6e",
"type": "github"
}
},
"devenv": {
"inputs": {
"cachix": "cachix",
"crate2nix": "crate2nix",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"ghostty": "ghostty",
"git-hooks": "git-hooks",
"nix": "nix",
"nixd": "nixd",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1780459148,
"narHash": "sha256-oIpiel88r8zV/WqTFwcGAjWXKOASHNzq7wjXQ6ORTvg=",
"owner": "cachix",
"repo": "devenv",
"rev": "493ed7ef062ba3972c06e60970fe5ebe014f5c33",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1777699697,
@@ -111,11 +18,11 @@
},
"flake-file": {
"locked": {
"lastModified": 1779051720,
"narHash": "sha256-+jbXnODsR19pFKB0x/6kHhFgW6yV6N+CGClFr45eDU8=",
"lastModified": 1781217157,
"narHash": "sha256-N3q/SP2Ropk336e9KSgLh7kpROY6P70dprYdbPIfd5c=",
"owner": "vic",
"repo": "flake-file",
"rev": "c58eb27d9434e5be0c8693f1eb18d47035bc21ba",
"rev": "ce63eaf7ebfe04a176653f66385a7f0a36380cee",
"type": "github"
},
"original": {
@@ -127,7 +34,6 @@
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"devenv",
"nixpkgs"
]
},
@@ -146,26 +52,6 @@
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1778716662,
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"nvf",
@@ -204,80 +90,16 @@
"type": "github"
}
},
"ghostty": {
"flake": false,
"locked": {
"lastModified": 1779069789,
"narHash": "sha256-ojo+gso45/6CVSuqfSVnlWpQ4d0QeLgwok+v/g3yu0E=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "4b7bf0b20e3baf9c1ba10c63f2ad1fd853faea8f",
"type": "github"
},
"original": {
"owner": "ghostty-org",
"repo": "ghostty",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1778507602,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"devenv",
"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": {
"inputs": {
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1780408569,
"narHash": "sha256-s7Tv6FUQThRAvW8En8XVC6HMb0uiikzVccCcCo9u/Bg=",
"lastModified": 1782881387,
"narHash": "sha256-HvlS1KDGXDjd1bNzzPvH1mkDJATlDAfVYfTh//wJBEA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f384af1bec6423a0d4ba1855917ab948f64e5808",
"rev": "d32537981c036473cf6990ae03176a5d84c43b29",
"type": "github"
},
"original": {
@@ -303,11 +125,11 @@
},
"mnw": {
"locked": {
"lastModified": 1778541201,
"narHash": "sha256-n0twkzWexzjsoDycOTvvQNuGEdg62UiNHYcFCduYpKI=",
"lastModified": 1780772958,
"narHash": "sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM=",
"owner": "Gerg-L",
"repo": "mnw",
"rev": "1a3573fc9d2486738fe0b2cacc5cd10dd5f3a445",
"rev": "0871dbf63a53610c95db04439ed8ea4d6ec9c160",
"type": "github"
},
"original": {
@@ -316,94 +138,6 @@
"type": "github"
}
},
"ndg": {
"inputs": {
"nixpkgs": [
"nvf",
"nixpkgs"
]
},
"locked": {
"lastModified": 1779233504,
"narHash": "sha256-YIKEyzh0NFQlD0O92LQQNMoVCDwV8yw1Xz0Iu+4ZC5U=",
"owner": "feel-co",
"repo": "ndg",
"rev": "86f6644411a64d5413711895b7cf6e0e1be465b6",
"type": "github"
},
"original": {
"owner": "feel-co",
"ref": "refs/tags/v2.8.0",
"repo": "ndg",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-parts": [
"devenv",
"flake-parts"
],
"git-hooks-nix": [
"devenv",
"git-hooks"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-23-11": [
"devenv"
],
"nixpkgs-regression": [
"devenv"
]
},
"locked": {
"lastModified": 1779748925,
"narHash": "sha256-meIhqGC04O5VXbKSFXSQoOKp+XCq5RMnwAk1Guo0VQo=",
"owner": "cachix",
"repo": "nix",
"rev": "0bc443c8ff235c3547d09327b48aaa2ab98b15f2",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "devenv-2.34",
"repo": "nix",
"type": "github"
}
},
"nixd": {
"inputs": {
"flake-parts": [
"devenv",
"flake-parts"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1778381404,
"narHash": "sha256-FqhdOTA8vyoIpkHhbs2cCT7h6EWM7nsLeOYJc1ifQLE=",
"owner": "nix-community",
"repo": "nixd",
"rev": "e3e45eb76663f522e196b7f0cf34cab201db7779",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixd",
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
@@ -428,11 +162,11 @@
"nixos-hardware": {
"flake": false,
"locked": {
"lastModified": 1780310866,
"narHash": "sha256-fPBRVf6A5xlACYcOI59shGrjURuvwu0lRsDoSCEXt/I=",
"lastModified": 1782562157,
"narHash": "sha256-a7+T6QSeowynwZ1ZJJbP8T8ntAytvrui8kFGJmIZt2c=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "4ed851c979641e28597a05086332d75cdc9e395f",
"rev": "a9cf7546a938c737b079e738de73934a13de9784",
"type": "github"
},
"original": {
@@ -442,32 +176,12 @@
}
},
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
},
"locked": {
"lastModified": 1778507786,
"narHash": "sha256-HzSQCKMsMr8r55LwM1JuzIOB+8bzk0FEv6sItKvsfoY=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "8f24a228a782e24576b155d1e39f0d914b380691",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-src": {
"flake": false,
"locked": {
"lastModified": 1778274207,
"narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=",
"lastModified": 1782175435,
"narHash": "sha256-EMzXKmnOtBQ2MnvpiNOm7E+kOMvdPrIKaeg52Tip2Uk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7",
"rev": "89570f24e97e614aa34aa9ab1c927b6578a43775",
"type": "github"
},
"original": {
@@ -479,27 +193,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1779877693,
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4100e830e085863741bc69b156ec4ccd53ab5be0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1780336545,
"narHash": "sha256-bWVU1JP9hCYZzQjMLdMzr/FINF+UvpZGvCJcnNY616k=",
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
"lastModified": 1782821651,
"narHash": "sha256-OBddwHNJ+qxOHaKih0bE2PXJeZHlzUC8WOHZrUcnFwY=",
"rev": "e52c192be9d7b2c4bd4aed326c8731b35f8bb75c",
"type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1008784.4df1b885d76a/nixexprs.tar.xz"
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1025128.e52c192be9d7/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
@@ -508,21 +206,20 @@
},
"nvf": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_3",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_2",
"mnw": "mnw",
"ndg": "ndg",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1780421419,
"narHash": "sha256-EkZYvhK9B9M9j9vuLNSexG1Uf51UshGkPy5iVpYORe8=",
"lastModified": 1782841360,
"narHash": "sha256-S1f/S5Vv7wURVUtzPkmAFlKPVciaPLXxoeg7/GCnl28=",
"owner": "notashelf",
"repo": "nvf",
"rev": "8265ea062b4c37dc1b9846ec83bb8c9615048ef1",
"rev": "6fad9e9a998dd3a7783c839ce2928877d3e5a883",
"type": "github"
},
"original": {
@@ -533,41 +230,19 @@
},
"root": {
"inputs": {
"devenv": "devenv",
"flake-file": "flake-file",
"flake-parts": "flake-parts_2",
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"import-tree": "import-tree",
"nixgl": "nixgl",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_2",
"nvf": "nvf",
"sops-nix": "sops-nix",
"wrapper-modules": "wrapper-modules",
"wrappers": "wrappers"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1779074409,
"narHash": "sha256-6aXy8Ga41iLVM8ibddFU1O5+wYWcBGNEfZzZuL91eIc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "2a77b5b1dc952f214e8102acdef1622b68515560",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@@ -575,11 +250,11 @@
]
},
"locked": {
"lastModified": 1777944972,
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=",
"lastModified": 1782165805,
"narHash": "sha256-478kKQBvK6SYTOdN2h9jhKJv94nbXRbFMfuL1WshErg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c",
"rev": "56b24064fdcaedca53553b1a6d607fd23b613a24",
"type": "github"
},
"original": {
@@ -618,28 +293,6 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"devenv",
"nixd",
"nixpkgs"
]
},
"locked": {
"lastModified": 1775636079,
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"wrapper-modules": {
"inputs": {
"nixpkgs": [
@@ -647,11 +300,11 @@
]
},
"locked": {
"lastModified": 1780449413,
"narHash": "sha256-ZsjnJ85CrTxI7+VaOWzkOB1u/+d4CM9AxBazXfsYXuA=",
"lastModified": 1782135443,
"narHash": "sha256-vAmbArdCyjqpVW+37aCy/PMBOLIqukUXLQuEKLwUhA4=",
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"rev": "e72bd9cf5fbc57e620912b773bed42b4e278bdc0",
"rev": "6e7f66fa2cdf4d63162580b438f7fcf87c28a46f",
"type": "github"
},
"original": {
@@ -667,11 +320,11 @@
]
},
"locked": {
"lastModified": 1780428045,
"narHash": "sha256-pMJOun/oYhXqes+B3khzRDGWuiCNiWJ25+SVW0OwzNY=",
"lastModified": 1782375095,
"narHash": "sha256-bRepNpAluz2i0IIk7Tmzw/4BkyOrwABvc66NEgXPEhA=",
"owner": "lassulus",
"repo": "wrappers",
"rev": "ce9122bf06697ade7c5087940e0c280b89dd0208",
"rev": "cd780e92c0fa66c2e721e1d91894f3db13b9f2b4",
"type": "github"
},
"original": {
-1
View File
@@ -4,7 +4,6 @@
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
inputs = {
devenv.url = "github:cachix/devenv";
flake-file.url = "github:vic/flake-file";
flake-parts = {
url = "github:hercules-ci/flake-parts";
+19
View File
@@ -0,0 +1,19 @@
{ self, inputs, ... }: {
flake.modules.nixos.audio = { config, pkgs, lib, ... }: {
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
# media-session.enable = true;
};
};
}
+4
View File
@@ -1,6 +1,7 @@
# This module is for programs with GUIs that run in a desktop environment
{ self, inputs, ... }: {
flake.modules.homeManager.desktop = { config, pkgs, lib, ... }: {
nixpkgs.config.problems.handlers.sublimetext4.broken = "ignore";
imports = with inputs.self.modules.homeManager; [
brave
ghostty
@@ -10,6 +11,9 @@
home.packages = with pkgs; [
mangohud
sublime4
proton-vpn
joplin-desktop
discord
];
};
}
+15 -2
View File
@@ -1,11 +1,24 @@
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
{ inputs, ... }: {
flake.modules.nixos.greetd = { pkgs, lib, ... }: {
flake.modules.nixos.greetd = { pkgs, lib, config, ... }:
let
niriPackage = if config.programs.niri.enable then config.programs.niri.package else pkgs.niri;
niriExe = lib.getExe niriPackage;
regreetExe = lib.getExe config.programs.regreet.package;
greeterNiriConfig = pkgs.writeText "niri-greeter.kdl" ''
spawn-at-startup "${regreetExe}"
hotkey-overlay {
skip-at-startup
}
'';
in {
programs.regreet.enable = true;
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${lib.getExe pkgs.tuigreet} --time --remember --cmd niri-session";
command = "${pkgs.dbus}/bin/dbus-run-session -- ${niriExe} --config ${greeterNiriConfig}";
user = "greeter";
};
};
+133 -8
View File
@@ -1,17 +1,26 @@
{ self, inputs, ... }: {
flake.nixosModules.niri = { pkgs, lib, ... }: {
flake.modules.nixos.niri = { pkgs, lib, ... }:
let
niriPkg = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
in
{
programs.niri = {
enable = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
package = niriPkg;
};
systemd.user.services.niri.enableDefaultPath = false;
};
perSystem = { pkgs, lib, self', ... }: {
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
perSystem = { pkgs, lib, self', ... }:
let
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
noctaliaPkg = self'.packages.myNoctaliaNixGL;
terminalPkg = pkgs.ghostty;
myNiriUnwrapped = inputs.wrapper-modules.wrappers.niri.wrap {
inherit pkgs;
settings = {
spawn-at-startup = [
(lib.getExe self'.packages.myNoctalia)
(lib.getExe noctaliaPkg)
];
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
@@ -21,11 +30,127 @@
layout.gaps = 5;
binds = {
"Mod+Return".spawn-sh = lib.getExe pkgs.kitty;
"Mod+Q".close-window = null;
"Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle";
"Mod+Return".spawn-sh = lib.getExe terminalPkg;
# "Mod+Ctrl+Return".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
"Mod+Space".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
"Mod+B".spawn-sh = "${lib.getExe pkgs.brave}";
"Mod+E".spawn-sh = "xdg-open .";
"Mod+Alt+L".spawn-sh = "loginctl lock-session";
"Alt+F4".spawn-sh = "${lib.getExe' pkgs.coreutils "true"}";
"Mod+Shift+Q".close-window = { };
"Mod+S".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
"Mod+1".focus-workspace = 1;
"Mod+2".focus-workspace = 2;
"Mod+3".focus-workspace = 3;
"Mod+4".focus-workspace = 4;
"Mod+5".focus-workspace = 5;
"Mod+6".focus-workspace = 6;
"Mod+7".focus-workspace = 7;
"Mod+8".focus-workspace = 8;
"Mod+9".focus-workspace = 9;
"Mod+Tab".focus-workspace-previous = { };
# "Mod+WheelScrollDown".focus-workspace-down = { };
# "Mod+WheelScrollUp".focus-workspace-up = { };
# "Mod+Up".focus-window-up = { };
# "Mod+Down".focus-window-down = { };
"Mod+Up".focus-workspace-up = { };
"Mod+Down".focus-workspace-down = { };
"Mod+Left".focus-column-left = { };
"Mod+Right".focus-column-right = { };
"Mod+K".focus-window-up = { };
"Mod+J".focus-window-down = { };
"Mod+H".focus-column-left = { };
"Mod+L".focus-column-right = { };
"Mod+Home".focus-column-first = { };
"Mod+End".focus-column-last = { };
# "Mod+Shift+Left".focus-monitor-left = { };
# "Mod+Shift+Right".focus-monitor-right = { };
# "Mod+Shift+Up".focus-monitor-up = { };
# "Mod+Shift+Down".focus-monitor-down = { };
"Mod+Shift+1".move-column-to-workspace = 1;
"Mod+Shift+2".move-column-to-workspace = 2;
"Mod+Shift+3".move-column-to-workspace = 3;
"Mod+Shift+4".move-column-to-workspace = 4;
"Mod+Shift+5".move-column-to-workspace = 5;
"Mod+Shift+6".move-column-to-workspace = 6;
"Mod+Shift+7".move-column-to-workspace = 7;
"Mod+Shift+8".move-column-to-workspace = 8;
"Mod+Shift+9".move-column-to-workspace = 9;
"Mod+Ctrl+Up".move-window-up = { };
"Mod+Ctrl+Down".move-window-down = { };
"Mod+Ctrl+Left".move-column-left = { };
"Mod+Ctrl+Right".move-column-right = { };
"Mod+Ctrl+K".move-window-up = { };
"Mod+Ctrl+J".move-window-down = { };
"Mod+Ctrl+H".move-column-left = { };
"Mod+Ctrl+L".move-column-right = { };
"Mod+Ctrl+Home".move-column-to-first = { };
"Mod+Ctrl+End".move-column-to-last = { };
"Mod+Shift+Ctrl+Left".move-column-to-monitor-left = { };
"Mod+Shift+Ctrl+Right".move-column-to-monitor-right = { };
"Mod+Shift+Ctrl+Up".move-column-to-monitor-up = { };
"Mod+Shift+Ctrl+Down".move-column-to-monitor-down = { };
"Mod+Ctrl+F".expand-column-to-available-width = { };
"Mod+C".center-column = { };
"Mod+Ctrl+C".center-visible-columns = { };
"Mod+Minus".set-column-width = "-10%";
"Mod+Equal".set-column-width = "+10%";
"Mod+Shift+Minus".set-window-height = "-10%";
"Mod+Shift+Equal".set-window-height = "+10%";
"Mod+T".toggle-window-floating = { };
"Mod+F".fullscreen-window = { };
"Mod+W".toggle-column-tabbed-display = { };
"Mod+O".toggle-overview = { };
"Ctrl+Shift+1".screenshot = { };
"Ctrl+Shift+2".screenshot-screen = { };
"Ctrl+Shift+3".screenshot-window = { };
"Mod+Shift+Slash".show-hotkey-overlay = { };
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = { };
"Mod+Shift+P".power-off-monitors = { };
"Ctrl+Alt+Delete".quit = { };
"Mod+WheelScrollRight".focus-column-right = { };
"Mod+WheelScrollLeft".focus-column-left = { };
"Mod+Ctrl+WheelScrollRight".move-column-right = { };
"Mod+Ctrl+WheelScrollLeft".move-column-left = { };
"Mod+Shift+WheelScrollDown".focus-column-right = { };
"Mod+Shift+WheelScrollUp".focus-column-left = { };
# "Mod+Ctrl+Shift+WheelScrollDown".move-column-right = { };
# "Mod+Ctrl+Shift+WheelScrollUp".move-column-left = { };
};
};
};
in {
packages.myNiri = myNiriUnwrapped;
packages.myNiriNixGL = pkgs.symlinkJoin {
name = "my-niri-nixgl";
paths = [ myNiriUnwrapped ];
nativeBuildInputs = [ pkgs.makeWrapper ];
meta.mainProgram = "niri";
postBuild = ''
for exe in "$out"/bin/*; do
if [[ -f "$exe" ]]; then
base="$(basename "$exe")"
mv "$exe" "$out/bin/.''${base}-real"
makeWrapper ${lib.getExe nixGLPackage} "$exe" \
--add-flags "$out/bin/.''${base}-real"
fi
done
'';
};
};
}
+63
View File
@@ -0,0 +1,63 @@
{ self, inputs, ... }: {
flake.modules.nixos.base = { config, pkgs, lib, ... }: {
imports = [
self.modules.nixos.audio
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config = {
permittedInsecurePackages = [ "openssl-1.1.1w" ];
allowUnfree = true;
problems.handlers.sublimetext4.broken = "ignore";
};
# Set your time zone.
time.timeZone = "US/Central";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
fonts.packages = with pkgs; [
nerd-fonts.hack
nerd-fonts.sauce-code-pro
];
# Need for less pain-in-the-ass for doing normal-ish stuff
# This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code
programs.nix-ld.enable = true;
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
services.openssh.enable = true;
security.polkit.enable = true; # polkit
services.gnome.gnome-keyring.enable = true; # secret service
security.pam.services.swaylock = {};
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
};
}
+30 -6
View File
@@ -1,10 +1,34 @@
{ self, inputs, ... }: {
perSystem = { pkgs, ... }: {
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
inherit pkgs; # THIS PART IS VERY IMPORTAINT, I FORGOT IT IN THE VIDEO!!!
settings =
(builtins.fromJSON
(builtins.readFile ./noctalia.json)).settings;
perSystem = { pkgs, lib, ... }:
let
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
myNoctaliaUnwrapped = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
inherit pkgs;
runtimePkgs = [
pkgs.qt6.qtwebsockets
];
# settings =
# (builtins.fromJSON
# (builtins.readFile ./noctalia.json)).settings;
};
in {
packages.myNoctalia = myNoctaliaUnwrapped;
packages.myNoctaliaNixGL = pkgs.symlinkJoin {
name = "my-noctalia-nixgl";
paths = [ myNoctaliaUnwrapped ];
nativeBuildInputs = [ pkgs.makeWrapper ];
meta.mainProgram = "noctalia-shell";
postBuild = ''
for exe in "$out"/bin/*; do
if [[ -f "$exe" ]]; then
base="$(basename "$exe")"
mv "$exe" "$out/bin/.''${base}-real"
makeWrapper ${lib.getExe nixGLPackage} "$exe" \
--add-flags "$out/bin/.''${base}-real"
fi
done
'';
};
};
}
+59 -4
View File
@@ -1,10 +1,65 @@
{ self, inputs, ... }: {
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }: {
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }:
let
cfg = config.resticServer;
port = builtins.fromJSON (lib.last (lib.splitString ":" cfg.listenAddress));
in {
options.resticServer = {
enable = lib.mkEnableOption "Enable the RESTic REST server";
dataDir = lib.mkOption {
description = "Storage directory for RESTic repositories served by this host.";
type = lib.types.str;
default = "/mnt/restic";
};
listenAddress = lib.mkOption {
description = "Listen address for the RESTic REST server.";
type = lib.types.str;
default = "0.0.0.0:8080";
};
privateRepos = lib.mkOption {
description = "Whether the RESTic server should use private repository mode.";
type = lib.types.bool;
default = true;
};
extraFlags = lib.mkOption {
description = "Additional flags to pass to the RESTic REST server before TLS flags are appended.";
type = lib.types.listOf lib.types.str;
default = [ "--no-auth" ];
};
tls = {
certFile = lib.mkOption {
description = "Path to the TLS certificate file for the RESTic REST server, or null to disable TLS.";
type = lib.types.nullOr lib.types.str;
default = null;
};
keyFile = lib.mkOption {
description = "Path to the TLS private key file for the RESTic REST server, or null to disable TLS.";
type = lib.types.nullOr lib.types.str;
default = null;
};
};
};
config = lib.mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ port ];
services.restic.server = {
enable = true;
dataDir = "/mnt/restic";
listenAddress = "0.0.0.0:8080";
extraFlags = [ "--no-auth" ];
inherit (cfg) dataDir listenAddress privateRepos;
extraFlags =
cfg.extraFlags
++ lib.optionals (cfg.tls.certFile != null && cfg.tls.keyFile != null) [
"--tls"
"--tls-cert=${cfg.tls.certFile}"
"--tls-key=${cfg.tls.keyFile}"
];
};
};
};
+3 -13
View File
@@ -16,7 +16,6 @@ in
lib.removePrefix "/etc/" cfg.certDir
else
cfg.certDir;
certRootEtcPath = "${certDirEtcPath}/root_ca.crt";
mkStepRules = home: user: group: [
"d ${home}/.step 0700 ${user} ${group} -"
"d ${home}/.step/config 0700 ${user} ${group} -"
@@ -38,10 +37,9 @@ in
environment.etc = lib.mkIf cfgInEtc {
"step-ca/defaults.json".text = builtins.toJSON {
ca-url = "https://janus.john-stream.com/";
fingerprint = builtins.readFile ./fingerprint;
root = "/etc/${certRootEtcPath}";
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
root = ./root_ca.crt;
};
"${certRootEtcPath}".source = ./root_ca.crt;
};
systemd.tmpfiles.rules =
mkStepRules johnHome username johnGroup
@@ -49,14 +47,6 @@ in
};
};
flake.modules.homeManager.janus-ca = { config, ... }: {
home.file.".step/config/defaults.json".text = builtins.toJSON {
ca-url = "https://janus.john-stream.com/";
fingerprint = builtins.readFile ./fingerprint;
root = ./root_ca.crt;
};
};
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
modules = with inputs.self.modules; [
nixos.lxc
@@ -70,6 +60,7 @@ in
nixos.mtls
{
networking.hostName = hostname;
sops.defaultSopsFile = ../../../keys/secrets.yaml;
step-ssh-host = {
hostname = hostname;
};
@@ -86,7 +77,6 @@ in
imports = with inputs.self.modules.homeManager; [
mysops
];
shell.program = "zsh";
docker.enable = true;
};
}
+11 -5
View File
@@ -1,7 +1,7 @@
{ withSystem, self, inputs, ... }:
let
username = "john";
hostname = "omen";
hostname = "john-kde";
in
{
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
@@ -62,9 +62,15 @@ in
};
};
flake.homeConfigurations."john@omen" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs'.nixpkgs.legacyPackages;
flake.homeConfigurations."john@john-kde" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs.outPath {
localSystem.system = "x86_64-linux";
config = {
allowUnfree = true;
permittedInsecurePackages = [ "openssl-1.1.1w" ];
problems.handlers.sublimetext4.broken = "ignore";
};
};
modules = [ inputs.self.modules.homeManager."${hostname}" ]; # Uses the module defined above
});
};
}
+3 -71
View File
@@ -9,28 +9,16 @@
in
{
imports = [
self.modules.nixos.base
self.modules.nixos.p14sHardware
self.modules.nixos.onepassword
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config = {
permittedInsecurePackages = [ "openssl-1.1.1w" ];
allowUnfree = true;
};
rebuild.flakeDir = flakeDir;
networking = {
hostName = hostname;
networkmanager.enable = true;
};
# Enable automatic login for the user.
# services.displayManager.autoLogin.enable = true;
# services.displayManager.autoLogin.user = "john";
networking.hostName = hostname;
programs.zsh.enable = true;
services.openssh.enable = true;
services.tailscale.enable = true;
# List packages installed in system profile. To search, run:
@@ -45,18 +33,6 @@
security.pam.services.swaylock = {};
security.pam.services.swaylock.fprintAuth = true;
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "john" ];
# TODO this should not be a hardcoded username
};
# This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code
programs.nix-ld.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
@@ -65,48 +41,10 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
fonts.packages = with pkgs; [
nerd-fonts.hack
nerd-fonts.sauce-code-pro
];
services.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager).
services.fprintd.enable = true; # Enables fingerprint sensor
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
# media-session.enable = true;
};
home-manager.users.root = {
imports = with inputs.self.modules.homeManager; [
@@ -123,12 +61,6 @@
my-vscode.enable = true;
mysops.hostSecretFile = "${flakeDir}/modules/hosts/john-p14s/secrets.yaml";
homeManagerFlakeDir = "${flakeDir}";
home.packages = with pkgs; [
bash
discord
proton-vpn
joplin-desktop
];
ssh.certificates.enable = true;
ssh.matchSets = {
appdaemon = true;
+13 -9
View File
@@ -26,6 +26,7 @@ in
desktop
step-client
mysops
# zed-editor
# myPackage
# myStepClient
];
@@ -38,6 +39,7 @@ in
home.username = "${username}";
home.homeDirectory = "/home/${username}";
home.packages = with pkgs; [
nil # Nix language server
selfPkgs.jsl-zsh
# selfPkgs.my-neovim
selfPkgs.ssh-certs
@@ -57,7 +59,7 @@ in
ssh = {
certificates.enable = true;
knownHosts = [
"fded:fb16:653e:25da:be24:11ff:fea0:753f ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9ZqiWPrCwHjxFCiu0lT4rlQs7KyMapxKJQQ5PJP1eh"
"@cert-authority fded:fb16:653e:25da:be24:11ff:fea0:753f ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNug18oLH0vZxnibXJzMJvTWFPZTnSlhCDDVi+rHhgnIum6ZXQ4SF+VHOOAM5BbzZmMKitNJ5lcrGP15Eur7DzQ="
];
matchSets = {
certs = true;
@@ -104,13 +106,15 @@ in
# };
};
flake.homeConfigurations."john@john-pc-ubuntu" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
inputs.home-manager.lib.homeManagerConfiguration {
# pkgs = import inputs.nixpkgs {
# inherit system;
# overlays = [ inputs.self.overlays.default ];
# };
pkgs = inputs'.nixpkgs.legacyPackages;
flake.homeConfigurations."john@john-pc-ubuntu" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs.outPath {
localSystem.system = "x86_64-linux";
config = {
allowUnfree = true;
permittedInsecurePackages = [ "openssl-1.1.1w" ];
problems.handlers.sublimetext4.broken = "ignore";
};
};
modules = [ inputs.self.modules.homeManager."${hostname}" ];
});
};
}
+17 -22
View File
@@ -1,10 +1,14 @@
{ self, inputs, ... }: {
flake.nixosModules.omen = { pkgs, lib, ... }: {
flake.modules.nixos.omen-nixos = { pkgs, lib, ... }: {
# import any other modules from here
imports = [
self.nixosModules.omenHardware
self.nixosModules.niri
self.modules.nixos.omen-nixos-hardware
self.modules.nixos.base
self.modules.nixos.greetd
self.modules.nixos.niri
self.modules.nixos.onepassword
self.modules.nixos.steam
];
# Use the systemd-boot EFI boot loader.
@@ -14,15 +18,7 @@
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "nixos-omen"; # Define your hostname.
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "US/Central";
networking.hostName = "omen-nixos"; # Define your hostname.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
@@ -36,16 +32,6 @@
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
@@ -76,6 +62,7 @@
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
micro
nh
];
@@ -123,6 +110,14 @@
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "26.05"; # Did you read the comment?
# ...
home-manager.users.john.imports = with inputs.self.modules.homeManager; [
desktop
# rebuild
{
my-vscode.enable = true;
}
];
};
}
+3 -2
View File
@@ -1,7 +1,8 @@
{ self, inputs, ... }: {
flake.nixosConfigurations.omen = inputs.nixpkgs.lib.nixosSystem {
flake.nixosConfigurations.omen-nixos = inputs.nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.omen
self.modules.nixos.omen-nixos
self.modules.nixos.john
];
};
}
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, inputs, ... }: {
flake.nixosModules.omenHardware = { config, lib, pkgs, modulesPath, ... }: {
flake.modules.nixos.omen-nixos-hardware = { config, lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
@@ -1,4 +1,5 @@
{ withSystem, self, inputs, lib, ... }:
# Intent: NixOS service node for Forgejo + restic with mTLS, host-local secrets, and a paired Home Manager profile for john.
let
username = "john";
hostname = "soteria";
@@ -15,7 +16,7 @@ in
nixos.mtls
nixos.janus-ca
nixos.forgejo
# nixos.restic-server
nixos.restic-server
# nixos.restic-envoy
({ config, pkgs, ... }: {
networking.hostName = hostname;
@@ -57,17 +58,15 @@ in
port = 443;
};
networking.firewall.allowedTCPPorts = [ 8000 ];
services.restic.server = {
resticServer = {
enable = true;
dataDir = "/mnt/restic";
privateRepos = true;
listenAddress = "0.0.0.0:8000";
extraFlags = [
"--no-auth"
"--tls"
"--tls-cert=${config.mtls.certFile}"
"--tls-key=${config.mtls.keyFile}"
];
tls = {
certFile = config.mtls.certFile;
keyFile = config.mtls.keyFile;
};
};
loginText.extraServiceStatus = {
@@ -83,7 +82,7 @@ in
# This provides the secrets at install time
sops.defaultSopsFile = ./secrets.yaml;
programs.zsh.enable = true;
# programs.zsh.enable = true;
home-manager.users."${username}".imports = [ inputs.self.modules.homeManager.soteria ];
+2 -1
View File
@@ -13,11 +13,12 @@ in
nixos."${username}"
nixos.docker
{
step-ssh-host.hostname = hostname;
sops.defaultSopsFile = ../../keys/secrets.yaml;
home-manager.users."${username}" = {
imports = with inputs.self.modules.homeManager; [
mysops
];
shell.program = "zsh";
docker.enable = true;
ssh.matchSets = {
certs = true;
+1 -1
View File
@@ -26,7 +26,7 @@
group = username;
home = "/home/${username}";
shell = pkgs.zsh;
extraGroups = [ "input" "networkmanager" ]
extraGroups = [ "input" "networkmanager" "video" "render" ]
++ lib.optional isAdmin "wheel"
++ lib.optional config.virtualisation.docker.enable "docker"
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
-28
View File
@@ -1,28 +0,0 @@
{ self, inputs, ... }: {
flake.modules.nixos.niri = { pkgs, lib, ... }: {
programs.niri = {
enable = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
};
};
perSystem = { pkgs, lib, self', ... }: {
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
inherit pkgs;
env.RUST_BACKTRACE = "full";
settings = {
spawn-at-startup = [
"${lib.getExe self'.packages.myNoctalia}"
];
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
input.keyboard.xkb.layout = "us,ua";
layout.gaps = 5;
binds = {
"Mod+Return".spawn-sh = lib.getExe pkgs.ghostty;
"Mod+Q".close-window = null;
"Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle";
};
};
};
};
}
-8
View File
@@ -1,8 +0,0 @@
{ self, inputs, ... }: {
perSystem = { pkgs, ... }: {
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
inherit pkgs;
# settings = (builtins.fromJSON (builtins.readFile ./noctalia.json)).settings;
};
};
}
+11
View File
@@ -1,4 +1,15 @@
{ self, inputs, ... }: {
flake.modules.nixos.onepassword = { config, ... }: {
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "john" ];
# TODO this should not be a hardcoded username
};
};
flake.modules.homeManager.onepassword = { config, ... }: {
home.file.".config/1Password/ssh/agent.toml".text = ''
# https://developer.1password.com/docs/ssh/agent/config
+34 -42
View File
@@ -126,99 +126,91 @@ in
SetEnv TERM="xterm-256color"
'';
matchBlocks = lib.mkMerge [
settings = lib.mkMerge [
{
"john-pc-ubuntu" = {
hostname = "192.168.1.85";
HostName = "192.168.1.85";
};
"*" = lib.mkMerge [
{
user = "john";
identityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
User = "john";
IdentityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
Compression = false;
ServerAliveInterval = 0;
ServerAliveCountMax = 3;
identitiesOnly = true;
inherit identityFile;
IdentitiesOnly = true;
IdentityFile = identityFile;
hashKnownHosts = false;
userKnownHostsFile = cfg.knownHostsFile;
HashKnownHosts = false;
UserKnownHostsFile = cfg.knownHostsFile;
addKeysToAgent = "yes";
forwardAgent = false;
AddKeysToAgent = "yes";
ForwardAgent = false;
}
(lib.mkIf cfg.certificates.enable { inherit certificateFile; })
(lib.mkIf cfg.certificates.enable { CertificateFile = certificateFile; })
];
}
(lib.mkIf cfg.matchSets.appdaemon {
"appdaemon" = {
hostname = "192.168.1.242";
user = "appdaemon";
HostName = "192.168.1.242";
User = "appdaemon";
};
"ad-nix" = {
hostname = "192.168.1.201";
user = "appdaemon";
HostName = "192.168.1.201";
User = "appdaemon";
};
})
(lib.mkIf cfg.matchSets.certs {
"janus" = {
hostname = "janus.john-stream.com";
user = "root";
HostName = "janus.john-stream.com";
User = "root";
};
"soteria" = {
hostname = "soteria.john-stream.com";
user = "john";
HostName = "soteria.john-stream.com";
User = "john";
};
})
(lib.mkIf cfg.matchSets.homelab {
"docs" = {
hostname = "192.168.1.110";
user = "root";
extraOptions = {
HostName = "192.168.1.110";
User = "root";
RequestTTY = "force";
RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
};
};
"gitea" = {
hostname = "192.168.1.104";
user = "john";
HostName = "192.168.1.104";
User = "john";
};
"hermes" = {
hostname = "192.168.1.150";
user = "root";
HostName = "192.168.1.150";
User = "root";
# Enabling this breaks the ability of Zed to install its remote stuff
# extraOptions = {
# RequestTTY = "force";
# RemoteCommand = "/root/.nix-profile/bin/jsl-zsh";
# };
};
"panoptes" = {
hostname = "192.168.1.107";
user = "panoptes";
HostName = "192.168.1.107";
User = "panoptes";
};
})
(lib.mkIf cfg.matchSets.dev {
"test-nix" = {
hostname = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
user = "john";
extraOptions = {
HostName = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
User = "john";
RequestTTY = "auto";
# RemoteCommand = "/run/current-system/sw/bin/jsl-zsh";
};
};
})
(lib.mkIf cfg.matchSets.tailscale {
"jdl-docker" = {
hostname = "jdl-docker.tailcf205.ts.net";
user = "john";
extraOptions = {
HostName = "jdl-docker.tailcf205.ts.net";
User = "john";
RequestTTY = "auto";
# RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
};
};
})
];
};