Compare commits
53
Commits
wrappers
...
cf418ca7a0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf418ca7a0 | ||
|
|
8ae74a9bc9 | ||
|
|
b74133985c | ||
|
|
2de7650f3d | ||
|
|
41f33653a7 | ||
|
|
460d8908bb | ||
|
|
621a61fb9e | ||
|
|
3f3d847134 | ||
|
|
4e5f1230ab | ||
|
|
c3eeeb16f8 | ||
|
|
7556b13eb9 | ||
|
|
a72f34ab51 | ||
|
|
4e465b1846 | ||
|
|
d2737a42e8 | ||
|
|
a9ae07d5c1 | ||
|
|
f505100bb4 | ||
|
|
aff22e3a0f | ||
|
|
b13b774738 | ||
|
|
43fe37d4e2 | ||
|
|
a98e637ce2 | ||
|
|
0e194e5d44 | ||
|
|
68737a513f | ||
|
|
e76fc00a98 | ||
|
|
f22e8cb1d5 | ||
|
|
bb06b848be | ||
|
|
021ca1ba83 | ||
|
|
4bd11e1047 | ||
|
|
ff80098418 | ||
|
|
3265669503 | ||
|
|
7294e04ae2 | ||
|
|
3e1d438453 | ||
|
|
2f653b95ce | ||
|
|
1c1515678a | ||
|
|
ee4839877c | ||
|
|
fc2325e70b | ||
|
|
2ae5eb9547 | ||
|
|
ba305e29fd | ||
|
|
deda2c9bbc | ||
|
|
10c8c887db | ||
|
|
7b2dffbccf | ||
|
|
95f382107d | ||
|
|
3cd3099987 | ||
|
|
775543224e | ||
|
|
aff608c1ce | ||
|
|
ecb640fa45 | ||
|
|
ceeba1c786 | ||
|
|
b8153f0ebc | ||
|
|
e9ec34f15c | ||
|
|
6c8ca29751 | ||
|
|
bcd07532db | ||
|
|
2861c460c2 | ||
|
|
6e27e92f89 | ||
|
|
1002e6e0da |
@@ -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.
|
||||||
@@ -16,6 +16,18 @@ nix flake show --all-systems
|
|||||||
nix run nixpkgs#nh home switch -- --configuration john@john-pc-ubuntu .
|
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
|
## Layout
|
||||||
|
|
||||||
- Everything under `./modules` gets auto-imported by `import-tree`
|
- Everything under `./modules` gets auto-imported by `import-tree`
|
||||||
|
|||||||
Generated
+36
-383
@@ -1,99 +1,6 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"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-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,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777699697,
|
"lastModified": 1777699697,
|
||||||
@@ -111,11 +18,11 @@
|
|||||||
},
|
},
|
||||||
"flake-file": {
|
"flake-file": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779051720,
|
"lastModified": 1781217157,
|
||||||
"narHash": "sha256-+jbXnODsR19pFKB0x/6kHhFgW6yV6N+CGClFr45eDU8=",
|
"narHash": "sha256-N3q/SP2Ropk336e9KSgLh7kpROY6P70dprYdbPIfd5c=",
|
||||||
"owner": "vic",
|
"owner": "vic",
|
||||||
"repo": "flake-file",
|
"repo": "flake-file",
|
||||||
"rev": "c58eb27d9434e5be0c8693f1eb18d47035bc21ba",
|
"rev": "ce63eaf7ebfe04a176653f66385a7f0a36380cee",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -127,7 +34,6 @@
|
|||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -146,26 +52,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
"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": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nvf",
|
"nvf",
|
||||||
@@ -204,80 +90,16 @@
|
|||||||
"type": "github"
|
"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": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780408569,
|
"lastModified": 1782881387,
|
||||||
"narHash": "sha256-s7Tv6FUQThRAvW8En8XVC6HMb0uiikzVccCcCo9u/Bg=",
|
"narHash": "sha256-HvlS1KDGXDjd1bNzzPvH1mkDJATlDAfVYfTh//wJBEA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "f384af1bec6423a0d4ba1855917ab948f64e5808",
|
"rev": "d32537981c036473cf6990ae03176a5d84c43b29",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -303,11 +125,11 @@
|
|||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778541201,
|
"lastModified": 1780772958,
|
||||||
"narHash": "sha256-n0twkzWexzjsoDycOTvvQNuGEdg62UiNHYcFCduYpKI=",
|
"narHash": "sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "1a3573fc9d2486738fe0b2cacc5cd10dd5f3a445",
|
"rev": "0871dbf63a53610c95db04439ed8ea4d6ec9c160",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -316,94 +138,6 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixgl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
@@ -428,11 +162,11 @@
|
|||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780310866,
|
"lastModified": 1782562157,
|
||||||
"narHash": "sha256-fPBRVf6A5xlACYcOI59shGrjURuvwu0lRsDoSCEXt/I=",
|
"narHash": "sha256-a7+T6QSeowynwZ1ZJJbP8T8ntAytvrui8kFGJmIZt2c=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "4ed851c979641e28597a05086332d75cdc9e395f",
|
"rev": "a9cf7546a938c737b079e738de73934a13de9784",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -442,32 +176,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-src": "nixpkgs-src"
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778507786,
|
"lastModified": 1782175435,
|
||||||
"narHash": "sha256-HzSQCKMsMr8r55LwM1JuzIOB+8bzk0FEv6sItKvsfoY=",
|
"narHash": "sha256-EMzXKmnOtBQ2MnvpiNOm7E+kOMvdPrIKaeg52Tip2Uk=",
|
||||||
"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=",
|
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7",
|
"rev": "89570f24e97e614aa34aa9ab1c927b6578a43775",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -479,27 +193,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779877693,
|
"lastModified": 1782821651,
|
||||||
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
|
"narHash": "sha256-OBddwHNJ+qxOHaKih0bE2PXJeZHlzUC8WOHZrUcnFwY=",
|
||||||
"owner": "NixOS",
|
"rev": "e52c192be9d7b2c4bd4aed326c8731b35f8bb75c",
|
||||||
"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",
|
|
||||||
"type": "tarball",
|
"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": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@@ -508,21 +206,20 @@
|
|||||||
},
|
},
|
||||||
"nvf": {
|
"nvf": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts_3",
|
"flake-parts": "flake-parts_2",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780421419,
|
"lastModified": 1782841360,
|
||||||
"narHash": "sha256-EkZYvhK9B9M9j9vuLNSexG1Uf51UshGkPy5iVpYORe8=",
|
"narHash": "sha256-S1f/S5Vv7wURVUtzPkmAFlKPVciaPLXxoeg7/GCnl28=",
|
||||||
"owner": "notashelf",
|
"owner": "notashelf",
|
||||||
"repo": "nvf",
|
"repo": "nvf",
|
||||||
"rev": "8265ea062b4c37dc1b9846ec83bb8c9615048ef1",
|
"rev": "6fad9e9a998dd3a7783c839ce2928877d3e5a883",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -533,41 +230,19 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devenv": "devenv",
|
|
||||||
"flake-file": "flake-file",
|
"flake-file": "flake-file",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nvf": "nvf",
|
"nvf": "nvf",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"wrapper-modules": "wrapper-modules",
|
"wrapper-modules": "wrapper-modules",
|
||||||
"wrappers": "wrappers"
|
"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": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -575,11 +250,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777944972,
|
"lastModified": 1782165805,
|
||||||
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=",
|
"narHash": "sha256-478kKQBvK6SYTOdN2h9jhKJv94nbXRbFMfuL1WshErg=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c",
|
"rev": "56b24064fdcaedca53553b1a6d607fd23b613a24",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -618,28 +293,6 @@
|
|||||||
"type": "github"
|
"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": {
|
"wrapper-modules": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -647,11 +300,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780449413,
|
"lastModified": 1782135443,
|
||||||
"narHash": "sha256-ZsjnJ85CrTxI7+VaOWzkOB1u/+d4CM9AxBazXfsYXuA=",
|
"narHash": "sha256-vAmbArdCyjqpVW+37aCy/PMBOLIqukUXLQuEKLwUhA4=",
|
||||||
"owner": "BirdeeHub",
|
"owner": "BirdeeHub",
|
||||||
"repo": "nix-wrapper-modules",
|
"repo": "nix-wrapper-modules",
|
||||||
"rev": "e72bd9cf5fbc57e620912b773bed42b4e278bdc0",
|
"rev": "6e7f66fa2cdf4d63162580b438f7fcf87c28a46f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -667,11 +320,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780428045,
|
"lastModified": 1782375095,
|
||||||
"narHash": "sha256-pMJOun/oYhXqes+B3khzRDGWuiCNiWJ25+SVW0OwzNY=",
|
"narHash": "sha256-bRepNpAluz2i0IIk7Tmzw/4BkyOrwABvc66NEgXPEhA=",
|
||||||
"owner": "lassulus",
|
"owner": "lassulus",
|
||||||
"repo": "wrappers",
|
"repo": "wrappers",
|
||||||
"rev": "ce9122bf06697ade7c5087940e0c280b89dd0208",
|
"rev": "cd780e92c0fa66c2e721e1d91894f3db13b9f2b4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
devenv.url = "github:cachix/devenv";
|
|
||||||
flake-file.url = "github:vic/flake-file";
|
flake-file.url = "github:vic/flake-file";
|
||||||
flake-parts = {
|
flake-parts = {
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
# This module is for programs with GUIs that run in a desktop environment
|
# This module is for programs with GUIs that run in a desktop environment
|
||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.modules.homeManager.desktop = { config, pkgs, lib, ... }: {
|
flake.modules.homeManager.desktop = { config, pkgs, lib, ... }: {
|
||||||
|
nixpkgs.config.problems.handlers.sublimetext4.broken = "ignore";
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
brave
|
brave
|
||||||
ghostty
|
ghostty
|
||||||
@@ -10,6 +11,9 @@
|
|||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
mangohud
|
mangohud
|
||||||
sublime4
|
sublime4
|
||||||
|
proton-vpn
|
||||||
|
joplin-desktop
|
||||||
|
discord
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
|
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
|
||||||
{ inputs, ... }: {
|
{ 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 = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
default_session = {
|
default_session = {
|
||||||
command = "${lib.getExe pkgs.tuigreet} --time --remember --cmd niri-session";
|
command = "${pkgs.dbus}/bin/dbus-run-session -- ${niriExe} --config ${greeterNiriConfig}";
|
||||||
user = "greeter";
|
user = "greeter";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+142
-17
@@ -1,31 +1,156 @@
|
|||||||
{ self, inputs, ... }: {
|
{ 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 = {
|
programs.niri = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
|
package = niriPkg;
|
||||||
};
|
};
|
||||||
|
systemd.user.services.niri.enableDefaultPath = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { pkgs, lib, self', ... }: {
|
perSystem = { pkgs, lib, self', ... }:
|
||||||
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
|
let
|
||||||
inherit pkgs;
|
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
|
||||||
settings = {
|
noctaliaPkg = self'.packages.myNoctaliaNixGL;
|
||||||
spawn-at-startup = [
|
terminalPkg = pkgs.ghostty;
|
||||||
(lib.getExe self'.packages.myNoctalia)
|
myNiriUnwrapped = inputs.wrapper-modules.wrappers.niri.wrap {
|
||||||
];
|
inherit pkgs;
|
||||||
|
settings = {
|
||||||
|
spawn-at-startup = [
|
||||||
|
(lib.getExe noctaliaPkg)
|
||||||
|
];
|
||||||
|
|
||||||
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
||||||
|
|
||||||
input.keyboard.xkb.layout = "us,ua";
|
input.keyboard.xkb.layout = "us,ua";
|
||||||
|
|
||||||
layout.gaps = 5;
|
layout.gaps = 5;
|
||||||
|
|
||||||
binds = {
|
binds = {
|
||||||
"Mod+Return".spawn-sh = lib.getExe pkgs.kitty;
|
"Mod+Return".spawn-sh = lib.getExe terminalPkg;
|
||||||
"Mod+Q".close-window = null;
|
# "Mod+Ctrl+Return".spawn-sh = "${lib.getExe noctaliaPkg} ipc call launcher toggle";
|
||||||
"Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,10 +1,34 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
perSystem = { pkgs, ... }: {
|
perSystem = { pkgs, lib, ... }:
|
||||||
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
let
|
||||||
inherit pkgs; # THIS PART IS VERY IMPORTAINT, I FORGOT IT IN THE VIDEO!!!
|
nixGLPackage = inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel;
|
||||||
settings =
|
myNoctaliaUnwrapped = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
||||||
(builtins.fromJSON
|
inherit pkgs;
|
||||||
(builtins.readFile ./noctalia.json)).settings;
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,67 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }: {
|
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }:
|
||||||
services.restic.server = {
|
let
|
||||||
enable = true;
|
cfg = config.resticServer;
|
||||||
dataDir = "/mnt/restic";
|
port = builtins.fromJSON (lib.last (lib.splitString ":" cfg.listenAddress));
|
||||||
listenAddress = "0.0.0.0:8080";
|
in {
|
||||||
extraFlags = [ "--no-auth" ];
|
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;
|
||||||
|
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}"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
flake.modules.homeManager.restic = { config, pkgs, lib, ... }:
|
flake.modules.homeManager.restic = { config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos.janus-ca =
|
flake.modules.nixos.janus-ca =
|
||||||
{ config, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.janus-ca;
|
cfg = config.janus-ca;
|
||||||
johnHome = lib.attrByPath [ "users" "users" username "home" ] "/home/${username}" config;
|
johnHome = lib.attrByPath [ "users" "users" username "home" ] "/home/${username}" config;
|
||||||
@@ -16,7 +16,6 @@ in
|
|||||||
lib.removePrefix "/etc/" cfg.certDir
|
lib.removePrefix "/etc/" cfg.certDir
|
||||||
else
|
else
|
||||||
cfg.certDir;
|
cfg.certDir;
|
||||||
certRootEtcPath = "${certDirEtcPath}/root_ca.crt";
|
|
||||||
mkStepRules = home: user: group: [
|
mkStepRules = home: user: group: [
|
||||||
"d ${home}/.step 0700 ${user} ${group} -"
|
"d ${home}/.step 0700 ${user} ${group} -"
|
||||||
"d ${home}/.step/config 0700 ${user} ${group} -"
|
"d ${home}/.step/config 0700 ${user} ${group} -"
|
||||||
@@ -38,10 +37,9 @@ in
|
|||||||
environment.etc = lib.mkIf cfgInEtc {
|
environment.etc = lib.mkIf cfgInEtc {
|
||||||
"step-ca/defaults.json".text = builtins.toJSON {
|
"step-ca/defaults.json".text = builtins.toJSON {
|
||||||
ca-url = "https://janus.john-stream.com/";
|
ca-url = "https://janus.john-stream.com/";
|
||||||
fingerprint = builtins.readFile ./fingerprint;
|
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||||
root = "/etc/${certRootEtcPath}";
|
root = ./root_ca.crt;
|
||||||
};
|
};
|
||||||
"${certRootEtcPath}".source = ./root_ca.crt;
|
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules =
|
systemd.tmpfiles.rules =
|
||||||
mkStepRules johnHome username johnGroup
|
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 {
|
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = with inputs.self.modules; [
|
modules = with inputs.self.modules; [
|
||||||
nixos.lxc
|
nixos.lxc
|
||||||
@@ -68,10 +58,15 @@ in
|
|||||||
nixos.docker
|
nixos.docker
|
||||||
nixos.login-text
|
nixos.login-text
|
||||||
nixos.mtls
|
nixos.mtls
|
||||||
{
|
({ lib, pkgs, ... }: {
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
|
sops.defaultSopsFile = ../../../keys/secrets.yaml;
|
||||||
step-ssh-host = {
|
step-ssh-host = {
|
||||||
hostname = hostname;
|
hostname = hostname;
|
||||||
|
extraPrincipals = [
|
||||||
|
"192.168.1.244"
|
||||||
|
"fded:fb16:653e:25da:be24:11ff:fea0:753f"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
mtls = {
|
mtls = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -82,14 +77,23 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users."${username}" = {
|
||||||
|
shell = lib.mkForce (
|
||||||
|
lib.getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
# users.users."${username}".openssh.authorizedKeys.keys = [
|
||||||
|
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
|
||||||
|
# ];
|
||||||
|
|
||||||
home-manager.users."${username}" = {
|
home-manager.users."${username}" = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
mysops
|
mysops
|
||||||
];
|
];
|
||||||
shell.program = "zsh";
|
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{ withSystem, self, inputs, ... }:
|
{ withSystem, self, inputs, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
hostname = "omen";
|
hostname = "john-kde";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
|
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
|
||||||
@@ -62,9 +62,15 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeConfigurations."john@omen" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
|
flake.homeConfigurations."john@john-kde" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
inputs.home-manager.lib.homeManagerConfiguration {
|
pkgs = import inputs.nixpkgs.outPath {
|
||||||
pkgs = inputs'.nixpkgs.legacyPackages;
|
localSystem.system = "x86_64-linux";
|
||||||
modules = [ inputs.self.modules.homeManager."${hostname}" ]; # Uses the module defined above
|
config = {
|
||||||
});
|
allowUnfree = true;
|
||||||
|
permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
|
problems.handlers.sublimetext4.broken = "ignore";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
modules = [ inputs.self.modules.homeManager."${hostname}" ]; # Uses the module defined above
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,28 +9,16 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
self.modules.nixos.base
|
||||||
self.modules.nixos.p14sHardware
|
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;
|
rebuild.flakeDir = flakeDir;
|
||||||
|
|
||||||
networking = {
|
networking.hostName = hostname;
|
||||||
hostName = hostname;
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable automatic login for the user.
|
|
||||||
# services.displayManager.autoLogin.enable = true;
|
|
||||||
# services.displayManager.autoLogin.user = "john";
|
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
services.openssh.enable = true;
|
|
||||||
services.tailscale.enable = true;
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
@@ -45,18 +33,6 @@
|
|||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
security.pam.services.swaylock.fprintAuth = true;
|
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
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
# 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).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
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.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager).
|
||||||
services.fprintd.enable = true; # Enables fingerprint sensor
|
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 = {
|
home-manager.users.root = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
@@ -123,12 +61,6 @@
|
|||||||
my-vscode.enable = true;
|
my-vscode.enable = true;
|
||||||
mysops.hostSecretFile = "${flakeDir}/modules/hosts/john-p14s/secrets.yaml";
|
mysops.hostSecretFile = "${flakeDir}/modules/hosts/john-p14s/secrets.yaml";
|
||||||
homeManagerFlakeDir = "${flakeDir}";
|
homeManagerFlakeDir = "${flakeDir}";
|
||||||
home.packages = with pkgs; [
|
|
||||||
bash
|
|
||||||
discord
|
|
||||||
proton-vpn
|
|
||||||
joplin-desktop
|
|
||||||
];
|
|
||||||
ssh.certificates.enable = true;
|
ssh.certificates.enable = true;
|
||||||
ssh.matchSets = {
|
ssh.matchSets = {
|
||||||
appdaemon = true;
|
appdaemon = true;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ in
|
|||||||
desktop
|
desktop
|
||||||
step-client
|
step-client
|
||||||
mysops
|
mysops
|
||||||
|
# zed-editor
|
||||||
# myPackage
|
# myPackage
|
||||||
# myStepClient
|
# myStepClient
|
||||||
];
|
];
|
||||||
@@ -38,6 +39,7 @@ in
|
|||||||
home.username = "${username}";
|
home.username = "${username}";
|
||||||
home.homeDirectory = "/home/${username}";
|
home.homeDirectory = "/home/${username}";
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
nil # Nix language server
|
||||||
selfPkgs.jsl-zsh
|
selfPkgs.jsl-zsh
|
||||||
# selfPkgs.my-neovim
|
# selfPkgs.my-neovim
|
||||||
selfPkgs.ssh-certs
|
selfPkgs.ssh-certs
|
||||||
@@ -57,7 +59,7 @@ in
|
|||||||
ssh = {
|
ssh = {
|
||||||
certificates.enable = true;
|
certificates.enable = true;
|
||||||
knownHosts = [
|
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 = {
|
matchSets = {
|
||||||
certs = true;
|
certs = true;
|
||||||
@@ -104,13 +106,15 @@ in
|
|||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeConfigurations."john@john-pc-ubuntu" = withSystem "x86_64-linux" (ctx@{ system, inputs', ... }:
|
flake.homeConfigurations."john@john-pc-ubuntu" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
inputs.home-manager.lib.homeManagerConfiguration {
|
pkgs = import inputs.nixpkgs.outPath {
|
||||||
# pkgs = import inputs.nixpkgs {
|
localSystem.system = "x86_64-linux";
|
||||||
# inherit system;
|
config = {
|
||||||
# overlays = [ inputs.self.overlays.default ];
|
allowUnfree = true;
|
||||||
# };
|
permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
pkgs = inputs'.nixpkgs.legacyPackages;
|
problems.handlers.sublimetext4.broken = "ignore";
|
||||||
modules = [ inputs.self.modules.homeManager."${hostname}" ];
|
};
|
||||||
});
|
};
|
||||||
|
modules = [ inputs.self.modules.homeManager."${hostname}" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
|
|
||||||
flake.nixosModules.omen = { pkgs, lib, ... }: {
|
flake.modules.nixos.omen-nixos = { pkgs, lib, ... }: {
|
||||||
# import any other modules from here
|
# import any other modules from here
|
||||||
imports = [
|
imports = [
|
||||||
self.nixosModules.omenHardware
|
self.modules.nixos.omen-nixos-hardware
|
||||||
self.nixosModules.niri
|
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.
|
# Use the systemd-boot EFI boot loader.
|
||||||
@@ -14,15 +18,7 @@
|
|||||||
# Use latest kernel.
|
# Use latest kernel.
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
networking.hostName = "nixos-omen"; # Define your hostname.
|
networking.hostName = "omen-nixos"; # 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";
|
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
@@ -36,16 +32,6 @@
|
|||||||
# useXkbConfig = true; # use xkb.options in tty.
|
# 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.
|
# Enable CUPS to print documents.
|
||||||
# services.printing.enable = true;
|
# services.printing.enable = true;
|
||||||
|
|
||||||
@@ -76,6 +62,7 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
wget
|
wget
|
||||||
|
git
|
||||||
micro
|
micro
|
||||||
nh
|
nh
|
||||||
];
|
];
|
||||||
@@ -123,6 +110,14 @@
|
|||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
# 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?
|
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;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.nixosConfigurations.omen = inputs.nixpkgs.lib.nixosSystem {
|
flake.nixosConfigurations.omen-nixos = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules.omen
|
self.modules.nixos.omen-nixos
|
||||||
|
self.modules.nixos.john
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.nixosModules.omenHardware = { config, lib, pkgs, modulesPath, ... }: {
|
flake.modules.nixos.omen-nixos-hardware = { config, lib, pkgs, modulesPath, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{ withSystem, self, inputs, lib, ... }:
|
{ 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
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
hostname = "soteria";
|
hostname = "soteria";
|
||||||
@@ -15,7 +16,7 @@ in
|
|||||||
nixos.mtls
|
nixos.mtls
|
||||||
nixos.janus-ca
|
nixos.janus-ca
|
||||||
nixos.forgejo
|
nixos.forgejo
|
||||||
# nixos.restic-server
|
nixos.restic-server
|
||||||
# nixos.restic-envoy
|
# nixos.restic-envoy
|
||||||
({ config, pkgs, ... }: {
|
({ config, pkgs, ... }: {
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
@@ -57,17 +58,15 @@ in
|
|||||||
port = 443;
|
port = 443;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8000 ];
|
resticServer = {
|
||||||
services.restic.server = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
|
dataDir = "/mnt/restic";
|
||||||
privateRepos = true;
|
privateRepos = true;
|
||||||
listenAddress = "0.0.0.0:8000";
|
listenAddress = "0.0.0.0:8000";
|
||||||
extraFlags = [
|
tls = {
|
||||||
"--no-auth"
|
certFile = config.mtls.certFile;
|
||||||
"--tls"
|
keyFile = config.mtls.keyFile;
|
||||||
"--tls-cert=${config.mtls.certFile}"
|
};
|
||||||
"--tls-key=${config.mtls.keyFile}"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loginText.extraServiceStatus = {
|
loginText.extraServiceStatus = {
|
||||||
@@ -83,7 +82,7 @@ in
|
|||||||
# This provides the secrets at install time
|
# This provides the secrets at install time
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
# programs.zsh.enable = true;
|
||||||
|
|
||||||
home-manager.users."${username}".imports = [ inputs.self.modules.homeManager.soteria ];
|
home-manager.users."${username}".imports = [ inputs.self.modules.homeManager.soteria ];
|
||||||
|
|
||||||
@@ -13,11 +13,12 @@ in
|
|||||||
nixos."${username}"
|
nixos."${username}"
|
||||||
nixos.docker
|
nixos.docker
|
||||||
{
|
{
|
||||||
|
step-ssh-host.hostname = hostname;
|
||||||
|
sops.defaultSopsFile = ../../keys/secrets.yaml;
|
||||||
home-manager.users."${username}" = {
|
home-manager.users."${username}" = {
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
mysops
|
mysops
|
||||||
];
|
];
|
||||||
shell.program = "zsh";
|
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
ssh.matchSets = {
|
ssh.matchSets = {
|
||||||
certs = true;
|
certs = true;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
group = username;
|
group = username;
|
||||||
home = "/home/${username}";
|
home = "/home/${username}";
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
extraGroups = [ "input" "networkmanager" ]
|
extraGroups = [ "input" "networkmanager" "video" "render" ]
|
||||||
++ lib.optional isAdmin "wheel"
|
++ lib.optional isAdmin "wheel"
|
||||||
++ lib.optional config.virtualisation.docker.enable "docker"
|
++ lib.optional config.virtualisation.docker.enable "docker"
|
||||||
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
|
++ lib.optional (isAdmin && config.services.forgejo.enable) config.services.forgejo.group
|
||||||
|
|||||||
+31
-17
@@ -1,24 +1,38 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
flake.modules.nixos.lxc = { pkgs, lib, ...}: {
|
flake.modules.nixos.lxc = { pkgs, lib, ...}:
|
||||||
imports = with inputs.self.modules.nixos; [
|
let
|
||||||
({ modulesPath, ... }: { imports = [ "${modulesPath}/virtualisation/proxmox-lxc.nix" ]; })
|
selfPackages = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
];
|
rootShellPath = lib.getExe' selfPackages.jsl-zsh-tty "jsl-zsh-tty";
|
||||||
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
|
in
|
||||||
system.stateVersion = "25.11";
|
{
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
imports = with inputs.self.modules.nixos; [
|
||||||
environment.systemPackages = with pkgs; [ git zsh ];
|
({ modulesPath, ... }: { imports = [ "${modulesPath}/virtualisation/proxmox-lxc.nix" ]; })
|
||||||
|
];
|
||||||
|
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
time.timeZone = "US/Central";
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
zsh
|
||||||
|
selfPackages.jsl-zsh-tty
|
||||||
|
];
|
||||||
|
environment.shells = lib.mkAfter [
|
||||||
|
rootShellPath
|
||||||
|
];
|
||||||
|
users.users.root.shell = lib.mkForce rootShellPath;
|
||||||
|
|
||||||
# security.sudo-rs.enable = true;
|
# security.sudo-rs.enable = true;
|
||||||
programs.nix-ld.enable = true;
|
programs.nix-ld.enable = true;
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
|
};
|
||||||
|
programs.bash.enable = true;
|
||||||
};
|
};
|
||||||
programs.bash.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Generic bootstrapping lxc, use a specific host file for more
|
# Generic bootstrapping lxc, use a specific host file for more
|
||||||
flake.nixosConfigurations.lxc = inputs.nixpkgs.lib.nixosSystem {
|
flake.nixosConfigurations.lxc = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
package = ghosttyX11;
|
package = ghosttyX11;
|
||||||
settings = {
|
settings = {
|
||||||
command = "TERM=xterm-256color ${lib.getExe pkgs.zsh}";
|
command = "TERM=xterm-256color ${lib.getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh}";
|
||||||
font-size = 12;
|
font-size = 12;
|
||||||
font-family = "Source Code Pro";
|
font-family = "Source Code Pro";
|
||||||
theme = "Catppuccin Mocha";
|
theme = "Catppuccin Mocha";
|
||||||
|
|||||||
@@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
{ self, inputs, ... }: {
|
{ 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, ... }: {
|
flake.modules.homeManager.onepassword = { config, ... }: {
|
||||||
home.file.".config/1Password/ssh/agent.toml".text = ''
|
home.file.".config/1Password/ssh/agent.toml".text = ''
|
||||||
# https://developer.1password.com/docs/ssh/agent/config
|
# https://developer.1password.com/docs/ssh/agent/config
|
||||||
|
|||||||
@@ -50,5 +50,65 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}).wrapper;
|
}).wrapper;
|
||||||
|
|
||||||
|
packages.starship-ascii = (inputs.wrappers.wrapperModules.starship.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = {
|
||||||
|
add_newline = false;
|
||||||
|
|
||||||
|
format = "$username$hostname$directory$git_branch$git_status$cmd_duration$line_break$character";
|
||||||
|
|
||||||
|
username = {
|
||||||
|
show_always = true;
|
||||||
|
format = "[$user]($style)";
|
||||||
|
style_user = "bold blue";
|
||||||
|
style_root = "bold red";
|
||||||
|
};
|
||||||
|
|
||||||
|
hostname = {
|
||||||
|
disabled = false;
|
||||||
|
ssh_only = false;
|
||||||
|
format = "[@$hostname]($style) ";
|
||||||
|
style = "bold blue";
|
||||||
|
};
|
||||||
|
|
||||||
|
directory = {
|
||||||
|
truncation_length = 3;
|
||||||
|
truncate_to_repo = true;
|
||||||
|
format = "[ in $path]($style) ";
|
||||||
|
style = "bold cyan";
|
||||||
|
};
|
||||||
|
|
||||||
|
git_branch = {
|
||||||
|
symbol = "on ";
|
||||||
|
format = "[$symbol$branch]($style) ";
|
||||||
|
style = "bold yellow";
|
||||||
|
};
|
||||||
|
|
||||||
|
git_status = {
|
||||||
|
format = "([$all_status$ahead_behind]($style) )";
|
||||||
|
style = "bold red";
|
||||||
|
ahead = "ahead:$count ";
|
||||||
|
behind = "behind:$count ";
|
||||||
|
diverged = "diverged:$ahead_count/$behind_count ";
|
||||||
|
up_to_date = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
cmd_duration = {
|
||||||
|
min_time = 2000;
|
||||||
|
show_notifications = false;
|
||||||
|
format = "took [$duration]($style) ";
|
||||||
|
style = "bold green";
|
||||||
|
};
|
||||||
|
|
||||||
|
line_break.disabled = false;
|
||||||
|
|
||||||
|
character = {
|
||||||
|
success_symbol = "[\\$](bold green) ";
|
||||||
|
error_symbol = "[\\$](bold red) ";
|
||||||
|
vicmd_symbol = "[\\$](bold yellow) ";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}).wrapper;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
+99
-110
@@ -23,127 +23,116 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules = {
|
flake.modules = {
|
||||||
nixos.zsh = { pkgs, ... }: {
|
nixos.zsh = { pkgs, ... }:
|
||||||
users.users."${username}".shell = pkgs.zsh;
|
let
|
||||||
programs.zsh.enable = true;
|
selfPackages = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
# Already being imported by the john.nix module
|
in
|
||||||
# home-manager.sharedModules = [
|
{
|
||||||
# inputs.self.modules.homeManager.zsh
|
users.users."${username}".shell = selfPackages.jsl-zsh;
|
||||||
# ];
|
programs.zsh.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManager.zsh = { pkgs, config, ... }: {
|
homeManager.zsh = { pkgs, config, ... }:
|
||||||
programs.zsh = {
|
let
|
||||||
enable = true;
|
selfPackages = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||||
package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh;
|
in
|
||||||
enableCompletion = true;
|
{
|
||||||
autosuggestion.enable = true;
|
programs.zsh = {
|
||||||
# syntaxHighlighting.enable = true;
|
|
||||||
initContent = ''
|
|
||||||
HOST=$(hostname -s)
|
|
||||||
${homeEndKeyBindings}
|
|
||||||
'';
|
|
||||||
dotDir = "${config.xdg.configHome}/zsh";
|
|
||||||
history = {
|
|
||||||
append = true;
|
|
||||||
ignoreAllDups = true;
|
|
||||||
ignorePatterns = [
|
|
||||||
"history"
|
|
||||||
"ls"
|
|
||||||
"eza"
|
|
||||||
"clear"
|
|
||||||
];
|
|
||||||
save = historySize;
|
|
||||||
size = historySize;
|
|
||||||
share = true;
|
|
||||||
};
|
|
||||||
oh-my-zsh = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
# theme = "risto";
|
package = selfPackages.jsl-zsh;
|
||||||
theme = "agnoster";
|
dotDir = "${config.xdg.configHome}/zsh";
|
||||||
plugins = [
|
|
||||||
"sudo"
|
|
||||||
"dotenv"
|
|
||||||
"git"
|
|
||||||
"ssh"
|
|
||||||
"ssh-agent"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { config, self', pkgs, lib, ... }: {
|
perSystem = { config, self', pkgs, lib, ... }:
|
||||||
packages.jsl-zsh =
|
let
|
||||||
let
|
ignorePatterns = [
|
||||||
ignorePatterns = [
|
"ls" "eza" "history" "clear"
|
||||||
"ls" "eza" "history" "clear"
|
];
|
||||||
];
|
integrationPackages = with pkgs; [
|
||||||
aliasStr = lib.concatStringsSep "\n" (
|
fzf
|
||||||
lib.mapAttrsToList (k: v: "alias -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") {
|
zoxide
|
||||||
ls = "eza";
|
];
|
||||||
ll = "eza -l";
|
extraToolPackages = with pkgs; [
|
||||||
la = "eza -a";
|
lazygit
|
||||||
lt = "eza --tree";
|
lazydocker
|
||||||
lla = "eza -la";
|
devenv
|
||||||
ds = "gdu -i /snap /";
|
self'.packages.shell-tools
|
||||||
ld = "lazydocker";
|
self'.packages.neovim-min
|
||||||
});
|
];
|
||||||
in
|
aliasStr = lib.concatStringsSep "\n" (
|
||||||
(inputs.wrappers.wrapperModules.zsh.apply {
|
lib.mapAttrsToList (k: v: "alias -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") {
|
||||||
inherit pkgs;
|
ls = "eza";
|
||||||
binName = "jsl-zsh";
|
ll = "eza -l";
|
||||||
env = {
|
la = "eza -a";
|
||||||
LANG = "en_US.UTF-8";
|
lt = "eza --tree";
|
||||||
COLORTERM = "truecolor";
|
lla = "eza -la";
|
||||||
DEVENV_SHELL_TYPE = "zsh";
|
ds = "gdu -i /snap /";
|
||||||
};
|
ld = "lazydocker";
|
||||||
settings = {
|
});
|
||||||
completion = {
|
|
||||||
enable = true;
|
mkJslZsh = { binName, starshipPackage }:
|
||||||
extraCompletions = true;
|
let
|
||||||
caseInsensitive = true;
|
loginBootstrapPath = lib.makeBinPath (integrationPackages ++ [ starshipPackage ] ++ extraToolPackages);
|
||||||
fuzzySearch = true;
|
in
|
||||||
|
(inputs.wrappers.wrapperModules.zsh.apply {
|
||||||
|
inherit pkgs binName;
|
||||||
|
env = {
|
||||||
|
LANG = "en_US.UTF-8";
|
||||||
|
COLORTERM = "truecolor";
|
||||||
|
DEVENV_SHELL_TYPE = "zsh";
|
||||||
};
|
};
|
||||||
autoSuggestions = {
|
settings = {
|
||||||
enable = true;
|
completion = {
|
||||||
strategy = [ "history" "completion" ];
|
|
||||||
};
|
|
||||||
history = {
|
|
||||||
append = true;
|
|
||||||
expanded = true;
|
|
||||||
share = true;
|
|
||||||
ignoreAllDups = true;
|
|
||||||
ignoreSpace = true;
|
|
||||||
};
|
|
||||||
integrations = {
|
|
||||||
fzf.enable = true;
|
|
||||||
starship = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
package = self'.packages.starship;
|
extraCompletions = true;
|
||||||
|
caseInsensitive = true;
|
||||||
|
fuzzySearch = true;
|
||||||
|
};
|
||||||
|
autoSuggestions = {
|
||||||
|
enable = true;
|
||||||
|
strategy = [ "history" "completion" ];
|
||||||
|
};
|
||||||
|
history = {
|
||||||
|
append = true;
|
||||||
|
expanded = true;
|
||||||
|
share = true;
|
||||||
|
ignoreAllDups = true;
|
||||||
|
ignoreSpace = true;
|
||||||
};
|
};
|
||||||
zoxide.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
extraRC = ''
|
||||||
extraRC = ''
|
${homeEndKeyBindings}
|
||||||
${homeEndKeyBindings}
|
|
||||||
|
|
||||||
HISTFILE=$HOME/.config/zsh/.zsh_history
|
# Login shells may reset PATH before integrations run.
|
||||||
SAVEHIST=${toString historySize}
|
export PATH=${lib.escapeShellArg loginBootstrapPath}:$PATH
|
||||||
HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"}
|
|
||||||
|
|
||||||
HOSTNAME=$(hostname -s)
|
source <(fzf --zsh)
|
||||||
${aliasStr}
|
eval "$(zoxide init zsh)"
|
||||||
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
eval "$(devenv hook zsh)"
|
HISTFILE=$HOME/.config/zsh/.zsh_history
|
||||||
'';
|
SAVEHIST=${toString historySize}
|
||||||
extraPackages = with pkgs; [
|
HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"}
|
||||||
lazygit
|
|
||||||
lazydocker
|
HOSTNAME=$(hostname -s)
|
||||||
devenv
|
${aliasStr}
|
||||||
self'.packages.shell-tools
|
|
||||||
self'.packages.neovim-min
|
eval "$(devenv hook zsh)"
|
||||||
];
|
'';
|
||||||
}).wrapper;
|
extraPackages = extraToolPackages;
|
||||||
};
|
}).wrapper;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.jsl-zsh = mkJslZsh {
|
||||||
|
binName = "jsl-zsh";
|
||||||
|
starshipPackage = self'.packages.starship;
|
||||||
|
};
|
||||||
|
|
||||||
|
packages.jsl-zsh-tty = mkJslZsh {
|
||||||
|
binName = "jsl-zsh-tty";
|
||||||
|
starshipPackage = self'.packages.starship-ascii;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-50
@@ -126,98 +126,90 @@ in
|
|||||||
SetEnv TERM="xterm-256color"
|
SetEnv TERM="xterm-256color"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
matchBlocks = lib.mkMerge [
|
settings = lib.mkMerge [
|
||||||
{
|
{
|
||||||
"john-pc-ubuntu" = {
|
"john-pc-ubuntu" = {
|
||||||
hostname = "192.168.1.85";
|
HostName = "192.168.1.85";
|
||||||
};
|
};
|
||||||
|
|
||||||
"*" = lib.mkMerge [
|
"*" = lib.mkMerge [
|
||||||
{
|
{
|
||||||
user = "john";
|
User = "john";
|
||||||
identityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
|
IdentityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
|
||||||
|
|
||||||
compression = false;
|
Compression = false;
|
||||||
serverAliveInterval = 0;
|
ServerAliveInterval = 0;
|
||||||
serverAliveCountMax = 3;
|
ServerAliveCountMax = 3;
|
||||||
|
|
||||||
identitiesOnly = true;
|
IdentitiesOnly = true;
|
||||||
inherit identityFile;
|
IdentityFile = identityFile;
|
||||||
|
|
||||||
hashKnownHosts = false;
|
HashKnownHosts = false;
|
||||||
userKnownHostsFile = cfg.knownHostsFile;
|
UserKnownHostsFile = cfg.knownHostsFile;
|
||||||
|
|
||||||
addKeysToAgent = "yes";
|
AddKeysToAgent = "yes";
|
||||||
forwardAgent = false;
|
ForwardAgent = false;
|
||||||
}
|
}
|
||||||
(lib.mkIf cfg.certificates.enable { inherit certificateFile; })
|
(lib.mkIf cfg.certificates.enable { CertificateFile = certificateFile; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf cfg.matchSets.appdaemon {
|
(lib.mkIf cfg.matchSets.appdaemon {
|
||||||
"appdaemon" = {
|
"appdaemon" = {
|
||||||
hostname = "192.168.1.242";
|
HostName = "192.168.1.242";
|
||||||
user = "appdaemon";
|
User = "appdaemon";
|
||||||
};
|
};
|
||||||
"ad-nix" = {
|
"ad-nix" = {
|
||||||
hostname = "192.168.1.201";
|
HostName = "192.168.1.201";
|
||||||
user = "appdaemon";
|
User = "appdaemon";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.certs {
|
(lib.mkIf cfg.matchSets.certs {
|
||||||
"janus" = {
|
"janus" = {
|
||||||
hostname = "janus.john-stream.com";
|
HostName = "janus.john-stream.com";
|
||||||
user = "root";
|
User = "root";
|
||||||
};
|
};
|
||||||
"soteria" = {
|
"soteria" = {
|
||||||
hostname = "soteria.john-stream.com";
|
HostName = "soteria.john-stream.com";
|
||||||
user = "john";
|
User = "john";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.homelab {
|
(lib.mkIf cfg.matchSets.homelab {
|
||||||
"docs" = {
|
"docs" = {
|
||||||
hostname = "192.168.1.110";
|
HostName = "192.168.1.110";
|
||||||
user = "root";
|
User = "root";
|
||||||
extraOptions = {
|
RequestTTY = "force";
|
||||||
RequestTTY = "force";
|
RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
||||||
RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
"gitea" = {
|
"gitea" = {
|
||||||
hostname = "192.168.1.104";
|
HostName = "192.168.1.104";
|
||||||
user = "john";
|
User = "john";
|
||||||
};
|
};
|
||||||
"hermes" = {
|
"hermes" = {
|
||||||
hostname = "192.168.1.150";
|
HostName = "192.168.1.150";
|
||||||
user = "root";
|
User = "root";
|
||||||
# Enabling this breaks the ability of Zed to install its remote stuff
|
# Enabling this breaks the ability of Zed to install its remote stuff
|
||||||
# extraOptions = {
|
# RequestTTY = "force";
|
||||||
# RequestTTY = "force";
|
# RemoteCommand = "/root/.nix-profile/bin/jsl-zsh";
|
||||||
# RemoteCommand = "/root/.nix-profile/bin/jsl-zsh";
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
"panoptes" = {
|
"panoptes" = {
|
||||||
hostname = "192.168.1.107";
|
HostName = "192.168.1.107";
|
||||||
user = "panoptes";
|
User = "panoptes";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.dev {
|
(lib.mkIf cfg.matchSets.dev {
|
||||||
"test-nix" = {
|
"test-nix" = {
|
||||||
hostname = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
|
HostName = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
|
||||||
user = "john";
|
User = "john";
|
||||||
extraOptions = {
|
RequestTTY = "auto";
|
||||||
RequestTTY = "auto";
|
# RemoteCommand = "/run/current-system/sw/bin/jsl-zsh";
|
||||||
# RemoteCommand = "/run/current-system/sw/bin/jsl-zsh";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf cfg.matchSets.tailscale {
|
(lib.mkIf cfg.matchSets.tailscale {
|
||||||
"jdl-docker" = {
|
"jdl-docker" = {
|
||||||
hostname = "jdl-docker.tailcf205.ts.net";
|
HostName = "jdl-docker.tailcf205.ts.net";
|
||||||
user = "john";
|
User = "john";
|
||||||
extraOptions = {
|
RequestTTY = "auto";
|
||||||
RequestTTY = "auto";
|
# RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
||||||
# RemoteCommand = "~/.nix-profile/bin/jsl-zsh";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,6 +5,12 @@
|
|||||||
provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path;
|
provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path;
|
||||||
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
|
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
sshCertPath = "${sshKeyPath}-cert.pub";
|
sshCertPath = "${sshKeyPath}-cert.pub";
|
||||||
|
mkPrincipalArgs = principals:
|
||||||
|
lib.concatMapStringsSep " " (principal: ''--principal "${principal}"'') principals;
|
||||||
|
principalArgs = mkPrincipalArgs ([
|
||||||
|
cfg.hostname
|
||||||
|
"${cfg.hostname}.john-stream.com"
|
||||||
|
] ++ cfg.extraPrincipals);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# NixOS Options
|
# NixOS Options
|
||||||
@@ -18,6 +24,11 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "admin";
|
default = "admin";
|
||||||
};
|
};
|
||||||
|
extraPrincipals = lib.mkOption {
|
||||||
|
description = "Additional SSH host certificate principals to include per host";
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = with inputs.self.modules.nixos; [ ssh ];
|
imports = with inputs.self.modules.nixos; [ ssh ];
|
||||||
@@ -39,8 +50,7 @@
|
|||||||
--host --sign \
|
--host --sign \
|
||||||
--provisioner "${cfg.provisioner}" \
|
--provisioner "${cfg.provisioner}" \
|
||||||
--provisioner-password-file "${provisionerPasswordPath}" \
|
--provisioner-password-file "${provisionerPasswordPath}" \
|
||||||
--principal "${cfg.hostname}" \
|
${principalArgs} \
|
||||||
--principal "${cfg.hostname}.john-stream.com" \
|
|
||||||
"${cfg.hostname}" "${sshKeyPath}.pub"
|
"${cfg.hostname}" "${sshKeyPath}.pub"
|
||||||
'')
|
'')
|
||||||
(writeShellScriptBin "ssh-host-cert-check" "${lib.getExe' pkgs.openssh "ssh-keygen"} -Lf ${sshCertPath}")
|
(writeShellScriptBin "ssh-host-cert-check" "${lib.getExe' pkgs.openssh "ssh-keygen"} -Lf ${sshCertPath}")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ self, inputs, lib, ... }:
|
{ self, inputs, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
baseUserModules = self.factory.user {
|
baseUserModules = self.factory.user {
|
||||||
@@ -14,13 +14,13 @@ in
|
|||||||
key = "";
|
key = "";
|
||||||
keygrip = [ ];
|
keygrip = [ ];
|
||||||
authorizedKeys = [
|
authorizedKeys = [
|
||||||
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
|
# Shared keys for every host can go here.
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.modules = {
|
flake.modules = {
|
||||||
nixos."${username}" = { ... }: {
|
nixos."${username}" = { config, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
baseUserModules.nixos."${username}"
|
baseUserModules.nixos."${username}"
|
||||||
];
|
];
|
||||||
@@ -38,9 +38,6 @@ in
|
|||||||
inputs.self.modules.homeManager.ssh
|
inputs.self.modules.homeManager.ssh
|
||||||
inputs.self.modules.homeManager.git
|
inputs.self.modules.homeManager.git
|
||||||
];
|
];
|
||||||
# home.packages = [
|
|
||||||
# inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
|
||||||
# ];
|
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
programs.git.settings.user.name = name;
|
programs.git.settings.user.name = name;
|
||||||
programs.git.settings.user.email = email;
|
programs.git.settings.user.email = email;
|
||||||
|
|||||||
Reference in New Issue
Block a user