Compare commits
45 Commits
02c6b3a45f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b8fa60540 | |||
| 86dc80eb3c | |||
| f1bd5146a3 | |||
| 6f35d60aab | |||
| 3d2e74d115 | |||
| 548a438f6a | |||
| 0939766e3a | |||
| f424ab98c7 | |||
| 15a4d8d5e8 | |||
| 5f7e9cada5 | |||
| c4a0eb0a98 | |||
| 103a485bf8 | |||
| 13f35677be | |||
| 579a120326 | |||
| c90d368432 | |||
| a787840ce2 | |||
| e2fd47aa58 | |||
| 5d70868e4f | |||
| db88a44435 | |||
| 524abb9ceb | |||
| 6291076494 | |||
| f3d358ce12 | |||
| 645e1f0f31 | |||
| e68321ac1e | |||
| 5357ba307b | |||
| 9960e874c4 | |||
| 2f28ec735d | |||
| 2cdfaa3ed7 | |||
| 32cb8955eb | |||
| d9b82bbf2b | |||
| 6f0c6b9c31 | |||
| bab8bdecb7 | |||
| 15fcf88da2 | |||
| b70f9f4822 | |||
| 87f839d16a | |||
| 25cf0167c1 | |||
| dc06c70c43 | |||
| fa62ba2b8c | |||
| 3b5c031619 | |||
| 1524100ff5 | |||
| 662d24a89c | |||
| 41ed709f4a | |||
| 3fdb859ff8 | |||
| 8b66fa8665 | |||
| 4ca225ed60 |
+14
-4
@@ -17,16 +17,26 @@ How to work on it: [conventions.md](./conventions.md).
|
|||||||
|
|
||||||
Each machine: `modules/hosts/<name>/default.nix` → `nixosConfigurations.<name>`, real config in `*Configuration` + optional `_private/` and `_services/`.
|
Each machine: `modules/hosts/<name>/default.nix` → `nixosConfigurations.<name>`, real config in `*Configuration` + optional `_private/` and `_services/`.
|
||||||
|
|
||||||
|
## Features at a glance
|
||||||
|
|
||||||
|
- **Users catalog** — one catalog in `modules/system/users.nix`, pick who exists on a host with `chiasson.users.enabled = [ "example" ]`, override per host. Home Manager wires itself from the same list.
|
||||||
|
- **SSH + Bitwarden (rbw) keys** — one ed25519 keypair per catalog user, private key in Bitwarden, public key in `modules/ssh/inventory.nix`. Outbound SSH uses a `.pub` filter against the rbw agent; inbound `authorized_keys` are generated from the same inventory. [Full wiring in conventions.md](./conventions.md#ssh-model).
|
||||||
|
- **Wisdom modules** — Home Manager slices in `modules/wisdom/` auto-catalog via `lib.wisdomCatalogExtraModules` (defined in `modules/desktop/options.nix`). The baseline `wisdom` module handles git identity + shared tools; all other `wisdom*` exports are pulled in once per user through `desktopHomeBase` → `chiasson.users.extraModules.olivier`. Hosts only flip `chiasson.home.<category>.<slice>.enable` — no manual imports in `home.nix`. Categories include `apps` (spotify, discord, localsend), `browsers` (chrome, edge, zen, …), `editors` (cursor, vscode, obsidian, …), `shells` (bash, fish, oh-my-posh, yazi), `desktop` (gtk-qt-theming, screenshot), and `terminals` (kitty). Trivial single-package slices can be written with the `lib.wisdomSlice` helper instead of repeating the `root`/`cfg` + `mkIf` boilerplate.
|
||||||
|
- **Wallpapers from a dedicated repo** — `modules/desktop/wallpapers.nix` pins `inputs.wallpapers` into the store and exposes it as `CHIASSON_NIX_WALLPAPERS` and `/etc/wallpapers`. Override `chiasson.desktop.wallpapers.source` if needed.
|
||||||
|
- **Private host data** — import-tree skips `_private/` globally, so machine-only files (firmware quirks, display configs, service tweaks) live next to the host module without leaking elsewhere.
|
||||||
|
|
||||||
## Deploy / rebuild
|
## Deploy / rebuild
|
||||||
|
|
||||||
Remote builds use the `builder` user (`systemDeployBuilder`, wired through `client-services` on desktops).
|
Remote builds use the `builder` user (`systemDeployBuilder`, wired through `client-services` on desktops/laptops/tablets).
|
||||||
|
|
||||||
Fleet deploy is [Navi](https://github.com/cafkafk/navi) — config in `modules/deploy/navi.nix`, outputs `flake.navi` / `flake.naviHive`.
|
Fleet deploy is [Navi](https://github.com/cafkafk/navi) — config in `modules/deploy/navi.nix`, outputs `flake.navi` / `flake.naviHive`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix develop # devShell has navi + hints
|
nix develop # devShell has navi + just + hints
|
||||||
|
just # list local helpers like `sync-dms`
|
||||||
navi apply --on <host>
|
navi apply --on <host>
|
||||||
navi apply-local --node 14900k --sudo # this machine, if hostname matches
|
navi apply-local --node 14900k --sudo # this machine, if hostname matches
|
||||||
|
navi tui # interactive fleet dashboard
|
||||||
```
|
```
|
||||||
|
|
||||||
Plain rebuild still works: `sudo nixos-rebuild switch --flake .#<host>`.
|
Plain rebuild still works: `sudo nixos-rebuild switch --flake .#<host>`.
|
||||||
@@ -37,11 +47,11 @@ Plain rebuild still works: `sudo nixos-rebuild switch --flake .#<host>`.
|
|||||||
modules/
|
modules/
|
||||||
hosts/<host>/ # per-machine composition
|
hosts/<host>/ # per-machine composition
|
||||||
system/ # nixosModules.system aggregate
|
system/ # nixosModules.system aggregate
|
||||||
desktop/ # GUI stack
|
desktop/ # GUI stack (niri, hyprland, plasma, DMS)
|
||||||
wisdom/ # HM modules (exports still named wisdom*)
|
wisdom/ # HM modules (exports still named wisdom*)
|
||||||
ssh/ # inbound NixOS + outbound HM
|
ssh/ # inbound NixOS + outbound HM
|
||||||
deploy/ # navi hive
|
deploy/ # navi hive
|
||||||
lib/ # pure helpers → flake.lib
|
patches/ # one-off patches (yt-dlp, t2fanrd, …)
|
||||||
```
|
```
|
||||||
|
|
||||||
Machine-only stuff lives in `hosts/<host>/_private/` — import-tree skips `_private/` globally, so those files only get pulled in where you import them.
|
Machine-only stuff lives in `hosts/<host>/_private/` — import-tree skips `_private/` globally, so those files only get pulled in where you import them.
|
||||||
|
|||||||
+73
-9
@@ -47,7 +47,7 @@ Leave upstream `services.*`, `networking.*`, `home.*`, etc. alone.
|
|||||||
|
|
||||||
Aggregates: `nixosModules.system` and `nixosModules.desktop` import their leaves. Host configs import those stacks and set options — they shouldn't reimplement whole subsystems.
|
Aggregates: `nixosModules.system` and `nixosModules.desktop` import their leaves. Host configs import those stacks and set options — they shouldn't reimplement whole subsystems.
|
||||||
|
|
||||||
**Home** — files under `modules/wisdom/`. Baseline is `homeManagerModules.wisdom` (`chiasson.home.enable`, wired via `chiasson.desktop.homeManager.bundleWisdom`). Other `wisdom*` slices auto-wire once per user via `lib.wisdomCatalogExtraModules self` (`modules/lib/wisdom-catalog.nix`); hosts only set matching `chiasson.home.*.enable` toggles — no re-import in `home.nix`.
|
**Home** — files under `modules/wisdom/`. Baseline is `homeManagerModules.wisdom` (`chiasson.home.enable`, wired via `chiasson.desktop.homeManager.bundleWisdom`). Other `wisdom*` slices auto-wire once per user via `lib.wisdomCatalogExtraModules self` (`modules/desktop/options.nix`); hosts only set matching `chiasson.home.*.enable` toggles — no re-import in `home.nix`.
|
||||||
|
|
||||||
User apps / dotfiles → wisdom. Daemons, firewall, kernel → NixOS. Sometimes both (LocalSend: HM installs, `systemLocalsend` opens the firewall).
|
User apps / dotfiles → wisdom. Daemons, firewall, kernel → NixOS. Sometimes both (LocalSend: HM installs, `systemLocalsend` opens the firewall).
|
||||||
|
|
||||||
@@ -63,13 +63,75 @@ User apps / dotfiles → wisdom. Daemons, firewall, kernel → NixOS. Sometimes
|
|||||||
- `desktopWallpapers` copies `inputs.wallpapers` into the store; override `chiasson.desktop.wallpapers.source` if needed.
|
- `desktopWallpapers` copies `inputs.wallpapers` into the store; override `chiasson.desktop.wallpapers.source` if needed.
|
||||||
|
|
||||||
|
|
||||||
## Users
|
## Users & SSH
|
||||||
|
|
||||||
User definitions live in `usersCatalogDefaults` (`modules/system/users/catalog-default.nix`) — olivier, server, builder, etc. Pick who exists on a host with `chiasson.users.enabled`.
|
User definitions live in the catalog defaults block inside `modules/system/users.nix` (was previously split across four files in `modules/system/users/`; **folded into one for cohesion**). olivier, server, builder, etc. Pick who exists on a host with `chiasson.users.enabled`.
|
||||||
|
|
||||||
|
### SSH model — read this once
|
||||||
|
|
||||||
|
SSH authentication has two independent sides:
|
||||||
|
|
||||||
|
| Side | Holds | Decides |
|
||||||
|
|------|-------|---------|
|
||||||
|
| **Client** (connecting from) | identity private keys | "Here's proof I own key K" |
|
||||||
|
| **Server** (connecting to) | `authorized_keys` | "Do I trust key K?" |
|
||||||
|
|
||||||
|
A key is just a cryptographic identity — it's not bound to a host or a machine account name. The model is **one key per user account**: each catalog account (`olivier`, `server`, `builder`) has its own keypair in `modules/ssh/inventory.nix`, regardless of which machine that account runs on. Concretely: when `olivier@14900k` sshes to `server@r5500`, OpenSSH routes via a `Match user server` block (generated from `chiasson.ssh.outbound.rbw.extraIdentities`) → `IdentityFile ~/.ssh/id_ed25519_server.pub` (written from `users.server.publicKey`) to ask the rbw agent for the `server` private key; r5500's `server` `authorized_keys` holds the matching server pubkey. olivier's catalog default sets `extraIdentities = [ "server" "builder" ]` so `ssh <account>@<host>` Just Works for every catalog role. We also support `from="ip,cidr"` constraints per account to scope which source IPs may authenticate as it.
|
||||||
|
|
||||||
|
This repo enforces "one key per user": every user has one ed25519 keypair, the private key in Bitwarden, the public key inline in `modules/ssh/inventory.nix`. On SSH connect:
|
||||||
|
|
||||||
|
1. `~/.ssh/config` (managed by home-manager) sets `IdentityAgent SSH_AUTH_SOCK` and `IdentityFile ~/.ssh/id_ed25519_<user>.pub` for every host block.
|
||||||
|
2. OpenSSH reads the `.pub` file as a **filter** against the agent (OpenSSH 7.3+ trick — `.pub` as IdentityFile tells the agent "give me the private key matching this pub"), so even with multiple keys loaded, only the matching one is tried. This is why the old "too many auth failures" symptom is gone by construction.
|
||||||
|
3. rbw holds the private key; HM-managed shells + the desktop session expose `SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/rbw/…` declaratively (no activation scripts).
|
||||||
|
|
||||||
|
### Bitwarden onboarding
|
||||||
|
|
||||||
|
For each new user (run on the user's primary machine):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# 1. Generate a keypair with rbw (creates a Bitwarden item + prints the pubkey).
|
||||||
|
rbw gen ssh-key olivier
|
||||||
|
|
||||||
|
# 2. Paste the printed `ssh-ed25519 AAAA… olivier` line into
|
||||||
|
# modules/lib/ssh-inventory.nix under users.olivier.publicKey.
|
||||||
|
|
||||||
|
# 3. Push the user to a host:
|
||||||
|
ssh root@nix-server nixos-rebuild switch --flake .#nix-server
|
||||||
|
|
||||||
|
# 4. Have the user ssh into the fleet from any client — their rbw key
|
||||||
|
# is the only thing offered, and every server already has it in
|
||||||
|
# authorized_keys.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Adding a host
|
||||||
|
|
||||||
|
Edit `modules/ssh/inventory.nix` and add:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
hosts."newhost" = {
|
||||||
|
hostName = "192.168.2.X"; # IP — required for navi to deploy here
|
||||||
|
aliases = [ "newhost" ]; # what you type at the ssh prompt
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Then add `self.nixosModules.<host>Configuration` to `modules/deploy/navi.nix`.
|
||||||
|
|
||||||
|
### Adding a catalog user
|
||||||
|
|
||||||
|
1. Generate a keypair: `rbw gen ssh-key <name>`.
|
||||||
|
2. Add a `users.<name> = { publicKey = "ssh-ed25519 …"; };` line under `users` in `modules/ssh/inventory.nix`.
|
||||||
|
3. Add a `<name> = { isNormalUser = true; … ssh.inbound.enable = true; ssh.inbound.authorizedHosts = "all"; }` entry under `chiasson.users.catalog` in `modules/system/users.nix`.
|
||||||
|
4. Enable on every host that needs that user, e.g.:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
chiasson.users.enabled = [ "olivier" "<name>" ];
|
||||||
|
```
|
||||||
|
|
||||||
|
### Passwords
|
||||||
|
|
||||||
Passwords aren't in the repo. They're in `secrets/secrets.yaml` (encrypted with sops). Each host that has `olivier` must declare that secret and set `neededForUsers = true`; sops-nix decrypts it at boot, and the catalog points `hashedPasswordFile` at that file. That's why the catalog is a proper module instead of a static list — it needs `config.sops.secrets.…` at eval time.
|
Passwords aren't in the repo. They're in `secrets/secrets.yaml` (encrypted with sops). Each host that has `olivier` must declare that secret and set `neededForUsers = true`; sops-nix decrypts it at boot, and the catalog points `hashedPasswordFile` at that file. That's why the catalog is a proper module instead of a static list — it needs `config.sops.secrets.…` at eval time.
|
||||||
|
|
||||||
On a host:
|
### Host overrides
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# configuration.nix — machine policy
|
# configuration.nix — machine policy
|
||||||
@@ -77,6 +139,8 @@ chiasson.users.enabled = [ "olivier" ];
|
|||||||
chiasson.users.hostOverrides.<name> = { /* optional */ };
|
chiasson.users.hostOverrides.<name> = { /* optional */ };
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Home-manager per-host slices (desktop/laptop hosts)
|
||||||
|
|
||||||
Desktop hosts also have `home.nix` exporting `flake.nixosModules.<host>Home`, wired from `default.nix` alongside `*Configuration`:
|
Desktop hosts also have `home.nix` exporting `flake.nixosModules.<host>Home`, wired from `default.nix` alongside `*Configuration`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
@@ -86,7 +150,7 @@ modules = [
|
|||||||
self.nixosModules."14900kHome"
|
self.nixosModules."14900kHome"
|
||||||
];
|
];
|
||||||
|
|
||||||
# home.nix — flake fragment, per-host `chiasson.home.*` toggles
|
# home.nix — flake fragment, per-host chiasson.home.* toggles
|
||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.nixosModules."14900kHome" = { self, pkgs, ... }: {
|
flake.nixosModules."14900kHome" = { self, pkgs, ... }: {
|
||||||
imports = [ self.nixosModules.desktopHomeBase ];
|
imports = [ self.nixosModules.desktopHomeBase ];
|
||||||
@@ -102,15 +166,15 @@ modules = [
|
|||||||
|
|
||||||
`flake.nixosModules.desktopHomeBase` expands `lib.wisdomCatalogExtraModules` plus shared desktop toggles. Host `*Home` modules append per-host `chiasson.home` overrides (and rare inline `home.packages` blocks). `chiasson.users.extraModules` concatenates lists from multiple modules (base + host), so both can set the same user key.
|
`flake.nixosModules.desktopHomeBase` expands `lib.wisdomCatalogExtraModules` plus shared desktop toggles. Host `*Home` modules append per-host `chiasson.home` overrides (and rare inline `home.packages` blocks). `chiasson.users.extraModules` concatenates lists from multiple modules (base + host), so both can set the same user key.
|
||||||
|
|
||||||
`usersHomeIntegration` turns that into `users.users` + HM. Don't hand-roll catalog users unless you're changing the users module itself.
|
The integration block at the bottom of `modules/system/users.nix` turns the catalog + overrides into `users.users` + HM + inbound SSH. Don't hand-roll catalog users unless you're changing this module.
|
||||||
|
|
||||||
SSH: `sshInbound` on NixOS, outbound/rbw under `modules/ssh/home-manager/`.
|
|
||||||
|
|
||||||
## Adding things
|
## Adding things
|
||||||
|
|
||||||
**New NixOS leaf:** export `flake.nixosModules.whatever`, wire from `system/default.nix` or `desktop/default.nix` if it's global, or only from a host `configuration.nix` if it's not. `nix flake check`. Git-add new paths if eval uses the git tree.
|
**New NixOS leaf:** export `flake.nixosModules.whatever`, wire from `system/default.nix` or `desktop/default.nix` if it's global, or only from a host `configuration.nix` if it's not. `nix flake check`. Git-add new paths if eval uses the git tree.
|
||||||
|
|
||||||
**New HM slice:** add `modules/wisdom/.../foo.nix` exporting `flake.homeManagerModules.wisdomFoo` (import-tree picks it up; `wisdomCatalogExtraModules` includes every `wisdom*` export except `wisdom` / `wisdomShellBash`). Gate packages on `chiasson.home.*.enable`, set `mkDefault true` in `desktop-home-base.nix` if shared, or `enable = true` in a host `home.nix`. Upstream HM deps stay imported unconditionally — use `mkIf` on `cfg.enable` for config (never `config`-dependent `imports`; that recurses).
|
**New HM slice:** add `modules/wisdom/.../foo.nix` exporting `flake.homeManagerModules.wisdomFoo` (import-tree picks it up; `wisdomCatalogExtraModules` includes every `wisdom*` export). Every `wisdom*` slice auto-catalogs — including the bash shell — so the root module no longer manually `imports` it. Gate packages on `chiasson.home.*.enable`, and set the slice's own `enable` default with `mkEnableOption "…" // { default = true/false }` in that same module — defaults live with the option that owns them, not in a shared defaults file. Hosts flip toggles in `home.nix`. Upstream HM deps stay imported unconditionally — use `mkIf` on `cfg.enable` for config (never `config`-dependent `imports`; that recurses).
|
||||||
|
|
||||||
|
**Trivial single-package slice:** use `self.lib.wisdomSlice { path = "a.b"; default = true/false; description = "…"; packages = pkgs: [ … ]; }` instead of the `root`/`cfg` + `mkIf (root.enable && cfg.enable)` boilerplate. `packages` is a `pkgs -> [ drv ]` function responsible for its own `availableOn`/platform gating. Several such slices may share one `simple.nix` in their category dir (each still exporting its own `wisdom*` module), rather than one file per slice.
|
||||||
|
|
||||||
**Derivations:** `let` inside a fragment, or `flake.packages` / `flake.lib` — not a bare `mkDerivation` file import-tree will try to load.
|
**Derivations:** `let` inside a fragment, or `flake.packages` / `flake.lib` — not a bare `mkDerivation` file import-tree will try to load.
|
||||||
|
|
||||||
|
|||||||
Generated
+674
-104
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,96 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dms-plugin-dank-vault = {
|
||||||
|
url = "github:alcxyz/DankVault";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-calculator = {
|
||||||
|
url = "github:rochacbruno/DankCalculator";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-home-assistant = {
|
||||||
|
url = "github:xxyangyoulin/dms-plugin-hass";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-dropdown-menu = {
|
||||||
|
url = "github:rdannenbring/dropdown-menu";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-ocr-scanner = {
|
||||||
|
url = "github:hthienloc/dms-ocr-scanner";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-unified-taskbar = {
|
||||||
|
url = "github:jslandau/dms-unified-taskbar";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-widget-group = {
|
||||||
|
url = "github:rdannenbring/widget-group";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-nix-package-runner = {
|
||||||
|
url = "github:iahccc/NixPackageRunner";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-ambient-sound = {
|
||||||
|
url = "github:hthienloc/dms-ambient-sound";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-cava-visualizer = {
|
||||||
|
url = "github:ernestowgg/cava-visualizer";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-emoji-launcher = {
|
||||||
|
url = "github:devnullvoid/dms-emoji-launcher";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-official = {
|
||||||
|
url = "github:AvengeMedia/dms-plugins";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-web-search = {
|
||||||
|
url = "github:devnullvoid/dms-web-search";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-wallpaper-carousel = {
|
||||||
|
url = "github:motor-dev/wallpaperCarousel";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-ephemera = {
|
||||||
|
url = "github:nicolasgarcia214/Ephemera";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-app-shortcut = {
|
||||||
|
url = "github:oabragh/AppShortcut";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-wvkbd-toggle = {
|
||||||
|
url = "git+https://git.chiasson.cloud/dms-plugins/wvkbd-toggle";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dms-plugin-rbw-lock-toggle = {
|
||||||
|
url = "git+https://git.chiasson.cloud/dms-plugins/rbw-lock-toggle";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
dgop = {
|
dgop = {
|
||||||
url = "github:AvengeMedia/dgop";
|
url = "github:AvengeMedia/dgop";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -110,6 +200,12 @@
|
|||||||
url = "https://flakehub.com/f/AshleyYakeley/NixVirt/*.tar.gz";
|
url = "https://flakehub.com/f/AshleyYakeley/NixVirt/*.tar.gz";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
hermes = {
|
||||||
|
url = "github:NousResearch/hermes-agent";
|
||||||
|
};
|
||||||
|
mt7927 = {
|
||||||
|
url = "github:cmspam/mt7927-nixos";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs:
|
outputs = inputs:
|
||||||
@@ -117,20 +213,13 @@
|
|||||||
lib = inputs.nixpkgs.lib;
|
lib = inputs.nixpkgs.lib;
|
||||||
# import-tree default: only .nix, skip paths with /_/ (see
|
# import-tree default: only .nix, skip paths with /_/ (see
|
||||||
# https://import-tree.oeiuwq.com/guides/filtering/ ). filterNot composes AND with that.
|
# https://import-tree.oeiuwq.com/guides/filtering/ ). filterNot composes AND with that.
|
||||||
# Skip /package/, /packages/, and dms/home-manager/ (callPackage + DMS HM colocation).
|
# Skip /package/ and /packages/ (callPackage colocation).
|
||||||
# Avoid a global "/home-manager/" filter — it would drop modules/ssh/home-manager/.
|
# Avoid a global "/home-manager/" filter — it would drop modules/ssh/home-manager/.
|
||||||
modulesTree =
|
modulesTree = lib.pipe inputs.import-tree [
|
||||||
lib.pipe inputs.import-tree [
|
(it: it.withLib lib)
|
||||||
(it: it.withLib lib)
|
(it: it.filterNot (p: lib.hasInfix "/package/" p || lib.hasInfix "/packages/" p))
|
||||||
(it:
|
(it: it ./modules)
|
||||||
it.filterNot (
|
];
|
||||||
p:
|
|
||||||
lib.hasInfix "/package/" p
|
|
||||||
|| lib.hasInfix "/packages/" p
|
|
||||||
|| lib.hasInfix "dms/home-manager/" p
|
|
||||||
))
|
|
||||||
(it: it ./modules)
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } modulesTree;
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } modulesTree;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Repo helpers. Run `just` to list recipes.
|
||||||
|
|
||||||
|
default:
|
||||||
|
@just --list
|
||||||
|
|
||||||
|
# Sync live DMS config into this host's seed dir. Pass --dry-run, --settings-only, or a host module name.
|
||||||
|
sync-dms *args='':
|
||||||
|
./modules/desktop/shells/dms/_private/sync-seed.sh {{args}}
|
||||||
+33
-12
@@ -93,14 +93,45 @@ let
|
|||||||
// lib.optionalAttrs (name == "nix-server") {
|
// lib.optionalAttrs (name == "nix-server") {
|
||||||
targetPort = 22;
|
targetPort = 22;
|
||||||
}
|
}
|
||||||
) ssh.activeHosts;
|
) ssh.activeHosts /* nix-deploy target list — IPs only */;
|
||||||
|
|
||||||
metaNixpkgs = import inputs.nixpkgs {
|
metaNixpkgs = import inputs.nixpkgs {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
|
# Build a raw Navi hive attrset from host specs + deployment targets.
|
||||||
|
# `inputs.navi.lib.makeHive` turns the result into `flake.naviHive`.
|
||||||
|
mkNaviHiveConfig =
|
||||||
|
{
|
||||||
|
metaNixpkgs,
|
||||||
|
hostSpecs,
|
||||||
|
deployments,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
deployNodes = lib.filterAttrs (name: _: deployments ? ${name}) hostSpecs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta = {
|
||||||
|
nixpkgs = metaNixpkgs;
|
||||||
|
nodeNixpkgs = lib.mapAttrs (
|
||||||
|
name: spec:
|
||||||
|
import inputs.nixpkgs {
|
||||||
|
system = spec.system;
|
||||||
|
}
|
||||||
|
) deployNodes;
|
||||||
|
nodeSpecialArgs = lib.mapAttrs (_: spec: spec.specialArgs) deployNodes;
|
||||||
|
allowApplyAll = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// lib.mapAttrs (
|
||||||
|
name: spec:
|
||||||
|
{
|
||||||
|
imports = spec.modules or [ spec.configuration ];
|
||||||
|
deployment = deployments.${name};
|
||||||
|
}
|
||||||
|
) deployNodes;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.navi = self.lib.mkNaviHiveConfig {
|
flake.navi = mkNaviHiveConfig {
|
||||||
inherit metaNixpkgs hostSpecs deployments;
|
inherit metaNixpkgs hostSpecs deployments;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,16 +147,6 @@ in
|
|||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
]) {
|
]) {
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
packages = [ inputs.navi.packages.${system}.default ];
|
|
||||||
shellHook = ''
|
|
||||||
echo "Navi fleet deploy (from repo root):"
|
|
||||||
echo " navi apply --on <host> # build + switch one host"
|
|
||||||
echo " navi apply-local --node 14900k --sudo # switch this machine locally (needs root), --node if hostname differs"
|
|
||||||
echo " navi tui # interactive fleet dashboard"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
navi = {
|
navi = {
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
{ ... }: {
|
||||||
|
flake.lib.hyprlandBinds =
|
||||||
|
{ lib, dmsEnabled ? false, dmsIpcBinds }:
|
||||||
|
let
|
||||||
|
workspaceBinds =
|
||||||
|
(builtins.map (i: "Super, ${toString i}, workspace, ${toString i}") (builtins.genList (n: n + 1) 9))
|
||||||
|
++ (builtins.map (
|
||||||
|
i: "ControlSuper, ${toString i}, focusworkspaceoncurrentmonitor, ${toString i}"
|
||||||
|
) (builtins.genList (n: n + 1) 9))
|
||||||
|
++ (builtins.map (i: "ShiftSuper, ${toString i}, movetoworkspacesilent, ${toString i}") (
|
||||||
|
builtins.genList (n: n + 1) 9
|
||||||
|
));
|
||||||
|
in
|
||||||
|
{
|
||||||
|
bind =
|
||||||
|
[
|
||||||
|
"SUPER,T,exec,kitty"
|
||||||
|
"ControlSuper,T,exec,konsole"
|
||||||
|
"SUPER,D,exec,rofi -show drun"
|
||||||
|
"ControlSuper,D,exec,rofi -show window"
|
||||||
|
"SUPER,E,exec,nemo"
|
||||||
|
"Super, Q, killactive"
|
||||||
|
"ControlSuper, Q, exec, hyprctl kill"
|
||||||
|
"Super, F, fullscreen, 0"
|
||||||
|
"Super, G, fullscreen, 1"
|
||||||
|
"ShiftSuper, F, fullscreenstate, 0 3"
|
||||||
|
"Super, Minus, splitratio, -0.1"
|
||||||
|
"Super, Equal, splitratio, 0.1"
|
||||||
|
"AltSuper, Space, togglefloating"
|
||||||
|
"Super, P, pin"
|
||||||
|
] ++ lib.optionals dmsEnabled [
|
||||||
|
"Super, Space, exec, ${dmsIpcBinds.spotlight}"
|
||||||
|
"Super, I, exec, ${dmsIpcBinds.settingsFocus}"
|
||||||
|
"Super, N, exec, ${dmsIpcBinds.notepad}"
|
||||||
|
"ShiftSuper, N, exec, ${dmsIpcBinds.notifications}"
|
||||||
|
"Super, M, exec, ${dmsIpcBinds.processlistFocus}"
|
||||||
|
"Super, L, exec, ${dmsIpcBinds.lock}"
|
||||||
|
"ShiftSuper, V, exec, ${dmsIpcBinds.clipboard}"
|
||||||
|
] ++ [
|
||||||
|
"Super, Tab, cyclenext"
|
||||||
|
"Super, Tab, bringactivetotop"
|
||||||
|
"Super, left, movefocus, l"
|
||||||
|
"Super, right, movefocus, r"
|
||||||
|
"Super, up, movefocus, u"
|
||||||
|
"Super, down, movefocus, d"
|
||||||
|
"ShiftSuper, left, movewindow, l"
|
||||||
|
"ShiftSuper, right, movewindow, r"
|
||||||
|
"ShiftSuper, up, movewindow, u"
|
||||||
|
"ShiftSuper, down, movewindow, d"
|
||||||
|
]
|
||||||
|
++ workspaceBinds;
|
||||||
|
|
||||||
|
bindm = [
|
||||||
|
" , mouse:282, movewindow"
|
||||||
|
"Super, mouse:272, movewindow"
|
||||||
|
"Super, mouse:273, resizewindow"
|
||||||
|
];
|
||||||
|
|
||||||
|
bindl = [
|
||||||
|
"Super, mouse_up, splitratio, -0.1"
|
||||||
|
"Super, mouse_down, splitratio, 0.1"
|
||||||
|
" , XF86AudioPlay, exec, playerctl play-pause"
|
||||||
|
" , XF86AudioPrev, exec, playerctl previous"
|
||||||
|
" , XF86AudioNext, exec, playerctl next"
|
||||||
|
" , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||||
|
" , XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
||||||
|
" , XF86MonBrightnessUp, exec, brightnessctl s +10%"
|
||||||
|
];
|
||||||
|
|
||||||
|
bindel = [
|
||||||
|
" , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||||
|
" , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
{ self, ... }: {
|
{ self, ... }: {
|
||||||
|
imports = [
|
||||||
|
./binds.nix
|
||||||
|
];
|
||||||
|
|
||||||
flake.nixosModules.desktopHyprland =
|
flake.nixosModules.desktopHyprland =
|
||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
@@ -38,6 +42,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
hyprlandEnabled = osConfig.chiasson.desktop.hyprland.enable or false;
|
hyprlandEnabled = osConfig.chiasson.desktop.hyprland.enable or false;
|
||||||
|
dmsEnabled = (osConfig.chiasson.desktop.shell or null) == "dms";
|
||||||
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
|
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
|
||||||
# nixpkgs hyprland-plugins pin is stale for current Hyprland — override to a known-good rev.
|
# nixpkgs hyprland-plugins pin is stale for current Hyprland — override to a known-good rev.
|
||||||
hyprbarsPatched =
|
hyprbarsPatched =
|
||||||
@@ -95,69 +100,12 @@
|
|||||||
"nm-applet --indicator &"
|
"nm-applet --indicator &"
|
||||||
"sleep 1 && hyprctl reload"
|
"sleep 1 && hyprctl reload"
|
||||||
];
|
];
|
||||||
|
}
|
||||||
# Default keybinds
|
(self.lib.hyprlandBinds {
|
||||||
bind =
|
inherit lib dmsEnabled;
|
||||||
[
|
dmsIpcBinds = self.lib.dmsIpcBinds;
|
||||||
"SUPER,T,exec,kitty"
|
})
|
||||||
"ControlSuper,T,exec,konsole"
|
{
|
||||||
"SUPER,D,exec,rofi -show drun"
|
|
||||||
"ControlSuper,D,exec,rofi -show window"
|
|
||||||
"SUPER,E,exec,nemo"
|
|
||||||
"Super, Q, killactive"
|
|
||||||
"ControlSuper, Q, exec, hyprctl kill"
|
|
||||||
"Super, F, fullscreen, 0"
|
|
||||||
"Super, G, fullscreen, 1"
|
|
||||||
"ShiftSuper, F, fullscreenstate, 0 3"
|
|
||||||
"Super, Minus, splitratio, -0.1"
|
|
||||||
"Super, Equal, splitratio, 0.1"
|
|
||||||
"AltSuper, Space, togglefloating"
|
|
||||||
"Super, P, pin"
|
|
||||||
"Super, Space, exec, dms ipc call spotlight toggle"
|
|
||||||
"Super, I, exec, dms ipc call settings focusOrToggle"
|
|
||||||
"Super, N, exec, dms ipc call notepad toggle"
|
|
||||||
"ShiftSuper, N, exec, dms ipc call notifications toggle"
|
|
||||||
"Super, M, exec, dms ipc call processlist focusOrToggle"
|
|
||||||
"Super, L, exec, dms ipc call lock lock"
|
|
||||||
"ShiftSuper, V, exec, dms ipc call clipboard toggle"
|
|
||||||
"Super, Tab, cyclenext"
|
|
||||||
"Super, Tab, bringactivetotop"
|
|
||||||
"Super, left, movefocus, l"
|
|
||||||
"Super, right, movefocus, r"
|
|
||||||
"Super, up, movefocus, u"
|
|
||||||
"Super, down, movefocus, d"
|
|
||||||
"ShiftSuper, left, movewindow, l"
|
|
||||||
"ShiftSuper, right, movewindow, r"
|
|
||||||
"ShiftSuper, up, movewindow, u"
|
|
||||||
"ShiftSuper, down, movewindow, d"
|
|
||||||
]
|
|
||||||
++ (builtins.map (i: "Super, ${toString i}, workspace, ${toString i}") (builtins.genList (n: n + 1) 9))
|
|
||||||
++ (builtins.map (i: "ControlSuper, ${toString i}, focusworkspaceoncurrentmonitor, ${toString i}") (builtins.genList (n: n + 1) 9))
|
|
||||||
++ (builtins.map (i: "ShiftSuper, ${toString i}, movetoworkspacesilent, ${toString i}") (builtins.genList (n: n + 1) 9));
|
|
||||||
|
|
||||||
bindm = [
|
|
||||||
" , mouse:282, movewindow"
|
|
||||||
"Super, mouse:272, movewindow"
|
|
||||||
"Super, mouse:273, resizewindow"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindl = [
|
|
||||||
"Super, mouse_up, splitratio, -0.1"
|
|
||||||
"Super, mouse_down, splitratio, 0.1"
|
|
||||||
" , XF86AudioPlay, exec, playerctl play-pause"
|
|
||||||
" , XF86AudioPrev, exec, playerctl previous"
|
|
||||||
" , XF86AudioNext, exec, playerctl next"
|
|
||||||
" , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
|
||||||
" , XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
|
||||||
" , XF86MonBrightnessUp, exec, brightnessctl s +10%"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindel = [
|
|
||||||
" , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
|
||||||
" , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Decoration / blur
|
|
||||||
decoration = {
|
decoration = {
|
||||||
rounding = 10;
|
rounding = 10;
|
||||||
active_opacity = 0.95;
|
active_opacity = 0.95;
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{ self, ... }: {
|
||||||
|
flake.lib.niriBaseSettings =
|
||||||
|
pkgs:
|
||||||
|
{
|
||||||
|
input.keyboard = {
|
||||||
|
xkb.layout = "ca";
|
||||||
|
xkb.variant = "";
|
||||||
|
};
|
||||||
|
input."focus-follows-mouse" = _: {
|
||||||
|
props."max-scroll-amount" = "45%";
|
||||||
|
content = { };
|
||||||
|
};
|
||||||
|
input."warp-mouse-to-focus" = _: { };
|
||||||
|
layout.gaps = 5;
|
||||||
|
prefer-no-csd = true;
|
||||||
|
window-rules = self.lib.niriWindowRules;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
{ ... }: {
|
||||||
|
flake.lib.niriBinds =
|
||||||
|
{ pkgs, dmsEnabled ? false, dmsIpcBinds }:
|
||||||
|
let
|
||||||
|
lib = pkgs.lib;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"Mod+T"."spawn-sh" = lib.getExe pkgs.kitty;
|
||||||
|
"Mod+Control+T"."spawn-sh" = "konsole";
|
||||||
|
"Mod+D"."spawn-sh" = "rofi -show drun";
|
||||||
|
"Mod+Control+O"."spawn-sh" = "rofi -show window";
|
||||||
|
"Mod+E"."spawn-sh" = "nemo";
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs dmsEnabled {
|
||||||
|
"Mod+Space"."spawn-sh" = dmsIpcBinds.spotlight;
|
||||||
|
"Mod+V"."spawn-sh" = dmsIpcBinds.clipboard;
|
||||||
|
"Mod+N"."spawn-sh" = dmsIpcBinds.notepad;
|
||||||
|
"Mod+Shift+N"."spawn-sh" = dmsIpcBinds.notifications;
|
||||||
|
"Mod+M"."spawn-sh" = dmsIpcBinds.processlist;
|
||||||
|
"Mod+B"."spawn-sh" = dmsIpcBinds.barToggle;
|
||||||
|
"Mod+Shift+B"."spawn-sh" = dmsIpcBinds.barToggleBar2;
|
||||||
|
"Mod+A"."spawn-sh" = dmsIpcBinds.ephemera;
|
||||||
|
"Mod+numbersign"."spawn-sh" = dmsIpcBinds.wallpaperCarousel;
|
||||||
|
"Mod+L"."spawn-sh" = dmsIpcBinds.lock;
|
||||||
|
}
|
||||||
|
// {
|
||||||
|
"Mod+Q"."close-window" = _: { };
|
||||||
|
"Mod+F"."maximize-column" = _: { };
|
||||||
|
"Mod+Shift+F"."fullscreen-window" = _: { };
|
||||||
|
"Mod+O"."toggle-overview" = _: { };
|
||||||
|
"Mod+Shift+NumberSign"."show-hotkey-overlay" = _: { };
|
||||||
|
"Mod+Shift+E".quit = _: { };
|
||||||
|
|
||||||
|
"Mod+Left"."focus-column-or-monitor-left" = _: { };
|
||||||
|
"Mod+Down"."focus-window-or-monitor-down" = _: { };
|
||||||
|
"Mod+Up"."focus-window-or-monitor-up" = _: { };
|
||||||
|
"Mod+Right"."focus-column-or-monitor-right" = _: { };
|
||||||
|
|
||||||
|
"Mod+Shift+WheelScrollDown"."focus-workspace-down" = _: { };
|
||||||
|
"Mod+Shift+WheelScrollUp"."focus-workspace-up" = _: { };
|
||||||
|
|
||||||
|
"Mod+WheelScrollDown"."focus-column-or-monitor-right" = _: { };
|
||||||
|
"Mod+WheelScrollUp"."focus-column-or-monitor-left" = _: { };
|
||||||
|
|
||||||
|
"Mod+Shift+Left"."move-column-left-or-to-monitor-left" = _: { };
|
||||||
|
"Mod+Shift+Down"."move-window-down" = _: { };
|
||||||
|
"Mod+Shift+Up"."move-window-up" = _: { };
|
||||||
|
"Mod+Shift+Right"."move-column-right-or-to-monitor-right" = _: { };
|
||||||
|
"Mod+Page_Up"."focus-workspace-up" = _: { };
|
||||||
|
"Mod+Page_Down"."focus-workspace-down" = _: { };
|
||||||
|
"Mod+Shift+Page_Up"."move-column-to-workspace-up" = _: { };
|
||||||
|
"Mod+Shift+Page_Down"."move-column-to-workspace-down" = _: { };
|
||||||
|
"Mod+R"."switch-preset-column-width" = _: { };
|
||||||
|
"Mod+BracketLeft"."consume-or-expel-window-left" = _: { };
|
||||||
|
"Mod+BracketRight"."consume-or-expel-window-right" = _: { };
|
||||||
|
"Mod+Comma"."consume-window-into-column" = _: { };
|
||||||
|
"Mod+Period"."expel-window-from-column" = _: { };
|
||||||
|
"Mod+Alt+Space"."toggle-window-floating" = _: { };
|
||||||
|
|
||||||
|
"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+Ctrl+1"."move-column-to-workspace" = 1;
|
||||||
|
"Mod+Ctrl+2"."move-column-to-workspace" = 2;
|
||||||
|
"Mod+Ctrl+3"."move-column-to-workspace" = 3;
|
||||||
|
"Mod+Ctrl+4"."move-column-to-workspace" = 4;
|
||||||
|
"Mod+Ctrl+5"."move-column-to-workspace" = 5;
|
||||||
|
"Mod+Ctrl+6"."move-column-to-workspace" = 6;
|
||||||
|
"Mod+Ctrl+7"."move-column-to-workspace" = 7;
|
||||||
|
"Mod+Ctrl+8"."move-column-to-workspace" = 8;
|
||||||
|
"Mod+Ctrl+9"."move-column-to-workspace" = 9;
|
||||||
|
|
||||||
|
"XF86AudioRaiseVolume".spawn = [
|
||||||
|
"wpctl"
|
||||||
|
"set-volume"
|
||||||
|
"@DEFAULT_AUDIO_SINK@"
|
||||||
|
"0.05+"
|
||||||
|
];
|
||||||
|
"XF86AudioLowerVolume".spawn = [
|
||||||
|
"wpctl"
|
||||||
|
"set-volume"
|
||||||
|
"@DEFAULT_AUDIO_SINK@"
|
||||||
|
"0.05-"
|
||||||
|
];
|
||||||
|
"XF86AudioMute".spawn = [
|
||||||
|
"wpctl"
|
||||||
|
"set-mute"
|
||||||
|
"@DEFAULT_AUDIO_SINK@"
|
||||||
|
"toggle"
|
||||||
|
];
|
||||||
|
"XF86MonBrightnessUp".spawn = [ "brightnessctl" "set" "+5%" ];
|
||||||
|
"XF86MonBrightnessDown".spawn = [ "brightnessctl" "set" "5%-" ];
|
||||||
|
|
||||||
|
Print.screenshot = _: { };
|
||||||
|
"Ctrl+Print"."screenshot-screen" = _: { };
|
||||||
|
"Alt+Print"."screenshot-window" = _: { };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,190 +1,10 @@
|
|||||||
{ self, inputs, ... }:
|
{ self, inputs, ... }: {
|
||||||
let
|
imports = [
|
||||||
# Keep defaults in this let — a bare niri-settings.nix next to this file would get picked up by import-tree.
|
./window-rules.nix
|
||||||
niriBaseSettings =
|
./base-settings.nix
|
||||||
pkgs:
|
./binds.nix
|
||||||
{
|
];
|
||||||
input.keyboard = {
|
|
||||||
xkb.layout = "ca";
|
|
||||||
xkb.variant = "";
|
|
||||||
};
|
|
||||||
input."focus-follows-mouse" = _: {
|
|
||||||
props."max-scroll-amount" = "45%";
|
|
||||||
content = { };
|
|
||||||
};
|
|
||||||
input."warp-mouse-to-focus" = _: { };
|
|
||||||
layout.gaps = 5;
|
|
||||||
prefer-no-csd = true;
|
|
||||||
|
|
||||||
window-rules = [
|
|
||||||
{
|
|
||||||
matches = [
|
|
||||||
{
|
|
||||||
app-id = "^$";
|
|
||||||
title = "^$";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
open-floating = true;
|
|
||||||
open-focused = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
matches = [
|
|
||||||
{ title = "^(Picture-in-Picture|Picture in picture)$"; }
|
|
||||||
];
|
|
||||||
open-floating = true;
|
|
||||||
open-focused = false;
|
|
||||||
default-column-width = { fixed = 640; };
|
|
||||||
default-window-height = { fixed = 360; };
|
|
||||||
default-floating-position = _: {
|
|
||||||
props = {
|
|
||||||
x = 32;
|
|
||||||
y = 32;
|
|
||||||
relative-to = "bottom-right";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
matches = [
|
|
||||||
{ app-id = "^Minecraft\\*"; }
|
|
||||||
{ app-id = "^Minecraft$"; }
|
|
||||||
];
|
|
||||||
tiled-state = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
#TODO[epic=Binds] Go over binds again
|
|
||||||
binds = {
|
|
||||||
"Mod+T"."spawn-sh" = pkgs.lib.getExe pkgs.kitty; # shell from kitty HM config
|
|
||||||
"Mod+Control+T"."spawn-sh" = "konsole"; #TODO[epic=Binds] This should only be set if having konsole
|
|
||||||
"Mod+D"."spawn-sh" = "rofi -show drun"; #TODO[epic=Binds] This should only be set if having rofi
|
|
||||||
"Mod+Space"."spawn-sh" = "dms ipc call spotlight toggle"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+E"."spawn-sh" = "nemo"; #TODO[epic=Binds] This should only be set if having nemo
|
|
||||||
"Mod+Control+O"."spawn-sh" = "rofi -show window"; #TODO[epic=Binds] This should only be set if having rofi
|
|
||||||
"Mod+V"."spawn-sh" = "dms ipc call clipboard toggle"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+N"."spawn-sh" = "dms ipc call notepad toggle"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+Shift+N"."spawn-sh" = "dms ipc call notifications toggle"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+M"."spawn-sh" = "dms ipc call processlist toggle"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+B"."spawn-sh" = "dms ipc call bar toggle name \"Main Bar\"; dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+Shift+B"."spawn-sh" = "dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
"Mod+L"."spawn-sh" = "dms ipc call lock lock"; #TODO[epic=Binds] This should only be set if having dms
|
|
||||||
|
|
||||||
"Mod+Q"."close-window" = _: { };
|
|
||||||
"Mod+F"."maximize-column" = _: { };
|
|
||||||
"Mod+Shift+F"."fullscreen-window" = _: { };
|
|
||||||
"Mod+O"."toggle-overview" = _: { };
|
|
||||||
"Mod+Shift+NumberSign"."show-hotkey-overlay" = _: { };
|
|
||||||
"Mod+Shift+E".quit = _: { };
|
|
||||||
|
|
||||||
"Mod+Left"."focus-column-or-monitor-left" = _: { };
|
|
||||||
"Mod+Down"."focus-window-or-monitor-down" = _: { };
|
|
||||||
"Mod+Up"."focus-window-or-monitor-up" = _: { };
|
|
||||||
"Mod+Right"."focus-column-or-monitor-right" = _: { };
|
|
||||||
|
|
||||||
"Mod+Shift+WheelScrollDown"."focus-workspace-down" = _: { };
|
|
||||||
"Mod+Shift+WheelScrollUp"."focus-workspace-up" = _: { };
|
|
||||||
|
|
||||||
"Mod+WheelScrollDown"."focus-column-or-monitor-right" = _: { };
|
|
||||||
"Mod+WheelScrollUp"."focus-column-or-monitor-left" = _: { };
|
|
||||||
|
|
||||||
"Mod+Shift+Left"."move-column-left-or-to-monitor-left" = _: { };
|
|
||||||
"Mod+Shift+Down"."move-window-down" = _: { };
|
|
||||||
"Mod+Shift+Up"."move-window-up" = _: { };
|
|
||||||
"Mod+Shift+Right"."move-column-right-or-to-monitor-right" = _: { };
|
|
||||||
"Mod+Page_Up"."focus-workspace-up" = _: { };
|
|
||||||
"Mod+Page_Down"."focus-workspace-down" = _: { };
|
|
||||||
"Mod+Shift+Page_Up"."move-column-to-workspace-up" = _: { };
|
|
||||||
"Mod+Shift+Page_Down"."move-column-to-workspace-down" = _: { };
|
|
||||||
"Mod+R"."switch-preset-column-width" = _: { };
|
|
||||||
"Mod+BracketLeft"."consume-or-expel-window-left" = _: { };
|
|
||||||
"Mod+BracketRight"."consume-or-expel-window-right" = _: { };
|
|
||||||
"Mod+Comma"."consume-window-into-column" = _: { };
|
|
||||||
"Mod+Period"."expel-window-from-column" = _: { };
|
|
||||||
"Mod+Alt+Space"."toggle-window-floating" = _: { };
|
|
||||||
#"Mod+Shift+V"."switch-focus-between-floating-and-tiling" = _: { }; #TODO[epic=Binds] Find free bind that is not in the way and not overcomplicated to remember
|
|
||||||
|
|
||||||
"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+Ctrl+1"."move-column-to-workspace" = 1;
|
|
||||||
"Mod+Ctrl+2"."move-column-to-workspace" = 2;
|
|
||||||
"Mod+Ctrl+3"."move-column-to-workspace" = 3;
|
|
||||||
"Mod+Ctrl+4"."move-column-to-workspace" = 4;
|
|
||||||
"Mod+Ctrl+5"."move-column-to-workspace" = 5;
|
|
||||||
"Mod+Ctrl+6"."move-column-to-workspace" = 6;
|
|
||||||
"Mod+Ctrl+7"."move-column-to-workspace" = 7;
|
|
||||||
"Mod+Ctrl+8"."move-column-to-workspace" = 8;
|
|
||||||
"Mod+Ctrl+9"."move-column-to-workspace" = 9;
|
|
||||||
|
|
||||||
"XF86AudioRaiseVolume".spawn = [
|
|
||||||
"wpctl"
|
|
||||||
"set-volume"
|
|
||||||
"@DEFAULT_AUDIO_SINK@"
|
|
||||||
"0.05+"
|
|
||||||
];
|
|
||||||
"XF86AudioLowerVolume".spawn = [
|
|
||||||
"wpctl"
|
|
||||||
"set-volume"
|
|
||||||
"@DEFAULT_AUDIO_SINK@"
|
|
||||||
"0.05-"
|
|
||||||
];
|
|
||||||
"XF86AudioMute".spawn = [
|
|
||||||
"wpctl"
|
|
||||||
"set-mute"
|
|
||||||
"@DEFAULT_AUDIO_SINK@"
|
|
||||||
"toggle"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Backlight: relies on `pkgs.brightnessctl` being on PATH (provided by `desktopGui` when
|
|
||||||
# any GUI session is enabled) and the user being in the `video` group (catalog default).
|
|
||||||
"XF86MonBrightnessUp".spawn = [ "brightnessctl" "set" "+5%" ];
|
|
||||||
"XF86MonBrightnessDown".spawn = [ "brightnessctl" "set" "5%-" ];
|
|
||||||
|
|
||||||
Print.screenshot = _: { };
|
|
||||||
"Ctrl+Print"."screenshot-screen" = _: { };
|
|
||||||
"Alt+Print"."screenshot-window" = _: { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
keyringNiriStartupKdl = ''
|
|
||||||
spawn-at-startup "dbus-update-activation-environment" "--systemd" "--all"
|
|
||||||
'';
|
|
||||||
|
|
||||||
mergeNiriSettings =
|
|
||||||
pkgs: niriCfg: keyringEnable:
|
|
||||||
let
|
|
||||||
lib = pkgs.lib;
|
|
||||||
pi5 = self.lib.pi5NiriKdl;
|
|
||||||
rpi5Extra = lib.optionalString (niriCfg.raspberryPi5DrmWorkaround or false) pi5.drmExtraConfig;
|
|
||||||
base = niriBaseSettings pkgs;
|
|
||||||
userExtra = niriCfg.extraSettings or { };
|
|
||||||
keyringExtra = lib.optionalString keyringEnable keyringNiriStartupKdl;
|
|
||||||
extraConfigMerged = keyringExtra + rpi5Extra + (userExtra.extraConfig or "");
|
|
||||||
windowRules = (base.window-rules or [ ]) ++ (userExtra.window-rules or [ ]);
|
|
||||||
userExtraNoSpecial = lib.removeAttrs userExtra [ "window-rules" "extraConfig" "binds" ];
|
|
||||||
mergedBinds =
|
|
||||||
(base.binds or { })
|
|
||||||
// (userExtra.binds or { })
|
|
||||||
// (niriCfg.extraBinds or { });
|
|
||||||
in
|
|
||||||
lib.recursiveUpdate base (
|
|
||||||
userExtraNoSpecial
|
|
||||||
// {
|
|
||||||
binds = mergedBinds;
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs (windowRules != [ ]) {
|
|
||||||
window-rules = windowRules;
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs (extraConfigMerged != "") {
|
|
||||||
extraConfig = extraConfigMerged;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.homeManagerModules.desktopNiri =
|
flake.homeManagerModules.desktopNiri =
|
||||||
{ config, lib, pkgs, osConfig ? { }, ... }:
|
{ config, lib, pkgs, osConfig ? { }, ... }:
|
||||||
let
|
let
|
||||||
@@ -193,21 +13,61 @@ in
|
|||||||
niriEnabled = osConfig.chiasson.desktop.niri.enable or false;
|
niriEnabled = osConfig.chiasson.desktop.niri.enable or false;
|
||||||
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
|
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
|
||||||
dmsEnabled = (osConfig.chiasson.desktop.shell or null) == "dms";
|
dmsEnabled = (osConfig.chiasson.desktop.shell or null) == "dms";
|
||||||
|
|
||||||
|
keyringNiriStartupKdl = ''
|
||||||
|
spawn-at-startup "dbus-update-activation-environment" "--systemd" "--all"
|
||||||
|
'';
|
||||||
|
|
||||||
|
niriBaseSettings =
|
||||||
|
pkgs: dmsEnabled:
|
||||||
|
self.lib.niriBaseSettings pkgs // {
|
||||||
|
binds = self.lib.niriBinds {
|
||||||
|
inherit pkgs dmsEnabled;
|
||||||
|
dmsIpcBinds = self.lib.dmsIpcBinds;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mergeNiriSettings =
|
||||||
|
pkgs: niriCfg: keyringEnable: dmsEnabled:
|
||||||
|
let
|
||||||
|
lib = pkgs.lib;
|
||||||
|
pi5 = self.lib.pi5NiriKdl;
|
||||||
|
rpi5Extra = lib.optionalString (niriCfg.raspberryPi5DrmWorkaround or false) pi5.drmExtraConfig;
|
||||||
|
base = niriBaseSettings pkgs dmsEnabled;
|
||||||
|
userExtra = niriCfg.extraSettings or { };
|
||||||
|
keyringExtra = lib.optionalString keyringEnable keyringNiriStartupKdl;
|
||||||
|
extraConfigMerged = keyringExtra + rpi5Extra + (userExtra.extraConfig or "");
|
||||||
|
windowRules = (base.window-rules or [ ]) ++ (userExtra.window-rules or [ ]);
|
||||||
|
userExtraNoSpecial = lib.removeAttrs userExtra [ "window-rules" "extraConfig" "binds" ];
|
||||||
|
mergedBinds =
|
||||||
|
(base.binds or { })
|
||||||
|
// (userExtra.binds or { })
|
||||||
|
// (niriCfg.extraBinds or { });
|
||||||
|
in
|
||||||
|
lib.recursiveUpdate base (
|
||||||
|
userExtraNoSpecial
|
||||||
|
// {
|
||||||
|
binds = mergedBinds;
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (windowRules != [ ]) {
|
||||||
|
window-rules = windowRules;
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (extraConfigMerged != "") {
|
||||||
|
extraConfig = extraConfigMerged;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
dmsWindowRulesPath = "${home}/.config/niri/dms/windowrules.kdl";
|
dmsWindowRulesPath = "${home}/.config/niri/dms/windowrules.kdl";
|
||||||
# wrapper-modules emits quoted KDL (`"include" "…"`) which DMS's parser ignores.
|
|
||||||
# config.kdl is a store symlink, so a relative include would not resolve to the real
|
|
||||||
# ~/.config/niri/dms/windowrules.kdl that DMS writes at runtime.
|
|
||||||
dmsWindowRulesInclude = lib.optionalString dmsEnabled ''
|
dmsWindowRulesInclude = lib.optionalString dmsEnabled ''
|
||||||
include "${dmsWindowRulesPath}"
|
include "${dmsWindowRulesPath}"
|
||||||
'';
|
'';
|
||||||
baseMergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled;
|
baseMergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled dmsEnabled;
|
||||||
mergedSettings = lib.recursiveUpdate baseMergedSettings {
|
mergedSettings = lib.recursiveUpdate baseMergedSettings {
|
||||||
extraConfig = dmsWindowRulesInclude + (baseMergedSettings.extraConfig or "");
|
extraConfig = dmsWindowRulesInclude + (baseMergedSettings.extraConfig or "");
|
||||||
};
|
};
|
||||||
niriConfigPkg = inputs.wrapper-modules.wrappers.niri.wrap {
|
niriConfigPkg = inputs.wrapper-modules.wrappers.niri.wrap {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
settings = mergedSettings;
|
settings = mergedSettings;
|
||||||
# User-owned rules path is not available during the Nix build.
|
|
||||||
disableConfigValidation = dmsEnabled;
|
disableConfigValidation = dmsEnabled;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@@ -217,7 +77,6 @@ in
|
|||||||
xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl";
|
xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl";
|
||||||
}
|
}
|
||||||
(lib.mkIf dmsEnabled {
|
(lib.mkIf dmsEnabled {
|
||||||
# Seed empty rules file so niri can load the include before DMS first deploy.
|
|
||||||
home.activation.dmsNiriWindowRulesSeed = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.dmsNiriWindowRulesSeed = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
rulesDir="$HOME/.config/niri/dms"
|
rulesDir="$HOME/.config/niri/dms"
|
||||||
rulesFile="$rulesDir/windowrules.kdl"
|
rulesFile="$rulesDir/windowrules.kdl"
|
||||||
@@ -281,8 +140,6 @@ in
|
|||||||
programs.niri.package = pkgs.niri;
|
programs.niri.package = pkgs.niri;
|
||||||
programs.xwayland.enable = true;
|
programs.xwayland.enable = true;
|
||||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
|
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
|
||||||
# Niri resolves `xwayland-satellite` from PATH to provide XWayland + `$DISPLAY` for X11
|
|
||||||
# clients (Steam, etc.). See https://github.com/YaLTeR/niri/issues/452
|
|
||||||
environment.systemPackages = [ pkgs.xwayland-satellite ];
|
environment.systemPackages = [ pkgs.xwayland-satellite ];
|
||||||
})
|
})
|
||||||
(lib.mkIf (cfg.niri.enable && hmAvailable) {
|
(lib.mkIf (cfg.niri.enable && hmAvailable) {
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{ ... }: {
|
||||||
|
flake.lib.niriWindowRules = [
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{
|
||||||
|
app-id = "^$";
|
||||||
|
title = "^$";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
open-floating = true;
|
||||||
|
open-focused = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{ title = "^(Picture-in-Picture|Picture in picture)$"; }
|
||||||
|
];
|
||||||
|
open-floating = true;
|
||||||
|
open-focused = false;
|
||||||
|
default-column-width = { fixed = 640; };
|
||||||
|
default-window-height = { fixed = 360; };
|
||||||
|
default-floating-position = _: {
|
||||||
|
props = {
|
||||||
|
x = 32;
|
||||||
|
y = 32;
|
||||||
|
relative-to = "bottom-right";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{ app-id = "^Minecraft\\*"; }
|
||||||
|
{ app-id = "^Minecraft$"; }
|
||||||
|
];
|
||||||
|
tiled-state = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
+65
-24
@@ -1,4 +1,38 @@
|
|||||||
{ ... }: {
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
flake.lib.wisdomCatalogExtraModules =
|
||||||
|
self:
|
||||||
|
let
|
||||||
|
names = lib.sort builtins.lessThan (
|
||||||
|
lib.filter (n: lib.hasPrefix "wisdom" n && n != "wisdom") (
|
||||||
|
builtins.attrNames self.homeManagerModules
|
||||||
|
)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
map (name: self.homeManagerModules.${name}) names;
|
||||||
|
|
||||||
|
flake.lib.wisdomSlice =
|
||||||
|
{ path, default, description, packages }:
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
segs = lib.splitString "." path;
|
||||||
|
optPath = [
|
||||||
|
"chiasson"
|
||||||
|
"home"
|
||||||
|
]
|
||||||
|
++ segs
|
||||||
|
++ [ "enable" ];
|
||||||
|
root = config.chiasson.home;
|
||||||
|
cfg = lib.getAttrFromPath segs root;
|
||||||
|
enabled = lib.getAttrFromPath optPath config;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = lib.setAttrByPath optPath (lib.mkEnableOption description // { inherit default; });
|
||||||
|
config = lib.mkIf (root.enable && enabled) {
|
||||||
|
home.packages = lib.filter (lib.meta.availableOn pkgs.stdenv.hostPlatform) (packages pkgs);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
flake.nixosModules.desktopOptions =
|
flake.nixosModules.desktopOptions =
|
||||||
{ config, options, lib, pkgs, self, inputs, ... }:
|
{ config, options, lib, pkgs, self, inputs, ... }:
|
||||||
let
|
let
|
||||||
@@ -34,11 +68,13 @@
|
|||||||
{
|
{
|
||||||
options.chiasson.desktop = {
|
options.chiasson.desktop = {
|
||||||
defaultSession = lib.mkOption {
|
defaultSession = lib.mkOption {
|
||||||
type = lib.types.nullOr (lib.types.enum [
|
type = lib.types.nullOr (
|
||||||
"hyprland"
|
lib.types.enum [
|
||||||
"niri"
|
"hyprland"
|
||||||
"plasma"
|
"niri"
|
||||||
]);
|
"plasma"
|
||||||
|
]
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
example = "niri";
|
example = "niri";
|
||||||
description = ''
|
description = ''
|
||||||
@@ -56,10 +92,12 @@
|
|||||||
|
|
||||||
displayManager = {
|
displayManager = {
|
||||||
variant = lib.mkOption {
|
variant = lib.mkOption {
|
||||||
type = lib.types.nullOr (lib.types.enum [
|
type = lib.types.nullOr (
|
||||||
"sddm"
|
lib.types.enum [
|
||||||
"dankgreeter"
|
"sddm"
|
||||||
]);
|
"dankgreeter"
|
||||||
|
]
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
SDDM vs DankGreeter (greetd + DMS — [docs](https://danklinux.com/docs/dankgreeter/nixos-flake)).
|
SDDM vs DankGreeter (greetd + DMS — [docs](https://danklinux.com/docs/dankgreeter/nixos-flake)).
|
||||||
@@ -80,11 +118,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
displayManager.sddm = {
|
displayManager.sddm = {
|
||||||
wayland.enable = lib.mkEnableOption ''
|
wayland.enable =
|
||||||
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
|
lib.mkEnableOption ''
|
||||||
'' // {
|
SDDM greeter on Wayland (nicer on HiDPI; turn off if the greeter glitches on your GPU).
|
||||||
default = true;
|
''
|
||||||
};
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
enableHidpi = lib.mkOption {
|
enableHidpi = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
@@ -159,12 +199,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
keyring = {
|
keyring = {
|
||||||
enable = lib.mkEnableOption ''
|
enable =
|
||||||
gnome-keyring + pam (login + sddm or greetd) + HM user service + `gcr` + `services.xserver.updateDbusEnvironment`.
|
lib.mkEnableOption ''
|
||||||
niri/hyprland: `dbus-update-activation-environment` at compositor start so libsecret/Electron see `WAYLAND_DISPLAY`.
|
gnome-keyring + pam (login + sddm or greetd) + HM user service + `gcr` + `services.xserver.updateDbusEnvironment`.
|
||||||
'' // {
|
niri/hyprland: `dbus-update-activation-environment` at compositor start so libsecret/Electron see `WAYLAND_DISPLAY`.
|
||||||
default = true;
|
''
|
||||||
};
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,8 +226,7 @@
|
|||||||
message = "chiasson.desktop.defaultSession = \"plasma\" requires chiasson.desktop.plasma.enable = true.";
|
message = "chiasson.desktop.defaultSession = \"plasma\" requires chiasson.desktop.plasma.enable = true.";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion =
|
assertion = cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
|
||||||
cfg.displayManager.variant != "dankgreeter" || cfg.hyprland.enable || cfg.niri.enable;
|
|
||||||
message = "chiasson.desktop.displayManager.variant = \"dankgreeter\" requires chiasson.desktop.hyprland or chiasson.desktop.niri.";
|
message = "chiasson.desktop.displayManager.variant = \"dankgreeter\" requires chiasson.desktop.hyprland or chiasson.desktop.niri.";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -210,7 +251,7 @@
|
|||||||
(lib.mkIf (dmsEnabled && hmAvailable) {
|
(lib.mkIf (dmsEnabled && hmAvailable) {
|
||||||
"home-manager".sharedModules = [ self.homeManagerModules.desktopShellDms ];
|
"home-manager".sharedModules = [ self.homeManagerModules.desktopShellDms ];
|
||||||
})
|
})
|
||||||
(lib.mkIf (hmAvailable && (dmsEnabled || cfg.niri.enable)) {
|
(lib.mkIf hmAvailable {
|
||||||
"home-manager".extraSpecialArgs = { inherit inputs; };
|
"home-manager".extraSpecialArgs = { inherit inputs; };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Generic defaults written once to ~/.config/DankMaterialShell/settings.json on first login.
|
# Generic defaults written once to ~/.config/DankMaterialShell/settings.json on first login.
|
||||||
# Hosts can override via `chiasson.desktop.shells.dms.defaultSettingsFile` (see 14900k).
|
# Hosts can override via `chiasson.desktop.shells.dms.defaultSeedDir` (see 14900k).
|
||||||
# After seeding, DMS settings are owned by the UI — rebuilds do not overwrite them.
|
# After seeding, DMS settings are owned by the UI — rebuilds do not overwrite them.
|
||||||
|
#
|
||||||
|
# To refresh host seeds from live DMS config: `just sync-dms`
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
gpuTempEnabled ? true,
|
gpuTempEnabled ? true,
|
||||||
|
|||||||
@@ -0,0 +1,276 @@
|
|||||||
|
# Home Manager wiring for DMS (imported by default.nix; lives under _private/ for import-tree).
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
osConfig ? { },
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
home = config.home.homeDirectory;
|
||||||
|
dmsEnabled = lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig == "dms";
|
||||||
|
dmsOs = lib.attrByPath [ "chiasson" "desktop" "shells" "dms" ] { } osConfig;
|
||||||
|
hostName = lib.attrByPath [ "networking" "hostName" ] "nixos" osConfig;
|
||||||
|
rebuildCommand =
|
||||||
|
if (dmsOs.rebuildCommand or null) != null then
|
||||||
|
dmsOs.rebuildCommand
|
||||||
|
else
|
||||||
|
[ "sudo" "nixos-rebuild" "switch" "--flake" ".#${hostName}" ];
|
||||||
|
gpuTempEnabled = dmsOs.enableGpuTemp or true;
|
||||||
|
hyprlandEnabled = lib.attrByPath [ "chiasson" "desktop" "hyprland" "enable" ] false osConfig;
|
||||||
|
discordEnabled = lib.attrByPath [ "chiasson" "home" "apps" "discord" "enable" ] false config;
|
||||||
|
ohMyPoshEnabled = config.programs.oh-my-posh.enable or false;
|
||||||
|
obsidianSnippetDirs = map (v: v + "/snippets") (dmsOs.obsidianVaults or [ ]);
|
||||||
|
matugenOutputDirs =
|
||||||
|
lib.optionals hyprlandEnabled [ "${home}/.config/hypr" ]
|
||||||
|
++ lib.optionals ohMyPoshEnabled [ "${home}/.config/oh-my-posh" ]
|
||||||
|
++ lib.optionals discordEnabled [ "${home}/.config/vesktop/themes" ]
|
||||||
|
++ [
|
||||||
|
"${home}/.config/qt6ct/colors"
|
||||||
|
"${home}/.config/qt5ct/colors"
|
||||||
|
];
|
||||||
|
ensureMatugenBody =
|
||||||
|
lib.concatStringsSep "\n" (map (dir: "mkdir -p ${lib.escapeShellArg dir}") matugenOutputDirs)
|
||||||
|
+ lib.concatStringsSep "\n" (map (dir: ''
|
||||||
|
snippetDir=${lib.escapeShellArg dir}
|
||||||
|
parentDir="$(dirname "$snippetDir")"
|
||||||
|
if [ -d "$snippetDir" ]; then
|
||||||
|
:
|
||||||
|
elif [ ! -d "$parentDir" ] || [ ! -w "$parentDir" ]; then
|
||||||
|
echo "dms: skipping Obsidian snippet dir '$snippetDir' (parent missing or not writable)" >&2
|
||||||
|
else
|
||||||
|
mkdir -p "$snippetDir"
|
||||||
|
fi
|
||||||
|
'') obsidianSnippetDirs)
|
||||||
|
+ lib.optionalString ohMyPoshEnabled ''
|
||||||
|
dest="$HOME/.config/oh-my-posh/theme.omp.json"
|
||||||
|
template="$HOME/.config/matugen/templates/ohmyposh-theme.omp.json"
|
||||||
|
if [ -L "$dest" ] || { [ -e "$dest" ] && ! [ -f "$dest" ]; }; then
|
||||||
|
rm -f "$dest"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$dest" ]; then
|
||||||
|
cp -L "$template" "$dest"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
ensureMatugenOutputDirsScript = pkgs.writeShellScript "dms-ensure-matugen-output-dirs" ''
|
||||||
|
set -euo pipefail
|
||||||
|
${ensureMatugenBody}
|
||||||
|
'';
|
||||||
|
|
||||||
|
dmsRestartOnceScript = pkgs.writeShellScript "dms-plugin-restart-once" (
|
||||||
|
builtins.replaceStrings
|
||||||
|
[ "@FLOCK@" "@SYSTEMCTL@" ]
|
||||||
|
[
|
||||||
|
"${pkgs.util-linux}/bin/flock"
|
||||||
|
"${pkgs.systemd}/bin/systemctl"
|
||||||
|
]
|
||||||
|
(builtins.readFile ../scripts/dms-restart-once.sh)
|
||||||
|
);
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
|
dmsConfigDir = "${config.xdg.configHome}/DankMaterialShell";
|
||||||
|
defaultSeedDir = dmsOs.defaultSeedDir or null;
|
||||||
|
|
||||||
|
dmsSeedSources =
|
||||||
|
if defaultSeedDir != null then
|
||||||
|
{
|
||||||
|
"settings.json" = defaultSeedDir + "/settings.json";
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (builtins.pathExists (defaultSeedDir + "/plugin_settings.json")) {
|
||||||
|
"plugin_settings.json" = defaultSeedDir + "/plugin_settings.json";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
"settings.json" = jsonFormat.generate "dms-settings-seed.json" (
|
||||||
|
import ./default-settings.nix {
|
||||||
|
inherit lib gpuTempEnabled;
|
||||||
|
extraRightBarWidgets = dmsOs.extraRightBarWidgets or [ ];
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
dmsSeedBody = lib.concatMapStringsSep "\n" (
|
||||||
|
fileName:
|
||||||
|
let
|
||||||
|
dest = "${dmsConfigDir}/${fileName}";
|
||||||
|
src = dmsSeedSources.${fileName};
|
||||||
|
in
|
||||||
|
''
|
||||||
|
dest=${lib.escapeShellArg dest}
|
||||||
|
mkdir -p "$(dirname "$dest")"
|
||||||
|
if [ -L "$dest" ]; then
|
||||||
|
${pkgs.coreutils}/bin/cp --remove-destination -L "$dest" "$dest"
|
||||||
|
fi
|
||||||
|
if [ ! -e "$dest" ]; then
|
||||||
|
${pkgs.coreutils}/bin/cp ${lib.escapeShellArg src} "$dest"
|
||||||
|
chmod u+w "$dest"
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
) (lib.attrNames dmsSeedSources);
|
||||||
|
dmsSeedConfigScript = pkgs.writeShellScript "dms-seed-config" ''
|
||||||
|
set -euo pipefail
|
||||||
|
${dmsSeedBody}
|
||||||
|
'';
|
||||||
|
|
||||||
|
matugenConfigText = import ./matugen-config.nix {
|
||||||
|
inherit
|
||||||
|
lib
|
||||||
|
home
|
||||||
|
hyprlandEnabled
|
||||||
|
ohMyPoshEnabled
|
||||||
|
discordEnabled
|
||||||
|
obsidianSnippetDirs
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Plugin registry auto-derived from flake inputs matching `dms-plugin-*`.
|
||||||
|
# Adding a plugin now requires editing only `flake.nix`. The on-disk
|
||||||
|
# plugin id (= path under ~/.config/DankMaterialShell/plugins/) is camelCase
|
||||||
|
# per upstream convention; the kebab→camel transform matches it. The
|
||||||
|
# `idExceptions` map carries the one plugin whose manifest id does not
|
||||||
|
# follow the default rule.
|
||||||
|
pluginInputs = lib.filterAttrs (n: _: lib.hasPrefix "dms-plugin-" n) inputs;
|
||||||
|
|
||||||
|
# `dank-vault` → `dankVault`. `lib.splitString` yields ≥ 1 element so
|
||||||
|
# `head parts` is safe; `map` runs over the tail only (no-op for
|
||||||
|
# single-word names like `calculator`). `builtins.substring 1 (-1) p`
|
||||||
|
# returns the rest of `p` from index 1, dropping the first char
|
||||||
|
# (Nix treats a negative `len` as "rest of string from `start`").
|
||||||
|
toCamel = s:
|
||||||
|
let parts = lib.splitString "-" s; in
|
||||||
|
builtins.head parts
|
||||||
|
+ lib.concatStrings (map (
|
||||||
|
p: if p == "" then ""
|
||||||
|
else lib.toUpper (builtins.substring 0 1 p)
|
||||||
|
+ builtins.substring 1 (-1) p
|
||||||
|
) (builtins.tail parts));
|
||||||
|
|
||||||
|
# The `home-assistant` plugin ships its manifest under id
|
||||||
|
# `homeAssistantMonitor` (not the default kebab→camel result).
|
||||||
|
idExceptions = { "home-assistant" = "homeAssistantMonitor"; };
|
||||||
|
|
||||||
|
# NB: don't rewrite as `idExceptions.${stripped} or toCamel stripped`.
|
||||||
|
# Nix grammar: `or` binds tighter than function application, so the
|
||||||
|
# `toCamel` and its arg parse as separate postfix args to the select.
|
||||||
|
# When the lookup succeeds the resolved string is then applied as a
|
||||||
|
# function, producing `attempt to call something which is not a function
|
||||||
|
# but a string: "homeAssistantMonitor"`. Explicit `if/hasAttr` sidesteps
|
||||||
|
# the parse entirely.
|
||||||
|
camelMap = lib.mapAttrs' (n: src:
|
||||||
|
let stripped = lib.removePrefix "dms-plugin-" n; in
|
||||||
|
lib.nameValuePair
|
||||||
|
(if builtins.hasAttr stripped idExceptions
|
||||||
|
then idExceptions.${stripped}
|
||||||
|
else toCamel stripped)
|
||||||
|
src
|
||||||
|
) pluginInputs;
|
||||||
|
|
||||||
|
# The official plugin pack bundles multiple QML apps. Ship only the
|
||||||
|
# DankDesktopWeather subdir (verified by its manifest) to slim closure
|
||||||
|
# and avoid overlapping with future dedicated `dms-plugin-*` flakes.
|
||||||
|
thirdPartyPlugins =
|
||||||
|
builtins.removeAttrs camelMap [ "official" ] // {
|
||||||
|
dankDesktopWeather = inputs.dms-plugin-official + "/DankDesktopWeather";
|
||||||
|
};
|
||||||
|
|
||||||
|
# DMS reads plugins from ~/.config/DankMaterialShell/plugins/<id>/, so
|
||||||
|
# we route each plugin source there via HM's `xdg.configFile.target`.
|
||||||
|
# The attrset name is scoped under `dms-plugin-${id}` (not the bare
|
||||||
|
# camelCase id) so unrelated HM modules can ship a same-named file
|
||||||
|
# (e.g. `xdg.configFile.calculator`) without colliding with us.
|
||||||
|
shipPlugin = id: src: {
|
||||||
|
source = src;
|
||||||
|
target = "DankMaterialShell/plugins/${id}";
|
||||||
|
onChange = "${dmsRestartOnceScript}";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.dms.homeModules.dank-material-shell
|
||||||
|
inputs.nix-monitor.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
config = lib.mkIf dmsEnabled (lib.mkMerge [
|
||||||
|
(lib.mkIf (dmsOs.bundleThirdPartyPlugins or true) {
|
||||||
|
xdg.configFile = lib.mapAttrs' (id: src: lib.nameValuePair
|
||||||
|
"dms-plugin-${id}" (shipPlugin id src)) thirdPartyPlugins;
|
||||||
|
})
|
||||||
|
{
|
||||||
|
programs.nix-monitor = {
|
||||||
|
enable = true;
|
||||||
|
inherit rebuildCommand;
|
||||||
|
generationsCommand = [
|
||||||
|
"bash"
|
||||||
|
"-c"
|
||||||
|
"readlink /nix/var/nix/profiles/system | cut -d- -f2"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
kdePackages.qtdeclarative
|
||||||
|
kdePackages.kirigami.unwrapped
|
||||||
|
kdePackages.qtmultimedia
|
||||||
|
kdePackages.sonnet
|
||||||
|
tesseract
|
||||||
|
mpv
|
||||||
|
socat
|
||||||
|
wl-clipboard
|
||||||
|
jq
|
||||||
|
cava
|
||||||
|
curl
|
||||||
|
libsecret
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.dank-material-shell = {
|
||||||
|
enable = true;
|
||||||
|
package = inputs.dms.packages.${pkgs.stdenv.hostPlatform.system}.dms-shell.override {
|
||||||
|
extraQtPackages = with pkgs.kdePackages; [ qtwebsockets ];
|
||||||
|
};
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
restartIfChanged = true;
|
||||||
|
};
|
||||||
|
enableSystemMonitoring = true;
|
||||||
|
dgop.package = inputs.dgop.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
enableVPN = true;
|
||||||
|
enableDynamicTheming = true;
|
||||||
|
enableAudioWavelength = true;
|
||||||
|
enableCalendarEvents = false;
|
||||||
|
# Empty on purpose: DMS owns ~/.config/DankMaterialShell/{settings,session}.json
|
||||||
|
# at runtime (seeded by `home.activation.dmsSeedConfig`). Setting these
|
||||||
|
# to non-empty here would clobber the runtime seed on every activation.
|
||||||
|
settings = { };
|
||||||
|
session = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
# Surface bad obsidianVaults paths at build time instead of at first matugen run.
|
||||||
|
# Each entry must point at the `<vault>/.obsidian` dir (matugen writes
|
||||||
|
# `<vault>/.obsidian/snippets/matugen.css` from there).
|
||||||
|
assertions = lib.mkIf ((dmsOs.obsidianVaults or [ ]) != [ ]) [
|
||||||
|
{
|
||||||
|
assertion = builtins.all (v: lib.hasSuffix "/.obsidian" v) (dmsOs.obsidianVaults or [ ]);
|
||||||
|
message = "chiasson.desktop.shells.dms.obsidianVaults entries must end in '/.obsidian' (matugen writes <vault>/.obsidian/snippets/matugen.css). Example: /home/olivier/Documents/HomeLab/.obsidian";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
home.activation.dmsSeedConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] "${dmsSeedConfigScript}";
|
||||||
|
|
||||||
|
systemd.user.services.dms.serviceConfig.ExecStartPre =
|
||||||
|
lib.mkOrder 100 "${ensureMatugenOutputDirsScript}";
|
||||||
|
|
||||||
|
xdg.configFile."matugen/config.toml".text = matugenConfigText;
|
||||||
|
xdg.configFile."matugen/templates/dank-discord.css".source = ../templates/dank-discord.css;
|
||||||
|
xdg.configFile."matugen/templates/hyprland-colors.conf".source = ../templates/hyprland-colors.conf;
|
||||||
|
xdg.configFile."matugen/templates/ohmyposh-theme.omp.json".source = ../templates/ohmyposh-theme.omp.json;
|
||||||
|
xdg.configFile."matugen/templates/obsidian-minimal-matugen-colors.css".source =
|
||||||
|
../templates/obsidian-minimal-matugen-colors.css;
|
||||||
|
}
|
||||||
|
(lib.mkIf ohMyPoshEnabled {
|
||||||
|
programs.oh-my-posh = {
|
||||||
|
useTheme = lib.mkForce null;
|
||||||
|
configFile = lib.mkForce "${config.xdg.configHome}/oh-my-posh/theme.omp.json";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# Builds matugen config.toml text for DMS dynamic theming.
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
home,
|
||||||
|
hyprlandEnabled,
|
||||||
|
ohMyPoshEnabled,
|
||||||
|
discordEnabled,
|
||||||
|
obsidianSnippetDirs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
templateBlock = name: input: output: ''
|
||||||
|
|
||||||
|
[templates.${name}]
|
||||||
|
input_path = '${input}'
|
||||||
|
output_path = '${output}'
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
''
|
||||||
|
[config]
|
||||||
|
''
|
||||||
|
+ lib.optionalString hyprlandEnabled (
|
||||||
|
templateBlock "hyprland"
|
||||||
|
"${home}/.config/matugen/templates/hyprland-colors.conf"
|
||||||
|
"${home}/.config/hypr/colors.conf"
|
||||||
|
)
|
||||||
|
+ lib.optionalString ohMyPoshEnabled (
|
||||||
|
templateBlock "ohmyposh"
|
||||||
|
"${home}/.config/matugen/templates/ohmyposh-theme.omp.json"
|
||||||
|
"${home}/.config/oh-my-posh/theme.omp.json"
|
||||||
|
)
|
||||||
|
+ lib.optionalString discordEnabled (
|
||||||
|
templateBlock "dank-discord"
|
||||||
|
"${home}/.config/matugen/templates/dank-discord.css"
|
||||||
|
"${home}/.config/vesktop/themes/dank-discord.css"
|
||||||
|
)
|
||||||
|
+ lib.optionalString (obsidianSnippetDirs != [ ]) (
|
||||||
|
lib.concatStringsSep "\n" (
|
||||||
|
lib.lists.imap0 (i: snippetDir:
|
||||||
|
templateBlock "Obsidian${toString i}"
|
||||||
|
"${home}/.config/matugen/templates/obsidian-minimal-matugen-colors.css"
|
||||||
|
"${snippetDir}/matugen.css"
|
||||||
|
) obsidianSnippetDirs
|
||||||
|
)
|
||||||
|
)
|
||||||
+119
@@ -0,0 +1,119 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Sync live DMS config into modules/hosts/<host>/_private/dms-defaults/ (see defaultSeedDir).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $(basename "$0") [options] [host]
|
||||||
|
|
||||||
|
Copy ~/.config/DankMaterialShell/{settings,plugin_settings}.json into the
|
||||||
|
host seed directory (pretty-printed). Host defaults to this machine's hostname.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--settings-only Skip plugin_settings.json
|
||||||
|
-n, --dry-run Preview without writing
|
||||||
|
-h, --help
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
just sync-dms
|
||||||
|
$(basename "$0") --dry-run ideapad
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
find_repo_root() {
|
||||||
|
local dir="${1:-$PWD}"
|
||||||
|
while [[ "$dir" != "/" ]]; do
|
||||||
|
if [[ -f "$dir/flake.nix" && -d "$dir/modules/hosts" ]]; then
|
||||||
|
printf '%s\n' "$dir"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
dir="$(dirname "$dir")"
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve_host_module() {
|
||||||
|
local hn="$1" repo_root="$2"
|
||||||
|
local hosts_dir="${repo_root}/modules/hosts" dir name
|
||||||
|
|
||||||
|
if [[ -d "${hosts_dir}/${hn}/_private" ]]; then
|
||||||
|
printf '%s' "$hn"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in "${hosts_dir}"/*/; do
|
||||||
|
name="$(basename "$dir")"
|
||||||
|
[[ -f "${dir}configuration.nix" ]] \
|
||||||
|
&& grep -qF "hostName = \"${hn}\";" "${dir}configuration.nix" \
|
||||||
|
&& { printf '%s' "$name"; return 0; }
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "error: no host module for hostname '${hn}' (pass module name explicitly)" >&2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
sync_json() {
|
||||||
|
local source="$1" dest="$2" label="$3"
|
||||||
|
|
||||||
|
[[ -f "$source" ]] || { echo "skip: $label not found" >&2; return 0; }
|
||||||
|
|
||||||
|
jq empty "$source"
|
||||||
|
if [[ "$DRY_RUN" -eq 1 ]]; then
|
||||||
|
echo " $source -> $dest"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local tmp
|
||||||
|
tmp="$(mktemp)"
|
||||||
|
jq . "$source" >"$tmp"
|
||||||
|
mv "$tmp" "$dest"
|
||||||
|
echo "Updated $dest"
|
||||||
|
UPDATED+=("$dest")
|
||||||
|
}
|
||||||
|
|
||||||
|
DRY_RUN=0
|
||||||
|
SETTINGS_ONLY=0
|
||||||
|
HOST=""
|
||||||
|
UPDATED=()
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
-n | --dry-run) DRY_RUN=1; shift ;;
|
||||||
|
--settings-only) SETTINGS_ONLY=1; shift ;;
|
||||||
|
-h | --help) usage; exit 0 ;;
|
||||||
|
-*) echo "error: unknown option: $1" >&2; usage >&2; exit 1 ;;
|
||||||
|
*) HOST="$1"; shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
REPO_ROOT="${CHIASSON_NIX_ROOT:-$(find_repo_root "$PWD" || true)}"
|
||||||
|
[[ -n "$REPO_ROOT" ]] || { echo "error: run from chiasson-nix repo root" >&2; exit 1; }
|
||||||
|
command -v jq >/dev/null || { echo "error: jq required" >&2; exit 1; }
|
||||||
|
|
||||||
|
if [[ -z "$HOST" ]]; then
|
||||||
|
SYSTEM_HOSTNAME="$(hostname -s 2>/dev/null || hostname)"
|
||||||
|
HOST="$(resolve_host_module "$SYSTEM_HOSTNAME" "$REPO_ROOT")"
|
||||||
|
[[ "$HOST" == "$SYSTEM_HOSTNAME" ]] \
|
||||||
|
&& echo "Using host module: $HOST" \
|
||||||
|
|| echo "Using host module: $HOST (hostname: $SYSTEM_HOSTNAME)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
HOST_PRIVATE="${REPO_ROOT}/modules/hosts/${HOST}/_private"
|
||||||
|
SEED_DIR="${HOST_PRIVATE}/dms-defaults"
|
||||||
|
DMS_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/DankMaterialShell"
|
||||||
|
|
||||||
|
[[ -d "$HOST_PRIVATE" ]] || { echo "error: missing $HOST_PRIVATE" >&2; exit 1; }
|
||||||
|
[[ -f "${DMS_CONFIG}/settings.json" ]] || {
|
||||||
|
echo "error: missing ${DMS_CONFIG}/settings.json" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ "$DRY_RUN" -eq 1 ]] && echo "Would sync into $SEED_DIR:"
|
||||||
|
[[ "$DRY_RUN" -eq 0 ]] && mkdir -p "$SEED_DIR"
|
||||||
|
|
||||||
|
sync_json "${DMS_CONFIG}/settings.json" "${SEED_DIR}/settings.json" settings.json
|
||||||
|
[[ "$SETTINGS_ONLY" -eq 0 ]] \
|
||||||
|
&& sync_json "${DMS_CONFIG}/plugin_settings.json" "${SEED_DIR}/plugin_settings.json" plugin_settings.json
|
||||||
|
|
||||||
|
[[ "$DRY_RUN" -eq 1 || ${#UPDATED[@]} -eq 0 ]] && exit 0
|
||||||
|
git -C "$REPO_ROOT" diff --stat -- "${UPDATED[@]}" 2>/dev/null || true
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ inputs, ... }: {
|
{ ... }: {
|
||||||
flake.nixosModules.desktopShellDmsOptions = { lib, ... }: {
|
flake.nixosModules.desktopShellDmsOptions = { lib, ... }: {
|
||||||
options.chiasson.desktop.shells.dms = {
|
options.chiasson.desktop.shells.dms = {
|
||||||
enableGpuTemp = lib.mkOption {
|
enableGpuTemp = lib.mkOption {
|
||||||
@@ -6,95 +6,65 @@
|
|||||||
default = true;
|
default = true;
|
||||||
description = "GPU temp in DMS bar.";
|
description = "GPU temp in DMS bar.";
|
||||||
};
|
};
|
||||||
obsidianSnippetsDir = lib.mkOption {
|
obsidianVaults = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
description = "Legacy single Obsidian snippets dir for matugen.";
|
|
||||||
};
|
|
||||||
obsidianConfigDirs = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
description = "Vault `.obsidian/` paths for matugen.";
|
example = [ "/mnt/zimaos/Obsidian/Home/.obsidian" ];
|
||||||
};
|
description = "Vault `.obsidian/` dirs; matugen writes `<vault>/snippets/matugen.css`.";
|
||||||
obsidianSnippetsDirs = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = "Explicit `.obsidian/snippets` paths.";
|
|
||||||
};
|
};
|
||||||
extraRightBarWidgets = lib.mkOption {
|
extraRightBarWidgets = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
description = "Extra right-bar widgets merged into the first-run DMS settings seed.";
|
description = "Extra right-bar widgets merged into the first-run DMS settings seed.";
|
||||||
};
|
};
|
||||||
enableWvkbdToggle = lib.mkEnableOption ''
|
|
||||||
wvkbd DMS plugin + bar toggle (touch / uConsole).
|
|
||||||
'';
|
|
||||||
enableRbwLockToggle = lib.mkEnableOption ''
|
|
||||||
rbw vault lock/unlock button in the DMS bar (Bitwarden CLI via rbw).
|
|
||||||
'';
|
|
||||||
rebuildCommand = lib.mkOption {
|
rebuildCommand = lib.mkOption {
|
||||||
type = lib.types.nullOr (lib.types.listOf lib.types.str);
|
type = lib.types.nullOr (lib.types.listOf lib.types.str);
|
||||||
default = null;
|
default = null;
|
||||||
example = [ "sudo" "nixos-rebuild" "switch" "--flake" ".#14900k" ];
|
example = [ "sudo" "nixos-rebuild" "switch" "--flake" ".#14900k" ];
|
||||||
description = "Command used by DMS nix-monitor widget for rebuild actions.";
|
description = "Command used by DMS nix-monitor widget for rebuild actions.";
|
||||||
};
|
};
|
||||||
defaultSettingsFile = lib.mkOption {
|
defaultSeedDir = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
default = null;
|
default = null;
|
||||||
example = ./dms-default-settings.json;
|
example = ./dms-defaults;
|
||||||
description = ''
|
description = ''
|
||||||
Host-specific first-run `settings.json` seed. When set, replaces the bundled
|
Host-specific first-run DMS config seed directory. When set, copies
|
||||||
`default-settings.nix` template on fresh profiles.
|
`settings.json` (required) and `plugin_settings.json` (optional) from this
|
||||||
|
directory into `~/.config/DankMaterialShell/` on fresh profiles.
|
||||||
|
Replaces the bundled `default-settings.nix` template for `settings.json`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
bundleThirdPartyPlugins = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Install bundled DMS plugins from flake inputs (third-party + chiasson).
|
||||||
|
Disable individual plugins in DMS settings; set this to false to skip all bundled plugins.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeManagerModules.desktopShellDms = {
|
flake.homeManagerModules.desktopShellDms = import ./_private/hm.nix;
|
||||||
lib,
|
|
||||||
osConfig ? { },
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = lib.attrByPath [ "chiasson" "desktop" "shells" "dms" ] { } osConfig;
|
|
||||||
selectedShell = lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig;
|
|
||||||
dmsEnabled = selectedShell == "dms";
|
|
||||||
hostName = lib.attrByPath [ "networking" "hostName" ] "nixos" osConfig;
|
|
||||||
rebuildCommand =
|
|
||||||
if (cfg.rebuildCommand or null) != null then
|
|
||||||
cfg.rebuildCommand
|
|
||||||
else
|
|
||||||
[ "sudo" "nixos-rebuild" "switch" "--flake" ".#${hostName}" ];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./home-manager/default.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
config = lib.mkIf dmsEnabled {
|
# DMS IPC commands shared between Niri and Hyprland keybind tables.
|
||||||
dms.enable = true;
|
# Defines flake.lib.dmsIpcBinds so each compositor formats the same
|
||||||
dms.enableGpuTemp = cfg.enableGpuTemp or true;
|
# command string in its native shape — Niri attrs vs Hyprland string-list.
|
||||||
dms.obsidianSnippetsDir = cfg.obsidianSnippetsDir or null;
|
# Adding a new DMS keybind requires editing this file plus the
|
||||||
dms.obsidianConfigDirs = cfg.obsidianConfigDirs or [ ];
|
# per-compositor bind layout, not the command string.
|
||||||
dms.obsidianSnippetsDirs = cfg.obsidianSnippetsDirs or [ ];
|
flake.lib.dmsIpcBinds = {
|
||||||
dms.enableWvkbdToggle = cfg.enableWvkbdToggle or false;
|
spotlight = "dms ipc call spotlight toggle";
|
||||||
dms.enableRbwLockToggle = cfg.enableRbwLockToggle or false;
|
clipboard = "dms ipc call clipboard toggle";
|
||||||
dms.extraRightBarWidgets =
|
notepad = "dms ipc call notepad toggle";
|
||||||
(lib.optionals (cfg.enableWvkbdToggle or false) [
|
notifications = "dms ipc call notifications toggle";
|
||||||
{
|
processlist = "dms ipc call processlist toggle";
|
||||||
id = "wvkbdToggle";
|
# Hyprland prefers focusOrToggle (window-aware); niri subscribes to toggle.
|
||||||
enabled = true;
|
processlistFocus = "dms ipc call processlist focusOrToggle";
|
||||||
}
|
settingsFocus = "dms ipc call settings focusOrToggle";
|
||||||
])
|
barToggle = ''dms ipc call bar toggle name "Main Bar"; dms ipc call bar toggle name "Bar 2"'';
|
||||||
++ (lib.optionals (cfg.enableRbwLockToggle or false) [
|
barToggleBar2 = ''dms ipc call bar toggle name "Bar 2"'';
|
||||||
{
|
ephemera = "dms ipc call ephemera toggle";
|
||||||
id = "rbwLockToggle";
|
wallpaperCarousel = "dms ipc call wallpaperCarousel toggle";
|
||||||
enabled = true;
|
lock = "dms ipc call lock lock";
|
||||||
}
|
|
||||||
])
|
|
||||||
++ (cfg.extraRightBarWidgets or [ ]);
|
|
||||||
programs.nix-monitor.rebuildCommand = rebuildCommand;
|
|
||||||
dms.defaultSettingsFile = cfg.defaultSettingsFile or null;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,725 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
osConfig ? { },
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
home = config.home.homeDirectory;
|
|
||||||
cfg = config.dms;
|
|
||||||
gpuTempEnabled = cfg.enableGpuTemp;
|
|
||||||
hyprlandEnabled = lib.attrByPath [ "chiasson" "desktop" "hyprland" "enable" ] false osConfig;
|
|
||||||
discordEnabled = lib.attrByPath [ "chiasson" "home" "apps" "discord" "enable" ] false config;
|
|
||||||
ohMyPoshEnabled = config.programs.oh-my-posh.enable or false;
|
|
||||||
matugenOutputDirs =
|
|
||||||
lib.optionals hyprlandEnabled [ "${home}/.config/hypr" ]
|
|
||||||
++ lib.optionals ohMyPoshEnabled [ "${home}/.config/oh-my-posh" ]
|
|
||||||
++ lib.optionals discordEnabled [ "${home}/.config/vesktop/themes" ]
|
|
||||||
++ [
|
|
||||||
"${home}/.config/qt6ct/colors"
|
|
||||||
"${home}/.config/qt5ct/colors"
|
|
||||||
];
|
|
||||||
ensureMatugenOutputDirsScript = pkgs.writeShellScript "dms-ensure-matugen-output-dirs" ''
|
|
||||||
set -euo pipefail
|
|
||||||
${lib.concatStringsSep "\n" (map (dir: "mkdir -p ${lib.escapeShellArg dir}") matugenOutputDirs)}
|
|
||||||
${lib.optionalString ohMyPoshEnabled ''
|
|
||||||
dest="$HOME/.config/oh-my-posh/theme.omp.json"
|
|
||||||
template="$HOME/.config/matugen/templates/ohmyposh-theme.omp.json"
|
|
||||||
# matugen writes output_path in place; HM symlinks into the store are read-only and go stale.
|
|
||||||
if [ -L "$dest" ] || { [ -e "$dest" ] && ! [ -f "$dest" ]; }; then
|
|
||||||
rm -f "$dest"
|
|
||||||
fi
|
|
||||||
if [ ! -f "$dest" ]; then
|
|
||||||
# Seed from our matugen template (same generation closure), not programs.oh-my-posh.package
|
|
||||||
# which can reference a GC'd store path after profile churn.
|
|
||||||
cp -L "$template" "$dest"
|
|
||||||
fi
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
obsidianSnippetsDir = cfg.obsidianSnippetsDir; # legacy single path
|
|
||||||
obsidianSnippetDirs =
|
|
||||||
let
|
|
||||||
snippetsFromConfigDirs = map (d: "${d}/snippets") cfg.obsidianConfigDirs;
|
|
||||||
explicitSnippetsDirs =
|
|
||||||
cfg.obsidianSnippetsDirs
|
|
||||||
++ lib.optionals (obsidianSnippetsDir != null) [obsidianSnippetsDir];
|
|
||||||
in
|
|
||||||
lib.unique (snippetsFromConfigDirs ++ explicitSnippetsDirs);
|
|
||||||
|
|
||||||
# Clears Quickshell QML bytecode cache so bar plugins reload (stale *.qmlc keeps old UI).
|
|
||||||
dmsRestartOnceScript = pkgs.writeShellScript "dms-rbw-plugin-restart-once" ''
|
|
||||||
set -euo pipefail
|
|
||||||
rt="''${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
|
|
||||||
exec 9>"$rt/dms-rbw-plugin-restart.lock"
|
|
||||||
${pkgs.util-linux}/bin/flock -n 9 || exit 0
|
|
||||||
cache="''${XDG_CACHE_HOME:-''$HOME/.cache}/quickshell/qmlcache"
|
|
||||||
rm -rf "$cache"
|
|
||||||
${pkgs.systemd}/bin/systemctl --user try-restart dms.service 2>/dev/null || true
|
|
||||||
'';
|
|
||||||
|
|
||||||
jsonFormat = pkgs.formats.json { };
|
|
||||||
dmsSeedSettings =
|
|
||||||
if cfg.defaultSettingsFile != null then
|
|
||||||
builtins.fromJSON (builtins.readFile cfg.defaultSettingsFile)
|
|
||||||
else
|
|
||||||
import ../_private/default-settings.nix {
|
|
||||||
inherit lib gpuTempEnabled;
|
|
||||||
extraRightBarWidgets = cfg.extraRightBarWidgets;
|
|
||||||
};
|
|
||||||
dmsSeedFile = jsonFormat.generate "dms-settings-seed.json" dmsSeedSettings;
|
|
||||||
dmsSettingsPath = "${config.xdg.configHome}/DankMaterialShell/settings.json";
|
|
||||||
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
dms.enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "DMS Home Manager config from this flake.";
|
|
||||||
};
|
|
||||||
|
|
||||||
dms.enableGpuTemp = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "GPU temp widget in the bar.";
|
|
||||||
};
|
|
||||||
|
|
||||||
# <vault>/.obsidian/snippets — unset skips Obsidian matugen output
|
|
||||||
dms.obsidianSnippetsDir = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
example = "/home/olivier/Documents/Notes/.obsidian/snippets";
|
|
||||||
description = "Snippet dir for `matugen.css` (legacy; prefer `obsidianConfigDirs`).";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Each path is a vault’s `.obsidian/` — we write `<path>/snippets/matugen.css`.
|
|
||||||
dms.obsidianConfigDirs = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"/mnt/zimaos/Obsidian/Home/.obsidian"
|
|
||||||
];
|
|
||||||
description = "Vault `.obsidian` dirs for matugen CSS.";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Or pass `.obsidian/snippets` paths yourself.
|
|
||||||
dms.obsidianSnippetsDirs = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"/mnt/zimaos/Obsidian/Home/.obsidian/snippets"
|
|
||||||
];
|
|
||||||
description = "Explicit snippet directories for matugen CSS.";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Prepended to the bar’s rightWidgets (shows first).
|
|
||||||
dms.extraRightBarWidgets = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.attrs;
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
{ id = "wvkbdToggle"; enabled = true; }
|
|
||||||
{ id = "rbwLockToggle"; enabled = true; }
|
|
||||||
];
|
|
||||||
description = "Extra `{ id, enabled, … }` widgets merged into the first-run settings seed.";
|
|
||||||
};
|
|
||||||
|
|
||||||
dms.enableWvkbdToggle = lib.mkEnableOption ''
|
|
||||||
Ship wvkbd-toggle plugin into `~/.config/DankMaterialShell/plugins/` (toggle from NixOS `desktop.shells.dms`).
|
|
||||||
'';
|
|
||||||
|
|
||||||
dms.enableRbwLockToggle = lib.mkEnableOption ''
|
|
||||||
Ship rbw-lock-toggle into `~/.config/DankMaterialShell/plugins/rbwLockToggle/` (directory name matches plugin id; Bitwarden vault lock/unlock in the bar).
|
|
||||||
'';
|
|
||||||
|
|
||||||
dms.defaultSettingsFile = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.path;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Host-specific first-run `settings.json` seed. When set, replaces the bundled
|
|
||||||
`default-settings.nix` template on fresh profiles.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
inputs.dms.homeModules.dank-material-shell
|
|
||||||
inputs.nix-monitor.homeManagerModules.default
|
|
||||||
];
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
||||||
(lib.mkIf cfg.enableWvkbdToggle {
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/wvkbd-toggle/plugin.json".source =
|
|
||||||
../plugins/wvkbd-toggle/plugin.json;
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/wvkbd-toggle/WvkbdToggle.qml".source =
|
|
||||||
../plugins/wvkbd-toggle/WvkbdToggle.qml;
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/wvkbd-toggle/WvkbdToggleSettings.qml".source =
|
|
||||||
../plugins/wvkbd-toggle/WvkbdToggleSettings.qml;
|
|
||||||
})
|
|
||||||
(lib.mkIf cfg.enableRbwLockToggle {
|
|
||||||
# Directory name matches plugin id (same idea as NixMonitor / ideapad wvkbdToggle).
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/rbwLockToggle/plugin.json" = {
|
|
||||||
source = ../plugins/rbw-lock-toggle/plugin.json;
|
|
||||||
onChange = "${dmsRestartOnceScript}";
|
|
||||||
};
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/rbwLockToggle/RbwLockToggleSettings.qml" = {
|
|
||||||
source = ../plugins/rbw-lock-toggle/RbwLockToggleSettings.qml;
|
|
||||||
onChange = "${dmsRestartOnceScript}";
|
|
||||||
};
|
|
||||||
xdg.configFile."DankMaterialShell/plugins/rbwLockToggle/RbwLockToggle.qml" = {
|
|
||||||
source = ../plugins/rbw-lock-toggle/RbwLockToggle.qml;
|
|
||||||
onChange = "${dmsRestartOnceScript}";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
{
|
|
||||||
|
|
||||||
# Nix rebuild widget used by DankMaterialShell (via nix-monitor).
|
|
||||||
# Per-host `rebuildCommand` is set in `modules/hosts/<host>/configuration.nix` (`chiasson.desktop.shells.dms`).
|
|
||||||
programs.nix-monitor = {
|
|
||||||
enable = true;
|
|
||||||
generationsCommand = [
|
|
||||||
"bash"
|
|
||||||
"-c"
|
|
||||||
"readlink /nix/var/nix/profiles/system | cut -d- -f2"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
kdePackages.qtdeclarative
|
|
||||||
kdePackages.kirigami.unwrapped
|
|
||||||
kdePackages.qtmultimedia
|
|
||||||
kdePackages.sonnet
|
|
||||||
];
|
|
||||||
programs.dank-material-shell = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# homeAssistantMonitor plugin (QtWebSockets) needs QML on DMS's import path, not just home.packages.
|
|
||||||
package = inputs.dms.packages.${pkgs.stdenv.hostPlatform.system}.dms-shell.override {
|
|
||||||
extraQtPackages = with pkgs.kdePackages; [ qtwebsockets ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd = {
|
|
||||||
enable = true; # Systemd service for auto-start
|
|
||||||
restartIfChanged = true; # Auto-restart dms.service when dankMaterialShell changes
|
|
||||||
};
|
|
||||||
|
|
||||||
# Core features
|
|
||||||
enableSystemMonitoring = true; # System monitoring widgets (dgop)
|
|
||||||
dgop.package = inputs.dgop.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
enableVPN = true; # VPN management widget
|
|
||||||
enableDynamicTheming = true; # Wallpaper-based theming (matugen)
|
|
||||||
enableAudioWavelength = true; # Audio visualizer (cava)
|
|
||||||
enableCalendarEvents = false; # Disable calendar integration (khal/ikhal)
|
|
||||||
|
|
||||||
# Leave `session` at {} — non-empty makes HM rewrite session.json every switch and nukes wallpaper/session state.
|
|
||||||
# Leave `settings` at {} — UI-owned settings.json is seeded once on first run (see home.activation below).
|
|
||||||
settings = { };
|
|
||||||
session = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
# Detach store symlink so UI edits survive rebuilds; seed defaults only on a fresh profile.
|
|
||||||
home.activation.dmsMaterializeSettings = lib.hm.dag.entryBefore [ "writeBoundary" ] ''
|
|
||||||
settingsFile=${lib.escapeShellArg dmsSettingsPath}
|
|
||||||
if [ -L "$settingsFile" ]; then
|
|
||||||
mkdir -p "$(dirname "$settingsFile")"
|
|
||||||
${pkgs.coreutils}/bin/cp --remove-destination -L "$settingsFile" "$settingsFile"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
home.activation.dmsSeedSettings = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
||||||
settingsFile=${lib.escapeShellArg dmsSettingsPath}
|
|
||||||
mkdir -p "$(dirname "$settingsFile")"
|
|
||||||
if [ ! -e "$settingsFile" ]; then
|
|
||||||
${pkgs.coreutils}/bin/cp ${lib.escapeShellArg dmsSeedFile} "$settingsFile"
|
|
||||||
chmod u+w "$settingsFile"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
# matugen won't create missing output_path parents; run before DMS theme generation.
|
|
||||||
systemd.user.services.dms.serviceConfig.ExecStartPre =
|
|
||||||
lib.mkOrder 100 "${ensureMatugenOutputDirsScript}";
|
|
||||||
|
|
||||||
# DMS / matugen custom templates.
|
|
||||||
#
|
|
||||||
# DMS docs (custom templates): https://danklinux.com/docs/dankmaterialshell/application-themes#custom-matugen-templates
|
|
||||||
xdg.configFile."matugen/config.toml".text =
|
|
||||||
''
|
|
||||||
[config]
|
|
||||||
''
|
|
||||||
+ lib.optionalString hyprlandEnabled ''
|
|
||||||
[templates.hyprland]
|
|
||||||
input_path = '${home}/.config/matugen/templates/hyprland-colors.conf'
|
|
||||||
output_path = '${home}/.config/hypr/colors.conf'
|
|
||||||
''
|
|
||||||
+ lib.optionalString ohMyPoshEnabled ''
|
|
||||||
|
|
||||||
[templates.ohmyposh]
|
|
||||||
input_path = '${home}/.config/matugen/templates/ohmyposh-theme.omp.json'
|
|
||||||
output_path = '${home}/.config/oh-my-posh/theme.omp.json'
|
|
||||||
''
|
|
||||||
+ lib.optionalString discordEnabled ''
|
|
||||||
|
|
||||||
[templates.dank-discord]
|
|
||||||
input_path = '${home}/.config/matugen/templates/dank-discord.css'
|
|
||||||
output_path = '${home}/.config/vesktop/themes/dank-discord.css'
|
|
||||||
''
|
|
||||||
+ lib.optionalString (obsidianSnippetDirs != []) (
|
|
||||||
lib.concatStringsSep "\n" (
|
|
||||||
lib.lists.imap0 (i: snippetDir: ''
|
|
||||||
|
|
||||||
[templates.Obsidian${toString i}]
|
|
||||||
input_path = '${home}/.config/matugen/templates/obsidian-minimal-matugen-colors.css'
|
|
||||||
output_path = '${snippetDir}/matugen.css'
|
|
||||||
'') obsidianSnippetDirs
|
|
||||||
)
|
|
||||||
)
|
|
||||||
;
|
|
||||||
|
|
||||||
# Obsidian snippet dirs for matugen: mkdir here instead of tmpfiles (no chmod fights on weird mounts).
|
|
||||||
home.activation.dmsEnsureObsidianSnippetDirs = lib.hm.dag.entryAfter ["writeBoundary"] (
|
|
||||||
let
|
|
||||||
snippetDirs = lib.unique obsidianSnippetDirs;
|
|
||||||
escapedSnippetDirs = map lib.escapeShellArg snippetDirs;
|
|
||||||
in
|
|
||||||
''
|
|
||||||
for snippetDir in ${lib.concatStringsSep " " escapedSnippetDirs}; do
|
|
||||||
parentDir="$(dirname "$snippetDir")"
|
|
||||||
|
|
||||||
if [ -d "$snippetDir" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "$parentDir" ] || [ ! -w "$parentDir" ]; then
|
|
||||||
echo "dms: skipping Obsidian snippet dir '$snippetDir' (parent missing or not writable)" >&2
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$snippetDir"
|
|
||||||
done
|
|
||||||
''
|
|
||||||
);
|
|
||||||
|
|
||||||
xdg.configFile."matugen/templates/dank-discord.css".source = ../templates/dank-discord.css;
|
|
||||||
|
|
||||||
# matugen template → Hyprland colors file sourced at runtime.
|
|
||||||
# Your Hyprland module includes: `source = ~/.config/hypr/colors.conf`
|
|
||||||
# (see `modules/desktop/hyprland/home-manager/appearance.nix`).
|
|
||||||
xdg.configFile."matugen/templates/hyprland-colors.conf".text = ''
|
|
||||||
# Hyprland colors generated by DMS/matugen
|
|
||||||
# Keep `.default` so DMS can swap to `.dark` when "Always use Dark Theme" is enabled.
|
|
||||||
|
|
||||||
general {
|
|
||||||
col.active_border = rgb({{colors.primary.default.hex_stripped}}) rgb({{colors.secondary.default.hex_stripped}}) rgb({{colors.tertiary.default.hex_stripped}})
|
|
||||||
col.inactive_border = rgba({{colors.surface_variant.default.hex_stripped}}ee)
|
|
||||||
}
|
|
||||||
|
|
||||||
decoration {
|
|
||||||
shadow {
|
|
||||||
color = rgba({{colors.shadow.default.hex_stripped}}cc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Hyprbars colors
|
|
||||||
plugin {
|
|
||||||
hyprbars {
|
|
||||||
bar_color = rgba({{colors.surface.default.hex_stripped}}ff)
|
|
||||||
col.text = rgba({{colors.on_surface.default.hex_stripped}}ff)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# matugen → Oh My Posh JSON; hex in the base theme swapped for matugen tokens.
|
|
||||||
xdg.configFile."matugen/templates/ohmyposh-theme.omp.json".text = ''
|
|
||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
|
||||||
"blocks": [
|
|
||||||
{
|
|
||||||
"alignment": "left",
|
|
||||||
"segments": [
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#ffbebc",
|
|
||||||
"leading_diamond": "\ue0b6",
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\u007B\u007B .UserName \u007D\u007D@\u007B\u007B .HostName \u007D\u007D <#ffffff>on</>",
|
|
||||||
"type": "session"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "os",
|
|
||||||
"style": "diamond",
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#ffffff",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"template": " \u007B\u007B .Icon \u007D\u007D "
|
|
||||||
},
|
|
||||||
{"type": "session",
|
|
||||||
"style": "diamond",
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#ffbebc",
|
|
||||||
"template": "\u007B\u007B if .SSHSession \u007D\u007Dvia SSH\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "session"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"style": "diamond",
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#ffbebc",
|
|
||||||
"template": "\u007B\u007B if .Env.IN_NIX_SHELL \u007D\u007Din nix-shell\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#bc93ff",
|
|
||||||
"leading_diamond": "\ue0b6",
|
|
||||||
"properties": {
|
|
||||||
"time_format": "Monday <#ffffff>at</> 3:04 PM"
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"template": "\u007B\u007B .CurrentDate | date .Format \u007D\u007D",
|
|
||||||
"type": "time"
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#43CCEA",
|
|
||||||
"foreground_templates": [
|
|
||||||
"\u007B\u007B if or (.Working.Changed) (.Staging.Changed) \u007D\u007D#FF9248\u007B\u007B end \u007D\u007D",
|
|
||||||
"\u007B\u007B if and (gt .Ahead 0) (gt .Behind 0) \u007D\u007D#ff4500\u007B\u007B end \u007D\u007D",
|
|
||||||
"\u007B\u007B if gt .Ahead 0 \u007D\u007D#B388FF\u007B\u007B end \u007D\u007D",
|
|
||||||
"\u007B\u007B if gt .Behind 0 \u007D\u007D#B388FF\u007B\u007B end \u007D\u007D"
|
|
||||||
],
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"branch_template": "\u007B\u007B trunc 25 .Branch \u007D\u007D",
|
|
||||||
"fetch_status": true,
|
|
||||||
"fetch_upstream_icon": true
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": " \u007B\u007B .UpstreamIcon \u007D\u007D\u007B\u007B .HEAD \u007D\u007D\u007B\u007Bif .BranchStatus \u007D\u007D \u007B\u007B .BranchStatus \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if .Working.Changed \u007D\u007D \uf044 \u007B\u007B .Working.String \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if and (.Working.Changed) (.Staging.Changed) \u007D\u007D |\u007B\u007B end \u007D\u007D\u007B\u007B if .Staging.Changed \u007D\u007D \uf046 \u007B\u007B .Staging.String \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if gt .StashCount 0 \u007D\u007D \ueb4b \u007B\u007B .StashCount \u007D\u007D\u007B\u007B end \u007D\u007D ",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "git"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#E4F34A",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue235 \u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B if .Venv \u007D\u007D\u007B\u007B .Venv \u007D\u007D \u007B\u007B end \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "python"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#7FD5EA",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue626\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "go"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#42E66C",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue718\u007B\u007B if .PackageManagerIcon \u007D\u007D\u007B\u007B .PackageManagerIcon \u007D\u007D \u007B\u007B end \u007D\u007D\u007B\u007B .Full \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "node"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#E64747",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue791\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "ruby"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#E64747",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue738\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "java"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#9B6BDF",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue624\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D ",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "julia"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "php",
|
|
||||||
"style": "diamond",
|
|
||||||
"foreground": "#ffffff",
|
|
||||||
"background": "#4063D8",
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"fetch_version": false
|
|
||||||
},
|
|
||||||
"template": "\ue73d \u007B\u007B .Full \u007D\u007D ",
|
|
||||||
"trailing_diamond": "\ue0b4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#9B6BDF",
|
|
||||||
"foreground_templates": [
|
|
||||||
"\u007B\u007Bif eq \"Charging\" .State.String\u007D\u007D#40c4ff\u007B\u007Bend\u007D\u007D",
|
|
||||||
"\u007B\u007Bif eq \"Discharging\" .State.String\u007D\u007D#ff5722\u007B\u007Bend\u007D\u007D",
|
|
||||||
"\u007B\u007Bif eq \"Full\" .State.String\u007D\u007D#4caf50\u007B\u007Bend\u007D\u007D"
|
|
||||||
],
|
|
||||||
"leading_diamond": " \ue0b6",
|
|
||||||
"options": {
|
|
||||||
"charged_icon": " ",
|
|
||||||
"charging_icon": "\u21e1 ",
|
|
||||||
"discharging_icon": "\u21e3 "
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\u007B\u007B if not .Error \u007D\u007D\u007B\u007B .Icon \u007D\u007D\u007B\u007B .Percentage \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B .Error \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "battery"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "prompt"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alignment": "right",
|
|
||||||
"segments": [
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#AEA4BF",
|
|
||||||
"leading_diamond": "\ue0b6",
|
|
||||||
"options": {
|
|
||||||
"style": "austin",
|
|
||||||
"threshold": 150
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\u007B\u007B .FormattedMs \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4 ",
|
|
||||||
"type": "executiontime"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "prompt"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alignment": "left",
|
|
||||||
"newline": true,
|
|
||||||
"segments": [
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#3EC669",
|
|
||||||
"leading_diamond": "\ue0b6",
|
|
||||||
"properties": {
|
|
||||||
"style": "agnoster_full",
|
|
||||||
"cycle": [
|
|
||||||
"#3EC669,#3A456E",
|
|
||||||
"#43CCEA,#3A456E",
|
|
||||||
"#E4F34A,#3A456E",
|
|
||||||
"#9B6BDF,#3A456E"
|
|
||||||
],
|
|
||||||
"cycle_folder_separator": true
|
|
||||||
},
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue5ff \u007B\u007B .Path \u007D\u007D",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "path"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"background": "#3A456E",
|
|
||||||
"foreground": "#ffbebc",
|
|
||||||
"leading_diamond": "\ue0b6",
|
|
||||||
"style": "diamond",
|
|
||||||
"template": "\ue602",
|
|
||||||
"trailing_diamond": "\ue0b4",
|
|
||||||
"type": "text"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "prompt"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"final_space": true,
|
|
||||||
"version": 4
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# matugen template → Obsidian CSS snippet (Minimal-compatible variables).
|
|
||||||
#
|
|
||||||
# Upstream template:
|
|
||||||
# https://raw.githubusercontent.com/Simorg2002/obsidian-matugen-template/refs/heads/main/obsidian-minimal-matugen-colors.css
|
|
||||||
xdg.configFile."matugen/templates/obsidian-minimal-matugen-colors.css".text = ''
|
|
||||||
.theme-dark {
|
|
||||||
--accent-h:calc({{colors.primary.dark.hue}}/255*360);
|
|
||||||
--accent-s:calc({{colors.primary.dark.saturation}}/255*100%);
|
|
||||||
--accent-l:calc({{colors.primary.dark.lightness}}/255*100%);
|
|
||||||
|
|
||||||
--text-normal:{{colors.on_surface.dark.hex}};
|
|
||||||
--text-muted:{{colors.on_surface_variant.dark.hex}};
|
|
||||||
--text-faint:{{colors.outline.dark.hex}};
|
|
||||||
|
|
||||||
--background-primary:{{colors.surface.dark.hex}}; /* editor and right ribbon */
|
|
||||||
--background-secondary:{{colors.surface_dim.dark.hex}}; /* left ribbon */
|
|
||||||
--background-modifier-hover:{{colors.secondary_container.dark.hex}};
|
|
||||||
--background-modifier-active-hover:{{colors.secondary.dark.hex}};
|
|
||||||
--background-modifier-message:{{colors.surface_dim.dark.hex}};
|
|
||||||
--background-modifier-form-field:{{colors.primary_container.dark.hex}};
|
|
||||||
|
|
||||||
--ribbon-background:{{colors.surface.dark.hex}};
|
|
||||||
--divider-color:{{colors.secondary_container.dark.hex}};
|
|
||||||
--scrollbar-thumb-bg:{{colors.on_secondary_container.dark.hex}};
|
|
||||||
--status-bar-border-color:{{colors.secondary_container.dark.hex}};
|
|
||||||
--status-bar-background:{{colors.surface.dark.hex}};
|
|
||||||
--titlebar-background:{{colors.surface.dark.hex}};
|
|
||||||
--titlebar-text-color:{{colors.on_surface.dark.hex}};
|
|
||||||
|
|
||||||
--nav-item-color:{{colors.on_surface_variant.dark.hex}};
|
|
||||||
--nav-item-color-active:{{colors.on_primary_container.dark.hex}};
|
|
||||||
--nav-item-background-active:{{colors.primary_container.dark.hex}};
|
|
||||||
--nav-item-color-hover:{{colors.on_secondary_container.dark.hex}};
|
|
||||||
--nav-item-background-hover:{{colors.secondary_container.dark.hex}};
|
|
||||||
|
|
||||||
--tab-background-active:{{colors.primary_container.dark.hex}};
|
|
||||||
--tab-text-color-active:{{colors.on_primary_container.dark.hex}};
|
|
||||||
--tab-text-color:{{colors.on_surface_variant.dark.hex}};
|
|
||||||
|
|
||||||
--icon-color:{{colors.on_surface.dark.hex}};
|
|
||||||
|
|
||||||
--h1-color:{{colors.primary.dark.hex}};
|
|
||||||
--h2-color: color-mix(in srgb, {{colors.primary.dark.hex}}, {{colors.tertiary.dark.hex}});
|
|
||||||
--h3-color:{{colors.tertiary.dark.hex}};
|
|
||||||
--h4-color: color-mix(in srgb, {{colors.primary.dark.hex}}, {{colors.secondary.dark.hex}});
|
|
||||||
--h5-color:{{colors.secondary.dark.hex}};
|
|
||||||
--h6-color: color-mix(in srgb, {{colors.tertiary.dark.hex}}, {{colors.secondary.dark.hex}});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* add parts not accessible without specific selector?*/
|
|
||||||
.theme-dark .sidebar-toggle-button.mod-left {
|
|
||||||
color:{{colors.on_surface.dark.hex}};
|
|
||||||
background:{{colors.surface.dark.hex}};
|
|
||||||
}
|
|
||||||
.theme-dark .sidebar-toggle-button.mod-right {
|
|
||||||
color:{{colors.on_surface.dark.hex}};
|
|
||||||
background:{{colors.surface.dark.hex}};
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme-dark .workspace-tab-header-container{
|
|
||||||
background:{{colors.surface.dark.hex}};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* copy for light mode */
|
|
||||||
.theme-light {
|
|
||||||
--accent-h:calc({{colors.primary.light.hue}}/255*360);
|
|
||||||
--accent-s:calc({{colors.primary.light.saturation}}/255*100%);
|
|
||||||
--accent-l:calc({{colors.primary.light.lightness}}/255*100%);
|
|
||||||
|
|
||||||
--text-normal:{{colors.on_surface.light.hex}};
|
|
||||||
--text-muted:{{colors.on_surface_variant.light.hex}};
|
|
||||||
--text-faint:{{colors.outline.light.hex}};
|
|
||||||
|
|
||||||
--background-primary:{{colors.surface.light.hex}}; /* editor and right ribbon */
|
|
||||||
--background-secondary:{{colors.surface_dim.light.hex}}; /* left ribbon */
|
|
||||||
--background-modifier-hover:{{colors.secondary_container.light.hex}};
|
|
||||||
--background-modifier-active-hover:{{colors.secondary.light.hex}};
|
|
||||||
--background-modifier-message:{{colors.surface_dim.light.hex}};
|
|
||||||
--background-modifier-form-field:{{colors.primary_container.light.hex}};
|
|
||||||
|
|
||||||
--ribbon-background:{{colors.surface.light.hex}};
|
|
||||||
--divider-color:{{colors.secondary_container.light.hex}};
|
|
||||||
--scrollbar-thumb-bg:{{colors.on_secondary_container.light.hex}};
|
|
||||||
--status-bar-border-color:{{colors.secondary_container.light.hex}};
|
|
||||||
--status-bar-background:{{colors.surface.light.hex}};
|
|
||||||
--titlebar-background:{{colors.surface.light.hex}};
|
|
||||||
--titlebar-text-color:{{colors.on_surface.light.hex}};
|
|
||||||
|
|
||||||
--nav-item-color:{{colors.on_surface_variant.light.hex}};
|
|
||||||
--nav-item-color-active:{{colors.on_primary_container.light.hex}};
|
|
||||||
--nav-item-background-active:{{colors.primary_container.light.hex}};
|
|
||||||
--nav-item-color-hover:{{colors.on_secondary_container.light.hex}};
|
|
||||||
--nav-item-background-hover:{{colors.secondary_container.light.hex}};
|
|
||||||
|
|
||||||
--tab-background-active:{{colors.primary_container.light.hex}};
|
|
||||||
--tab-text-color-active:{{colors.on_primary_container.light.hex}};
|
|
||||||
--tab-text-color:{{colors.on_surface_variant.light.hex}};
|
|
||||||
|
|
||||||
--icon-color:{{colors.on_surface.light.hex}};
|
|
||||||
|
|
||||||
--h1-color:{{colors.primary.light.hex}};
|
|
||||||
--h2-color: color-mix(in srgb, {{colors.primary.light.hex}}, {{colors.tertiary.light.hex}});
|
|
||||||
--h3-color:{{colors.tertiary.light.hex}};
|
|
||||||
--h4-color: color-mix(in srgb, {{colors.primary.light.hex}}, {{colors.secondary.light.hex}});
|
|
||||||
--h5-color:{{colors.secondary.light.hex}};
|
|
||||||
--h6-color: color-mix(in srgb, {{colors.tertiary.light.hex}}, {{colors.secondary.light.hex}});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* add parts not accessible without specific selector?*/
|
|
||||||
.theme-light .sidebar-toggle-button.mod-left {
|
|
||||||
color:{{colors.on_surface.light.hex}};
|
|
||||||
background:{{colors.surface.light.hex}};
|
|
||||||
}
|
|
||||||
.theme-light .sidebar-toggle-button.mod-right {
|
|
||||||
color:{{colors.on_surface.light.hex}};
|
|
||||||
background:{{colors.surface.light.hex}};
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme-light .workspace-tab-header-container{
|
|
||||||
background:{{colors.surface.light.hex}};
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide window controls (frameless titlebar buttons) */
|
|
||||||
div[aria-label="Close window"],
|
|
||||||
div[aria-label="Minimize"],
|
|
||||||
div[aria-label="Restore down"],
|
|
||||||
div[aria-label="Maximize"]{
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove the extra right-side spacing reserved for those buttons */
|
|
||||||
.is-hidden-frameless:not(.is-fullscreen) .workspace-tabs.mod-top-right-space .workspace-tab-header-container{
|
|
||||||
padding-right: 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.is-hidden-frameless:not(.is-fullscreen) .workspace-tabs.mod-top-right-space .workspace-tab-header-container:after{
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
(lib.mkIf ohMyPoshEnabled {
|
|
||||||
# Same path as matugen `[templates.ohmyposh]`; seeded as a real file by `ensureMatugenOutputDirsScript`.
|
|
||||||
programs.oh-my-posh = {
|
|
||||||
useTheme = lib.mkForce null;
|
|
||||||
configFile = lib.mkForce "${config.xdg.configHome}/oh-my-posh/theme.omp.json";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.Plugins
|
|
||||||
|
|
||||||
PluginComponent {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool vaultUnlocked: false
|
|
||||||
|
|
||||||
function refreshLockState() {
|
|
||||||
if (!statusProcess.running)
|
|
||||||
statusProcess.exec(["rbw", "unlocked"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleLock() {
|
|
||||||
if (root.vaultUnlocked) {
|
|
||||||
Quickshell.execDetached(["rbw", "lock"]);
|
|
||||||
} else {
|
|
||||||
Quickshell.execDetached(["rbw", "unlock"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pillClickAction: () => root.toggleLock()
|
|
||||||
|
|
||||||
Component.onCompleted: refreshLockState()
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
interval: 2500
|
|
||||||
repeat: true
|
|
||||||
running: true
|
|
||||||
onTriggered: root.refreshLockState()
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: statusProcess
|
|
||||||
command: ["rbw", "unlocked"]
|
|
||||||
onExited: (exitCode, _exitStatus) => {
|
|
||||||
root.vaultUnlocked = exitCode === 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
horizontalBarPill: Component {
|
|
||||||
MouseArea {
|
|
||||||
implicitWidth: iconH.implicitWidth
|
|
||||||
implicitHeight: iconH.implicitHeight
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root.toggleLock()
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: iconH
|
|
||||||
name: root.vaultUnlocked ? "lock_open_right" : "lock"
|
|
||||||
size: root.iconSize
|
|
||||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
verticalBarPill: Component {
|
|
||||||
MouseArea {
|
|
||||||
implicitWidth: iconV.implicitWidth
|
|
||||||
implicitHeight: iconV.implicitHeight
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root.toggleLock()
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: iconV
|
|
||||||
name: root.vaultUnlocked ? "lock_open_right" : "lock"
|
|
||||||
size: root.iconSize
|
|
||||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.Plugins
|
|
||||||
|
|
||||||
PluginSettings {
|
|
||||||
id: root
|
|
||||||
pluginId: "rbwLockToggle"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: "Shows rbw vault state with a closed lock (locked) or open lock (unlocked). Click to run `rbw unlock` (pinentry) or `rbw lock`. Requires `rbw` on PATH in the DMS session and a working pinentry."
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "rbwLockToggle",
|
|
||||||
"name": "Bitwarden (rbw) lock",
|
|
||||||
"description": "Bar control for rbw vault: locked/unlocked padlock; click to unlock or lock",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": "chiasson.cloud",
|
|
||||||
"type": "widget",
|
|
||||||
"capabilities": ["dankbar-widget"],
|
|
||||||
"component": "./RbwLockToggle.qml",
|
|
||||||
"settings": "./RbwLockToggleSettings.qml",
|
|
||||||
"icon": "lock_open",
|
|
||||||
"permissions": ["settings_read"]
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.Plugins
|
|
||||||
|
|
||||||
PluginComponent {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
function toggleKeyboard() {
|
|
||||||
Quickshell.execDetached(["sh", "-c", "pkill -SIGRTMIN -x wvkbd-mobintl"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
pillClickAction: () => root.toggleKeyboard()
|
|
||||||
|
|
||||||
horizontalBarPill: Component {
|
|
||||||
MouseArea {
|
|
||||||
implicitWidth: icon.implicitWidth
|
|
||||||
implicitHeight: icon.implicitHeight
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root.toggleKeyboard()
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: icon
|
|
||||||
name: "keyboard"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
verticalBarPill: Component {
|
|
||||||
MouseArea {
|
|
||||||
implicitWidth: iconV.implicitWidth
|
|
||||||
implicitHeight: iconV.implicitHeight
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root.toggleKeyboard()
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: iconV
|
|
||||||
name: "keyboard"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.Plugins
|
|
||||||
|
|
||||||
PluginSettings {
|
|
||||||
id: root
|
|
||||||
pluginId: "wvkbdToggle"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: "Click the keyboard icon in the bar to show or hide the on-screen keyboard (wvkbd)."
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "wvkbdToggle",
|
|
||||||
"name": "Virtual Keyboard Toggle",
|
|
||||||
"description": "Bar button to show/hide the wvkbd on-screen keyboard (for touch/tablet)",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": "chiasson.cloud",
|
|
||||||
"type": "widget",
|
|
||||||
"capabilities": ["dankbar-widget"],
|
|
||||||
"component": "./WvkbdToggle.qml",
|
|
||||||
"settings": "./WvkbdToggleSettings.qml",
|
|
||||||
"icon": "keyboard",
|
|
||||||
"permissions": ["settings_read"]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
rt="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
|
||||||
|
exec 9>"$rt/dms-plugin-restart.lock"
|
||||||
|
@FLOCK@ -n 9 || exit 0
|
||||||
|
cache="${XDG_CACHE_HOME:-$HOME/.cache}/quickshell/qmlcache"
|
||||||
|
rm -rf "$cache"
|
||||||
|
@SYSTEMCTL@ --user try-restart dms.service 2>/dev/null || true
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Hyprland colors generated by DMS/matugen
|
||||||
|
# Keep `.default` so DMS can swap to `.dark` when "Always use Dark Theme" is enabled.
|
||||||
|
|
||||||
|
general {
|
||||||
|
col.active_border = rgb({{colors.primary.default.hex_stripped}}) rgb({{colors.secondary.default.hex_stripped}}) rgb({{colors.tertiary.default.hex_stripped}})
|
||||||
|
col.inactive_border = rgba({{colors.surface_variant.default.hex_stripped}}ee)
|
||||||
|
}
|
||||||
|
|
||||||
|
decoration {
|
||||||
|
shadow {
|
||||||
|
color = rgba({{colors.shadow.default.hex_stripped}}cc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Hyprbars colors
|
||||||
|
plugin {
|
||||||
|
hyprbars {
|
||||||
|
bar_color = rgba({{colors.surface.default.hex_stripped}}ff)
|
||||||
|
col.text = rgba({{colors.on_surface.default.hex_stripped}}ff)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
.theme-dark {
|
||||||
|
--accent-h:calc({{colors.primary.dark.hue}}/255*360);
|
||||||
|
--accent-s:calc({{colors.primary.dark.saturation}}/255*100%);
|
||||||
|
--accent-l:calc({{colors.primary.dark.lightness}}/255*100%);
|
||||||
|
|
||||||
|
--text-normal:{{colors.on_surface.dark.hex}};
|
||||||
|
--text-muted:{{colors.on_surface_variant.dark.hex}};
|
||||||
|
--text-faint:{{colors.outline.dark.hex}};
|
||||||
|
|
||||||
|
--background-primary:{{colors.surface.dark.hex}}; /* editor and right ribbon */
|
||||||
|
--background-secondary:{{colors.surface_dim.dark.hex}}; /* left ribbon */
|
||||||
|
--background-modifier-hover:{{colors.secondary_container.dark.hex}};
|
||||||
|
--background-modifier-active-hover:{{colors.secondary.dark.hex}};
|
||||||
|
--background-modifier-message:{{colors.surface_dim.dark.hex}};
|
||||||
|
--background-modifier-form-field:{{colors.primary_container.dark.hex}};
|
||||||
|
|
||||||
|
--ribbon-background:{{colors.surface.dark.hex}};
|
||||||
|
--divider-color:{{colors.secondary_container.dark.hex}};
|
||||||
|
--scrollbar-thumb-bg:{{colors.on_secondary_container.dark.hex}};
|
||||||
|
--status-bar-border-color:{{colors.secondary_container.dark.hex}};
|
||||||
|
--status-bar-background:{{colors.surface.dark.hex}};
|
||||||
|
--titlebar-background:{{colors.surface.dark.hex}};
|
||||||
|
--titlebar-text-color:{{colors.on_surface.dark.hex}};
|
||||||
|
|
||||||
|
--nav-item-color:{{colors.on_surface_variant.dark.hex}};
|
||||||
|
--nav-item-color-active:{{colors.on_primary_container.dark.hex}};
|
||||||
|
--nav-item-background-active:{{colors.primary_container.dark.hex}};
|
||||||
|
--nav-item-color-hover:{{colors.on_secondary_container.dark.hex}};
|
||||||
|
--nav-item-background-hover:{{colors.secondary_container.dark.hex}};
|
||||||
|
|
||||||
|
--tab-background-active:{{colors.primary_container.dark.hex}};
|
||||||
|
--tab-text-color-active:{{colors.on_primary_container.dark.hex}};
|
||||||
|
--tab-text-color:{{colors.on_surface_variant.dark.hex}};
|
||||||
|
|
||||||
|
--icon-color:{{colors.on_surface.dark.hex}};
|
||||||
|
|
||||||
|
--h1-color:{{colors.primary.dark.hex}};
|
||||||
|
--h2-color: color-mix(in srgb, {{colors.primary.dark.hex}}, {{colors.tertiary.dark.hex}});
|
||||||
|
--h3-color:{{colors.tertiary.dark.hex}};
|
||||||
|
--h4-color: color-mix(in srgb, {{colors.primary.dark.hex}}, {{colors.secondary.dark.hex}});
|
||||||
|
--h5-color:{{colors.secondary.dark.hex}};
|
||||||
|
--h6-color: color-mix(in srgb, {{colors.tertiary.dark.hex}}, {{colors.secondary.dark.hex}});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* add parts not accessible without specific selector?*/
|
||||||
|
.theme-dark .sidebar-toggle-button.mod-left {
|
||||||
|
color:{{colors.on_surface.dark.hex}};
|
||||||
|
background:{{colors.surface.dark.hex}};
|
||||||
|
}
|
||||||
|
.theme-dark .sidebar-toggle-button.mod-right {
|
||||||
|
color:{{colors.on_surface.dark.hex}};
|
||||||
|
background:{{colors.surface.dark.hex}};
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .workspace-tab-header-container{
|
||||||
|
background:{{colors.surface.dark.hex}};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* copy for light mode */
|
||||||
|
.theme-light {
|
||||||
|
--accent-h:calc({{colors.primary.light.hue}}/255*360);
|
||||||
|
--accent-s:calc({{colors.primary.light.saturation}}/255*100%);
|
||||||
|
--accent-l:calc({{colors.primary.light.lightness}}/255*100%);
|
||||||
|
|
||||||
|
--text-normal:{{colors.on_surface.light.hex}};
|
||||||
|
--text-muted:{{colors.on_surface_variant.light.hex}};
|
||||||
|
--text-faint:{{colors.outline.light.hex}};
|
||||||
|
|
||||||
|
--background-primary:{{colors.surface.light.hex}}; /* editor and right ribbon */
|
||||||
|
--background-secondary:{{colors.surface_dim.light.hex}}; /* left ribbon */
|
||||||
|
--background-modifier-hover:{{colors.secondary_container.light.hex}};
|
||||||
|
--background-modifier-active-hover:{{colors.secondary.light.hex}};
|
||||||
|
--background-modifier-message:{{colors.surface_dim.light.hex}};
|
||||||
|
--background-modifier-form-field:{{colors.primary_container.light.hex}};
|
||||||
|
|
||||||
|
--ribbon-background:{{colors.surface.light.hex}};
|
||||||
|
--divider-color:{{colors.secondary_container.light.hex}};
|
||||||
|
--scrollbar-thumb-bg:{{colors.on_secondary_container.light.hex}};
|
||||||
|
--status-bar-border-color:{{colors.secondary_container.light.hex}};
|
||||||
|
--status-bar-background:{{colors.surface.light.hex}};
|
||||||
|
--titlebar-background:{{colors.surface.light.hex}};
|
||||||
|
--titlebar-text-color:{{colors.on_surface.light.hex}};
|
||||||
|
|
||||||
|
--nav-item-color:{{colors.on_surface_variant.light.hex}};
|
||||||
|
--nav-item-color-active:{{colors.on_primary_container.light.hex}};
|
||||||
|
--nav-item-background-active:{{colors.primary_container.light.hex}};
|
||||||
|
--nav-item-color-hover:{{colors.on_secondary_container.light.hex}};
|
||||||
|
--nav-item-background-hover:{{colors.secondary_container.light.hex}};
|
||||||
|
|
||||||
|
--tab-background-active:{{colors.primary_container.light.hex}};
|
||||||
|
--tab-text-color-active:{{colors.on_primary_container.light.hex}};
|
||||||
|
--tab-text-color:{{colors.on_surface_variant.light.hex}};
|
||||||
|
|
||||||
|
--icon-color:{{colors.on_surface.light.hex}};
|
||||||
|
|
||||||
|
--h1-color:{{colors.primary.light.hex}};
|
||||||
|
--h2-color: color-mix(in srgb, {{colors.primary.light.hex}}, {{colors.tertiary.light.hex}});
|
||||||
|
--h3-color:{{colors.tertiary.light.hex}};
|
||||||
|
--h4-color: color-mix(in srgb, {{colors.primary.light.hex}}, {{colors.secondary.light.hex}});
|
||||||
|
--h5-color:{{colors.secondary.light.hex}};
|
||||||
|
--h6-color: color-mix(in srgb, {{colors.tertiary.light.hex}}, {{colors.secondary.light.hex}});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* add parts not accessible without specific selector?*/
|
||||||
|
.theme-light .sidebar-toggle-button.mod-left {
|
||||||
|
color:{{colors.on_surface.light.hex}};
|
||||||
|
background:{{colors.surface.light.hex}};
|
||||||
|
}
|
||||||
|
.theme-light .sidebar-toggle-button.mod-right {
|
||||||
|
color:{{colors.on_surface.light.hex}};
|
||||||
|
background:{{colors.surface.light.hex}};
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .workspace-tab-header-container{
|
||||||
|
background:{{colors.surface.light.hex}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide window controls (frameless titlebar buttons) */
|
||||||
|
div[aria-label="Close window"],
|
||||||
|
div[aria-label="Minimize"],
|
||||||
|
div[aria-label="Restore down"],
|
||||||
|
div[aria-label="Maximize"]{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove the extra right-side spacing reserved for those buttons */
|
||||||
|
.is-hidden-frameless:not(.is-fullscreen) .workspace-tabs.mod-top-right-space .workspace-tab-header-container{
|
||||||
|
padding-right: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-hidden-frameless:not(.is-fullscreen) .workspace-tabs.mod-top-right-space .workspace-tab-header-container:after{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"alignment": "left",
|
||||||
|
"segments": [
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#ffbebc",
|
||||||
|
"leading_diamond": "\ue0b6",
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\u007B\u007B .UserName \u007D\u007D@\u007B\u007B .HostName \u007D\u007D <#ffffff>on</>",
|
||||||
|
"type": "session"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "os",
|
||||||
|
"style": "diamond",
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#ffffff",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"template": " \u007B\u007B .Icon \u007D\u007D "
|
||||||
|
},
|
||||||
|
{"type": "session",
|
||||||
|
"style": "diamond",
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#ffbebc",
|
||||||
|
"template": "\u007B\u007B if .SSHSession \u007D\u007Dvia SSH\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "session"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"style": "diamond",
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#ffbebc",
|
||||||
|
"template": "\u007B\u007B if .Env.IN_NIX_SHELL \u007D\u007Din nix-shell\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#bc93ff",
|
||||||
|
"leading_diamond": "\ue0b6",
|
||||||
|
"properties": {
|
||||||
|
"time_format": "Monday <#ffffff>at</> 3:04 PM"
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"template": "\u007B\u007B .CurrentDate | date .Format \u007D\u007D",
|
||||||
|
"type": "time"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#43CCEA",
|
||||||
|
"foreground_templates": [
|
||||||
|
"\u007B\u007B if or (.Working.Changed) (.Staging.Changed) \u007D\u007D#FF9248\u007B\u007B end \u007D\u007D",
|
||||||
|
"\u007B\u007B if and (gt .Ahead 0) (gt .Behind 0) \u007D\u007D#ff4500\u007B\u007B end \u007D\u007D",
|
||||||
|
"\u007B\u007B if gt .Ahead 0 \u007D\u007D#B388FF\u007B\u007B end \u007D\u007D",
|
||||||
|
"\u007B\u007B if gt .Behind 0 \u007D\u007D#B388FF\u007B\u007B end \u007D\u007D"
|
||||||
|
],
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"branch_template": "\u007B\u007B trunc 25 .Branch \u007D\u007D",
|
||||||
|
"fetch_status": true,
|
||||||
|
"fetch_upstream_icon": true
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": " \u007B\u007B .UpstreamIcon \u007D\u007D\u007B\u007B .HEAD \u007D\u007D\u007B\u007Bif .BranchStatus \u007D\u007D \u007B\u007B .BranchStatus \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if .Working.Changed \u007D\u007D \uf044 \u007B\u007B .Working.String \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if and (.Working.Changed) (.Staging.Changed) \u007D\u007D |\u007B\u007B end \u007D\u007D\u007B\u007B if .Staging.Changed \u007D\u007D \uf046 \u007B\u007B .Staging.String \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B if gt .StashCount 0 \u007D\u007D \ueb4b \u007B\u007B .StashCount \u007D\u007D\u007B\u007B end \u007D\u007D ",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#E4F34A",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue235 \u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B if .Venv \u007D\u007D\u007B\u007B .Venv \u007D\u007D \u007B\u007B end \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "python"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#7FD5EA",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue626\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "go"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#42E66C",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue718\u007B\u007B if .PackageManagerIcon \u007D\u007D\u007B\u007B .PackageManagerIcon \u007D\u007D \u007B\u007B end \u007D\u007D\u007B\u007B .Full \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "node"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#E64747",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue791\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "ruby"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#E64747",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue738\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "java"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#9B6BDF",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue624\u007B\u007B if .Error \u007D\u007D\u007B\u007B .Error \u007D\u007D\u007B\u007B else \u007D\u007D\u007B\u007B .Full \u007D\u007D\u007B\u007B end \u007D\u007D ",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "julia"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "php",
|
||||||
|
"style": "diamond",
|
||||||
|
"foreground": "#ffffff",
|
||||||
|
"background": "#4063D8",
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"fetch_version": false
|
||||||
|
},
|
||||||
|
"template": "\ue73d \u007B\u007B .Full \u007D\u007D ",
|
||||||
|
"trailing_diamond": "\ue0b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#9B6BDF",
|
||||||
|
"foreground_templates": [
|
||||||
|
"\u007B\u007Bif eq \"Charging\" .State.String\u007D\u007D#40c4ff\u007B\u007Bend\u007D\u007D",
|
||||||
|
"\u007B\u007Bif eq \"Discharging\" .State.String\u007D\u007D#ff5722\u007B\u007Bend\u007D\u007D",
|
||||||
|
"\u007B\u007Bif eq \"Full\" .State.String\u007D\u007D#4caf50\u007B\u007Bend\u007D\u007D"
|
||||||
|
],
|
||||||
|
"leading_diamond": " \ue0b6",
|
||||||
|
"options": {
|
||||||
|
"charged_icon": " ",
|
||||||
|
"charging_icon": "\u21e1 ",
|
||||||
|
"discharging_icon": "\u21e3 "
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\u007B\u007B if not .Error \u007D\u007D\u007B\u007B .Icon \u007D\u007D\u007B\u007B .Percentage \u007D\u007D\u007B\u007B end \u007D\u007D\u007B\u007B .Error \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "battery"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "prompt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alignment": "right",
|
||||||
|
"segments": [
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#AEA4BF",
|
||||||
|
"leading_diamond": "\ue0b6",
|
||||||
|
"options": {
|
||||||
|
"style": "austin",
|
||||||
|
"threshold": 150
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\u007B\u007B .FormattedMs \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4 ",
|
||||||
|
"type": "executiontime"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "prompt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alignment": "left",
|
||||||
|
"newline": true,
|
||||||
|
"segments": [
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#3EC669",
|
||||||
|
"leading_diamond": "\ue0b6",
|
||||||
|
"properties": {
|
||||||
|
"style": "agnoster_full",
|
||||||
|
"cycle": [
|
||||||
|
"#3EC669,#3A456E",
|
||||||
|
"#43CCEA,#3A456E",
|
||||||
|
"#E4F34A,#3A456E",
|
||||||
|
"#9B6BDF,#3A456E"
|
||||||
|
],
|
||||||
|
"cycle_folder_separator": true
|
||||||
|
},
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue5ff \u007B\u007B .Path \u007D\u007D",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#3A456E",
|
||||||
|
"foreground": "#ffbebc",
|
||||||
|
"leading_diamond": "\ue0b6",
|
||||||
|
"style": "diamond",
|
||||||
|
"template": "\ue602",
|
||||||
|
"trailing_diamond": "\ue0b4",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "prompt"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"final_space": true,
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{ inputs, lib, ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.optionalAttrs (lib.elem system [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
]) {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
inputs.navi.packages.${system}.default
|
||||||
|
pkgs.just
|
||||||
|
pkgs.jq
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
echo "Repo helpers (from repo root):"
|
||||||
|
echo " just # list justfile recipes"
|
||||||
|
echo " just sync-dms [--dry-run] # copy live DMS config into host seed dir"
|
||||||
|
echo ""
|
||||||
|
echo "Navi fleet deploy:"
|
||||||
|
echo " navi apply --on <host> # build + switch one host"
|
||||||
|
echo " navi apply-local --node 14900k --sudo # switch locally (needs root)"
|
||||||
|
echo " navi tui # interactive fleet dashboard"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{config, inputs, pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.hermes.nixosModules.default
|
||||||
|
];
|
||||||
|
services.ollama = {
|
||||||
|
enable = true;
|
||||||
|
# Replace the old acceleration line with this:
|
||||||
|
package = pkgs.ollama-cuda;
|
||||||
|
};
|
||||||
|
chiasson.users.extraModules.olivier = [{chiasson.home.extraPackages = with pkgs; [ zed-editor devin-desktop];}];
|
||||||
|
}
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
# Monitor layout for 14900k.
|
# Monitor layout for 14900k.
|
||||||
# NVIDIA (default): DP-2 ultrawide, HDMI-A-3 + DP-4 side/top stack.
|
# NVIDIA (default): DP-3 ultrawide, HDMI-A-3 + DP-4 stack; DP-2 virtual 4K when streamingDisplay is on.
|
||||||
# Intel iGPU (gpu passthru): DP-1 ultrawide, HDMI-A-2 Samsung to the left.
|
# Intel iGPU (gpu passthru): DP-1 ultrawide, HDMI-A-2 to the left.
|
||||||
# Niri: `extraSettings` (KDL via `extraConfig`, other wrapper-modules keys) + `extraBinds` (merged keybinds).
|
# Niri uses `extraSettings.extraConfig`; Hyprland uses `chiasson.desktop.hyprland.settings`.
|
||||||
# Hyprland: `chiasson.desktop.hyprland.settings` (merged in HM when `chiasson.desktop.hyprland.enable`).
|
|
||||||
|
|
||||||
#TODO[epic=Moderate] Clean this up, move to host's configuration.nix.
|
#TODO[epic=Moderate] Clean this up, move to host's configuration.nix.
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
|
streamingDisplay = config.chiasson.system.streamingDisplay;
|
||||||
gpuPassthru = config.chiasson.system.gpuPassthru.enable;
|
gpuPassthru = config.chiasson.system.gpuPassthru.enable;
|
||||||
|
|
||||||
|
# Niri outputs: a static block per GPU layout, plus the optional virtual 4K panel.
|
||||||
niriOutputs =
|
niriOutputs =
|
||||||
if gpuPassthru then
|
(if gpuPassthru then
|
||||||
''
|
''
|
||||||
output "DP-1" {
|
output "DP-1" {
|
||||||
mode "2560x1080@144"
|
mode "2560x1080@144"
|
||||||
@@ -42,43 +43,31 @@ let
|
|||||||
scale 1.0
|
scale 1.0
|
||||||
position x=0 y=-1080
|
position x=0 y=-1080
|
||||||
}
|
}
|
||||||
|
'')
|
||||||
|
+ lib.optionalString streamingDisplay.enable ''
|
||||||
|
output "${streamingDisplay.connector}" {
|
||||||
|
mode "${streamingDisplay.mode}"
|
||||||
|
scale ${toString streamingDisplay.niriScale}
|
||||||
|
position ${streamingDisplay.niriPosition}
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Hyprland monitor strings, with the virtual panel appended when enabled.
|
||||||
hyprlandMonitors =
|
hyprlandMonitors =
|
||||||
if gpuPassthru then
|
(if gpuPassthru then
|
||||||
[
|
[ "DP-1, 2560x1080@144, 0x0, 1" "HDMI-A-2, 1920x1080@60, -1920x0, 1" ]
|
||||||
"DP-1, 2560x1080@144, 0x0, 1"
|
|
||||||
"HDMI-A-2, 1920x1080@60, -1920x0, 1"
|
|
||||||
]
|
|
||||||
else
|
else
|
||||||
[
|
[ "DP-3, 2560x1080@144, 0x0, 1" "DP-4, 1920x1080@144, 0x-1080, 1" "HDMI-A-3, 1920x1080@60, -1920x0, 1" ])
|
||||||
"DP-3, 2560x1080@144, 0x0, 1"
|
++ lib.optional streamingDisplay.enable "${streamingDisplay.connector}, ${streamingDisplay.mode}, 7680x0, ${toString streamingDisplay.niriScale}";
|
||||||
"DP-4, 1920x1080@144, 0x-1080, 1"
|
|
||||||
"HDMI-A-3, 1920x1080@60, -1920x0, 1"
|
|
||||||
];
|
|
||||||
|
|
||||||
hyprlandWorkspaces =
|
hyprlandWorkspaces =
|
||||||
if gpuPassthru then
|
if gpuPassthru then
|
||||||
[
|
[ "1, monitor:DP-1, default:true" "2, monitor:DP-1" "3, monitor:DP-1"
|
||||||
"1, monitor:DP-1, default:true"
|
"4, monitor:HDMI-A-2, default:true" "5, monitor:HDMI-A-2" "6, monitor:HDMI-A-2" ]
|
||||||
"2, monitor:DP-1"
|
|
||||||
"3, monitor:DP-1"
|
|
||||||
"4, monitor:HDMI-A-2, default:true"
|
|
||||||
"5, monitor:HDMI-A-2"
|
|
||||||
"6, monitor:HDMI-A-2"
|
|
||||||
]
|
|
||||||
else
|
else
|
||||||
[
|
[ "1, monitor:DP-3, default:true" "2, monitor:DP-3" "3, monitor:DP-3"
|
||||||
"1, monitor:DP-3, default:true"
|
"4, monitor:HDMI-A-3, default:true" "5, monitor:HDMI-A-3" "6, monitor:HDMI-A-3"
|
||||||
"2, monitor:DP-3"
|
"7, monitor:DP-4" "8, monitor:DP-4" "9, monitor:DP-4" ];
|
||||||
"3, monitor:DP-3"
|
|
||||||
"4, monitor:HDMI-A-3, default:true"
|
|
||||||
"5, monitor:HDMI-A-3"
|
|
||||||
"6, monitor:HDMI-A-3"
|
|
||||||
"7, monitor:DP-4"
|
|
||||||
"8, monitor:DP-4"
|
|
||||||
"9, monitor:DP-4"
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
chiasson.desktop.niri.extraSettings = {
|
chiasson.desktop.niri.extraSettings = {
|
||||||
@@ -86,10 +75,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
chiasson.desktop.niri.extraBinds."XF86Tools".spawn = [
|
chiasson.desktop.niri.extraBinds."XF86Tools".spawn = [
|
||||||
"wpctl"
|
"wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"
|
||||||
"set-mute"
|
|
||||||
"@DEFAULT_AUDIO_SOURCE@"
|
|
||||||
"toggle"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
chiasson.desktop.hyprland.settings = lib.mkIf config.chiasson.desktop.hyprland.enable {
|
chiasson.desktop.hyprland.settings = lib.mkIf config.chiasson.desktop.hyprland.enable {
|
||||||
|
|||||||
@@ -0,0 +1,279 @@
|
|||||||
|
{
|
||||||
|
"dankDesktopWeather": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"nixMonitor": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"newClock": {
|
||||||
|
"enabled": true,
|
||||||
|
"clockStyle": "digital",
|
||||||
|
"showSeconds": true,
|
||||||
|
"showDate": true
|
||||||
|
},
|
||||||
|
"rbwLockToggle": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"ambientSound": {
|
||||||
|
"enabled": true,
|
||||||
|
"whenDoneActions": [],
|
||||||
|
"soundVolumes": {
|
||||||
|
"acoustic-guitar": 100,
|
||||||
|
"warm-piano": 100,
|
||||||
|
"lofi-beats": 100
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bongoCat": {
|
||||||
|
"enabled": true,
|
||||||
|
"selectedDevicePath": "/dev/input/event4"
|
||||||
|
},
|
||||||
|
"calculator": {
|
||||||
|
"enabled": true,
|
||||||
|
"trigger": "="
|
||||||
|
},
|
||||||
|
"dankGifSearch": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"homeAssistantMonitor": {
|
||||||
|
"enabled": true,
|
||||||
|
"hassUrl": "https://home.chiasson.cloud/",
|
||||||
|
"hassTokenPath": "/run/secrets/home-assistant/auth-token",
|
||||||
|
"showButtonsOnStatusBar": true,
|
||||||
|
"showAttributes": false,
|
||||||
|
"haRefreshCounter": 1
|
||||||
|
},
|
||||||
|
"unifiedTaskbar": {
|
||||||
|
"enabled": true,
|
||||||
|
"allMonitors": false,
|
||||||
|
"reverseMonitorOrder": false,
|
||||||
|
"groupByApp": false,
|
||||||
|
"compactMode": false,
|
||||||
|
"filledPills": false,
|
||||||
|
"iconPadding": 4,
|
||||||
|
"itemSpacing": 2
|
||||||
|
},
|
||||||
|
"widgetGroup": {
|
||||||
|
"enabled": true,
|
||||||
|
"variants": [
|
||||||
|
{
|
||||||
|
"icon": "widgets",
|
||||||
|
"label": "",
|
||||||
|
"display": "both",
|
||||||
|
"expandDir": "right",
|
||||||
|
"targets": [
|
||||||
|
"rbwLockToggle"
|
||||||
|
],
|
||||||
|
"mainTarget": "",
|
||||||
|
"mainClickButton": "right",
|
||||||
|
"mainMarkerColor": "primary",
|
||||||
|
"expandIndicatorPosition": "",
|
||||||
|
"showArrow": false,
|
||||||
|
"showArrowOnlyOnHover": false,
|
||||||
|
"hideMain": false,
|
||||||
|
"id": "variant_1781997418516",
|
||||||
|
"name": "Test",
|
||||||
|
"autoCollapse": false,
|
||||||
|
"autoCollapseSeconds": 5,
|
||||||
|
"autoCollapseOnLeave": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "bug_report",
|
||||||
|
"label": "",
|
||||||
|
"display": "both",
|
||||||
|
"expandDir": "right",
|
||||||
|
"targets": [
|
||||||
|
"nixMonitor",
|
||||||
|
"cpuUsage",
|
||||||
|
"memUsage",
|
||||||
|
"diskUsage",
|
||||||
|
"cpuTemp",
|
||||||
|
"gpuTemp"
|
||||||
|
],
|
||||||
|
"mainTarget": "cpuUsage",
|
||||||
|
"mainClickButton": "right",
|
||||||
|
"mainMarkerColor": "primary",
|
||||||
|
"expandIndicatorPosition": "",
|
||||||
|
"showArrow": false,
|
||||||
|
"showArrowOnlyOnHover": false,
|
||||||
|
"hideMain": false,
|
||||||
|
"id": "variant_1781999113601",
|
||||||
|
"name": "SysInfo",
|
||||||
|
"autoCollapse": false,
|
||||||
|
"autoCollapseSeconds": 5,
|
||||||
|
"autoCollapseOnLeave": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"desktopWidgetToggle": {
|
||||||
|
"enabled": false,
|
||||||
|
"activeGroupIds": [],
|
||||||
|
"activeGroupId": "",
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"id": "g1",
|
||||||
|
"name": "Group 1",
|
||||||
|
"icon": "widgets",
|
||||||
|
"widgets": [],
|
||||||
|
"overrideIndividual": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "g_1781998217464_d0ngn3bo3",
|
||||||
|
"name": "New Group",
|
||||||
|
"icon": "widgets",
|
||||||
|
"widgets": [],
|
||||||
|
"overrideIndividual": true,
|
||||||
|
"widgetOverrides": {}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"conflictMode": "single"
|
||||||
|
},
|
||||||
|
"dropdownMenu": {
|
||||||
|
"enabled": true,
|
||||||
|
"variants": [
|
||||||
|
{
|
||||||
|
"icon": "expand_circle_down",
|
||||||
|
"text": "",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "popout",
|
||||||
|
"icon": "",
|
||||||
|
"label": "Home Assistant",
|
||||||
|
"display": "both",
|
||||||
|
"widgetId": "homeAssistantMonitor"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "variant_1781998267426",
|
||||||
|
"name": "Main Drop"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ocrScanner": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"obsidianSearch": {
|
||||||
|
"enabled": true,
|
||||||
|
"vaultPath": "/mnt/zimaos/Obsidian/Home/",
|
||||||
|
"isFlatpak": true
|
||||||
|
},
|
||||||
|
"dankObsidian": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"dankPinentry": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"dankVault": {
|
||||||
|
"enabled": true,
|
||||||
|
"backend": "rbw"
|
||||||
|
},
|
||||||
|
"nixPackageRunner": {
|
||||||
|
"enabled": true,
|
||||||
|
"runInTerminal": false
|
||||||
|
},
|
||||||
|
"dmsconky": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"discordVoice": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"emojiLauncher": {
|
||||||
|
"enabled": true,
|
||||||
|
"trigger": ":",
|
||||||
|
"pasteOnSelect": true,
|
||||||
|
"recentEmojis": "🃏"
|
||||||
|
},
|
||||||
|
"webSearch": {
|
||||||
|
"enabled": true,
|
||||||
|
"searchEngines": [],
|
||||||
|
"disabledEngines": [],
|
||||||
|
"trigger": "#"
|
||||||
|
},
|
||||||
|
"wallpaperCarousel": {
|
||||||
|
"enabled": true,
|
||||||
|
"cacheSize": 30,
|
||||||
|
"holdDelay": 1206
|
||||||
|
},
|
||||||
|
"ephemera": {
|
||||||
|
"enabled": true,
|
||||||
|
"provider": "gemini",
|
||||||
|
"model": "gemini-3-flash-preview"
|
||||||
|
},
|
||||||
|
"aiAssistant": {
|
||||||
|
"enabled": true,
|
||||||
|
"providers": {
|
||||||
|
"openai": {
|
||||||
|
"baseUrl": "https://api.openai.com",
|
||||||
|
"model": "gpt-5.2",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30
|
||||||
|
},
|
||||||
|
"anthropic": {
|
||||||
|
"baseUrl": "https://api.anthropic.com",
|
||||||
|
"model": "claude-sonnet-4-5",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30
|
||||||
|
},
|
||||||
|
"gemini": {
|
||||||
|
"baseUrl": "https://generativelanguage.googleapis.com",
|
||||||
|
"model": "gemini-3-flash-preview",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30,
|
||||||
|
"geminiWebSearch": false
|
||||||
|
},
|
||||||
|
"inception": {
|
||||||
|
"baseUrl": "https://api.inceptionlabs.ai/v1",
|
||||||
|
"model": "mercury-2",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.75,
|
||||||
|
"maxTokens": 8192,
|
||||||
|
"timeout": 30,
|
||||||
|
"inceptionReasoningEffort": "medium",
|
||||||
|
"inceptionReasoningSummary": true,
|
||||||
|
"inceptionReasoningSummaryWait": false
|
||||||
|
},
|
||||||
|
"ollama": {
|
||||||
|
"baseUrl": "http://localhost:11434",
|
||||||
|
"model": "",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"baseUrl": "https://api.openai.com",
|
||||||
|
"model": "gpt-5.2",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"provider": "openai",
|
||||||
|
"baseUrl": "https://api.openai.com",
|
||||||
|
"model": "gpt-5.2",
|
||||||
|
"apiKey": "",
|
||||||
|
"saveApiKey": false,
|
||||||
|
"apiKeyEnvVar": "",
|
||||||
|
"temperature": 0.7,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"timeout": 30,
|
||||||
|
"geminiWebSearch": false
|
||||||
|
}
|
||||||
|
}
|
||||||
+455
-14
@@ -4,11 +4,14 @@
|
|||||||
"customThemeFile": "",
|
"customThemeFile": "",
|
||||||
"registryThemeVariants": {},
|
"registryThemeVariants": {},
|
||||||
"matugenScheme": "scheme-tonal-spot",
|
"matugenScheme": "scheme-tonal-spot",
|
||||||
|
"matugenContrast": 0,
|
||||||
"runUserMatugenTemplates": true,
|
"runUserMatugenTemplates": true,
|
||||||
"matugenTargetMonitor": "",
|
"matugenTargetMonitor": "",
|
||||||
"popupTransparency": 1,
|
"popupTransparency": 1,
|
||||||
"dockTransparency": 1,
|
"dockTransparency": 1,
|
||||||
"widgetBackgroundColor": "sch",
|
"widgetBackgroundColor": "sch",
|
||||||
|
"widgetBackgroundCustomColor": "#6750A4",
|
||||||
|
"widgetBackgroundCustomStrength": 0.5,
|
||||||
"widgetColorMode": "default",
|
"widgetColorMode": "default",
|
||||||
"controlCenterTileColorMode": "primary",
|
"controlCenterTileColorMode": "primary",
|
||||||
"buttonColorMode": "primary",
|
"buttonColorMode": "primary",
|
||||||
@@ -17,11 +20,18 @@
|
|||||||
"niriLayoutRadiusOverride": -1,
|
"niriLayoutRadiusOverride": -1,
|
||||||
"niriLayoutBorderSize": -1,
|
"niriLayoutBorderSize": -1,
|
||||||
"hyprlandLayoutGapsOverride": -1,
|
"hyprlandLayoutGapsOverride": -1,
|
||||||
|
"hyprlandLayoutGapsOutOverride": -1,
|
||||||
"hyprlandLayoutRadiusOverride": -1,
|
"hyprlandLayoutRadiusOverride": -1,
|
||||||
"hyprlandLayoutBorderSize": -1,
|
"hyprlandLayoutBorderSize": -1,
|
||||||
|
"hyprlandResizeOnBorder": false,
|
||||||
"mangoLayoutGapsOverride": -1,
|
"mangoLayoutGapsOverride": -1,
|
||||||
|
"mangoLayoutGapsOutOverride": -1,
|
||||||
"mangoLayoutRadiusOverride": -1,
|
"mangoLayoutRadiusOverride": -1,
|
||||||
"mangoLayoutBorderSize": -1,
|
"mangoLayoutBorderSize": -1,
|
||||||
|
"mangoTrackpadNaturalScrolling": true,
|
||||||
|
"firstDayOfWeek": -1,
|
||||||
|
"showWeekNumber": false,
|
||||||
|
"calendarBackend": "auto",
|
||||||
"use24HourClock": false,
|
"use24HourClock": false,
|
||||||
"showSeconds": true,
|
"showSeconds": true,
|
||||||
"padHours12Hour": false,
|
"padHours12Hour": false,
|
||||||
@@ -36,6 +46,17 @@
|
|||||||
"modalAnimationSpeed": 1,
|
"modalAnimationSpeed": 1,
|
||||||
"modalCustomAnimationDuration": 150,
|
"modalCustomAnimationDuration": 150,
|
||||||
"enableRippleEffects": true,
|
"enableRippleEffects": true,
|
||||||
|
"animationVariant": 0,
|
||||||
|
"motionEffect": 0,
|
||||||
|
"m3ElevationEnabled": true,
|
||||||
|
"m3ElevationIntensity": 12,
|
||||||
|
"m3ElevationOpacity": 30,
|
||||||
|
"m3ElevationColorMode": "default",
|
||||||
|
"m3ElevationLightDirection": "top",
|
||||||
|
"m3ElevationCustomColor": "#000000",
|
||||||
|
"modalElevationEnabled": true,
|
||||||
|
"popoutElevationEnabled": true,
|
||||||
|
"barElevationEnabled": false,
|
||||||
"blurEnabled": false,
|
"blurEnabled": false,
|
||||||
"blurForegroundLayers": true,
|
"blurForegroundLayers": true,
|
||||||
"blurLayerOutlineOpacity": 0.12,
|
"blurLayerOutlineOpacity": 0.12,
|
||||||
@@ -45,6 +66,8 @@
|
|||||||
"wallpaperFillMode": "Fill",
|
"wallpaperFillMode": "Fill",
|
||||||
"blurredWallpaperLayer": false,
|
"blurredWallpaperLayer": false,
|
||||||
"blurWallpaperOnOverview": false,
|
"blurWallpaperOnOverview": false,
|
||||||
|
"wallpaperBackgroundColorMode": "black",
|
||||||
|
"wallpaperBackgroundCustomColor": "#000000",
|
||||||
"showLauncherButton": true,
|
"showLauncherButton": true,
|
||||||
"showWorkspaceSwitcher": true,
|
"showWorkspaceSwitcher": true,
|
||||||
"showFocusedWindow": true,
|
"showFocusedWindow": true,
|
||||||
@@ -64,6 +87,12 @@
|
|||||||
"showClock": true,
|
"showClock": true,
|
||||||
"showNotificationButton": true,
|
"showNotificationButton": true,
|
||||||
"showBattery": true,
|
"showBattery": true,
|
||||||
|
"showBatteryPercent": true,
|
||||||
|
"showBatteryPercentOnlyOnBattery": false,
|
||||||
|
"showBatteryTime": false,
|
||||||
|
"showBatteryTimeOnlyOnBattery": false,
|
||||||
|
"batteryPillStyle": false,
|
||||||
|
"batteryPillPercentSign": false,
|
||||||
"showControlCenterButton": true,
|
"showControlCenterButton": true,
|
||||||
"showCapsLockIndicator": true,
|
"showCapsLockIndicator": true,
|
||||||
"controlCenterShowNetworkIcon": true,
|
"controlCenterShowNetworkIcon": true,
|
||||||
@@ -78,6 +107,8 @@
|
|||||||
"controlCenterShowBatteryIcon": false,
|
"controlCenterShowBatteryIcon": false,
|
||||||
"controlCenterShowPrinterIcon": false,
|
"controlCenterShowPrinterIcon": false,
|
||||||
"controlCenterShowScreenSharingIcon": true,
|
"controlCenterShowScreenSharingIcon": true,
|
||||||
|
"controlCenterShowIdleInhibitorIcon": false,
|
||||||
|
"controlCenterShowDoNotDisturbIcon": false,
|
||||||
"showPrivacyButton": true,
|
"showPrivacyButton": true,
|
||||||
"privacyShowMicIcon": false,
|
"privacyShowMicIcon": false,
|
||||||
"privacyShowCameraIcon": false,
|
"privacyShowCameraIcon": false,
|
||||||
@@ -133,29 +164,57 @@
|
|||||||
"maxWorkspaceIcons": 9,
|
"maxWorkspaceIcons": 9,
|
||||||
"workspaceAppIconSizeOffset": 1,
|
"workspaceAppIconSizeOffset": 1,
|
||||||
"groupWorkspaceApps": true,
|
"groupWorkspaceApps": true,
|
||||||
|
"groupActiveWorkspaceApps": false,
|
||||||
"workspaceFollowFocus": false,
|
"workspaceFollowFocus": false,
|
||||||
"showOccupiedWorkspacesOnly": true,
|
"showOccupiedWorkspacesOnly": true,
|
||||||
"reverseScrolling": false,
|
"reverseScrolling": false,
|
||||||
"dwlShowAllTags": false,
|
"dwlShowAllTags": false,
|
||||||
|
"workspaceActiveAppHighlightEnabled": false,
|
||||||
"workspaceColorMode": "default",
|
"workspaceColorMode": "default",
|
||||||
|
"workspaceFocusedCustomColor": "#6750A4",
|
||||||
"workspaceOccupiedColorMode": "none",
|
"workspaceOccupiedColorMode": "none",
|
||||||
|
"workspaceOccupiedCustomColor": "#625B71",
|
||||||
"workspaceUnfocusedColorMode": "default",
|
"workspaceUnfocusedColorMode": "default",
|
||||||
|
"workspaceUnfocusedCustomColor": "#49454E",
|
||||||
"workspaceUrgentColorMode": "default",
|
"workspaceUrgentColorMode": "default",
|
||||||
|
"workspaceUrgentCustomColor": "#B3261E",
|
||||||
"workspaceFocusedBorderEnabled": false,
|
"workspaceFocusedBorderEnabled": false,
|
||||||
"workspaceFocusedBorderColor": "primary",
|
"workspaceFocusedBorderColor": "primary",
|
||||||
|
"workspaceFocusedBorderCustomColor": "#6750A4",
|
||||||
"workspaceFocusedBorderThickness": 2,
|
"workspaceFocusedBorderThickness": 2,
|
||||||
|
"workspaceUnfocusedMonitorSeparateAppearance": false,
|
||||||
|
"workspaceUnfocusedMonitorColorMode": "default",
|
||||||
|
"workspaceUnfocusedMonitorFocusedCustomColor": "#6750A4",
|
||||||
|
"workspaceUnfocusedMonitorOccupiedColorMode": "none",
|
||||||
|
"workspaceUnfocusedMonitorOccupiedCustomColor": "#625B71",
|
||||||
|
"workspaceUnfocusedMonitorUnfocusedColorMode": "default",
|
||||||
|
"workspaceUnfocusedMonitorUnfocusedCustomColor": "#49454E",
|
||||||
|
"workspaceUnfocusedMonitorUrgentColorMode": "default",
|
||||||
|
"workspaceUnfocusedMonitorUrgentCustomColor": "#B3261E",
|
||||||
|
"workspaceUnfocusedMonitorBorderEnabled": false,
|
||||||
|
"workspaceUnfocusedMonitorBorderColor": "primary",
|
||||||
|
"workspaceUnfocusedMonitorBorderCustomColor": "#6750A4",
|
||||||
|
"workspaceUnfocusedMonitorBorderThickness": 2,
|
||||||
"workspaceNameIcons": {},
|
"workspaceNameIcons": {},
|
||||||
"waveProgressEnabled": true,
|
"waveProgressEnabled": true,
|
||||||
"scrollTitleEnabled": true,
|
"scrollTitleEnabled": true,
|
||||||
|
"mediaAdaptiveWidthEnabled": true,
|
||||||
"audioVisualizerEnabled": true,
|
"audioVisualizerEnabled": true,
|
||||||
"audioScrollMode": "volume",
|
"audioScrollMode": "volume",
|
||||||
"audioWheelScrollAmount": 5,
|
"audioWheelScrollAmount": 5,
|
||||||
|
"audioDeviceScrollVolumeEnabled": false,
|
||||||
|
"mediaExcludePlayers": [],
|
||||||
"clockCompactMode": false,
|
"clockCompactMode": false,
|
||||||
"focusedWindowCompactMode": false,
|
"focusedWindowCompactMode": false,
|
||||||
|
"focusedWindowSize": 1,
|
||||||
|
"focusedWindowShowIcon": true,
|
||||||
"runningAppsCompactMode": true,
|
"runningAppsCompactMode": true,
|
||||||
"barMaxVisibleApps": 0,
|
"barMaxVisibleApps": 0,
|
||||||
"barMaxVisibleRunningApps": 0,
|
"barMaxVisibleRunningApps": 0,
|
||||||
"barShowOverflowBadge": true,
|
"barShowOverflowBadge": true,
|
||||||
|
"trayAutoOverflow": true,
|
||||||
|
"trayPopupSingleLine": true,
|
||||||
|
"trayMaxVisibleItems": 0,
|
||||||
"appsDockHideIndicators": false,
|
"appsDockHideIndicators": false,
|
||||||
"appsDockColorizeActive": false,
|
"appsDockColorizeActive": false,
|
||||||
"appsDockActiveColorMode": "primary",
|
"appsDockActiveColorMode": "primary",
|
||||||
@@ -163,6 +222,7 @@
|
|||||||
"appsDockEnlargePercentage": 125,
|
"appsDockEnlargePercentage": 125,
|
||||||
"appsDockIconSizePercentage": 100,
|
"appsDockIconSizePercentage": 100,
|
||||||
"keyboardLayoutNameCompactMode": false,
|
"keyboardLayoutNameCompactMode": false,
|
||||||
|
"keyboardLayoutNameShowIcon": false,
|
||||||
"runningAppsCurrentWorkspace": true,
|
"runningAppsCurrentWorkspace": true,
|
||||||
"runningAppsGroupByApp": false,
|
"runningAppsGroupByApp": false,
|
||||||
"runningAppsCurrentMonitor": false,
|
"runningAppsCurrentMonitor": false,
|
||||||
@@ -198,9 +258,18 @@
|
|||||||
"lockDateFormat": "dddd, MMMM d",
|
"lockDateFormat": "dddd, MMMM d",
|
||||||
"greeterRememberLastSession": true,
|
"greeterRememberLastSession": true,
|
||||||
"greeterRememberLastUser": true,
|
"greeterRememberLastUser": true,
|
||||||
|
"greeterAutoLogin": false,
|
||||||
"greeterEnableFprint": false,
|
"greeterEnableFprint": false,
|
||||||
"greeterEnableU2f": false,
|
"greeterEnableU2f": false,
|
||||||
"greeterWallpaperPath": "",
|
"greeterWallpaperPath": "",
|
||||||
|
"greeterUse24HourClock": true,
|
||||||
|
"greeterShowSeconds": false,
|
||||||
|
"greeterPadHours12Hour": false,
|
||||||
|
"greeterLockDateFormat": "",
|
||||||
|
"greeterFontFamily": "",
|
||||||
|
"greeterWallpaperFillMode": "",
|
||||||
|
"greeterSyncPending": false,
|
||||||
|
"greeterSyncBaseline": {},
|
||||||
"mediaSize": 1,
|
"mediaSize": 1,
|
||||||
"appLauncherViewMode": "list",
|
"appLauncherViewMode": "list",
|
||||||
"spotlightModalViewMode": "list",
|
"spotlightModalViewMode": "list",
|
||||||
@@ -211,19 +280,53 @@
|
|||||||
"sortAppsAlphabetically": false,
|
"sortAppsAlphabetically": false,
|
||||||
"appLauncherGridColumns": 4,
|
"appLauncherGridColumns": 4,
|
||||||
"spotlightCloseNiriOverview": true,
|
"spotlightCloseNiriOverview": true,
|
||||||
|
"rememberLastQuery": false,
|
||||||
|
"rememberLastMode": true,
|
||||||
"spotlightSectionViewModes": {},
|
"spotlightSectionViewModes": {},
|
||||||
"appDrawerSectionViewModes": {},
|
"appDrawerSectionViewModes": {},
|
||||||
"niriOverviewOverlayEnabled": true,
|
"niriOverviewOverlayEnabled": true,
|
||||||
"dankLauncherV2Size": "compact",
|
"dankLauncherV2Size": "medium",
|
||||||
|
"dankLauncherV2ShowSourceBadges": true,
|
||||||
"dankLauncherV2BorderEnabled": false,
|
"dankLauncherV2BorderEnabled": false,
|
||||||
"dankLauncherV2BorderThickness": 2,
|
"dankLauncherV2BorderThickness": 2,
|
||||||
"dankLauncherV2BorderColor": "primary",
|
"dankLauncherV2BorderColor": "primary",
|
||||||
"dankLauncherV2ShowFooter": true,
|
"dankLauncherV2ShowFooter": true,
|
||||||
"dankLauncherV2UnloadOnClose": false,
|
"dankLauncherV2UnloadOnClose": true,
|
||||||
|
"dankLauncherV2IncludeFilesInAll": false,
|
||||||
|
"dankLauncherV2IncludeFoldersInAll": false,
|
||||||
|
"launcherUseOverlayLayer": false,
|
||||||
|
"launcherStyle": "spotlight",
|
||||||
|
"spotlightBarShowModeChips": true,
|
||||||
|
"keybindsFloatingWindow": false,
|
||||||
"useAutoLocation": false,
|
"useAutoLocation": false,
|
||||||
"weatherEnabled": true,
|
"weatherEnabled": true,
|
||||||
"networkPreference": "auto",
|
"dashTabs": [
|
||||||
"iconTheme": "WhiteSur-dark",
|
{
|
||||||
|
"id": "overview",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "media",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wallpaper",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "weather",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "settings",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"networkPreference": "ethernet",
|
||||||
|
"iconThemeDark": "System Default",
|
||||||
|
"iconThemeLight": "System Default",
|
||||||
|
"iconThemePerMode": false,
|
||||||
|
"lastAppliedIconTheme": "",
|
||||||
"cursorSettings": {
|
"cursorSettings": {
|
||||||
"theme": "System Default",
|
"theme": "System Default",
|
||||||
"size": 24,
|
"size": 24,
|
||||||
@@ -240,9 +343,9 @@
|
|||||||
"cursorHideTimeout": 0
|
"cursorHideTimeout": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"launcherLogoMode": "apps",
|
"launcherLogoMode": "os",
|
||||||
"launcherLogoCustomPath": "",
|
"launcherLogoCustomPath": "",
|
||||||
"launcherLogoColorOverride": "",
|
"launcherLogoColorOverride": "primary",
|
||||||
"launcherLogoColorInvertOnMode": false,
|
"launcherLogoColorInvertOnMode": false,
|
||||||
"launcherLogoBrightness": 0.5,
|
"launcherLogoBrightness": 0.5,
|
||||||
"launcherLogoContrast": 1,
|
"launcherLogoContrast": 1,
|
||||||
@@ -251,28 +354,50 @@
|
|||||||
"monoFontFamily": "Fira Code",
|
"monoFontFamily": "Fira Code",
|
||||||
"fontWeight": 400,
|
"fontWeight": 400,
|
||||||
"fontScale": 1,
|
"fontScale": 1,
|
||||||
|
"textRenderType": 0,
|
||||||
|
"textRenderQuality": 0,
|
||||||
"notepadUseMonospace": true,
|
"notepadUseMonospace": true,
|
||||||
"notepadFontFamily": "",
|
"notepadFontFamily": "",
|
||||||
"notepadFontSize": 14,
|
"notepadFontSize": 14,
|
||||||
|
"notificationSummaryFontSize": 0,
|
||||||
|
"notificationBodyFontSize": 0,
|
||||||
"notepadShowLineNumbers": false,
|
"notepadShowLineNumbers": false,
|
||||||
|
"notepadAutoSave": false,
|
||||||
|
"notepadSlideoutSide": "right",
|
||||||
|
"notepadDefaultMode": "slideout",
|
||||||
"notepadTransparencyOverride": -1,
|
"notepadTransparencyOverride": -1,
|
||||||
"notepadLastCustomTransparency": 0.7,
|
"notepadLastCustomTransparency": 0.7,
|
||||||
|
"notepadUseCompositorGap": false,
|
||||||
|
"notepadEdgeGap": 0,
|
||||||
"soundsEnabled": true,
|
"soundsEnabled": true,
|
||||||
"useSystemSoundTheme": false,
|
"useSystemSoundTheme": false,
|
||||||
|
"soundLogin": false,
|
||||||
"soundNewNotification": true,
|
"soundNewNotification": true,
|
||||||
"soundVolumeChanged": true,
|
"soundVolumeChanged": true,
|
||||||
"soundPluggedIn": true,
|
"soundPluggedIn": true,
|
||||||
|
"muteSoundsWhenMediaPlaying": true,
|
||||||
"acMonitorTimeout": 0,
|
"acMonitorTimeout": 0,
|
||||||
"acLockTimeout": 0,
|
"acLockTimeout": 0,
|
||||||
"acSuspendTimeout": 0,
|
"acSuspendTimeout": 0,
|
||||||
"acSuspendBehavior": 0,
|
"acSuspendBehavior": 0,
|
||||||
"acProfileName": "",
|
"acProfileName": "",
|
||||||
|
"acPostLockMonitorTimeout": 0,
|
||||||
"batteryMonitorTimeout": 0,
|
"batteryMonitorTimeout": 0,
|
||||||
"batteryLockTimeout": 0,
|
"batteryLockTimeout": 0,
|
||||||
"batterySuspendTimeout": 0,
|
"batterySuspendTimeout": 0,
|
||||||
"batterySuspendBehavior": 0,
|
"batterySuspendBehavior": 0,
|
||||||
"batteryProfileName": "",
|
"batteryProfileName": "",
|
||||||
|
"batteryPostLockMonitorTimeout": 0,
|
||||||
"batteryChargeLimit": 100,
|
"batteryChargeLimit": 100,
|
||||||
|
"batteryNotifyChargeLimit": false,
|
||||||
|
"batteryCriticalThreshold": 10,
|
||||||
|
"batteryNotifyCritical": true,
|
||||||
|
"batteryLowThreshold": 20,
|
||||||
|
"batteryNotifyLow": false,
|
||||||
|
"batteryChargeLimitNotificationType": 0,
|
||||||
|
"batteryLowNotificationType": 0,
|
||||||
|
"batteryCriticalNotificationType": 1,
|
||||||
|
"batteryAutoPowerSaver": false,
|
||||||
"lockBeforeSuspend": false,
|
"lockBeforeSuspend": false,
|
||||||
"loginctlLockIntegration": true,
|
"loginctlLockIntegration": true,
|
||||||
"fadeToLockEnabled": true,
|
"fadeToLockEnabled": true,
|
||||||
@@ -304,6 +429,7 @@
|
|||||||
"matugenTemplatePywalfox": true,
|
"matugenTemplatePywalfox": true,
|
||||||
"matugenTemplateZenBrowser": true,
|
"matugenTemplateZenBrowser": true,
|
||||||
"matugenTemplateVesktop": false,
|
"matugenTemplateVesktop": false,
|
||||||
|
"matugenTemplateVencord": true,
|
||||||
"matugenTemplateEquibop": true,
|
"matugenTemplateEquibop": true,
|
||||||
"matugenTemplateGhostty": true,
|
"matugenTemplateGhostty": true,
|
||||||
"matugenTemplateKitty": true,
|
"matugenTemplateKitty": true,
|
||||||
@@ -316,10 +442,23 @@
|
|||||||
"matugenTemplateVscode": true,
|
"matugenTemplateVscode": true,
|
||||||
"matugenTemplateEmacs": true,
|
"matugenTemplateEmacs": true,
|
||||||
"matugenTemplateZed": true,
|
"matugenTemplateZed": true,
|
||||||
|
"matugenTemplateNeovimSettings": {
|
||||||
|
"dark": {
|
||||||
|
"baseTheme": "github_dark",
|
||||||
|
"harmony": 0.5
|
||||||
|
},
|
||||||
|
"light": {
|
||||||
|
"baseTheme": "github_light",
|
||||||
|
"harmony": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"matugenTemplateNeovimSetBackground": true,
|
||||||
"showDock": false,
|
"showDock": false,
|
||||||
"dockAutoHide": false,
|
"dockAutoHide": false,
|
||||||
"dockSmartAutoHide": false,
|
"dockSmartAutoHide": false,
|
||||||
|
"dockUseOverlayLayer": false,
|
||||||
"dockGroupByApp": false,
|
"dockGroupByApp": false,
|
||||||
|
"dockRestoreSpecialWorkspaceOnClick": false,
|
||||||
"dockOpenOnOverview": false,
|
"dockOpenOnOverview": false,
|
||||||
"dockPosition": 1,
|
"dockPosition": 1,
|
||||||
"dockSpacing": 4,
|
"dockSpacing": 4,
|
||||||
@@ -342,6 +481,9 @@
|
|||||||
"dockMaxVisibleApps": 0,
|
"dockMaxVisibleApps": 0,
|
||||||
"dockMaxVisibleRunningApps": 0,
|
"dockMaxVisibleRunningApps": 0,
|
||||||
"dockShowOverflowBadge": true,
|
"dockShowOverflowBadge": true,
|
||||||
|
"dockShowTrash": false,
|
||||||
|
"dockTrashFileManager": "default",
|
||||||
|
"dockTrashCustomCommand": "",
|
||||||
"notificationOverlayEnabled": false,
|
"notificationOverlayEnabled": false,
|
||||||
"notificationPopupShadowEnabled": true,
|
"notificationPopupShadowEnabled": true,
|
||||||
"notificationPopupPrivacyMode": false,
|
"notificationPopupPrivacyMode": false,
|
||||||
@@ -359,14 +501,21 @@
|
|||||||
"maxFprintTries": 15,
|
"maxFprintTries": 15,
|
||||||
"enableU2f": false,
|
"enableU2f": false,
|
||||||
"u2fMode": "or",
|
"u2fMode": "or",
|
||||||
"lockScreenActiveMonitor": "all",
|
|
||||||
"lockScreenInactiveColor": "#000000",
|
"lockScreenInactiveColor": "#000000",
|
||||||
"lockScreenNotificationMode": 0,
|
"lockScreenNotificationMode": 0,
|
||||||
|
"lockScreenVideoEnabled": false,
|
||||||
|
"lockScreenVideoPath": "",
|
||||||
|
"lockScreenVideoCycling": false,
|
||||||
|
"lockScreenWallpaperPath": "",
|
||||||
|
"lockScreenWallpaperFillMode": "",
|
||||||
|
"lockScreenFontFamily": "",
|
||||||
"hideBrightnessSlider": false,
|
"hideBrightnessSlider": false,
|
||||||
"notificationTimeoutLow": 5000,
|
"notificationTimeoutLow": 5000,
|
||||||
"notificationTimeoutNormal": 5000,
|
"notificationTimeoutNormal": 5000,
|
||||||
"notificationTimeoutCritical": 0,
|
"notificationTimeoutCritical": 0,
|
||||||
"notificationCompactMode": false,
|
"notificationCompactMode": false,
|
||||||
|
"notificationShowTimeoutBar": false,
|
||||||
|
"notificationDedupeEnabled": true,
|
||||||
"notificationPopupPosition": 0,
|
"notificationPopupPosition": 0,
|
||||||
"notificationAnimationSpeed": 1,
|
"notificationAnimationSpeed": 1,
|
||||||
"notificationCustomAnimationDuration": 400,
|
"notificationCustomAnimationDuration": 400,
|
||||||
@@ -377,6 +526,7 @@
|
|||||||
"notificationHistorySaveNormal": true,
|
"notificationHistorySaveNormal": true,
|
||||||
"notificationHistorySaveCritical": true,
|
"notificationHistorySaveCritical": true,
|
||||||
"notificationRules": [],
|
"notificationRules": [],
|
||||||
|
"notificationFocusedMonitor": false,
|
||||||
"osdAlwaysShowValue": false,
|
"osdAlwaysShowValue": false,
|
||||||
"osdPosition": 5,
|
"osdPosition": 5,
|
||||||
"osdVolumeEnabled": true,
|
"osdVolumeEnabled": true,
|
||||||
@@ -407,9 +557,13 @@
|
|||||||
"customPowerActionReboot": "",
|
"customPowerActionReboot": "",
|
||||||
"customPowerActionPowerOff": "",
|
"customPowerActionPowerOff": "",
|
||||||
"updaterHideWidget": false,
|
"updaterHideWidget": false,
|
||||||
|
"updaterCheckOnStart": false,
|
||||||
"updaterUseCustomCommand": false,
|
"updaterUseCustomCommand": false,
|
||||||
"updaterCustomCommand": "",
|
"updaterCustomCommand": "",
|
||||||
"updaterTerminalAdditionalParams": "",
|
"updaterTerminalAdditionalParams": "",
|
||||||
|
"updaterIntervalSeconds": 1800,
|
||||||
|
"updaterIncludeFlatpak": true,
|
||||||
|
"updaterAllowAUR": true,
|
||||||
"displayNameMode": "system",
|
"displayNameMode": "system",
|
||||||
"screenPreferences": {},
|
"screenPreferences": {},
|
||||||
"showOnLastDisplay": {},
|
"showOnLastDisplay": {},
|
||||||
@@ -420,6 +574,7 @@
|
|||||||
"displayProfileAutoSelect": false,
|
"displayProfileAutoSelect": false,
|
||||||
"displayShowDisconnected": false,
|
"displayShowDisconnected": false,
|
||||||
"displaySnapToEdge": true,
|
"displaySnapToEdge": true,
|
||||||
|
"connectedFrameBarStyleBackups": {},
|
||||||
"barConfigs": [
|
"barConfigs": [
|
||||||
{
|
{
|
||||||
"bottomGap": 0,
|
"bottomGap": 0,
|
||||||
@@ -513,7 +668,7 @@
|
|||||||
"id": "gpuTemp",
|
"id": "gpuTemp",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"selectedGpuIndex": 0,
|
"selectedGpuIndex": 0,
|
||||||
"pciId": "",
|
"pciId": "10de:1f07",
|
||||||
"minimumWidth": true
|
"minimumWidth": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -526,9 +681,21 @@
|
|||||||
{
|
{
|
||||||
"id": "privacyIndicator",
|
"id": "privacyIndicator",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ambientSound",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "discordVoice",
|
||||||
|
"enabled": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rightWidgets": [
|
"rightWidgets": [
|
||||||
|
{
|
||||||
|
"id": "ocrScanner",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "homeAssistantMonitor",
|
"id": "homeAssistantMonitor",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
@@ -586,7 +753,7 @@
|
|||||||
"autoHideDelay": 250,
|
"autoHideDelay": 250,
|
||||||
"showOnWindowsOpen": false,
|
"showOnWindowsOpen": false,
|
||||||
"openOnOverview": false,
|
"openOnOverview": false,
|
||||||
"visible": false,
|
"visible": true,
|
||||||
"popupGapsAuto": true,
|
"popupGapsAuto": true,
|
||||||
"popupGapsManual": 4,
|
"popupGapsManual": 4,
|
||||||
"maximizeDetection": true,
|
"maximizeDetection": true,
|
||||||
@@ -667,12 +834,286 @@
|
|||||||
],
|
],
|
||||||
"systemMonitorVariants": [],
|
"systemMonitorVariants": [],
|
||||||
"desktopWidgetPositions": {},
|
"desktopWidgetPositions": {},
|
||||||
"desktopWidgetGridSettings": {},
|
"desktopWidgetGridSettings": {
|
||||||
"desktopWidgetInstances": [],
|
"DP-3": {
|
||||||
|
"enabled": true,
|
||||||
|
"size": 40
|
||||||
|
},
|
||||||
|
"HDMI-A-3": {
|
||||||
|
"enabled": true,
|
||||||
|
"size": 50
|
||||||
|
},
|
||||||
|
"DP-4": {
|
||||||
|
"enabled": true,
|
||||||
|
"size": 50
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"desktopWidgetInstances": [
|
||||||
|
{
|
||||||
|
"id": "dw_1782021985000_p2b35s81f",
|
||||||
|
"widgetType": "desktopClock",
|
||||||
|
"name": "Desktop Clock",
|
||||||
|
"enabled": true,
|
||||||
|
"config": {
|
||||||
|
"style": "digital",
|
||||||
|
"transparency": 0.8,
|
||||||
|
"colorMode": "primary",
|
||||||
|
"customColor": "#ffffff",
|
||||||
|
"showDate": true,
|
||||||
|
"showAnalogNumbers": false,
|
||||||
|
"showAnalogSeconds": true,
|
||||||
|
"displayPreferences": [
|
||||||
|
{
|
||||||
|
"name": "DP-2",
|
||||||
|
"model": "SUN-4K"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DP-3",
|
||||||
|
"model": "34GL750"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DP-4",
|
||||||
|
"model": "ZOWIE XL LCD"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"showDigitalSeconds": false,
|
||||||
|
"showOnOverlay": false,
|
||||||
|
"showOnOverviewOnly": false,
|
||||||
|
"showOnOverview": false
|
||||||
|
},
|
||||||
|
"positions": {
|
||||||
|
"DP-3": {
|
||||||
|
"width": 240,
|
||||||
|
"height": 240,
|
||||||
|
"x": 2240,
|
||||||
|
"y": 40
|
||||||
|
},
|
||||||
|
"DP-4": {
|
||||||
|
"width": 240.484375,
|
||||||
|
"height": 240.484375,
|
||||||
|
"x": 1350,
|
||||||
|
"y": 50
|
||||||
|
},
|
||||||
|
"HDMI-A-3": {
|
||||||
|
"width": 250,
|
||||||
|
"height": 250,
|
||||||
|
"x": 1650,
|
||||||
|
"y": 50
|
||||||
|
},
|
||||||
|
"DP-2": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 412,
|
||||||
|
"y": 284
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dw_1782022922490_aiumfxf49",
|
||||||
|
"widgetType": "cavaVisualizer",
|
||||||
|
"name": "Cava Visualizer",
|
||||||
|
"enabled": false,
|
||||||
|
"config": {
|
||||||
|
"displayPreferences": [
|
||||||
|
"all"
|
||||||
|
],
|
||||||
|
"syncPositionAcrossScreens": true,
|
||||||
|
"vizMode": "bars",
|
||||||
|
"barCount": 20,
|
||||||
|
"barSpacing": 10,
|
||||||
|
"barWidth": 0,
|
||||||
|
"orientation": "bottom",
|
||||||
|
"channels": "mono",
|
||||||
|
"colorChoice": "primary",
|
||||||
|
"bgOpacity": 0
|
||||||
|
},
|
||||||
|
"positions": {
|
||||||
|
"DP-3": {
|
||||||
|
"width": 1100,
|
||||||
|
"height": 500,
|
||||||
|
"x": 700,
|
||||||
|
"y": 550
|
||||||
|
},
|
||||||
|
"DP-4": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 860,
|
||||||
|
"y": 440
|
||||||
|
},
|
||||||
|
"HDMI-A-3": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 860,
|
||||||
|
"y": 440
|
||||||
|
},
|
||||||
|
"_synced": {
|
||||||
|
"x": 0.27313639322916666,
|
||||||
|
"y": 0.5089156539351852,
|
||||||
|
"width": 1100,
|
||||||
|
"height": 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dw_1782023131450_et7n3pv2q",
|
||||||
|
"widgetType": "dankDesktopWeather",
|
||||||
|
"name": "Dank Desktop Weather",
|
||||||
|
"enabled": true,
|
||||||
|
"config": {
|
||||||
|
"displayPreferences": [
|
||||||
|
{
|
||||||
|
"name": "DP-4",
|
||||||
|
"model": "ZOWIE XL LCD"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"syncPositionAcrossScreens": true,
|
||||||
|
"viewMode": "compact",
|
||||||
|
"colorMode": "primary",
|
||||||
|
"backgroundOpacity": 80,
|
||||||
|
"showPressure": true,
|
||||||
|
"forecastDays": 7,
|
||||||
|
"showHourlyForecast": false,
|
||||||
|
"hourlyCount": 12,
|
||||||
|
"showLocation": false,
|
||||||
|
"showCondition": true,
|
||||||
|
"showFeelsLike": true
|
||||||
|
},
|
||||||
|
"positions": {
|
||||||
|
"DP-3": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 1450,
|
||||||
|
"y": 200
|
||||||
|
},
|
||||||
|
"DP-4": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 860,
|
||||||
|
"y": 440
|
||||||
|
},
|
||||||
|
"HDMI-A-3": {
|
||||||
|
"width": 200,
|
||||||
|
"height": 200,
|
||||||
|
"x": 860,
|
||||||
|
"y": 440
|
||||||
|
},
|
||||||
|
"_synced": {
|
||||||
|
"x": 0.859375,
|
||||||
|
"y": 0.046296296296296294,
|
||||||
|
"width": 250,
|
||||||
|
"height": 250
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dw_1782021988600_vdg97np4g",
|
||||||
|
"widgetType": "systemMonitor",
|
||||||
|
"name": "System Monitor",
|
||||||
|
"enabled": true,
|
||||||
|
"config": {
|
||||||
|
"showHeader": true,
|
||||||
|
"transparency": 0.8,
|
||||||
|
"colorMode": "primary",
|
||||||
|
"customColor": "#ffffff",
|
||||||
|
"showCpu": true,
|
||||||
|
"showCpuGraph": true,
|
||||||
|
"showCpuTemp": true,
|
||||||
|
"showGpuTemp": false,
|
||||||
|
"gpuPciId": "",
|
||||||
|
"showMemory": true,
|
||||||
|
"showMemoryGraph": true,
|
||||||
|
"showNetwork": true,
|
||||||
|
"showNetworkGraph": true,
|
||||||
|
"showDisk": true,
|
||||||
|
"showTopProcesses": false,
|
||||||
|
"topProcessCount": 3,
|
||||||
|
"topProcessSortBy": "cpu",
|
||||||
|
"layoutMode": "auto",
|
||||||
|
"graphInterval": 300,
|
||||||
|
"displayPreferences": [
|
||||||
|
{
|
||||||
|
"name": "DP-2",
|
||||||
|
"model": "SUN-4K"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DP-4",
|
||||||
|
"model": "ZOWIE XL LCD"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"positions": {
|
||||||
|
"DP-3": {
|
||||||
|
"width": 800,
|
||||||
|
"height": 350,
|
||||||
|
"x": 1650,
|
||||||
|
"y": 650
|
||||||
|
},
|
||||||
|
"DP-4": {
|
||||||
|
"width": 800,
|
||||||
|
"height": 350,
|
||||||
|
"x": 1100,
|
||||||
|
"y": 650
|
||||||
|
},
|
||||||
|
"HDMI-A-3": {
|
||||||
|
"width": 700,
|
||||||
|
"height": 350,
|
||||||
|
"x": 1200,
|
||||||
|
"y": 650
|
||||||
|
},
|
||||||
|
"DP-2": {
|
||||||
|
"width": 320,
|
||||||
|
"height": 480,
|
||||||
|
"x": 352,
|
||||||
|
"y": 144
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"desktopWidgetGroups": [],
|
"desktopWidgetGroups": [],
|
||||||
"builtInPluginSettings": {},
|
"builtInPluginSettings": {
|
||||||
|
"dms_settings_search": {
|
||||||
|
"trigger": "?"
|
||||||
|
},
|
||||||
|
"dms_clipboard_search": {
|
||||||
|
"trigger": "cb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"clipboardClickToPaste": false,
|
||||||
"clipboardEnterToPaste": false,
|
"clipboardEnterToPaste": false,
|
||||||
"launcherPluginVisibility": {},
|
"clipboardRememberTypeFilter": false,
|
||||||
|
"clipboardTypeFilter": "all",
|
||||||
|
"clipboardVisibleEntryActions": [
|
||||||
|
"pin",
|
||||||
|
"edit",
|
||||||
|
"delete"
|
||||||
|
],
|
||||||
|
"launcherPluginVisibility": {
|
||||||
|
"obsidianSearch": {
|
||||||
|
"allowWithoutTrigger": false
|
||||||
|
},
|
||||||
|
"dms_settings_search": {
|
||||||
|
"allowWithoutTrigger": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"launcherPluginOrder": [],
|
"launcherPluginOrder": [],
|
||||||
"configVersion": 5
|
"frameEnabled": false,
|
||||||
|
"frameThickness": 100,
|
||||||
|
"frameRounding": 100,
|
||||||
|
"frameColor": "surface",
|
||||||
|
"frameOpacity": 0.69,
|
||||||
|
"frameScreenPreferences": [
|
||||||
|
"all"
|
||||||
|
],
|
||||||
|
"frameBarSize": 100,
|
||||||
|
"frameShowOnOverview": false,
|
||||||
|
"frameBlurEnabled": true,
|
||||||
|
"frameCloseGaps": false,
|
||||||
|
"frameLauncherEmergeSide": "bottom",
|
||||||
|
"frameLauncherArcExtender": true,
|
||||||
|
"frameLauncherEdgeHover": true,
|
||||||
|
"frameMode": "connected",
|
||||||
|
"barInsetPaddingShared": -1,
|
||||||
|
"barInsetPaddingSyncAll": false,
|
||||||
|
"frameBarInsetPadding": 26,
|
||||||
|
"configVersion": 12
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Generate a virtual-display EDID with 4K CTA VICs (trimmed from EnriqueWood POC)."""
|
||||||
|
|
||||||
|
import math
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def cvt_rb(w, h, refresh):
|
||||||
|
hblank, hfront, hsync = 160, 48, 32
|
||||||
|
htotal = w + hblank
|
||||||
|
vfront, vsync = 3, 8
|
||||||
|
rb_min_vblank = 460e-6
|
||||||
|
vblank = math.ceil(rb_min_vblank * refresh * h / (1.0 - rb_min_vblank * refresh))
|
||||||
|
vblank = max(vblank, vfront + vsync + 6)
|
||||||
|
vtotal = h + vblank
|
||||||
|
pixclk_khz = int(round(htotal * vtotal * refresh / 10000.0)) * 10
|
||||||
|
return dict(
|
||||||
|
w=w,
|
||||||
|
h=h,
|
||||||
|
refresh=refresh,
|
||||||
|
htotal=htotal,
|
||||||
|
vtotal=vtotal,
|
||||||
|
hblank=hblank,
|
||||||
|
hfront=hfront,
|
||||||
|
hsync=hsync,
|
||||||
|
vblank=vblank,
|
||||||
|
vfront=vfront,
|
||||||
|
vsync=vsync,
|
||||||
|
pixclk_khz=pixclk_khz,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def make_dtd(t, hmm=600, vmm=340):
|
||||||
|
w, h = t["w"], t["h"]
|
||||||
|
hblank, vblank = t["hblank"], t["vblank"]
|
||||||
|
hfront, hsync = t["hfront"], t["hsync"]
|
||||||
|
vfront, vsync = t["vfront"], t["vsync"]
|
||||||
|
pc = t["pixclk_khz"] // 10
|
||||||
|
d = bytearray(18)
|
||||||
|
d[0] = pc & 0xFF
|
||||||
|
d[1] = (pc >> 8) & 0xFF
|
||||||
|
d[2] = w & 0xFF
|
||||||
|
d[3] = hblank & 0xFF
|
||||||
|
d[4] = ((w >> 4) & 0xF0) | ((hblank >> 8) & 0x0F)
|
||||||
|
d[5] = h & 0xFF
|
||||||
|
d[6] = vblank & 0xFF
|
||||||
|
d[7] = ((h >> 4) & 0xF0) | ((vblank >> 8) & 0x0F)
|
||||||
|
d[8] = hfront & 0xFF
|
||||||
|
d[9] = hsync & 0xFF
|
||||||
|
d[10] = ((vfront & 0x0F) << 4) | (vsync & 0x0F)
|
||||||
|
d[11] = (
|
||||||
|
(((hfront >> 8) & 3) << 6)
|
||||||
|
| (((hsync >> 8) & 3) << 4)
|
||||||
|
| (((vfront >> 4) & 3) << 2)
|
||||||
|
| ((vsync >> 4) & 3)
|
||||||
|
)
|
||||||
|
d[12] = hmm & 0xFF
|
||||||
|
d[13] = vmm & 0xFF
|
||||||
|
d[14] = ((hmm >> 4) & 0xF0) | ((vmm >> 8) & 0x0F)
|
||||||
|
d[17] = 0x1E
|
||||||
|
return bytes(d)
|
||||||
|
|
||||||
|
|
||||||
|
def make_name(name):
|
||||||
|
d = bytearray(18)
|
||||||
|
d[3] = 0xFC
|
||||||
|
nb = name.encode("ascii")[:13]
|
||||||
|
d[5 : 5 + len(nb)] = nb
|
||||||
|
pos = 5 + len(nb)
|
||||||
|
if pos < 18:
|
||||||
|
d[pos] = 0x0A
|
||||||
|
pos += 1
|
||||||
|
for i in range(pos, 18):
|
||||||
|
d[i] = 0x20
|
||||||
|
return bytes(d)
|
||||||
|
|
||||||
|
|
||||||
|
def make_range(min_v, max_v, min_h, max_h, max_pixclk_mhz):
|
||||||
|
d = bytearray(18)
|
||||||
|
d[3] = 0xFD
|
||||||
|
flags = 0
|
||||||
|
mv, mh = max_v, max_h
|
||||||
|
if mh > 255:
|
||||||
|
flags |= 0x08
|
||||||
|
mh -= 255
|
||||||
|
if mv > 255:
|
||||||
|
flags |= 0x02
|
||||||
|
mv -= 255
|
||||||
|
d[4] = flags
|
||||||
|
d[5] = min_v
|
||||||
|
d[6] = mv
|
||||||
|
d[7] = min_h
|
||||||
|
d[8] = mh
|
||||||
|
d[9] = max_pixclk_mhz // 10
|
||||||
|
d[10] = 0x01
|
||||||
|
for i in range(11, 18):
|
||||||
|
d[i] = 0x0A if i == 11 else 0x20
|
||||||
|
return bytes(d)
|
||||||
|
|
||||||
|
|
||||||
|
def checksum(block):
|
||||||
|
return (256 - (sum(block[:-1]) % 256)) % 256
|
||||||
|
|
||||||
|
|
||||||
|
VICS = [97, 118, 96, 95, 63, 16, 4]
|
||||||
|
|
||||||
|
|
||||||
|
def build_base(base_dtds, name, max_pixclk_mhz):
|
||||||
|
b = bytearray(128)
|
||||||
|
b[0:8] = b"\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00"
|
||||||
|
b[8:10] = b"\x50\x74"
|
||||||
|
b[10:12] = b"\x70\x02"
|
||||||
|
b[16] = 22
|
||||||
|
b[17] = 34
|
||||||
|
b[18] = 1
|
||||||
|
b[19] = 4
|
||||||
|
b[20] = 0xA5
|
||||||
|
b[21] = 60
|
||||||
|
b[22] = 34
|
||||||
|
b[23] = 120
|
||||||
|
b[24] = 0x2E
|
||||||
|
b[25:35] = bytes([0x35, 0x85, 0xA6, 0x56, 0x48, 0x9A, 0x24, 0x12, 0x50, 0x54])
|
||||||
|
for i in range(8):
|
||||||
|
b[38 + i * 2] = 0x01
|
||||||
|
b[39 + i * 2] = 0x01
|
||||||
|
b[54:72] = make_dtd(base_dtds[0])
|
||||||
|
b[72:90] = make_dtd(base_dtds[1])
|
||||||
|
b[90:108] = make_range(24, 240, 30, 510, max_pixclk_mhz)
|
||||||
|
b[108:126] = make_name(name)
|
||||||
|
b[126] = 1
|
||||||
|
b[127] = checksum(b)
|
||||||
|
return b
|
||||||
|
|
||||||
|
|
||||||
|
def build_cta_primary(dtds):
|
||||||
|
b = bytearray(128)
|
||||||
|
b[0] = 0x02
|
||||||
|
b[1] = 0x03
|
||||||
|
pos = 4
|
||||||
|
b[pos] = (2 << 5) | len(VICS)
|
||||||
|
for i, v in enumerate(VICS):
|
||||||
|
b[pos + 1 + i] = v
|
||||||
|
pos += 1 + len(VICS)
|
||||||
|
b[pos] = (1 << 5) | 3
|
||||||
|
b[pos + 1], b[pos + 2], b[pos + 3] = 0x17, 0x7F, 0x07
|
||||||
|
pos += 4
|
||||||
|
b[pos] = (4 << 5) | 3
|
||||||
|
b[pos + 1] = 0x4F
|
||||||
|
pos += 4
|
||||||
|
b[2] = pos
|
||||||
|
b[3] = 0x40
|
||||||
|
used, p = [], pos
|
||||||
|
for t in dtds:
|
||||||
|
if p + 18 > 127:
|
||||||
|
break
|
||||||
|
b[p : p + 18] = make_dtd(t)
|
||||||
|
used.append(t)
|
||||||
|
p += 18
|
||||||
|
b[127] = checksum(b)
|
||||||
|
return b, used
|
||||||
|
|
||||||
|
|
||||||
|
def build(custom, name, max_pixclk_mhz=1200):
|
||||||
|
if len(custom) < 2:
|
||||||
|
custom = custom + custom[:1] * (2 - len(custom))
|
||||||
|
base = build_base(custom[0:2], name, max_pixclk_mhz)
|
||||||
|
rest = custom[2:]
|
||||||
|
cta1, _used = build_cta_primary(rest)
|
||||||
|
base[126] = 1
|
||||||
|
base[127] = checksum(base)
|
||||||
|
return bytes(base + cta1)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
output = sys.argv[1]
|
||||||
|
custom = [
|
||||||
|
cvt_rb(3840, 2160, 60),
|
||||||
|
cvt_rb(2560, 1440, 60),
|
||||||
|
cvt_rb(1920, 1080, 60),
|
||||||
|
]
|
||||||
|
edid = build(custom, "SUN-4K")
|
||||||
|
with open(output, "wb") as f:
|
||||||
|
f.write(edid)
|
||||||
|
assert len(edid) % 128 == 0
|
||||||
|
for i in range(len(edid) // 128):
|
||||||
|
block = edid[i * 128 : (i + 1) * 128]
|
||||||
|
assert sum(block) % 256 == 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
# Extra local disks. Declared here, not in hardware.nix (hardware.nix is generated).
|
# Extra local disks. Declared here, not in hardware.nix (hardware.nix is generated).
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
|
||||||
# Stable UID so NTFS `uid=` matches `users.users.olivier` (override if your account is not 1000).
|
|
||||||
olivierUid = config.users.users.olivier.uid or 1000;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
users.users.olivier.uid = lib.mkDefault 1000;
|
users.users.olivier.uid = lib.mkDefault 1000;
|
||||||
# LABEL="MediaLibrary" (btrfs on sda1 by UUID). No subvol=@ — this disk has no @ subvolume.
|
# LABEL="MediaLibrary" (btrfs on sda1 by UUID). No subvol=@ — this disk has no @ subvolume.
|
||||||
@@ -33,15 +29,4 @@ in
|
|||||||
# LABEL="Deep Storage Unit". Owner olivier, group nfsmedia (990) so:
|
# LABEL="Deep Storage Unit". Owner olivier, group nfsmedia (990) so:
|
||||||
# - local logins write as user 1000 (owner rwx);
|
# - local logins write as user 1000 (owner rwx);
|
||||||
# - NFS (all_squash → uid/gid 990) matches group 990 → rwx (see jellyfin-nfs-export).
|
# - NFS (all_squash → uid/gid 990) matches group 990 → rwx (see jellyfin-nfs-export).
|
||||||
#fileSystems."/mnt/test" = {
|
|
||||||
# device = "/dev/disk/by-uuid/BC12E55E12E51DE0";
|
|
||||||
# fsType = "ntfs-3g";
|
|
||||||
# options = [
|
|
||||||
# "rw"
|
|
||||||
# "force"
|
|
||||||
# "uid=${toString olivierUid}"
|
|
||||||
# "gid=990"
|
|
||||||
# "umask=0002"
|
|
||||||
# ];
|
|
||||||
#};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
# All MediaTek MT7927 / MT6639 (Filogic 380) WiFi 7 + Bluetooth support for this
|
||||||
|
# host in one place: the upstream flake module, the hardware enablement, and the
|
||||||
|
# workarounds needed to actually make it function on nixos-unstable.
|
||||||
|
#
|
||||||
|
# Workaround background: on current nixos-unstable, `boot.extraModulePackages`
|
||||||
|
# modules placed in `extra/` are NOT indexed by `depmod` (modules.dep /
|
||||||
|
# modules.alias contain zero `extra/` entries). As a result `modprobe`/udev
|
||||||
|
# resolve mt7925e / btusb to the stock in-tree drivers, which do not support the
|
||||||
|
# MediaTek MT7927 (14c3:7927). We therefore force the patched out-of-tree modules
|
||||||
|
# to load by explicit path, blacklist the in-tree collisions so udev cannot bind
|
||||||
|
# them first, and fix the BT firmware path the driver expects.
|
||||||
|
let
|
||||||
|
# The upstream mt7927 flake installs the BT firmware under
|
||||||
|
# `mediatek/mt6639/`, but the patched btmtk driver requests it from
|
||||||
|
# `mediatek/mt7927/`. Provide it at the expected path.
|
||||||
|
mt7927BtFirmwareFix = pkgs.runCommand "mt7927-bt-firmware-fix" { } ''
|
||||||
|
src="${inputs.mt7927.packages.${pkgs.system}.firmware}/lib/firmware/mediatek/mt6639/BT_RAM_CODE_MT6639_2_1_hdr.bin"
|
||||||
|
install -Dm644 "$src" \
|
||||||
|
"$out/lib/firmware/mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.mt7927.nixosModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.mediatek-mt7927 = {
|
||||||
|
enable = true;
|
||||||
|
enableWifi = true;
|
||||||
|
enableBluetooth = true;
|
||||||
|
disableAspm = true; # Highly recommended to fix upload speeds
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.firmware = [ mt7927BtFirmwareFix ];
|
||||||
|
|
||||||
|
boot.blacklistedKernelModules = [
|
||||||
|
# Whole mt76 stack (patched extra/ copy replaces it entirely).
|
||||||
|
"mt76"
|
||||||
|
"mt76_connac_lib"
|
||||||
|
"mt792x_lib"
|
||||||
|
"mt7921_common"
|
||||||
|
"mt7921e"
|
||||||
|
"mt7925_common"
|
||||||
|
"mt7925e"
|
||||||
|
# Patched bluetooth.
|
||||||
|
"btusb"
|
||||||
|
"btmtk"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.mt7927-force = {
|
||||||
|
description = "Force-load patched MediaTek MT7927 (Filogic 380) kernel modules";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
before = [ "network.target" "NetworkManager.service" ];
|
||||||
|
path = [ pkgs.kmod ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
KVER="$(uname -r)"
|
||||||
|
EXTRA="/run/booted-system/kernel-modules/lib/modules/$KVER/extra"
|
||||||
|
|
||||||
|
# Load in-tree core dependencies (these ARE indexed, so modprobe works).
|
||||||
|
modprobe mac80211 cfg80211 rfkill led-class bluetooth || true
|
||||||
|
|
||||||
|
# Defensive: drop any in-tree mt76 modules that may have been pulled in
|
||||||
|
# (e.g. via boot.kernelModules) so the patched copies can bind instead.
|
||||||
|
rmmod mt7925e mt7921e mt7925_common mt7921_common mt792x_lib mt76_connac_lib mt76 2>/dev/null || true
|
||||||
|
|
||||||
|
insmod_x() {
|
||||||
|
local mod="$1"
|
||||||
|
local name
|
||||||
|
name="''${mod##*/}"; name="''${name%.ko}"
|
||||||
|
if lsmod | grep -q "^$name "; then
|
||||||
|
echo "mt7927-force: $name already loaded, skipping"
|
||||||
|
else
|
||||||
|
echo "mt7927-force: insmod $mod"
|
||||||
|
insmod "$mod" || echo "mt7927-force: FAILED to insmod $mod"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Patched mt76 stack (full replacement, dependency order).
|
||||||
|
insmod_x "$EXTRA/mt76/mt76.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt76-connac-lib.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt792x-lib.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt7921/mt7921-common.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt7925/mt7925-common.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt7921/mt7921e.ko"
|
||||||
|
insmod_x "$EXTRA/mt76/mt7925/mt7925e.ko"
|
||||||
|
|
||||||
|
# Patched bluetooth. The patched btmtk/btusb need symbols from the
|
||||||
|
# in-tree bluetooth core (bluetooth.ko) and the btrtl/btintel/btbcm
|
||||||
|
# helpers, so load those first (they are indexed and modprobe-able).
|
||||||
|
for m in bluetooth btrtl btintel btbcm rfkill ecdh_generic ecc crc16; do
|
||||||
|
if modprobe "$m" 2>/dev/null; then
|
||||||
|
echo "mt7927-force: modprobe $m ok"
|
||||||
|
else
|
||||||
|
echo "mt7927-force: modprobe $m FAILED (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
insmod_x "$EXTRA/bluetooth/btmtk.ko"
|
||||||
|
insmod_x "$EXTRA/bluetooth/btusb.ko"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
{
|
{
|
||||||
appId = "org.moonfin.linux";
|
appId = "org.moonfin.linux";
|
||||||
bundle = pkgs.fetchurl {
|
bundle = pkgs.fetchurl {
|
||||||
url = "https://github.com/Moonfin-Client/Moonfin-Core/releases/download/2.1.0/Moonfin_Linux_v2.1.0.flatpak";
|
url = "https://github.com/Moonfin-Client/Moonfin-Core/releases/download/2.2.0/Moonfin_Linux_v2.2.0.flatpak";
|
||||||
hash = "sha256-dJcI/bzKS/+SCkHarSBesei5CKCm93SjRJBp09Jn810=";
|
hash = "sha256-66YaGJQEK3u+SAmtsXLbCH4ZF8gL/Jl1S5PRGDfZ5fE=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ lib.mkIf (!config.chiasson.system.gpuPassthru.enable) {
|
|||||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.nvidia-container-toolkit.enable = true;
|
hardware.nvidia-container-toolkit.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Headless 4K virtual output for Sunshine → Moonlight on a client TV.
|
||||||
|
#
|
||||||
|
# NVIDIA: force-enable a spare DRM connector with a custom EDID via kernel params:
|
||||||
|
# video=<connector>:e force-enables the connector
|
||||||
|
# drm.edid_firmware=<connector>:… loads modes from the EDID blob
|
||||||
|
#
|
||||||
|
# Capture is pinned to the connector by name (Sunshine `output_name`), which is
|
||||||
|
# stable across reboots/hotplug — unlike a numeric monitor index.
|
||||||
|
# Reboot after changing connector or EDID. 4K@60 is realistic on RTX 2070.
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.chiasson.system.streamingDisplay;
|
||||||
|
|
||||||
|
edidFirmware = pkgs.runCommand "sunshine-virtual-4k-edid" {
|
||||||
|
nativeBuildInputs = [ pkgs.python3 ];
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/lib/firmware/edid
|
||||||
|
${pkgs.python3}/bin/python3 ${./generate-virtual-edid.py} $out/lib/firmware/edid/${cfg.edidFileName}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# On stream start: scale + focus the virtual 4K output so streamed windows
|
||||||
|
# land there. Capture is pinned to the connector via Sunshine `output_name`,
|
||||||
|
# so no fragile numeric-index detection is needed.
|
||||||
|
streamDisplayUp = pkgs.writeShellScriptBin "stream-display-up" ''
|
||||||
|
${pkgs.niri}/bin/niri msg output ${cfg.connector} scale ${toString cfg.niriScale}
|
||||||
|
${pkgs.niri}/bin/niri msg action focus-monitor ${cfg.connector}
|
||||||
|
${pkgs.niri}/bin/niri msg action move-window-to-monitor ${cfg.connector} || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
streamDisplayDown = pkgs.writeShellScriptBin "stream-display-down" ''
|
||||||
|
${pkgs.niri}/bin/niri msg action focus-monitor ${cfg.focusMonitorOnEnd}
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.chiasson.system.streamingDisplay = {
|
||||||
|
enable = lib.mkEnableOption ''
|
||||||
|
Force-enable a spare NVIDIA DRM connector with a 4K EDID for Sunshine/Moonlight.
|
||||||
|
Requires reboot. Pair with `chiasson.desktop.niri` output config in `displays.nix`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
connector = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "DP-2";
|
||||||
|
example = "HDMI-A-1";
|
||||||
|
description = ''
|
||||||
|
DRM connector name (e.g. `DP-2`, `HDMI-A-1`). Must be unused on the host —
|
||||||
|
14900k desk uses DP-3, DP-4, and HDMI-A-3 by default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
edidFileName = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "virtual-4k.bin";
|
||||||
|
description = "Filename under `/lib/firmware/edid/` referenced by `drm.edid_firmware`.";
|
||||||
|
};
|
||||||
|
|
||||||
|
mode = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "3840x2160@60";
|
||||||
|
description = "Mode Niri should use on the virtual output (must match EDID).";
|
||||||
|
};
|
||||||
|
|
||||||
|
niriPosition = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "x=7680 y=0";
|
||||||
|
description = ''
|
||||||
|
Niri `position` for the virtual panel — keep it clear of desk monitors
|
||||||
|
so streamed windows do not overlap your ultrawide layout.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
niriScale = lib.mkOption {
|
||||||
|
type = lib.types.float;
|
||||||
|
default = 1.5;
|
||||||
|
example = 1.5;
|
||||||
|
description = ''
|
||||||
|
Niri `scale` on the virtual panel. Values above 1.0 enlarge UI and text
|
||||||
|
on the 4K framebuffer (helpful when viewing on a TV from the couch).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
focusMonitorOnEnd = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "DP-3";
|
||||||
|
description = "Niri monitor to refocus when a Moonlight session ends.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
{
|
||||||
|
hardware.firmware = [ edidFirmware ];
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
"video=${cfg.connector}:e"
|
||||||
|
"drm.edid_firmware=${cfg.connector}:edid/${cfg.edidFileName}"
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
streamDisplayUp
|
||||||
|
streamDisplayDown
|
||||||
|
];
|
||||||
|
}
|
||||||
|
(lib.mkIf config.chiasson.system.gaming.sunshine.enable {
|
||||||
|
services.sunshine.settings = {
|
||||||
|
capture = "wlr";
|
||||||
|
# Pin capture to the virtual display by connector name (stable across
|
||||||
|
# reboots/hotplug). A numeric index drifted to the ultrawide before.
|
||||||
|
output_name = cfg.connector;
|
||||||
|
# RTX 2070 has no AV1 NVENC; avoid probing av1_nvenc.
|
||||||
|
encoder = "hevc_nvenc,h264_nvenc";
|
||||||
|
global_prep_cmd = "[{\"do\":\"${streamDisplayUp}/bin/stream-display-up\",\"undo\":\"${streamDisplayDown}/bin/stream-display-down\"}]";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# VM self-test overrides — used with nixos-rebuild build-vm to try the system
|
||||||
|
# in a VM without rebuilding/rebooting the host.
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
config = {
|
||||||
|
|
||||||
|
|
||||||
|
hardware.nvidia-container-toolkit.enable = lib.mkForce false;
|
||||||
|
hardware.nvidia.package = lib.mkForce null;
|
||||||
|
services.xserver.videoDrivers = lib.mkForce [ "modesetting" ];
|
||||||
|
|
||||||
|
virtualisation = {
|
||||||
|
memorySize = 4096;
|
||||||
|
cores = 3;
|
||||||
|
graphics = true;
|
||||||
|
qemu.options = [
|
||||||
|
"-device virtio-vga-gl"
|
||||||
|
"-display gtk,gl=on"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.olivier = {
|
||||||
|
initialPassword = lib.mkForce "";
|
||||||
|
hashedPasswordFile = lib.mkForce null; # Disable the secret file dependency
|
||||||
|
};
|
||||||
|
|
||||||
|
# Force greetd's `initial_session` directly. We can't rely on
|
||||||
|
# `services.displayManager.autoLogin` because DankGreeter's flake module
|
||||||
|
# (inputs.dms.nixosModules.greeter) aggressively overwrites
|
||||||
|
# `services.greetd.settings`, clobbering whatever the displayManager
|
||||||
|
# module injects for auto-login. mkForce on `initial_session` alone wins
|
||||||
|
# against DMS without touching `default_session` (DankGreeter), so a
|
||||||
|
# manual logout in the VM still shows DankGreeter. VM-only — host build
|
||||||
|
# is unaffected because this whole block lives under vmVariant.
|
||||||
|
services.greetd.settings.initial_session = lib.mkForce {
|
||||||
|
command = "${pkgs.niri}/bin/niri-session";
|
||||||
|
user = "olivier";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.grc ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,16 +15,21 @@
|
|||||||
self.nixosModules."client-services"
|
self.nixosModules."client-services"
|
||||||
./_private/platform.nix
|
./_private/platform.nix
|
||||||
./_private/nvidia.nix
|
./_private/nvidia.nix
|
||||||
|
./_private/vm-self.nix
|
||||||
./_private/gpu-passthru.nix
|
./_private/gpu-passthru.nix
|
||||||
./_private/peripherals.nix
|
./_private/peripherals.nix
|
||||||
# ./_private/printing-epson.nix
|
# ./_private/printing-epson.nix
|
||||||
./_private/displays.nix
|
./_private/displays.nix
|
||||||
|
./_private/streaming-display.nix
|
||||||
|
./_private/ai.nix
|
||||||
./_private/media-disk.nix
|
./_private/media-disk.nix
|
||||||
|
./_private/mediatek-mt7927.nix
|
||||||
./_private/jellyfin-nfs-export.nix
|
./_private/jellyfin-nfs-export.nix
|
||||||
./_private/moonfin-flatpak.nix
|
./_private/moonfin-flatpak.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.cloudflare-warp.enable = true;
|
services.cloudflare-warp.enable = true;
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;
|
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;
|
||||||
boot.kernel.sysctl."fs.inotify.max_user_instances" = 2048;
|
boot.kernel.sysctl."fs.inotify.max_user_instances" = 2048;
|
||||||
@@ -40,22 +45,12 @@
|
|||||||
libvdpau-va-gl
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.sessionVariables = {
|
environment.sessionVariables = {
|
||||||
LIBVA_DRIVER_NAME = "iHD";
|
LIBVA_DRIVER_NAME = "iHD";
|
||||||
# Force VA-API to use the Intel iGPU render node (otherwise libva may pick NVIDIA and iHD fails).
|
# Force VA-API to use the Intel iGPU render node (otherwise libva may pick NVIDIA and iHD fails).
|
||||||
LIBVA_DRM_DEVICE = "/dev/dri/renderD128";
|
LIBVA_DRM_DEVICE = "/dev/dri/renderD128";
|
||||||
};
|
};
|
||||||
|
|
||||||
chiasson.system.caching.attic = {
|
|
||||||
enable = true;
|
|
||||||
cacheName = "nixos-new";
|
|
||||||
endpoint = "http://192.168.2.238:8080/";
|
|
||||||
publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
|
|
||||||
tokenFile = config.sops.secrets."caching/attic/token".path;
|
|
||||||
push.enable = true;
|
|
||||||
userCli.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
chiasson.desktop = {
|
chiasson.desktop = {
|
||||||
niri.enable = true;
|
niri.enable = true;
|
||||||
@@ -69,8 +64,7 @@
|
|||||||
"--flake"
|
"--flake"
|
||||||
".#14900k"
|
".#14900k"
|
||||||
];
|
];
|
||||||
enableRbwLockToggle = true;
|
defaultSeedDir = ./_private/dms-defaults;
|
||||||
defaultSettingsFile = ./_private/dms-default-settings.json;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -86,6 +80,10 @@
|
|||||||
gaming.sunshine.enable = true;
|
gaming.sunshine.enable = true;
|
||||||
gaming.sunshine.cudaSupport = true;
|
gaming.sunshine.cudaSupport = true;
|
||||||
|
|
||||||
|
streamingDisplay.enable = true;
|
||||||
|
# Spare NVIDIA port — verify with: grep -H . /sys/class/drm/card*-*/status
|
||||||
|
streamingDisplay.connector = "DP-2";
|
||||||
|
|
||||||
monitorInput.enable = true;
|
monitorInput.enable = true;
|
||||||
|
|
||||||
flatpak.enable = true;
|
flatpak.enable = true;
|
||||||
@@ -102,7 +100,9 @@
|
|||||||
yt-dlp
|
yt-dlp
|
||||||
|
|
||||||
# Native install (avoid flatpak sandbox issues for QSV/VAAPI).
|
# Native install (avoid flatpak sandbox issues for QSV/VAAPI).
|
||||||
handbrake
|
# handbrake # TEMP removed 2026-07-13 — depends on broken ffmpeg-full-8.1.2
|
||||||
|
# # (A01-mov-read patch fails against 8.1.2 source). Re-enable
|
||||||
|
# # when nixpkgs regenerates the patch or when switching to stable.
|
||||||
|
|
||||||
qbittorrent
|
qbittorrent
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
host = "14900k";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules."14900kConfiguration"
|
self.nixosModules."14900kConfiguration"
|
||||||
|
|||||||
@@ -23,6 +23,13 @@
|
|||||||
pokeclicker.enable = true;
|
pokeclicker.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
editors.vscode = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
alefragnani.project-manager
|
||||||
|
johnpapa.vscode-peacock
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,93 +1,22 @@
|
|||||||
# Shared Home Manager selection for all desktop hosts (14900k, t2mbp, ideapad, uConsole).
|
# Shared Home Manager selection for all desktop hosts (14900k, t2mbp, ideapad, uConsole).
|
||||||
# Wisdom slices resolved here (NixOS has `self`); toggles select what actually installs.
|
# Wisdom slices resolved here (NixOS has `self`); toggles select what actually installs.
|
||||||
{ self, inputs, ... }:
|
{ self, ... }:
|
||||||
{
|
{
|
||||||
flake.nixosModules.desktopHomeBase =
|
flake.nixosModules.desktopHomeBase =
|
||||||
{ self, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
chiasson.system.chromiumHevc.enable = lib.mkDefault true;
|
chiasson.system.chromiumHevc.enable = lib.mkDefault true;
|
||||||
|
|
||||||
chiasson.users.extraModules.olivier =
|
chiasson.system.caching.attic = lib.mkDefault {
|
||||||
self.lib.wisdomCatalogExtraModules self
|
enable = true;
|
||||||
++ [
|
cacheName = "nixos-new";
|
||||||
(
|
endpoint = "http://192.168.2.238:8080/";
|
||||||
{ lib, pkgs, ... }:
|
publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
|
||||||
let
|
tokenFile = config.sops.secrets."caching/attic/token".path;
|
||||||
aarch64 = pkgs.stdenv.hostPlatform.isAarch64;
|
push.enable = true;
|
||||||
in
|
userCli.enable = true;
|
||||||
{
|
};
|
||||||
programs.git = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
settings.user = {
|
|
||||||
name = "OlivierChiasson";
|
|
||||||
email = "olivierchiasson@hotmail.fr";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#TODO[epic=Moderate] Check if git-crypt should belong in desktop-home-base.
|
chiasson.users.extraModules.olivier = self.lib.wisdomCatalogExtraModules self;
|
||||||
home.packages = [ pkgs.git-crypt ];
|
|
||||||
|
|
||||||
chiasson.home = {
|
|
||||||
# Catalog of `chiasson.home.*` toggles — host `home.nix` sets `enable = true` to override `mkDefault false`.
|
|
||||||
shell = {
|
|
||||||
fish.enable = lib.mkDefault true;
|
|
||||||
ohMyPosh.enable = lib.mkDefault true;
|
|
||||||
yazi.enable = lib.mkDefault true;
|
|
||||||
};
|
|
||||||
|
|
||||||
terminals.kitty.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
filebrowsers.nemo.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
browsers = {
|
|
||||||
chrome.enable = lib.mkDefault false;
|
|
||||||
chromiumHevc = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
packages = lib.mkDefault (
|
|
||||||
if aarch64 then
|
|
||||||
[ "chromium" ]
|
|
||||||
else
|
|
||||||
[ "google-chrome" ]
|
|
||||||
);
|
|
||||||
} // lib.optionalAttrs (!aarch64) {
|
|
||||||
# Chromium + NVIDIA VA-API → frame pool errors in Jellyfin; gecko may fare better on NVIDIA.
|
|
||||||
vaapi.gpu = lib.mkDefault "intel";
|
|
||||||
};
|
|
||||||
edge.enable = lib.mkDefault false;
|
|
||||||
flow.enable = lib.mkDefault false;
|
|
||||||
orion.enable = lib.mkDefault false;
|
|
||||||
zen.enable = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
|
|
||||||
editors = {
|
|
||||||
cursor.enable = lib.mkDefault true;
|
|
||||||
kate.enable = lib.mkDefault false;
|
|
||||||
obsidian.enable = lib.mkDefault true;
|
|
||||||
};
|
|
||||||
|
|
||||||
apps = {
|
|
||||||
discord.enable = lib.mkDefault false;
|
|
||||||
localsend.enable = lib.mkDefault true;
|
|
||||||
pokeclicker.enable = lib.mkDefault false;
|
|
||||||
spotify = {
|
|
||||||
enable = lib.mkDefault false;
|
|
||||||
openDiscoveryFirewall = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
desktop = {
|
|
||||||
screenshot = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
swiftshareApiKeyFile = "/run/secrets/swiftshare/API_KEY"; #TODO[epic=sops] redo this by passing sops file output directly
|
|
||||||
};
|
|
||||||
# WhiteSur GTK/icons, Phinger cursor, DMS matugen for GTK (+ qt6ct for Qt apps).
|
|
||||||
theming.enable = lib.mkDefault true;
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.uconsoleGamepad.enable = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,26 +42,10 @@
|
|||||||
# rebuilds Mobile NixOS' script-loader against the patched mruby.
|
# rebuilds Mobile NixOS' script-loader against the patched mruby.
|
||||||
chiasson.system.ideapadMrubyOverlay.enable = true;
|
chiasson.system.ideapadMrubyOverlay.enable = true;
|
||||||
|
|
||||||
# Wi-Fi modem (qcom-wcn3990) + Bluetooth (QCA crnv32) need binary blobs.
|
# Wi-Fi modem (qcom-wcn3990) + Bluetooth (QCA crnv32) need binary blobs
|
||||||
nixpkgs.config.allowUnfreePredicate =
|
|
||||||
pkg: builtins.elem (lib.getName pkg) [
|
|
||||||
"chromeos-sc7180-unredistributable-firmware"
|
|
||||||
"chromeos-sc7180-unredistributable-firmware-zstd"
|
|
||||||
];
|
|
||||||
hardware.firmware = [ pkgs.chromeos-sc7180-unredistributable-firmware ];
|
hardware.firmware = [ pkgs.chromeos-sc7180-unredistributable-firmware ];
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
# ─────────────────────── Attic (substitution + push + CLI token) ───────
|
|
||||||
chiasson.system.caching.attic = {
|
|
||||||
enable = true;
|
|
||||||
cacheName = "nixos-new";
|
|
||||||
endpoint = "http://192.168.2.238:8080/";
|
|
||||||
publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
|
|
||||||
tokenFile = config.sops.secrets."caching/attic/token".path;
|
|
||||||
push.enable = true;
|
|
||||||
userCli.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# ─────────────────────── System bits ───────────────────────
|
# ─────────────────────── System bits ───────────────────────
|
||||||
chiasson.system = {
|
chiasson.system = {
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
@@ -90,8 +74,6 @@
|
|||||||
defaultSession = "niri";
|
defaultSession = "niri";
|
||||||
shell = "dms";
|
shell = "dms";
|
||||||
shells.dms = {
|
shells.dms = {
|
||||||
enableWvkbdToggle = true;
|
|
||||||
enableRbwLockToggle = true;
|
|
||||||
# Cross-build on the 14900k via binfmt and push back over LAN — much faster than
|
# Cross-build on the 14900k via binfmt and push back over LAN — much faster than
|
||||||
# rebuilding aarch64 closure on the Snapdragon. Mirrors the old NixOS-New flow:
|
# rebuilding aarch64 closure on the Snapdragon. Mirrors the old NixOS-New flow:
|
||||||
# ssh out to nixdesk, run nixos-rebuild --target-host pointing back at us.
|
# ssh out to nixdesk, run nixos-rebuild --target-host pointing back at us.
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
host = "ideapad";
|
|
||||||
system = "aarch64-linux";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules.ideapadConfiguration
|
self.nixosModules.ideapadConfiguration
|
||||||
|
|||||||
@@ -4,18 +4,5 @@
|
|||||||
{ self, ... }:
|
{ self, ... }:
|
||||||
{
|
{
|
||||||
imports = [ self.nixosModules.desktopHomeBase ];
|
imports = [ self.nixosModules.desktopHomeBase ];
|
||||||
|
|
||||||
# Host-only HM overrides (tablet apps, toggles off from desktop-home-base, …).
|
|
||||||
chiasson.users.extraModules.olivier = [
|
|
||||||
# {
|
|
||||||
# chiasson.home = {
|
|
||||||
# # editors.kate.enable = true;
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
# (
|
|
||||||
# { pkgs, ... }:
|
|
||||||
# { home.packages = with pkgs; [ ]; }
|
|
||||||
# )
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ in
|
|||||||
"blackfry.day"
|
"blackfry.day"
|
||||||
"yestur.day"
|
"yestur.day"
|
||||||
"rp-own.life"
|
"rp-own.life"
|
||||||
"xn--1iu.cc"
|
"慧.cc"
|
||||||
];
|
];
|
||||||
proxied = true;
|
proxied = true;
|
||||||
ipv4 = true;
|
ipv4 = true;
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
{ lib, ... }:
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
secretFilePath = ../secrets.yaml;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
sops.secrets."cloudflare-turnstile/secret-key".sopsFile = secretFilePath;
|
||||||
|
sops.secrets."cloudflare-turnstile/site-key".sopsFile = secretFilePath;
|
||||||
|
|
||||||
|
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@@ -22,7 +30,16 @@
|
|||||||
SSH_LISTEN_PORT = 222;
|
SSH_LISTEN_PORT = 222;
|
||||||
};
|
};
|
||||||
|
|
||||||
service.DISABLE_REGISTRATION = false;
|
service = {
|
||||||
|
DISABLE_REGISTRATION = false;
|
||||||
|
ENABLE_CAPTCHA = true;
|
||||||
|
CAPTCHA_TYPE = "cfturnstile";
|
||||||
|
CF_TURNSTILE_SECRET = config.sops.secrets."cloudflare-turnstile/secret-key".path;
|
||||||
|
CF_TURNSTILE_SITEKEY = config.sops.secrets."cloudflare-turnstile/site-key".path;
|
||||||
|
REGISTER_EMAIL_CONFIRM = false;
|
||||||
|
ENABLE_NOTIFY_MAIL = false;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
# NFS mounts of nixdesk (14900k) bulk storage for nix-server. Exports live in
|
|
||||||
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
|
|
||||||
#
|
|
||||||
# Jellyfin library paths (see also services/jellyfin.nix):
|
|
||||||
# Movies → /mnt/nixdesk-jellyfin/movies
|
|
||||||
# Shows → /mnt/nixdesk-jellyfin/tv
|
|
||||||
#
|
|
||||||
# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the
|
|
||||||
# old client mount and let automount reattach, e.g.:
|
|
||||||
# sudo umount -l /mnt/nixdesk-jellyfin
|
|
||||||
# ls /mnt/nixdesk-jellyfin
|
|
||||||
# (or reboot nix-server.)
|
|
||||||
{ ... }:
|
|
||||||
let
|
|
||||||
nfsExportHost = "192.168.2.25";
|
|
||||||
# nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes.
|
|
||||||
nfsClientOpts = [
|
|
||||||
"rw"
|
|
||||||
"noatime"
|
|
||||||
"nofail"
|
|
||||||
"_netdev"
|
|
||||||
"nfsvers=3"
|
|
||||||
"tcp"
|
|
||||||
"lookupcache=none"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.idle-timeout=3600"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
fileSystems."/mnt/nixdesk-jellyfin" = {
|
|
||||||
device = "${nfsExportHost}:/mnt/deep/jellyfin";
|
|
||||||
fsType = "nfs";
|
|
||||||
options = nfsClientOpts;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -3,8 +3,6 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
host = "nix-server";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules.nix-serverConfiguration
|
self.nixosModules.nix-serverConfiguration
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ personal-website:
|
|||||||
oauth-discord-client-secret: ENC[AES256_GCM,data:YegPgoSRKNcDaID9LPWxHDz4T7VnhFfuWMyALfFhpg8=,iv:VSLWA1HG1+Y70tKnRoFulBZSKdoJTYmIDzCXIZeFYCc=,tag:yNR8rrm/7Mrj/RIVNLFfsg==,type:str]
|
oauth-discord-client-secret: ENC[AES256_GCM,data:YegPgoSRKNcDaID9LPWxHDz4T7VnhFfuWMyALfFhpg8=,iv:VSLWA1HG1+Y70tKnRoFulBZSKdoJTYmIDzCXIZeFYCc=,tag:yNR8rrm/7Mrj/RIVNLFfsg==,type:str]
|
||||||
cloudflare-ddns:
|
cloudflare-ddns:
|
||||||
api-token: ENC[AES256_GCM,data:wFKbclETO0YQTcfNUdKyr6mxQODeiaYn3gLeC1mWeRda97rOvlum+Q==,iv:IuT4exNhh0z+9DbY3WNnVqEy4398DTm7aluhOv9XFss=,tag:GGPoSJLBScTmXyQ7Vab6EA==,type:str]
|
api-token: ENC[AES256_GCM,data:wFKbclETO0YQTcfNUdKyr6mxQODeiaYn3gLeC1mWeRda97rOvlum+Q==,iv:IuT4exNhh0z+9DbY3WNnVqEy4398DTm7aluhOv9XFss=,tag:GGPoSJLBScTmXyQ7Vab6EA==,type:str]
|
||||||
|
cloudflare-turnstile:
|
||||||
|
secret-key: ENC[AES256_GCM,data:fSsH5HRLvzwyovBezNQnil7due6+FCE2yW/S91aOwqb4yow=,iv:7hTu9YyACvOys42n8XFBmVykKJ0op8btb3xQ6tGpqP4=,tag:Z4FvKKPsb1rAQuWY4v5frg==,type:str]
|
||||||
|
site-key: ENC[AES256_GCM,data:qKmx5EY3Yl5A3zsofFfskN3DrZI+yrHJ,iv:ZGnhkm12VG/O0TNQsKOIb53BlxXPqhBmSPh6rlLGpN4=,tag:C0vQsXRil72z6SRoLiifcA==,type:str]
|
||||||
sops:
|
sops:
|
||||||
age:
|
age:
|
||||||
- enc: |
|
- enc: |
|
||||||
@@ -46,7 +49,7 @@ sops:
|
|||||||
Nf0uOoSWPTJ/2SRNkSu7FMumATH4ldQ6TFSwKda3mBfBwhnFzLq10Q==
|
Nf0uOoSWPTJ/2SRNkSu7FMumATH4ldQ6TFSwKda3mBfBwhnFzLq10Q==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
recipient: age1p05z980kdtngk9mw67hfev72h7xhslplpxfk9yskgmf0hl4lu3ls04zht9
|
recipient: age1p05z980kdtngk9mw67hfev72h7xhslplpxfk9yskgmf0hl4lu3ls04zht9
|
||||||
lastmodified: "2026-06-12T00:44:20Z"
|
lastmodified: "2026-07-10T20:47:30Z"
|
||||||
mac: ENC[AES256_GCM,data:cyI5NH6+OR/Q4T3atFN+gXsJbRaR/Q5I+MyJHy5qXsShh8LnQvEKBnnIPKz2xpuDwFvKd4DabMOxcu5xe6IRH9TN7G411vp+vruM+TicoCJ4U2xAP/J9Tlh3YKT6kZJqj/zAhvP5qPCzvz7xkFTvluLrWgPlaHWn/rlCskh0t5M=,iv:WBeS1rqjJblNGMVa7hEn5MXbZJU8WKd6541BCxu2rGI=,tag:OfOzQI6ESUdUYCbBEq9GFw==,type:str]
|
mac: ENC[AES256_GCM,data:gqrsaZ7GwS+qkuVRwGkrTJjL1qfBid3RdbGLEZIr1P4XuKatqiFWs0ihj/Qm6jItktoPXwMHcejzx/wQgTImBvdNXDW5TbgF39VJYCZ8r/ToTX2LdZXCBJHim8F9eVE+aBJfsb/LHyvTJLcp3BgrOFyNYjt067585hDt/D3Tmh0=,iv:cKUPZI1lH1wMJVhgR0/TB3iDU6TUSv8vLo+vlThk2AU=,tag:eT2BwsN8mL5RgpQ+pAaKPg==,type:str]
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.13.1
|
version: 3.13.1
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
# NFS mounts of nixdesk (14900k) bulk storage for r5500. Exports live in
|
|
||||||
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
|
|
||||||
#
|
|
||||||
# Jellyfin library paths:
|
|
||||||
# Movies → /mnt/nixdesk-jellyfin/movies
|
|
||||||
# Shows → /mnt/nixdesk-jellyfin/tv
|
|
||||||
{ ... }:
|
|
||||||
let
|
|
||||||
nfsExportHost = "192.168.2.25";
|
|
||||||
nfsClientOpts = [
|
|
||||||
"rw"
|
|
||||||
"noatime"
|
|
||||||
"nofail"
|
|
||||||
"_netdev"
|
|
||||||
"nfsvers=3"
|
|
||||||
"tcp"
|
|
||||||
"lookupcache=none"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.idle-timeout=3600"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
fileSystems."/mnt/nixdesk-jellyfin" = {
|
|
||||||
device = "${nfsExportHost}:/mnt/deep/jellyfin";
|
|
||||||
fsType = "nfs";
|
|
||||||
options = nfsClientOpts;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
./_private/media-disk.nix
|
./_private/media-disk.nix
|
||||||
./_private/media-paths.nix
|
./_private/media-paths.nix
|
||||||
./_services/docker-media.nix
|
./_services/docker-media.nix
|
||||||
./_services/nixdesk-nfs-client.nix
|
self.nixosModules.nixdeskJellyfin
|
||||||
./_services/jellyfin.nix
|
./_services/jellyfin.nix
|
||||||
./_services/sonarr.nix
|
./_services/sonarr.nix
|
||||||
./_services/radarr.nix
|
./_services/radarr.nix
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
host = "r5500";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules.r5500Configuration
|
self.nixosModules.r5500Configuration
|
||||||
|
|||||||
@@ -19,10 +19,6 @@
|
|||||||
./_private/firmware.nix
|
./_private/firmware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
sops.secrets."tailscale/auth-key" = {
|
|
||||||
mode = "0400";
|
|
||||||
};
|
|
||||||
|
|
||||||
chiasson.system.librepods.enable = true;
|
chiasson.system.librepods.enable = true;
|
||||||
chiasson.system.palera1n.enable = true;
|
chiasson.system.palera1n.enable = true;
|
||||||
|
|
||||||
@@ -54,17 +50,6 @@
|
|||||||
# Dynamic function row on the Touch Bar (`tiny-dfr`; needs `DRM_APPLETBDRM` — see t2linux kernel opts).
|
# Dynamic function row on the Touch Bar (`tiny-dfr`; needs `DRM_APPLETBDRM` — see t2linux kernel opts).
|
||||||
hardware.apple.touchBar.enable = true;
|
hardware.apple.touchBar.enable = true;
|
||||||
|
|
||||||
# ─────────────────────── Attic (pull + push + CLI token) ────────────────────
|
|
||||||
chiasson.system.caching.attic = {
|
|
||||||
enable = true;
|
|
||||||
cacheName = "nixos-new";
|
|
||||||
endpoint = "http://192.168.2.238:8080/";
|
|
||||||
publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
|
|
||||||
tokenFile = config.sops.secrets."caching/attic/token".path;
|
|
||||||
push.enable = true;
|
|
||||||
userCli.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# ─────────────────────── Display Server & Desktop ──────────────────────────
|
# ─────────────────────── Display Server & Desktop ──────────────────────────
|
||||||
chiasson.desktop = {
|
chiasson.desktop = {
|
||||||
niri = {
|
niri = {
|
||||||
@@ -79,9 +64,6 @@
|
|||||||
};
|
};
|
||||||
defaultSession = "niri";
|
defaultSession = "niri";
|
||||||
shell = "dms";
|
shell = "dms";
|
||||||
shells.dms = {
|
|
||||||
enableRbwLockToggle = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
chiasson.system = {
|
chiasson.system = {
|
||||||
@@ -90,11 +72,6 @@
|
|||||||
networking = {
|
networking = {
|
||||||
hostName = "t2mbp";
|
hostName = "t2mbp";
|
||||||
networkManager.enable = true;
|
networkManager.enable = true;
|
||||||
tailscale = {
|
|
||||||
enable = true;
|
|
||||||
authKeyFile = config.sops.secrets."tailscale/auth-key".path;
|
|
||||||
acceptRoutes = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit self inputs;
|
inherit self inputs;
|
||||||
host = "t2mbp";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
self.nixosModules.t2mbpConfiguration
|
self.nixosModules.t2mbpConfiguration
|
||||||
|
|||||||
@@ -1,21 +1,27 @@
|
|||||||
{ self, inputs, ... }:
|
{ self, inputs, ... }:
|
||||||
{
|
{
|
||||||
flake.nixosModules.t2mbpHome =
|
flake.nixosModules.t2mbpHome =
|
||||||
{ self, ... }:
|
{ self, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [ self.nixosModules.desktopHomeBase ];
|
imports = [ self.nixosModules.desktopHomeBase ];
|
||||||
|
|
||||||
chiasson.users.extraModules.olivier = [
|
chiasson.users.extraModules.olivier = [
|
||||||
{
|
{
|
||||||
chiasson.home = {
|
chiasson.home = {
|
||||||
browsers = {
|
browsers.edge.enable = true;
|
||||||
edge.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
discord.enable = true;
|
discord.enable = true;
|
||||||
pokeclicker.enable = true;
|
pokeclicker.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
editors.vscode = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
alefragnani.project-manager
|
||||||
|
johnpapa.vscode-peacock
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -45,16 +45,6 @@
|
|||||||
chiasson.system.librepods.enable = true;
|
chiasson.system.librepods.enable = true;
|
||||||
chiasson.system.palera1n.enable = true;
|
chiasson.system.palera1n.enable = true;
|
||||||
|
|
||||||
# ─────────────────────── Attic (pull + push + CLI token) ────────────────────
|
|
||||||
chiasson.system.caching.attic = {
|
|
||||||
enable = true;
|
|
||||||
cacheName = "nixos-new";
|
|
||||||
endpoint = "http://192.168.2.238:8080/";
|
|
||||||
publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
|
|
||||||
tokenFile = config.sops.secrets."caching/attic/token".path;
|
|
||||||
push.enable = true;
|
|
||||||
userCli.enable = true;
|
|
||||||
};
|
|
||||||
# ─────────────────────── Display Server & Desktop ──────────────────────────
|
# ─────────────────────── Display Server & Desktop ──────────────────────────
|
||||||
|
|
||||||
chiasson.desktop = {
|
chiasson.desktop = {
|
||||||
@@ -66,9 +56,6 @@
|
|||||||
};
|
};
|
||||||
defaultSession = "niri";
|
defaultSession = "niri";
|
||||||
shell = "dms";
|
shell = "dms";
|
||||||
shells.dms = {
|
|
||||||
enableWvkbdToggle = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
chiasson.system = {
|
chiasson.system = {
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
specialArgs = inputs // {
|
specialArgs = inputs // {
|
||||||
inherit self;
|
inherit self;
|
||||||
inputs = inputs;
|
inputs = inputs;
|
||||||
host = "uConsole";
|
|
||||||
system = "aarch64-linux";
|
|
||||||
};
|
};
|
||||||
trustCaches = false;
|
trustCaches = false;
|
||||||
modules = [
|
modules = [
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
{ self, inputs, ... }:
|
{ self, inputs, ... }:
|
||||||
{
|
{
|
||||||
flake.nixosModules.uConsoleHome =
|
flake.nixosModules.uConsoleHome =
|
||||||
{ self, ... }:
|
{ self, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [ self.nixosModules.desktopHomeBase ];
|
imports = [ self.nixosModules.desktopHomeBase ];
|
||||||
|
|
||||||
chiasson.users.extraModules.olivier = [
|
chiasson.users.extraModules.olivier = [
|
||||||
{
|
{
|
||||||
chiasson.home = {
|
chiasson.home.hardware.uconsoleGamepad.enable = true;
|
||||||
hardware.uconsoleGamepad.enable = true;
|
|
||||||
|
chiasson.home.editors.vscode = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
alefragnani.project-manager
|
||||||
|
johnpapa.vscode-peacock
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
# Build a raw Navi hive attrset from host specs + deployment targets.
|
|
||||||
# Call `inputs.navi.lib.makeHive` on the result to produce `flake.naviHive`.
|
|
||||||
{ lib, inputs, ... }: {
|
|
||||||
flake.lib.mkNaviHiveConfig =
|
|
||||||
{
|
|
||||||
metaNixpkgs,
|
|
||||||
hostSpecs,
|
|
||||||
deployments,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
deployNodes = lib.filterAttrs (name: _: deployments ? ${name}) hostSpecs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
meta = {
|
|
||||||
nixpkgs = metaNixpkgs;
|
|
||||||
nodeNixpkgs = lib.mapAttrs (
|
|
||||||
name: spec:
|
|
||||||
import inputs.nixpkgs {
|
|
||||||
system = spec.system;
|
|
||||||
}
|
|
||||||
) deployNodes;
|
|
||||||
nodeSpecialArgs = lib.mapAttrs (_: spec: spec.specialArgs) deployNodes;
|
|
||||||
allowApplyAll = false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// lib.mapAttrs (
|
|
||||||
name: spec:
|
|
||||||
{
|
|
||||||
imports = spec.modules or [ spec.configuration ];
|
|
||||||
deployment = deployments.${name};
|
|
||||||
}
|
|
||||||
) deployNodes;
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
{ lib, ... }: {
|
|
||||||
flake.lib.sshInventory =
|
|
||||||
let
|
|
||||||
hosts = {
|
|
||||||
"14900k" = {
|
|
||||||
hostName = "192.168.2.25";
|
|
||||||
aliases = [ "14900k" "nixdesk" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILwUevBGnf+Y/sL1ZsB4bt0c50a89iqwPRoYUGP4UHsL 14900k";
|
|
||||||
};
|
|
||||||
|
|
||||||
ideapad = {
|
|
||||||
hostName = "192.168.2.229";
|
|
||||||
aliases = [ "ideapad" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQwaaI90xIMjZ46EcMyO8kBwGCxf7qVL75IYhw8Ssze ideapad";
|
|
||||||
};
|
|
||||||
|
|
||||||
t2mbp = {
|
|
||||||
hostName = "192.168.2.15";
|
|
||||||
aliases = [ "t2mbp" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMhVWB9YXl/FuQvufle4VWUas/QM8qCKoRd5a83Tt3S6 t2mbp";
|
|
||||||
};
|
|
||||||
|
|
||||||
uConsole = {
|
|
||||||
hostName = "192.168.2.99";
|
|
||||||
aliases = [ "uConsole" "uconsole" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAVPR0lRAcywPR7iTchM3+eO7NCdXAR6NPzYXxalr+dP uConsole";
|
|
||||||
};
|
|
||||||
|
|
||||||
test = {
|
|
||||||
hostName = "test";
|
|
||||||
aliases = [ "test" ];
|
|
||||||
publicKey = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
nix-server = {
|
|
||||||
hostName = "192.168.2.238";
|
|
||||||
aliases = [ "nix-server" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL3KDicMjtOFR6LfZrFzfAD1gdYUdwv6ZM4PSgtmIuzd nix-server";
|
|
||||||
};
|
|
||||||
|
|
||||||
r5500 = {
|
|
||||||
hostName = "192.168.2.100";
|
|
||||||
aliases = [ "r5500" ];
|
|
||||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7iWCEtkYDLZFRF3w1gzyAok5VCAGUOwu4iWZdMjf3D r5500";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkIdentityFileName = hostName: ".ssh/id_ed25519_${lib.strings.toLower hostName}.pub";
|
|
||||||
activeHosts = builtins.removeAttrs hosts (
|
|
||||||
builtins.filter (name: hosts.${name}.publicKey == null) (builtins.attrNames hosts)
|
|
||||||
);
|
|
||||||
|
|
||||||
mkIdentityFiles = selectedHosts:
|
|
||||||
builtins.listToAttrs (
|
|
||||||
builtins.map
|
|
||||||
(hostName: {
|
|
||||||
name = mkIdentityFileName hostName;
|
|
||||||
value.text = "${selectedHosts.${hostName}.publicKey}\n";
|
|
||||||
})
|
|
||||||
(builtins.attrNames selectedHosts)
|
|
||||||
);
|
|
||||||
|
|
||||||
# Gitea git-over-SSH listens on port 222. System SSH (nix deploy, server@…) uses port 22
|
|
||||||
# via the catalog `nix-server` Host block — never list nix-server or 192.168.2.238 here.
|
|
||||||
giteaSshBlock = identityAgent: ''
|
|
||||||
Host git.chiasson.cloud gitea
|
|
||||||
HostName 192.168.2.238
|
|
||||||
Port 222
|
|
||||||
User git
|
|
||||||
IdentityAgent ${identityAgent}
|
|
||||||
IdentitiesOnly no
|
|
||||||
|
|
||||||
Match host nix-server,192.168.2.238 user git
|
|
||||||
HostName 192.168.2.238
|
|
||||||
Port 222
|
|
||||||
User git
|
|
||||||
IdentityAgent ${identityAgent}
|
|
||||||
IdentitiesOnly no
|
|
||||||
'';
|
|
||||||
|
|
||||||
mkSshConfigTemplate =
|
|
||||||
{
|
|
||||||
selectedHosts ? activeHosts,
|
|
||||||
user ? null,
|
|
||||||
identityAgent ? "__RBW_SSH_SOCK__",
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostBlocks = builtins.map
|
|
||||||
(hostName:
|
|
||||||
let
|
|
||||||
entry = selectedHosts.${hostName};
|
|
||||||
hostPatterns = builtins.concatStringsSep " " (entry.aliases ++ [ entry.hostName ]);
|
|
||||||
userLine = if user == null then "" else " User ${user}\n";
|
|
||||||
portLine =
|
|
||||||
if hostName == "nix-server" then
|
|
||||||
" Port 22\n"
|
|
||||||
else
|
|
||||||
"";
|
|
||||||
in
|
|
||||||
''
|
|
||||||
Host ${hostPatterns}
|
|
||||||
HostName ${entry.hostName}
|
|
||||||
${userLine}${portLine} IdentityFile ~/${mkIdentityFileName hostName}
|
|
||||||
IdentityAgent ${identityAgent}
|
|
||||||
IdentitiesOnly yes
|
|
||||||
'')
|
|
||||||
(builtins.attrNames selectedHosts);
|
|
||||||
in
|
|
||||||
builtins.concatStringsSep "\n" (
|
|
||||||
[
|
|
||||||
(giteaSshBlock identityAgent)
|
|
||||||
]
|
|
||||||
++ hostBlocks
|
|
||||||
++ [
|
|
||||||
''
|
|
||||||
Host *
|
|
||||||
IdentitiesOnly yes
|
|
||||||
IdentityAgent none
|
|
||||||
''
|
|
||||||
]
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit hosts activeHosts mkIdentityFiles mkSshConfigTemplate;
|
|
||||||
authorizedKeys = lib.unique (
|
|
||||||
builtins.map (entry: entry.publicKey) (builtins.attrValues activeHosts)
|
|
||||||
);
|
|
||||||
identityFiles = mkIdentityFiles activeHosts;
|
|
||||||
sshConfigTemplate = mkSshConfigTemplate { };
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
# Pure helpers: catalog → NixOS/HM/SSH shapes (`self.lib.usersMerge lib`).
|
|
||||||
{ ... }: {
|
|
||||||
flake.lib.usersMerge =
|
|
||||||
lib:
|
|
||||||
let
|
|
||||||
userHm = user: user.homeManager or { };
|
|
||||||
userSsh = user: user.ssh or { };
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
resolveHomeManagerModule =
|
|
||||||
moduleSpec:
|
|
||||||
let
|
|
||||||
t = builtins.typeOf moduleSpec;
|
|
||||||
in
|
|
||||||
if t == "path" || t == "string" then import moduleSpec else moduleSpec;
|
|
||||||
|
|
||||||
selectedUsersAttr =
|
|
||||||
{ catalog, enabled, hostOverrides }:
|
|
||||||
lib.listToAttrs (
|
|
||||||
map (name: {
|
|
||||||
inherit name;
|
|
||||||
value = lib.recursiveUpdate catalog.${name} (hostOverrides.${name} or { });
|
|
||||||
}) enabled
|
|
||||||
);
|
|
||||||
|
|
||||||
missingEnabledNames = catalog: enabled: builtins.filter (name: !(builtins.hasAttr name catalog)) enabled;
|
|
||||||
|
|
||||||
strayHomeUserKeys = homeUsers: enabled:
|
|
||||||
builtins.filter (k: !(builtins.elem k enabled)) (builtins.attrNames homeUsers);
|
|
||||||
|
|
||||||
mkNixosUser =
|
|
||||||
name: user:
|
|
||||||
{
|
|
||||||
isNormalUser = user.isNormalUser or true;
|
|
||||||
description = user.description or name;
|
|
||||||
extraGroups = user.extraGroups or [ ];
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs (user ? hashedPasswordFile && user.hashedPasswordFile != null) {
|
|
||||||
hashedPasswordFile = user.hashedPasswordFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
hmWiredNames =
|
|
||||||
selectedUsers:
|
|
||||||
lib.attrNames (
|
|
||||||
lib.filterAttrs (_: user:
|
|
||||||
let
|
|
||||||
hm = userHm user;
|
|
||||||
in
|
|
||||||
(hm.enable or false) && (hm.module or null) != null
|
|
||||||
) selectedUsers
|
|
||||||
);
|
|
||||||
|
|
||||||
rbwOutboundSnippet =
|
|
||||||
name: user:
|
|
||||||
let
|
|
||||||
outboundCfg = ((userSsh user).outbound or { }).rbw or { };
|
|
||||||
in
|
|
||||||
lib.mkIf (outboundCfg.enable or false) {
|
|
||||||
chiasson.ssh.outbound.rbw.enable = true;
|
|
||||||
chiasson.ssh.outbound.rbw.user = name;
|
|
||||||
chiasson.ssh.outbound.rbw.hosts =
|
|
||||||
if (outboundCfg.hosts or "all") == "all" then [ "all" ] else outboundCfg.hosts;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkHmUserModule =
|
|
||||||
{ name, user, hostExtraModules }:
|
|
||||||
let
|
|
||||||
hm = userHm user;
|
|
||||||
hmModule = resolveHomeManagerModule hm.module;
|
|
||||||
in
|
|
||||||
lib.mkMerge (
|
|
||||||
[
|
|
||||||
hmModule
|
|
||||||
(rbwOutboundSnippet name user)
|
|
||||||
]
|
|
||||||
++ (hm.extraModules or [ ])
|
|
||||||
++ hostExtraModules
|
|
||||||
);
|
|
||||||
|
|
||||||
inboundAuthorizedOrNull =
|
|
||||||
user:
|
|
||||||
let
|
|
||||||
inboundCfg = (userSsh user).inbound or { };
|
|
||||||
in
|
|
||||||
if !(inboundCfg.enable or false) then
|
|
||||||
null
|
|
||||||
else if (inboundCfg.authorizedHosts or "all") == "all" then
|
|
||||||
"all"
|
|
||||||
else
|
|
||||||
inboundCfg.authorizedHosts;
|
|
||||||
|
|
||||||
inboundHostsAttr =
|
|
||||||
selectedUsers:
|
|
||||||
lib.pipe selectedUsers [
|
|
||||||
(lib.mapAttrs (_: inboundAuthorizedOrNull))
|
|
||||||
(lib.filterAttrs (_: v: v != null))
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Resolve `wisdom*` HM slices for NixOS `extraModules` (`self` is not an HM specialArg).
|
|
||||||
# Slices are gated by `chiasson.home.*.enable`; hosts only flip toggles in `home.nix`.
|
|
||||||
{ lib, ... }: {
|
|
||||||
flake.lib.wisdomCatalogExtraModules =
|
|
||||||
self:
|
|
||||||
let
|
|
||||||
names = lib.sort builtins.lessThan (
|
|
||||||
lib.filter (
|
|
||||||
n:
|
|
||||||
lib.hasPrefix "wisdom" n
|
|
||||||
&& n != "wisdom"
|
|
||||||
&& n != "wisdomShellBash"
|
|
||||||
) (builtins.attrNames self.homeManagerModules)
|
|
||||||
);
|
|
||||||
in
|
|
||||||
map (name: self.homeManagerModules.${name}) names;
|
|
||||||
}
|
|
||||||
@@ -1,96 +1,154 @@
|
|||||||
{ self, ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.sshOutboundRbw = {
|
flake.homeManagerModules.sshOutboundRbw =
|
||||||
config,
|
{ config, lib, pkgs, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
cfg = config.chiasson.ssh.outbound.rbw;
|
||||||
...
|
inventory = self.lib.sshInventory;
|
||||||
}:
|
# Resolve which hosts to emit blocks for, and which user identity to
|
||||||
let
|
# use as the IdentityFile filter against the rbw agent.
|
||||||
cfg = config.chiasson.ssh.outbound.rbw;
|
selectedHostNames =
|
||||||
inventory = self.lib.sshInventory;
|
if cfg.hosts == [ "all" ] then builtins.attrNames inventory.activeHosts else cfg.hosts;
|
||||||
selectedHostNames =
|
missingHosts = builtins.filter (name: !(builtins.hasAttr name inventory.hosts)) selectedHostNames;
|
||||||
if cfg.hosts == [ "all" ] then
|
# Resolve to the actual host attrs for the template. The "all" case
|
||||||
builtins.attrNames inventory.activeHosts
|
# reuses `activeHosts` directly instead of rebuilding the same attrset.
|
||||||
else
|
selectedHosts =
|
||||||
cfg.hosts;
|
if cfg.hosts == [ "all" ] then
|
||||||
missing = builtins.filter (name: !(builtins.hasAttr name inventory.hosts)) selectedHostNames;
|
inventory.activeHosts
|
||||||
selectedHosts = builtins.listToAttrs (
|
else
|
||||||
builtins.map (name: {
|
builtins.listToAttrs (
|
||||||
inherit name;
|
map (n: {
|
||||||
value = inventory.hosts.${name};
|
name = n;
|
||||||
}) selectedHostNames
|
value = inventory.hosts.${n};
|
||||||
);
|
}) selectedHostNames
|
||||||
sshConfigTemplate = inventory.mkSshConfigTemplate {
|
);
|
||||||
selectedHosts = selectedHosts;
|
# All identities this HM user may authenticate AS: cfg.user ∪
|
||||||
user = cfg.user;
|
# extraIdentities. `cfg.user` can be null (e.g. user not in inventory
|
||||||
};
|
# yet) — in that case the Host-block IdentityFile line is suppressed
|
||||||
in
|
# and cross-account SSH is wired from extraIdentities alone.
|
||||||
{
|
effectiveIdentities = lib.filter (n: n != null) ([ cfg.user ] ++ cfg.extraIdentities);
|
||||||
options.chiasson.ssh.outbound.rbw = {
|
defaultUserHasKey = cfg.user == null || (inventory.users.${cfg.user}.publicKey or "") != "";
|
||||||
enable = lib.mkEnableOption "Generated `~/.ssh/config` + rbw agent socket.";
|
# Each extra identity must have a pubkey in the inventory. Dropping
|
||||||
user = lib.mkOption {
|
# it silently would produce a dead Match block — fail the build.
|
||||||
type = lib.types.str;
|
missingExtraKeys = lib.filter (n: (inventory.users.${n}.publicKey or "") == "") cfg.extraIdentities;
|
||||||
default = config.home.username;
|
in
|
||||||
description = "`User` in generated `Host` blocks.";
|
{
|
||||||
};
|
options.chiasson.ssh.outbound.rbw = {
|
||||||
hosts = lib.mkOption {
|
enable = lib.mkEnableOption "Generated `~/.ssh/config` + rbw agent socket.";
|
||||||
type = lib.types.listOf lib.types.str;
|
user = lib.mkOption {
|
||||||
default = [ "all" ];
|
type = lib.types.nullOr lib.types.str;
|
||||||
description = "Inventory hosts to emit (or `[ \"all\" ]`).";
|
default = config.home.username;
|
||||||
};
|
description = ''
|
||||||
manageSshConfig = lib.mkOption {
|
Inventory user whose public key is written to `~/.ssh/id_ed25519_<user>.pub`
|
||||||
type = lib.types.bool;
|
and used as `IdentityFile` to filter the rbw agent. Set `null`
|
||||||
default = true;
|
to disable the per-user .pub file / IdentityFile line (e.g.
|
||||||
description = "Write `~/.ssh/config` from the template.";
|
when the user isn't in the inventory yet).
|
||||||
};
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
||||||
{
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = missing == [ ];
|
|
||||||
message = "ssh.outbound.rbw: unknown host keys: ${builtins.concatStringsSep ", " missing}";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [ rbw pinentry-gtk2 ];
|
|
||||||
home.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket";
|
|
||||||
home.file = inventory.mkIdentityFiles selectedHosts;
|
|
||||||
|
|
||||||
programs.ssh.enable = lib.mkIf cfg.manageSshConfig false;
|
|
||||||
home.activation.rbwSshConfig = lib.mkIf cfg.manageSshConfig (lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
||||||
mkdir -p "$HOME/.ssh"
|
|
||||||
chmod 700 "$HOME/.ssh"
|
|
||||||
RBW_SSH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
|
||||||
cat > "$HOME/.ssh/config" <<'EOF'
|
|
||||||
${sshConfigTemplate}
|
|
||||||
EOF
|
|
||||||
sed -i "s|__RBW_SSH_SOCK__|$RBW_SSH_SOCK|g" "$HOME/.ssh/config"
|
|
||||||
chmod 600 "$HOME/.ssh/config"
|
|
||||||
'');
|
|
||||||
|
|
||||||
systemd.user.services.rbw-agent-bootstrap = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Bootstrap rbw SSH agent";
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
After = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "${pkgs.bash}/bin/bash -lc '${pkgs.rbw}/bin/rbw unlocked >/dev/null 2>&1 || true'";
|
|
||||||
RemainAfterExit = true;
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
hosts = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ "all" ];
|
||||||
|
description = "Inventory hosts to emit (or `[ \"all\" ]`).";
|
||||||
|
};
|
||||||
|
manageSshConfig = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Write `~/.ssh/config` (disable for manual management).";
|
||||||
|
};
|
||||||
|
# Cross-account SSH on the operator's laptop/desktop. Each entry
|
||||||
|
# adds a `~/.ssh/id_ed25519_<account>.pub` filter file and a
|
||||||
|
# `Match user <account>` block in `~/.ssh/config` so
|
||||||
|
# `ssh <account>@<host>` picks the right key from the rbw agent.
|
||||||
|
# `cfg.user` is already wired by the Host blocks — don't list it here.
|
||||||
|
extraIdentities = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [
|
||||||
|
"server"
|
||||||
|
"builder"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Catalog accounts this HM user may authenticate AS, in addition
|
||||||
|
to `cfg.user`. Each entry must have a publicKey pasted into
|
||||||
|
`modules/ssh/inventory.nix`. Typical for the operator's
|
||||||
|
primary laptop: `[ "server" "builder" ]` so fleet/ops commands
|
||||||
|
like `ssh server@r5500` or `ssh builder@nix-server` work
|
||||||
|
without touching `/etc/passwd` on each host.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home.activation.rbwPinentryConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
config = lib.mkIf cfg.enable (
|
||||||
${pkgs.rbw}/bin/rbw config set pinentry "${pkgs.pinentry-gtk2}/bin/pinentry-gtk-2" >/dev/null 2>&1 || true
|
lib.mkMerge [
|
||||||
'';
|
{
|
||||||
}
|
assertions = [
|
||||||
]);
|
{
|
||||||
};
|
assertion = missingHosts == [ ];
|
||||||
|
message = "ssh.outbound.rbw: unknown host keys: ${builtins.concatStringsSep ", " missingHosts}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = defaultUserHasKey;
|
||||||
|
message = "ssh.outbound.rbw: no publicKey for inventory user `${cfg.user}` in `modules/ssh/inventory.nix`.";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = missingExtraKeys == [ ];
|
||||||
|
message = "ssh.outbound.rbw: extraIdentities has entries with no publicKey in `modules/ssh/inventory.nix`: ${builtins.concatStringsSep ", " missingExtraKeys}";
|
||||||
|
}
|
||||||
|
# `enable=true` with neither a default user nor any extras gives the
|
||||||
|
# agent no IdentityFile at all; with IdentitiesOnly yes the user
|
||||||
|
# would silently be unable to authenticate as any catalog user.
|
||||||
|
{
|
||||||
|
assertion = effectiveIdentities != [ ];
|
||||||
|
message = "ssh.outbound.rbw: enabled but no identities wired. Set `chiasson.ssh.outbound.rbw.user` (defaults to `home.username`) or list catalog accounts under `extraIdentities`.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
(lib.mkMerge [
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
rbw
|
||||||
|
pinentry-gtk2
|
||||||
|
];
|
||||||
|
home.sessionVariables.SSH_AUTH_SOCK = self.lib.rbwSshSocket.sessionVariable;
|
||||||
|
# Write a `.pub` file per identity this HM user may act as
|
||||||
|
# (cfg.user ∪ extraIdentities). OpenSSH reads each one via
|
||||||
|
# IdentityFile/Match to filter agent keys — they never hold
|
||||||
|
# private key material, so 0644 (HM's default) is fine.
|
||||||
|
# OpenSSH's StrictModes only rejects group/other-writable files.
|
||||||
|
home.file = lib.listToAttrs (
|
||||||
|
map (n: {
|
||||||
|
name = inventory.mkIdentityFileName n;
|
||||||
|
value.text = "${inventory.users.${n}.publicKey}\n";
|
||||||
|
}) effectiveIdentities
|
||||||
|
);
|
||||||
|
programs.ssh.enable = lib.mkIf cfg.manageSshConfig false;
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.manageSshConfig {
|
||||||
|
home.file.".ssh/config".text = inventory.mkSshConfigTemplate {
|
||||||
|
inherit selectedHosts;
|
||||||
|
user = cfg.user;
|
||||||
|
inherit (cfg) extraIdentities;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
{
|
||||||
|
systemd.user.services.rbw-agent-bootstrap = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Bootstrap rbw SSH agent";
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.bash}/bin/bash -lc '${pkgs.rbw}/bin/rbw unlocked >/dev/null 2>&1 || true'";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
home.activation.rbwPinentryConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
${pkgs.rbw}/bin/rbw config set pinentry "${pkgs.pinentry-gtk2}/bin/pinentry-gtk-2" >/dev/null 2>&1 || true
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
{ lib, ... }: {
|
||||||
|
flake.lib.sshInventory =
|
||||||
|
let
|
||||||
|
# Hosts: pure network endpoints. No public keys live here anymore —
|
||||||
|
# keys are per USER (see `users` below), one key per person.
|
||||||
|
hosts = {
|
||||||
|
"14900k" = {
|
||||||
|
hostName = "192.168.2.25";
|
||||||
|
aliases = [ "14900k" "nixdesk" ];
|
||||||
|
};
|
||||||
|
ideapad = {
|
||||||
|
hostName = "192.168.2.229";
|
||||||
|
aliases = [ "ideapad" ];
|
||||||
|
};
|
||||||
|
t2mbp = {
|
||||||
|
hostName = "192.168.2.15";
|
||||||
|
aliases = [ "t2mbp" ];
|
||||||
|
};
|
||||||
|
"uConsole" = {
|
||||||
|
hostName = "192.168.2.99";
|
||||||
|
aliases = [ "uConsole" "uconsole" ];
|
||||||
|
};
|
||||||
|
# Scratchpad / recovery target — hostName isn't an IP, so `activeHosts`
|
||||||
|
# excludes it from navi deployments. Leave it in `hosts` for inventory
|
||||||
|
# visibility while recovery is in progress.
|
||||||
|
test = {
|
||||||
|
hostName = "test";
|
||||||
|
aliases = [ "test" ];
|
||||||
|
};
|
||||||
|
"nix-server" = {
|
||||||
|
hostName = "192.168.2.238";
|
||||||
|
aliases = [ "nix-server" ];
|
||||||
|
};
|
||||||
|
r5500 = {
|
||||||
|
hostName = "192.168.2.100";
|
||||||
|
aliases = [ "r5500" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Per-user public keys. One keypair per person, generated once with
|
||||||
|
# `ssh-keygen -t ed25519 -C <comment>` (or `rbw gen ssh-key <user>`),
|
||||||
|
# private key stored in Bitwarden under the same name. Paste the
|
||||||
|
# `ssh-ed25519 AAAA… <comment>` line here.
|
||||||
|
users = {
|
||||||
|
olivier = {
|
||||||
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICpORzDw8kEOobjywl7bQaEp6Tez1c/ZP+7VBDsTcM8I olivier";
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICsksvNGOt/ebJtpRi9ocLBjwyl16VSaf+BsL2Hz5PRy server";
|
||||||
|
};
|
||||||
|
builder = {
|
||||||
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIILBtfW1cq9mG6uAjAfpZuVa1EWDSTPSCThapDXXlLgV builder";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Hosts SSH is actually safe to deploy/scan to: anything whose hostName
|
||||||
|
# parses as an IPv4 dotted-quad. Filters out scratchpad/non-routable
|
||||||
|
# entries (e.g. `hostName = "test"`).
|
||||||
|
activeHosts = lib.filterAttrs
|
||||||
|
(_: h: lib.match "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$" h.hostName != null)
|
||||||
|
hosts;
|
||||||
|
|
||||||
|
# .pub filename convention. OpenSSH 7.3+ accepts a `.pub` file as
|
||||||
|
# IdentityFile to filter `IdentityAgent` (rbw) keys without storing the
|
||||||
|
# private key on disk — keep this trick.
|
||||||
|
mkIdentityFileName = userName: ".ssh/id_ed25519_${lib.strings.toLower userName}.pub";
|
||||||
|
|
||||||
|
mkSshConfigTemplate =
|
||||||
|
{
|
||||||
|
selectedHosts ? activeHosts,
|
||||||
|
user ? null,
|
||||||
|
# Catalog accounts the operator may authenticate AS via
|
||||||
|
# `ssh <account>@<host>`. Each entry gets a `Match user <account>`
|
||||||
|
# block that overrides IdentityFile so OpenSSH asks the rbw agent
|
||||||
|
# for that account's private key. `cfg.user` is already covered
|
||||||
|
# by the Host blocks, so don't list it here.
|
||||||
|
extraIdentities ? [ ],
|
||||||
|
identityAgent ? "SSH_AUTH_SOCK",
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Shared `IdentityFile` filter line (when `user` is set). Used by
|
||||||
|
# both the per-host and gitea blocks so the two can't drift apart.
|
||||||
|
idLine = lib.optionalString (user != null) " IdentityFile ~/${mkIdentityFileName user}\n";
|
||||||
|
|
||||||
|
# Match blocks for cross-account SSH. Filter out cfg.user since
|
||||||
|
# the matching pub is already loaded via the Host block's
|
||||||
|
# IdentityFile line — re-emitting it would just duplicate.
|
||||||
|
matchBlocks = lib.concatStringsSep "\n" (map
|
||||||
|
(n: ''
|
||||||
|
Match user ${n}
|
||||||
|
IdentityFile ~/${mkIdentityFileName n}
|
||||||
|
IdentitiesOnly yes
|
||||||
|
'')
|
||||||
|
(builtins.filter (n: n != user) extraIdentities));
|
||||||
|
|
||||||
|
# Per-host block. `IdentityFile` (when `user` is set) is a .pub file
|
||||||
|
# pointing at the agent's matching private key. With IdentitiesOnly
|
||||||
|
# yes, only agent keys matching that pub are tried — fixes the old
|
||||||
|
# "too many auth failures" symptom by design.
|
||||||
|
hostBlock = hostName:
|
||||||
|
let
|
||||||
|
e = selectedHosts.${hostName};
|
||||||
|
hostPatterns = lib.concatStringsSep " " (e.aliases ++ [ e.hostName ]);
|
||||||
|
in ''
|
||||||
|
Host ${hostPatterns}
|
||||||
|
HostName ${e.hostName}
|
||||||
|
${idLine} IdentityAgent ${identityAgent}
|
||||||
|
IdentitiesOnly yes
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Gitea block: always emitted. `User git`, port 222. olivier's
|
||||||
|
# public key (passed via `IdentityFile`) is what gitea accepts
|
||||||
|
# because it gets pushed into gitea's authorized_keys through
|
||||||
|
# gitea's own UI for that account.
|
||||||
|
giteaBlock = ''
|
||||||
|
Host git.chiasson.cloud gitea
|
||||||
|
HostName 192.168.2.238
|
||||||
|
Port 222
|
||||||
|
User git
|
||||||
|
${idLine} IdentityAgent ${identityAgent}
|
||||||
|
IdentitiesOnly yes
|
||||||
|
'';
|
||||||
|
|
||||||
|
hostBlocks = lib.concatStringsSep "\n" (map hostBlock (lib.attrNames selectedHosts));
|
||||||
|
in
|
||||||
|
# Filter empty sections so an absent Match block (no extraIdentities)
|
||||||
|
# doesn't add leading whitespace to the rendered config.
|
||||||
|
lib.concatStringsSep "\n" (lib.filter (s: s != "") [
|
||||||
|
matchBlocks
|
||||||
|
giteaBlock
|
||||||
|
hostBlocks
|
||||||
|
''
|
||||||
|
Host *
|
||||||
|
IdentitiesOnly yes
|
||||||
|
IdentityAgent none
|
||||||
|
''
|
||||||
|
]);
|
||||||
|
|
||||||
|
# Per-user line for `users.users.<u>.openssh.authorizedKeys.keys`.
|
||||||
|
# `selection` is either "all" or a list of source identifiers for
|
||||||
|
# sshd's `from=` constraint (IP, CIDR, or hostname if reverse-DNS works).
|
||||||
|
# Returns null if inventory is missing the user's pubkey — caller is
|
||||||
|
# expected to assert and fail the build rather than silently lock out.
|
||||||
|
mkAuthorizedKeyLine = userName: selection:
|
||||||
|
let
|
||||||
|
entry = users.${userName} or null;
|
||||||
|
in
|
||||||
|
if entry == null then null
|
||||||
|
else if (entry.publicKey or "") == "" then null
|
||||||
|
else if selection == "all" then entry.publicKey
|
||||||
|
else ''from="${lib.concatStringsSep "," selection}" ${entry.publicKey}'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit hosts users activeHosts;
|
||||||
|
mkSshConfigTemplate = mkSshConfigTemplate;
|
||||||
|
mkAuthorizedKeyLine = mkAuthorizedKeyLine;
|
||||||
|
mkIdentityFileName = mkIdentityFileName;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,35 +1,51 @@
|
|||||||
{ self, ... }: {
|
{ self, ... }: {
|
||||||
flake.nixosModules.sshInbound = {
|
flake.nixosModules.sshInbound =
|
||||||
config,
|
{ config, lib, ... }:
|
||||||
lib,
|
let
|
||||||
...
|
cfg = config.chiasson.ssh.inbound;
|
||||||
}:
|
inventory = self.lib.sshInventory;
|
||||||
let
|
# Every inbound-enabled user must have a publicKey pasted into the
|
||||||
cfg = config.chiasson.ssh.inbound;
|
# inventory — silently dropping the key would lock the user out.
|
||||||
inventory = self.lib.sshInventory;
|
missingKeys = lib.filter
|
||||||
in
|
(name:
|
||||||
{
|
let line = inventory.mkAuthorizedKeyLine name (cfg.userAuthorizedHosts.${name} or "all");
|
||||||
options.chiasson.ssh.inbound = {
|
in line == null)
|
||||||
enable = lib.mkEnableOption "Apply SSH inventory public keys to `authorized_keys`.";
|
(lib.attrNames cfg.userAuthorizedHosts);
|
||||||
userAuthorizedHosts = lib.mkOption {
|
in
|
||||||
type = lib.types.attrsOf (lib.types.either (lib.types.enum [ "all" ]) (lib.types.listOf lib.types.str));
|
{
|
||||||
default = { };
|
options.chiasson.ssh.inbound = {
|
||||||
example = {
|
enable = lib.mkEnableOption "Write user-specific SSH inventory public keys into `authorized_keys`.";
|
||||||
olivier = "all";
|
userAuthorizedHosts = lib.mkOption {
|
||||||
admin = [ "14900k" "t2mbp" ];
|
type = lib.types.attrsOf (lib.types.either (lib.types.enum [ "all" ]) (lib.types.listOf lib.types.str));
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
olivier = "all";
|
||||||
|
server = [ "192.168.2.25" "192.168.2.15" ];
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Catalog users whose inventory public key is installed in
|
||||||
|
`authorized_keys`. The value is either `"all"` (no `from=`
|
||||||
|
restriction) or a list of source identifiers appended to
|
||||||
|
sshd's `from=` constraint. List entries should be IPs or CIDRs;
|
||||||
|
hostnames require reverse-DNS to resolve cleanly on the target.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
description = ''
|
|
||||||
Catalog users that receive the SSH inventory public keys in `authorized_keys`.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkMerge [
|
||||||
users.users = lib.mapAttrs
|
{
|
||||||
(_user: _selection: {
|
assertions = [{
|
||||||
openssh.authorizedKeys.keys = inventory.authorizedKeys;
|
assertion = cfg.enable -> missingKeys == [ ];
|
||||||
|
message = "chiasson.ssh.inbound: users enabled but missing public key in `modules/ssh/inventory.nix`: ${lib.concatStringsSep ", " missingKeys}";
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
users.users = lib.mapAttrs
|
||||||
|
(name: selection: {
|
||||||
|
openssh.authorizedKeys.keys = [ (inventory.mkAuthorizedKeyLine name selection) ];
|
||||||
|
})
|
||||||
|
cfg.userAuthorizedHosts;
|
||||||
})
|
})
|
||||||
cfg.userAuthorizedHosts;
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# rbw (Bitwarden) SSH-agent socket wiring, shared across shells and the
|
||||||
|
# outbound-rbw Home Manager module. Exposed as `flake.lib.rbwSshSocket`.
|
||||||
|
{ ... }: {
|
||||||
|
flake.lib.rbwSshSocket =
|
||||||
|
let
|
||||||
|
socketPath = "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket";
|
||||||
|
|
||||||
|
# Bash init snippet — used by wisdom/shells/bash.nix (profile + interactive).
|
||||||
|
bashSnippet = ''
|
||||||
|
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
||||||
|
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
||||||
|
export SSH_AUTH_SOCK="${socketPath}"
|
||||||
|
else
|
||||||
|
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Fish init snippet — used by wisdom/shells/fish.nix.
|
||||||
|
fishSnippet = pkgs: ''
|
||||||
|
if test -z "$SSH_AUTH_SOCK"
|
||||||
|
if test -n "$XDG_RUNTIME_DIR"
|
||||||
|
set -gx SSH_AUTH_SOCK "${socketPath}"
|
||||||
|
else
|
||||||
|
set -l _hm_uid (${pkgs.coreutils}/bin/id -u)
|
||||||
|
set -gx SSH_AUTH_SOCK "/run/user/$_hm_uid/rbw/ssh-agent-socket"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit bashSnippet fishSnippet;
|
||||||
|
# Used by home-manager modules to expose SSH_AUTH_SOCK to GUI apps
|
||||||
|
# and HM-managed shells declaratively (no activation script needed).
|
||||||
|
sessionVariable = socketPath;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -17,10 +17,9 @@
|
|||||||
++ lib.optionals pkgs.stdenv.isx86_64 [ heroic ];
|
++ lib.optionals pkgs.stdenv.isx86_64 [ heroic ];
|
||||||
|
|
||||||
steamExtraPkgs =
|
steamExtraPkgs =
|
||||||
if !cfg.steam.steamTinkerLaunch.enable then
|
lib.optional (cfg.steam.steamTinkerLaunch.enable && lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.steamtinkerlaunch) pkgs.steamtinkerlaunch;
|
||||||
[ ]
|
|
||||||
else
|
launcherSet = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
||||||
lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.steamtinkerlaunch) pkgs.steamtinkerlaunch;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.system.gaming = {
|
options.chiasson.system.gaming = {
|
||||||
@@ -194,11 +193,11 @@
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf (cfg.launchers.forUsers == null) {
|
(lib.mkIf (cfg.launchers.forUsers == null) {
|
||||||
environment.systemPackages = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
environment.systemPackages = launcherSet;
|
||||||
})
|
})
|
||||||
(lib.mkIf (cfg.launchers.forUsers != null) {
|
(lib.mkIf (cfg.launchers.forUsers != null) {
|
||||||
users.users = lib.genAttrs cfg.launchers.forUsers (_: {
|
users.users = lib.genAttrs cfg.launchers.forUsers (_: {
|
||||||
packages = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
packages = launcherSet;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# NFS mount of nixdesk (14900k) bulk storage for clients. Exports live in
|
||||||
|
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
|
||||||
|
#
|
||||||
|
# Jellyfin library paths (see also jellyfin.nix):
|
||||||
|
# Movies → /mnt/nixdesk-jellyfin/movies
|
||||||
|
# Shows → /mnt/nixdesk-jellyfin/tv
|
||||||
|
#
|
||||||
|
# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the
|
||||||
|
# old client mount and let automount reattach, e.g.:
|
||||||
|
# sudo umount -l /mnt/nixdesk-jellyfin
|
||||||
|
# ls /mnt/nixdesk-jellyfin
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.nixosModules.nixdeskJellyfin =
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
nfsExportHost = "192.168.2.25";
|
||||||
|
# nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes.
|
||||||
|
nfsClientOpts = [
|
||||||
|
"rw"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
"_netdev"
|
||||||
|
"nfsvers=3"
|
||||||
|
"tcp"
|
||||||
|
"lookupcache=none"
|
||||||
|
"x-systemd.automount"
|
||||||
|
"x-systemd.idle-timeout=3600"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
fileSystems."/mnt/nixdesk-jellyfin" = {
|
||||||
|
device = "${nfsExportHost}:/mnt/deep/jellyfin";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = nfsClientOpts;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,339 @@
|
|||||||
|
# Users & SSH inbound: options + catalog defaults + integration. Single module
|
||||||
|
# that used to be split across `modules/system/users/{default,catalog-options,
|
||||||
|
# catalog-default,home-integration}.nix`. Per-host overrides / extra HM modules
|
||||||
|
# work the same way they always have; only the file structure changed.
|
||||||
|
{ self, ... }:
|
||||||
|
{
|
||||||
|
flake.nixosModules.users =
|
||||||
|
{ config, options, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.chiasson.users;
|
||||||
|
usersLib =
|
||||||
|
let
|
||||||
|
userHm = user: user.homeManager or { };
|
||||||
|
userSsh = user: user.ssh or { };
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
resolveHomeManagerModule =
|
||||||
|
moduleSpec:
|
||||||
|
let
|
||||||
|
t = builtins.typeOf moduleSpec;
|
||||||
|
in
|
||||||
|
if t == "path" || t == "string" then import moduleSpec else moduleSpec;
|
||||||
|
|
||||||
|
selectedUsersAttr =
|
||||||
|
{ catalog, enabled, hostOverrides }:
|
||||||
|
lib.listToAttrs (
|
||||||
|
map (name: {
|
||||||
|
inherit name;
|
||||||
|
value = lib.recursiveUpdate catalog.${name} (hostOverrides.${name} or { });
|
||||||
|
}) enabled
|
||||||
|
);
|
||||||
|
|
||||||
|
missingEnabledNames =
|
||||||
|
catalog: enabled: builtins.filter (name: !(builtins.hasAttr name catalog)) enabled;
|
||||||
|
|
||||||
|
strayHomeUserKeys =
|
||||||
|
homeUsers: enabled: builtins.filter (k: !(builtins.elem k enabled)) (builtins.attrNames homeUsers);
|
||||||
|
|
||||||
|
mkNixosUser =
|
||||||
|
name: user:
|
||||||
|
{
|
||||||
|
isNormalUser = user.isNormalUser or true;
|
||||||
|
description = user.description or name;
|
||||||
|
extraGroups = user.extraGroups or [ ];
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (user ? hashedPasswordFile && user.hashedPasswordFile != null) {
|
||||||
|
hashedPasswordFile = user.hashedPasswordFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
hmWiredNames =
|
||||||
|
selectedUsers:
|
||||||
|
lib.attrNames (
|
||||||
|
lib.filterAttrs (
|
||||||
|
_: user:
|
||||||
|
let
|
||||||
|
hm = userHm user;
|
||||||
|
in
|
||||||
|
(hm.enable or false) && (hm.module or null) != null
|
||||||
|
) selectedUsers
|
||||||
|
);
|
||||||
|
|
||||||
|
rbwOutboundSnippet =
|
||||||
|
name: user:
|
||||||
|
let
|
||||||
|
outboundCfg = ((userSsh user).outbound or { }).rbw or { };
|
||||||
|
in
|
||||||
|
lib.mkIf (outboundCfg.enable or false) {
|
||||||
|
chiasson.ssh.outbound.rbw.enable = true;
|
||||||
|
chiasson.ssh.outbound.rbw.user = name;
|
||||||
|
chiasson.ssh.outbound.rbw.hosts =
|
||||||
|
if (outboundCfg.hosts or "all") == "all" then [ "all" ] else outboundCfg.hosts;
|
||||||
|
chiasson.ssh.outbound.rbw.extraIdentities = outboundCfg.extraIdentities or [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
mkHmUserModule =
|
||||||
|
{ name, user, hostExtraModules }:
|
||||||
|
let
|
||||||
|
hm = userHm user;
|
||||||
|
hmModule = resolveHomeManagerModule hm.module;
|
||||||
|
in
|
||||||
|
lib.mkMerge (
|
||||||
|
[
|
||||||
|
hmModule
|
||||||
|
(rbwOutboundSnippet name user)
|
||||||
|
]
|
||||||
|
++ (hm.extraModules or [ ])
|
||||||
|
++ hostExtraModules
|
||||||
|
);
|
||||||
|
|
||||||
|
inboundAuthorizedOrNull =
|
||||||
|
user:
|
||||||
|
let
|
||||||
|
inboundCfg = (userSsh user).inbound or { };
|
||||||
|
in
|
||||||
|
if !(inboundCfg.enable or false) then
|
||||||
|
null
|
||||||
|
else if (inboundCfg.authorizedHosts or "all") == "all" then
|
||||||
|
"all"
|
||||||
|
else
|
||||||
|
inboundCfg.authorizedHosts;
|
||||||
|
|
||||||
|
inboundHostsAttr =
|
||||||
|
selectedUsers:
|
||||||
|
lib.pipe selectedUsers [
|
||||||
|
(lib.mapAttrs (_: inboundAuthorizedOrNull))
|
||||||
|
(lib.filterAttrs (_: v: v != null))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
inventory = self.lib.sshInventory;
|
||||||
|
|
||||||
|
olivierEnabled = lib.elem "olivier" cfg.enabled;
|
||||||
|
|
||||||
|
# Merge catalog + per-host overrides into the final user attrs.
|
||||||
|
selectedUsers = lib.listToAttrs (
|
||||||
|
map (name: {
|
||||||
|
inherit name;
|
||||||
|
value = lib.recursiveUpdate cfg.catalog.${name} (cfg.hostOverrides.${name} or { });
|
||||||
|
}) cfg.enabled
|
||||||
|
);
|
||||||
|
|
||||||
|
names = usersLib.hmWiredNames selectedUsers;
|
||||||
|
missing = usersLib.missingEnabledNames cfg.catalog cfg.enabled;
|
||||||
|
stray = usersLib.strayHomeUserKeys cfg.extraModules cfg.enabled;
|
||||||
|
hmAvailable = lib.hasAttrByPath [ "home-manager" "users" ] options;
|
||||||
|
inboundUsersAttr = usersLib.inboundHostsAttr selectedUsers;
|
||||||
|
|
||||||
|
hmUsersAttr = lib.listToAttrs (
|
||||||
|
map (name: {
|
||||||
|
inherit name;
|
||||||
|
value = usersLib.mkHmUserModule {
|
||||||
|
inherit name;
|
||||||
|
user = selectedUsers.${name};
|
||||||
|
hostExtraModules = cfg.extraModules.${name} or [ ];
|
||||||
|
};
|
||||||
|
}) names
|
||||||
|
);
|
||||||
|
|
||||||
|
# Fish shell wiring: HM's fish module declares its package, but
|
||||||
|
# /etc/passwd + /etc/shells need updating so login shells work.
|
||||||
|
# Only fires for HM users that actually enable fish.
|
||||||
|
hmFishUsers =
|
||||||
|
if !hmAvailable then
|
||||||
|
{ }
|
||||||
|
else
|
||||||
|
lib.filterAttrs (
|
||||||
|
name: hmUser: (hmUser.programs.fish.enable or false) && builtins.elem name names
|
||||||
|
) config.home-manager.users;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
self.nixosModules.sshInbound
|
||||||
|
{ _module.args = { inherit self usersLib; }; }
|
||||||
|
];
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Options
|
||||||
|
####################
|
||||||
|
options.chiasson.users = {
|
||||||
|
catalog = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
default = { };
|
||||||
|
description = "User records; defaults below. Override with `hostOverrides` or `mkForce`.";
|
||||||
|
};
|
||||||
|
enabled = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
description = "Catalog names to materialize as `users.users` on this machine.";
|
||||||
|
};
|
||||||
|
hostOverrides = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
default = { };
|
||||||
|
description = "`recursiveUpdate`'d onto catalog users on this host.";
|
||||||
|
};
|
||||||
|
# Standard `attrsOf (listOf …)` already concatenates lists across
|
||||||
|
# module definitions; no custom merge function needed.
|
||||||
|
extraModules = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf (lib.types.listOf lib.types.unspecified);
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Per-user Home Manager extraModules keyed by catalog name. Lists
|
||||||
|
from multiple modules (desktopHomeBase + this host's home.nix)
|
||||||
|
are concatenated.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
homeManager.autoWire = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Auto-create Home Manager users from the catalog.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Catalog defaults + integration
|
||||||
|
####################
|
||||||
|
# Nix won't accept both `config.X = …` and `config = …` in the same
|
||||||
|
# attrset (the path-attr partially defines `config`, then the explicit
|
||||||
|
# `config = …` is a redefinition error). All `config.` writes must
|
||||||
|
# therefore live INSIDE the single mkMerge block below.
|
||||||
|
config = lib.mkMerge [
|
||||||
|
####################
|
||||||
|
# Catalog defaults
|
||||||
|
####################
|
||||||
|
{
|
||||||
|
chiasson.users.catalog = {
|
||||||
|
olivier = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Olivier";
|
||||||
|
extraGroups = [
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
"docker"
|
||||||
|
"fuse"
|
||||||
|
"uinput"
|
||||||
|
"kvm"
|
||||||
|
# `video` lets brightnessctl/light udev rules own /sys/backlight without sudo.
|
||||||
|
# Harmless on headless hosts (no devices).
|
||||||
|
"video"
|
||||||
|
# DRI render + input for gamescope / Steam on Wayland, no sudo.
|
||||||
|
"render"
|
||||||
|
"input"
|
||||||
|
];
|
||||||
|
hashedPasswordFile = lib.mkIf olivierEnabled (
|
||||||
|
config.sops.secrets."users/olivier/hashedPassword".path
|
||||||
|
);
|
||||||
|
homeManager = {
|
||||||
|
enable = true;
|
||||||
|
module = { pkgs, ... }: {
|
||||||
|
home.username = "olivier";
|
||||||
|
home.homeDirectory = "/home/olivier";
|
||||||
|
home.stateVersion = "25.11";
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
# Declarative rbw config — replaces per-host
|
||||||
|
# `rbw config set email|base_url`. Neither value is a
|
||||||
|
# secret (URL + login email), so plaintext is fine, same
|
||||||
|
# as the public keys committed in ssh-inventory.nix.
|
||||||
|
programs.rbw = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
email = "olivierchiasson@hotmail.fr";
|
||||||
|
base_url = "https://bitwarden.chiasson.cloud";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ssh.inbound.enable = true;
|
||||||
|
ssh.inbound.authorizedHosts = "all";
|
||||||
|
ssh.outbound.rbw.enable = true;
|
||||||
|
ssh.outbound.rbw.hosts = [ "all" ];
|
||||||
|
# olivier's laptop: the HM SSH module writes the matching
|
||||||
|
# `.pub` filter for each of these and emits a `Match user`
|
||||||
|
# block, so `ssh server@r5500` / `ssh builder@nix-server`
|
||||||
|
# route the right private key from the rbw agent.
|
||||||
|
ssh.outbound.rbw.extraIdentities = [
|
||||||
|
"server"
|
||||||
|
"builder"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
server = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Server user";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
homeManager = {
|
||||||
|
enable = false;
|
||||||
|
module = null;
|
||||||
|
};
|
||||||
|
ssh.inbound.enable = true;
|
||||||
|
ssh.inbound.authorizedHosts = "all";
|
||||||
|
ssh.outbound.rbw.enable = false;
|
||||||
|
ssh.outbound.rbw.hosts = [ "all" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
builder = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Navi fleet deploy (push + activate only)";
|
||||||
|
extraGroups = [ ];
|
||||||
|
createHome = false;
|
||||||
|
homeManager = {
|
||||||
|
enable = false;
|
||||||
|
module = null;
|
||||||
|
};
|
||||||
|
ssh.inbound.enable = true;
|
||||||
|
ssh.inbound.authorizedHosts = "all";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Pull in olivier's hashed password from sops; `neededForUsers`
|
||||||
|
# makes nixos decrypt it at boot so the user record can read it.
|
||||||
|
sops.secrets."users/olivier/hashedPassword" = lib.mkIf olivierEnabled {
|
||||||
|
neededForUsers = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Integration
|
||||||
|
####################
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = missing == [ ];
|
||||||
|
message = "chiasson.users.enabled references unknown catalog names: ${lib.concatStringsSep ", " missing}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = stray == [ ];
|
||||||
|
message = "chiasson.users.extraModules has keys not in chiasson.users.enabled: ${lib.concatStringsSep ", " stray}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# NixOS user accounts (no HM, raw).
|
||||||
|
users.users = lib.mapAttrs (name: user: usersLib.mkNixosUser name user) selectedUsers;
|
||||||
|
}
|
||||||
|
(lib.optionalAttrs hmAvailable {
|
||||||
|
"home-manager".useGlobalPkgs = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) true;
|
||||||
|
"home-manager".sharedModules = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) [
|
||||||
|
self.homeManagerModules.sshOutboundRbw
|
||||||
|
];
|
||||||
|
"home-manager".users = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) hmUsersAttr;
|
||||||
|
})
|
||||||
|
# Wire user-specific ACLs into the inbound module — fail the build
|
||||||
|
# if a user has no matching pubkey.
|
||||||
|
(lib.mkIf (inboundUsersAttr != { }) {
|
||||||
|
chiasson.ssh.inbound.enable = true;
|
||||||
|
chiasson.ssh.inbound.userAuthorizedHosts = inboundUsersAttr;
|
||||||
|
})
|
||||||
|
# Fish-shell wiring: HM knows the package; we sync /etc/passwd +
|
||||||
|
# /etc/shells with `mkForce`. `mkNixosUser` doesn't emit `shell`, so
|
||||||
|
# the force is uncontested.
|
||||||
|
(lib.mkIf (hmFishUsers != { }) {
|
||||||
|
environment.shells = lib.mkAfter (
|
||||||
|
lib.mapAttrsToList (_: hmUser: lib.getExe hmUser.programs.fish.package) hmFishUsers
|
||||||
|
);
|
||||||
|
users.users = lib.mapAttrs (name: hmUser: {
|
||||||
|
shell = lib.mkForce (lib.getExe hmUser.programs.fish.package);
|
||||||
|
}) hmFishUsers;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
# Shared user definitions for all hosts that import `nixosModules.users`.
|
|
||||||
# Module (not bare attrset) so catalog entries can use `config.*` for sops paths etc.
|
|
||||||
{ ... }: {
|
|
||||||
flake.nixosModules.usersCatalogDefaults =
|
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
olivierEnabled = lib.elem "olivier" config.chiasson.users.enabled;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config.sops.secrets."users/olivier/hashedPassword" = lib.mkIf olivierEnabled {
|
|
||||||
neededForUsers = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
config.chiasson.users.catalog = {
|
|
||||||
olivier = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Olivier";
|
|
||||||
extraGroups = [
|
|
||||||
"networkmanager"
|
|
||||||
"wheel"
|
|
||||||
"docker"
|
|
||||||
"fuse"
|
|
||||||
"uinput"
|
|
||||||
"kvm"
|
|
||||||
# `video` is required for the brightnessctl/light udev rules to grant write access
|
|
||||||
# to /sys/class/backlight/*/brightness without sudo. Harmless on hosts without a
|
|
||||||
# backlight (servers, desktop towers): the group simply has no devices to own.
|
|
||||||
"video"
|
|
||||||
# DRI render nodes and input devices for gamescope / Steam on Wayland (no sudo).
|
|
||||||
"render"
|
|
||||||
"input"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Declared in this module when olivier is in `chiasson.users.enabled`.
|
|
||||||
# With `neededForUsers`, `.path` is under /run/secrets-for-users/… (sops-nix README).
|
|
||||||
hashedPasswordFile = lib.mkIf olivierEnabled (
|
|
||||||
config.sops.secrets."users/olivier/hashedPassword".path
|
|
||||||
);
|
|
||||||
|
|
||||||
homeManager = {
|
|
||||||
enable = true;
|
|
||||||
module =
|
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
home.username = "olivier";
|
|
||||||
home.homeDirectory = "/home/olivier";
|
|
||||||
home.stateVersion = "25.11";
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
ssh = {
|
|
||||||
inbound = {
|
|
||||||
enable = true;
|
|
||||||
authorizedHosts = "all";
|
|
||||||
};
|
|
||||||
outbound = {
|
|
||||||
rbw = {
|
|
||||||
enable = true;
|
|
||||||
hosts = "all";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
server = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Server user";
|
|
||||||
extraGroups = [ "wheel" ];
|
|
||||||
|
|
||||||
homeManager = {
|
|
||||||
enable = false;
|
|
||||||
module = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
ssh = {
|
|
||||||
inbound = {
|
|
||||||
enable = true;
|
|
||||||
authorizedHosts = "all";
|
|
||||||
};
|
|
||||||
outbound = {
|
|
||||||
rbw = {
|
|
||||||
enable = false;
|
|
||||||
hosts = "all";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
builder = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Navi fleet deploy (push + activate only)";
|
|
||||||
extraGroups = [ ];
|
|
||||||
createHome = false;
|
|
||||||
|
|
||||||
homeManager = {
|
|
||||||
enable = false;
|
|
||||||
module = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
ssh.inbound.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{ ... }: {
|
|
||||||
flake.nixosModules.usersCatalogOptions =
|
|
||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
options.chiasson.users = {
|
|
||||||
catalog = lib.mkOption {
|
|
||||||
type = lib.types.attrs;
|
|
||||||
default = { };
|
|
||||||
description = ''
|
|
||||||
User records merged from `usersCatalogDefaults`; override with `hostOverrides` or `mkForce`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
enabled = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = "Catalog names to materialize as `users.users` on this machine.";
|
|
||||||
};
|
|
||||||
hostOverrides = lib.mkOption {
|
|
||||||
type = lib.types.attrs;
|
|
||||||
default = { };
|
|
||||||
description = ''
|
|
||||||
`recursiveUpdate`d onto catalog users.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
extraModules = lib.mkOption {
|
|
||||||
type =
|
|
||||||
(lib.types.attrsOf (lib.types.listOf lib.types.unspecified))
|
|
||||||
// {
|
|
||||||
merge =
|
|
||||||
loc: defs:
|
|
||||||
let
|
|
||||||
values = map (d: d.value) defs;
|
|
||||||
names = lib.unique (lib.concatLists (map builtins.attrNames values));
|
|
||||||
in
|
|
||||||
lib.genAttrs names (
|
|
||||||
name: lib.concatLists (map (v: v.${name} or [ ]) values)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
default = { };
|
|
||||||
description = ''
|
|
||||||
Per-user Home Manager `extraModules` keyed by catalog user name.
|
|
||||||
Keys must match `chiasson.users.enabled`. Lists from multiple modules
|
|
||||||
are concatenated (e.g. `desktop-home-base.nix` + host `home.nix`).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
homeManager = {
|
|
||||||
autoWire = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Create HM users from the catalog when true.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# Catalog → NixOS `users.users` + Home Manager + SSH inbound.
|
|
||||||
{ self, ... }: {
|
|
||||||
flake.nixosModules.users =
|
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
usersLib = self.lib.usersMerge lib;
|
|
||||||
selectUsers =
|
|
||||||
c:
|
|
||||||
let
|
|
||||||
uc = c.chiasson.users;
|
|
||||||
in
|
|
||||||
usersLib.selectedUsersAttr {
|
|
||||||
catalog = uc.catalog;
|
|
||||||
enabled = uc.enabled;
|
|
||||||
hostOverrides = uc.hostOverrides;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
self.nixosModules.sshInbound
|
|
||||||
self.nixosModules.usersCatalogOptions
|
|
||||||
self.nixosModules.usersCatalogDefaults
|
|
||||||
{ _module.args = { inherit self usersLib selectUsers; }; }
|
|
||||||
self.nixosModules.usersHomeIntegration
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
{ ... }: {
|
|
||||||
flake.nixosModules.usersHomeIntegration =
|
|
||||||
{ config, options, lib, self, usersLib, selectUsers, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.chiasson.users;
|
|
||||||
selected = selectUsers config;
|
|
||||||
missing = usersLib.missingEnabledNames cfg.catalog cfg.enabled;
|
|
||||||
stray = usersLib.strayHomeUserKeys cfg.extraModules cfg.enabled;
|
|
||||||
names = usersLib.hmWiredNames selected;
|
|
||||||
hmAvailable = lib.hasAttrByPath [ "home-manager" "users" ] options;
|
|
||||||
hmUsersAttr = lib.listToAttrs (
|
|
||||||
map (name: {
|
|
||||||
inherit name;
|
|
||||||
value = usersLib.mkHmUserModule {
|
|
||||||
inherit name;
|
|
||||||
user = selected.${name};
|
|
||||||
hostExtraModules = cfg.extraModules.${name} or [ ];
|
|
||||||
};
|
|
||||||
}) names
|
|
||||||
);
|
|
||||||
inboundUsersAttr = usersLib.inboundHostsAttr selected;
|
|
||||||
|
|
||||||
# HM configures fish in ~/.config/fish but no longer sets /etc/passwd or /etc/shells.
|
|
||||||
hmFishUsers =
|
|
||||||
if !hmAvailable then { }
|
|
||||||
else
|
|
||||||
lib.filterAttrs (
|
|
||||||
name: hmUser: (hmUser.programs.fish.enable or false) && builtins.elem name names
|
|
||||||
) config.home-manager.users;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = missing == [ ];
|
|
||||||
message = "chiasson.users.enabled references unknown catalog users: ${builtins.concatStringsSep ", " missing}";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
assertion = stray == [ ];
|
|
||||||
message = "chiasson.users.extraModules has keys not in chiasson.users.enabled: ${builtins.concatStringsSep ", " stray}";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
users.users = lib.mapAttrs (name: user: usersLib.mkNixosUser name user) selected;
|
|
||||||
}
|
|
||||||
(lib.optionalAttrs hmAvailable {
|
|
||||||
"home-manager".useGlobalPkgs = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) true;
|
|
||||||
"home-manager".sharedModules = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) [ self.homeManagerModules.sshOutboundRbw ];
|
|
||||||
"home-manager".users = lib.mkIf (cfg.homeManager.autoWire && names != [ ]) hmUsersAttr;
|
|
||||||
})
|
|
||||||
(lib.mkIf (inboundUsersAttr != { }) {
|
|
||||||
chiasson.ssh.inbound.enable = true;
|
|
||||||
chiasson.ssh.inbound.userAuthorizedHosts = inboundUsersAttr;
|
|
||||||
})
|
|
||||||
(lib.mkIf (hmFishUsers != { }) {
|
|
||||||
environment.shells = lib.mkAfter (
|
|
||||||
lib.mapAttrsToList (
|
|
||||||
_: hmUser: lib.getExe hmUser.programs.fish.package
|
|
||||||
) hmFishUsers
|
|
||||||
);
|
|
||||||
users.users = lib.mapAttrs (
|
|
||||||
name: hmUser: {
|
|
||||||
shell = lib.mkForce (lib.getExe hmUser.programs.fish.package);
|
|
||||||
}
|
|
||||||
) hmFishUsers;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,9 @@
|
|||||||
|
|
||||||
options.chiasson.home.apps.discord.enable = lib.mkEnableOption ''
|
options.chiasson.home.apps.discord.enable = lib.mkEnableOption ''
|
||||||
Vesktop (nixcord). Needs nixpkgs `discord` — breaks on e.g. aarch64-linux.
|
Vesktop (nixcord). Needs nixpkgs `discord` — breaks on e.g. aarch64-linux.
|
||||||
'';
|
'' // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf root.enable (lib.mkMerge [
|
config = lib.mkIf root.enable (lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.nixosModules.systemLocalsend =
|
flake.nixosModules.systemLocalsend =
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
@@ -19,23 +19,10 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeManagerModules.wisdomAppsLocalsend =
|
flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "apps.localsend";
|
||||||
let
|
default = true;
|
||||||
root = config.chiasson.home;
|
description = "LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.";
|
||||||
cfg = config.chiasson.home.apps.localsend;
|
packages = pkgs: [ pkgs.localsend ];
|
||||||
in
|
};
|
||||||
{
|
|
||||||
options.chiasson.home.apps.localsend = {
|
|
||||||
enable = lib.mkEnableOption ''
|
|
||||||
LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.
|
|
||||||
'';
|
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "localsend" { };
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = [ cfg.package ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,8 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomAppsPokeclicker =
|
flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "apps.pokeclicker";
|
||||||
let
|
default = false;
|
||||||
root = config.chiasson.home;
|
description = "PokéClicker desktop (Farigh fork .deb → nix).";
|
||||||
cfg = config.chiasson.home.apps.pokeclicker;
|
packages = pkgs: [ (pkgs.callPackage ./package { }) ];
|
||||||
pokeclickerPkg = pkgs.callPackage ./package { };
|
};
|
||||||
in
|
|
||||||
{
|
|
||||||
options.chiasson.home.apps.pokeclicker.enable = lib.mkEnableOption "PokéClicker desktop (Farigh fork .deb → nix).";
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = [ pokeclickerPkg ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomBrowsersChrome =
|
flake.homeManagerModules.wisdomBrowsersChrome = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "browsers.chrome";
|
||||||
let
|
default = false;
|
||||||
root = config.chiasson.home;
|
description = "Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform.";
|
||||||
cfg = config.chiasson.home.browsers.chrome;
|
packages = pkgs: [ pkgs.google-chrome ];
|
||||||
in
|
};
|
||||||
{
|
|
||||||
options.chiasson.home.browsers.chrome.enable = lib.mkEnableOption ''
|
|
||||||
Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform.
|
|
||||||
'';
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = lib.optional (
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.google-chrome
|
|
||||||
) pkgs.google-chrome;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,25 +5,43 @@
|
|||||||
cfg = config.chiasson.system.chromiumHevc;
|
cfg = config.chiasson.system.chromiumHevc;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.system.chromiumHevc.enable = lib.mkEnableOption ''
|
options.chiasson.system.chromiumHevc = {
|
||||||
VA-API packages for Chromium HEVC (Intel iHD + optional NVIDIA nvidia-vaapi-driver).
|
enable = lib.mkEnableOption ''
|
||||||
Pair with `wisdomBrowsersChromiumHevc` on the user side.
|
VA-API packages for Chromium HEVC (Intel iHD + optional NVIDIA nvidia-vaapi-driver).
|
||||||
'';
|
Pair with `wisdomBrowsersChromiumHevc` on the user side.
|
||||||
|
'';
|
||||||
|
|
||||||
|
gpu = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"intel"
|
||||||
|
"nvidia"
|
||||||
|
];
|
||||||
|
default = "intel";
|
||||||
|
description = ''
|
||||||
|
VA-API stack for the `*-hevc` browser launchers. Use **intel** for Jellyfin
|
||||||
|
(Chromium + nvidia-vaapi-driver is unsupported upstream and fails with
|
||||||
|
`failed Initialize()ing the frame pool` in Jellyfin). **nvidia** adds the
|
||||||
|
nvidia-vaapi-driver and keep renderD129 + VaapiOnNvidiaGPUs for experiments only.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.graphics.enable = lib.mkDefault true;
|
hardware.graphics.enable = lib.mkDefault true;
|
||||||
hardware.graphics.extraPackages = lib.mkAfter (
|
hardware.graphics.extraPackages = lib.mkAfter (
|
||||||
with pkgs;
|
lib.optionals (cfg.gpu == "nvidia") [
|
||||||
[ nvidia-vaapi-driver ]
|
pkgs.nvidia-vaapi-driver
|
||||||
|
]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeManagerModules.wisdomBrowsersChromiumHevc =
|
flake.homeManagerModules.wisdomBrowsersChromiumHevc =
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, osConfig ? { }, ... }:
|
||||||
let
|
let
|
||||||
root = config.chiasson.home;
|
root = config.chiasson.home;
|
||||||
cfg = config.chiasson.home.browsers.chromiumHevc;
|
cfg = config.chiasson.home.browsers.chromiumHevc;
|
||||||
|
gpu = lib.attrByPath [ "chiasson" "system" "chromiumHevc" "gpu" ] "intel" osConfig;
|
||||||
|
|
||||||
browserCatalog = {
|
browserCatalog = {
|
||||||
"google-chrome" = {
|
"google-chrome" = {
|
||||||
@@ -53,7 +71,6 @@
|
|||||||
intel = {
|
intel = {
|
||||||
driver = "iHD";
|
driver = "iHD";
|
||||||
drmDevice = "/dev/dri/renderD128";
|
drmDevice = "/dev/dri/renderD128";
|
||||||
nvdBackend = "direct";
|
|
||||||
enableFeatures = [
|
enableFeatures = [
|
||||||
"VaapiVideoDecodeLinuxGL"
|
"VaapiVideoDecodeLinuxGL"
|
||||||
"VaapiVideoDecoder"
|
"VaapiVideoDecoder"
|
||||||
@@ -69,7 +86,6 @@
|
|||||||
nvidia = {
|
nvidia = {
|
||||||
driver = "nvidia";
|
driver = "nvidia";
|
||||||
drmDevice = "/dev/dri/renderD129";
|
drmDevice = "/dev/dri/renderD129";
|
||||||
nvdBackend = "direct";
|
|
||||||
enableFeatures = [
|
enableFeatures = [
|
||||||
"VaapiVideoDecoder"
|
"VaapiVideoDecoder"
|
||||||
"VaapiIgnoreDriverChecks"
|
"VaapiIgnoreDriverChecks"
|
||||||
@@ -85,7 +101,30 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
activeGpu = gpuProfiles.${cfg.vaapi.gpu};
|
activeGpu = gpuProfiles.${gpu};
|
||||||
|
enableFeatures = lib.concatStringsSep "," activeGpu.enableFeatures;
|
||||||
|
disableFeatures = lib.concatStringsSep "," activeGpu.disableFeatures;
|
||||||
|
|
||||||
|
mkDesktopItem =
|
||||||
|
spec:
|
||||||
|
pkgs.makeDesktopItem {
|
||||||
|
name = spec.launcher;
|
||||||
|
desktopName = spec.desktopName;
|
||||||
|
genericName = "Web Browser";
|
||||||
|
exec = "${spec.launcher} %U";
|
||||||
|
icon = spec.icon;
|
||||||
|
categories = [
|
||||||
|
"Network"
|
||||||
|
"WebBrowser"
|
||||||
|
];
|
||||||
|
mimeTypes = [
|
||||||
|
"text/html"
|
||||||
|
"text/xml"
|
||||||
|
"application/xhtml+xml"
|
||||||
|
"x-scheme-handler/http"
|
||||||
|
"x-scheme-handler/https"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
mkChromiumHevc =
|
mkChromiumHevc =
|
||||||
packageName:
|
packageName:
|
||||||
@@ -93,26 +132,7 @@
|
|||||||
spec = browserCatalog.${packageName};
|
spec = browserCatalog.${packageName};
|
||||||
browser = spec.package;
|
browser = spec.package;
|
||||||
launcherName = spec.launcher;
|
launcherName = spec.launcher;
|
||||||
enableFeatures = lib.concatStringsSep "," activeGpu.enableFeatures;
|
desktopItem = mkDesktopItem spec;
|
||||||
disableFeatures = lib.concatStringsSep "," activeGpu.disableFeatures;
|
|
||||||
desktopItem = pkgs.makeDesktopItem {
|
|
||||||
name = launcherName;
|
|
||||||
desktopName = spec.desktopName;
|
|
||||||
genericName = "Web Browser";
|
|
||||||
exec = "${launcherName} %U";
|
|
||||||
icon = spec.icon;
|
|
||||||
categories = [
|
|
||||||
"Network"
|
|
||||||
"WebBrowser"
|
|
||||||
];
|
|
||||||
mimeTypes = [
|
|
||||||
"text/html"
|
|
||||||
"text/xml"
|
|
||||||
"application/xhtml+xml"
|
|
||||||
"x-scheme-handler/http"
|
|
||||||
"x-scheme-handler/https"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
pkgs.runCommand launcherName
|
pkgs.runCommand launcherName
|
||||||
{
|
{
|
||||||
@@ -126,7 +146,7 @@
|
|||||||
makeWrapper ${browser}/bin/${spec.binary} $out/bin/${launcherName} \
|
makeWrapper ${browser}/bin/${spec.binary} $out/bin/${launcherName} \
|
||||||
--set LIBVA_DRIVER_NAME ${lib.escapeShellArg activeGpu.driver} \
|
--set LIBVA_DRIVER_NAME ${lib.escapeShellArg activeGpu.driver} \
|
||||||
--set LIBVA_DRM_DEVICE ${lib.escapeShellArg activeGpu.drmDevice} \
|
--set LIBVA_DRM_DEVICE ${lib.escapeShellArg activeGpu.drmDevice} \
|
||||||
--set NVD_BACKEND ${lib.escapeShellArg activeGpu.nvdBackend} \
|
--set NVD_BACKEND direct \
|
||||||
--add-flags "--enable-features=${enableFeatures}" \
|
--add-flags "--enable-features=${enableFeatures}" \
|
||||||
--add-flags "--disable-features=${disableFeatures}" \
|
--add-flags "--disable-features=${disableFeatures}" \
|
||||||
${lib.concatMapStringsSep " " (a: "--add-flags ${lib.escapeShellArg a}") cfg.extraCommandLineArgs}
|
${lib.concatMapStringsSep " " (a: "--add-flags ${lib.escapeShellArg a}") cfg.extraCommandLineArgs}
|
||||||
@@ -136,48 +156,30 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
selectedPackages = lib.filter (
|
selectedPackages = lib.filter (
|
||||||
name:
|
name: lib.meta.availableOn pkgs.stdenv.hostPlatform browserCatalog.${name}.package
|
||||||
let
|
|
||||||
spec = browserCatalog.${name};
|
|
||||||
in
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform spec.package
|
|
||||||
) cfg.packages;
|
) cfg.packages;
|
||||||
|
|
||||||
wrappers = map mkChromiumHevc selectedPackages;
|
wrappers = map mkChromiumHevc selectedPackages;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.home.browsers.chromiumHevc = {
|
options.chiasson.home.browsers.chromiumHevc = {
|
||||||
enable = lib.mkEnableOption ''
|
enable =
|
||||||
`google-chrome-hevc`: Chromium with VA-API HEVC for Jellyfin / MSE playback.
|
lib.mkEnableOption ''
|
||||||
|
`google-chrome-hevc`: Chromium with VA-API HEVC for Jellyfin / MSE playback.
|
||||||
|
|
||||||
Default GPU is **Intel** (`vaapi.gpu = "intel"`): Chromium + NVIDIA VA-API is
|
GPU stack comes from `chiasson.system.chromiumHevc.gpu` (default **intel**).
|
||||||
unsupported upstream (`nvidia-vaapi-driver` README) and fails with
|
Requires `chiasson.system.chromiumHevc.enable` on NixOS.
|
||||||
`failed Initialize()ing the frame pool` in Jellyfin.
|
''
|
||||||
|
// {
|
||||||
Requires `chiasson.system.chromiumHevc.enable` on NixOS.
|
default = true;
|
||||||
'';
|
};
|
||||||
|
|
||||||
packages = lib.mkOption {
|
packages = lib.mkOption {
|
||||||
type = lib.types.listOf (
|
type = lib.types.listOf (lib.types.enum (lib.attrNames browserCatalog));
|
||||||
lib.types.enum (lib.attrNames browserCatalog)
|
default = if pkgs.stdenv.hostPlatform.isAarch64 then [ "chromium" ] else [ "google-chrome" ];
|
||||||
);
|
|
||||||
default = [ "google-chrome" ];
|
|
||||||
description = "Chromium-based browsers to wrap.";
|
description = "Chromium-based browsers to wrap.";
|
||||||
};
|
};
|
||||||
|
|
||||||
vaapi.gpu = lib.mkOption {
|
|
||||||
type = lib.types.enum [
|
|
||||||
"intel"
|
|
||||||
"nvidia"
|
|
||||||
];
|
|
||||||
default = "intel";
|
|
||||||
description = ''
|
|
||||||
VA-API stack for `google-chrome-hevc`. Use **intel** for Jellyfin (Chromium +
|
|
||||||
nvidia-vaapi-driver is unsupported and hits frame-pool init errors). **nvidia**
|
|
||||||
keeps renderD129 + VaapiOnNvidiaGPUs for experiments only.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraCommandLineArgs = lib.mkOption {
|
extraCommandLineArgs = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
|||||||
@@ -1,17 +1,8 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomBrowsersEdge =
|
flake.homeManagerModules.wisdomBrowsersEdge = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "browsers.edge";
|
||||||
let
|
default = false;
|
||||||
root = config.chiasson.home;
|
description = "Edge (unfree); skipped if unavailable on this platform.";
|
||||||
cfg = config.chiasson.home.browsers.edge;
|
packages = pkgs: [ pkgs.microsoft-edge ];
|
||||||
in
|
};
|
||||||
{
|
|
||||||
options.chiasson.home.browsers.edge.enable = lib.mkEnableOption "Edge (unfree); skipped if unavailable on this platform.";
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = lib.optional (
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.microsoft-edge
|
|
||||||
) pkgs.microsoft-edge;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomBrowsersFlow =
|
flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "browsers.flow";
|
||||||
let
|
default = false;
|
||||||
root = config.chiasson.home;
|
description = "[Flow](https://github.com/MultiboxLabs/flow-browser) — upstream AppImage wrapped for NixOS.";
|
||||||
cfg = config.chiasson.home.browsers.flow;
|
packages =
|
||||||
|
pkgs:
|
||||||
|
let
|
||||||
|
pname = "flow-browser";
|
||||||
|
version = "0.11.0";
|
||||||
|
|
||||||
flow-browser =
|
suffix = if pkgs.stdenv.hostPlatform.isAarch64 then "arm64" else "x86_64";
|
||||||
let
|
|
||||||
pname = "flow-browser";
|
|
||||||
version = "0.11.0";
|
|
||||||
|
|
||||||
suffix = if pkgs.stdenv.hostPlatform.isAarch64 then "arm64" else "x86_64";
|
hash =
|
||||||
|
if pkgs.stdenv.hostPlatform.isAarch64 then
|
||||||
|
"sha256-rTRKbNyVRJAw7ZyDR6kx+XJ4rWmErZqA0b6LP9t5eOA="
|
||||||
|
else
|
||||||
|
"sha256-/Tca4uUBfgbZQEeXdYkCz6CWxqvCl40CQpACFry1k9s=";
|
||||||
|
|
||||||
hash =
|
src = pkgs.fetchurl {
|
||||||
if pkgs.stdenv.hostPlatform.isAarch64 then
|
url = "https://github.com/MultiboxLabs/flow-browser/releases/download/v${version}/flow-browser-${version}-${suffix}.AppImage";
|
||||||
"sha256-rTRKbNyVRJAw7ZyDR6kx+XJ4rWmErZqA0b6LP9t5eOA="
|
inherit hash;
|
||||||
else
|
};
|
||||||
"sha256-/Tca4uUBfgbZQEeXdYkCz6CWxqvCl40CQpACFry1k9s=";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
appimageContents = pkgs.appimageTools.extractType2 { inherit pname version src; };
|
||||||
url = "https://github.com/MultiboxLabs/flow-browser/releases/download/v${version}/flow-browser-${version}-${suffix}.AppImage";
|
in
|
||||||
inherit hash;
|
[
|
||||||
};
|
(pkgs.appimageTools.wrapType2 {
|
||||||
|
|
||||||
appimageContents = pkgs.appimageTools.extractType2 { inherit pname version src; };
|
|
||||||
in
|
|
||||||
pkgs.appimageTools.wrapType2 {
|
|
||||||
inherit pname version src;
|
inherit pname version src;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
@@ -45,23 +45,13 @@
|
|||||||
meta = {
|
meta = {
|
||||||
description = "Chromium-based browser (upstream AppImage)";
|
description = "Chromium-based browser (upstream AppImage)";
|
||||||
homepage = "https://github.com/MultiboxLabs/flow-browser";
|
homepage = "https://github.com/MultiboxLabs/flow-browser";
|
||||||
license = lib.licenses.gpl3Plus;
|
license = pkgs.lib.licenses.gpl3Plus;
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
sourceProvenance = with pkgs.lib.sourceTypes; [ binaryNativeCode ];
|
||||||
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
mainProgram = pname;
|
mainProgram = pname;
|
||||||
maintainers = [ ];
|
maintainers = [ ];
|
||||||
};
|
};
|
||||||
};
|
})
|
||||||
in
|
];
|
||||||
{
|
};
|
||||||
options.chiasson.home.browsers.flow.enable = lib.mkEnableOption ''
|
|
||||||
[Flow](https://github.com/MultiboxLabs/flow-browser) — upstream AppImage wrapped for NixOS.
|
|
||||||
'';
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = lib.optional (
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform flow-browser
|
|
||||||
) flow-browser;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
{
|
{
|
||||||
options.chiasson.home.browsers.orion.enable = lib.mkEnableOption ''
|
options.chiasson.home.browsers.orion.enable = lib.mkEnableOption ''
|
||||||
[Orion](https://orionbrowser.com/) (Kagi) — installs the upstream Flatpak bundle and provides `oriongtk`.
|
[Orion](https://orionbrowser.com/) (Kagi) — installs the upstream Flatpak bundle and provides `oriongtk`.
|
||||||
'';
|
'' // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
home.packages = [ oriongtk ];
|
home.packages = [ oriongtk ];
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
{
|
{
|
||||||
imports = [ inputs.zen-browser.homeModules.beta ];
|
imports = [ inputs.zen-browser.homeModules.beta ];
|
||||||
|
|
||||||
options.chiasson.home.browsers.zen.enable = lib.mkEnableOption "Zen Browser + locked-down policies / extensions.";
|
options.chiasson.home.browsers.zen.enable = lib.mkEnableOption "Zen Browser + locked-down policies / extensions." // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
programs.zen-browser = {
|
programs.zen-browser = {
|
||||||
|
|||||||
+32
-24
@@ -1,34 +1,23 @@
|
|||||||
# HM side of the flake; option tree is `chiasson.home.*` (docs/conventions.md).
|
# HM side of the flake; option tree is `chiasson.home.*` (docs/conventions.md).
|
||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
imports = [
|
# Root module: chiasson.home.enable + git identity. Other `wisdom*` slices (including
|
||||||
./apps/discord.nix
|
# the bash shell) auto-wire via `lib.wisdomCatalogExtraModules`; hosts flip
|
||||||
./apps/localsend.nix
|
# `chiasson.home.*.enable` rather than re-importing.
|
||||||
./apps/pokeclicker
|
|
||||||
./apps/spotify.nix
|
|
||||||
./browsers/orion.nix
|
|
||||||
./desktop/screenshot.nix
|
|
||||||
./hardware/uconsole-gamepad.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Root module: chiasson.home.enable + bash. Other `wisdom*` slices auto-wire via
|
|
||||||
# `lib.wisdomCatalogExtraModules`; hosts flip `chiasson.home.*.enable` rather than re-importing.
|
|
||||||
flake.homeManagerModules.wisdom =
|
flake.homeManagerModules.wisdom =
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.chiasson.home;
|
cfg = config.chiasson.home;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
self.homeManagerModules.wisdomShellBash
|
|
||||||
];
|
|
||||||
|
|
||||||
options.chiasson.home = {
|
options.chiasson.home = {
|
||||||
enable = lib.mkEnableOption ''
|
enable =
|
||||||
HM profile root for this flake (bash on by default). Desktop hosts use
|
lib.mkEnableOption ''
|
||||||
`lib.wisdomCatalogExtraModules` once per user and flip `chiasson.home.*.enable` on the host.
|
HM profile root for this flake (bash on by default). Desktop hosts use
|
||||||
'' // {
|
`lib.wisdomCatalogExtraModules` once per user and flip `chiasson.home.*.enable` on the host.
|
||||||
default = true;
|
''
|
||||||
};
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
extraPackages = lib.mkOption {
|
extraPackages = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.package;
|
type = lib.types.listOf lib.types.package;
|
||||||
@@ -39,6 +28,25 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable { home.packages = cfg.extraPackages; };
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{ home.packages = cfg.extraPackages; }
|
||||||
|
|
||||||
|
# Base git identity + encryption/player tools shared by every HM user.
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
settings.user = {
|
||||||
|
name = "OlivierChiasson";
|
||||||
|
email = "olivierchiasson@hotmail.fr";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home.packages = [
|
||||||
|
pkgs.git-crypt
|
||||||
|
pkgs.feishin
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption ''
|
||||||
WhiteSur GTK + icon themes, Phinger cursor, and Qt via qt6ct (DMS) or KDE platform theme.
|
WhiteSur GTK + icon themes, Phinger cursor, and Qt via qt6ct (DMS) or KDE platform theme.
|
||||||
Matugen accent colors load via gtk3/gtk4 extraCss when matugenGtkColors is enabled.
|
Matugen accent colors load via gtk3/gtk4 extraCss when matugenGtkColors is enabled.
|
||||||
'';
|
'' // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
matugenGtkColors = lib.mkOption {
|
matugenGtkColors = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|||||||
@@ -7,15 +7,19 @@
|
|||||||
hyprlandHm = lib.attrByPath [ "wayland" "windowManager" "hyprland" ] { } config;
|
hyprlandHm = lib.attrByPath [ "wayland" "windowManager" "hyprland" ] { } config;
|
||||||
hyprlandHmEnabled = hyprlandHm.enable or false;
|
hyprlandHmEnabled = hyprlandHm.enable or false;
|
||||||
keyOk = cfg.swiftshareApiKeyFile != null && cfg.swiftshareApiKeyFile != "";
|
keyOk = cfg.swiftshareApiKeyFile != null && cfg.swiftshareApiKeyFile != "";
|
||||||
|
uploadScript = builtins.readFile ./scripts/swiftshare-upload.sh;
|
||||||
|
screenshotScript = builtins.readFile ./scripts/swiftshare-screenshot.sh;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.home.desktop.screenshot.enable = lib.mkEnableOption ''
|
options.chiasson.home.desktop.screenshot.enable = lib.mkEnableOption ''
|
||||||
grim/slurp/swappy + SwiftShare helpers; Hyprland binds if HM Hyprland is on.
|
grim/slurp/swappy + SwiftShare helpers; Hyprland binds if HM Hyprland is on.
|
||||||
'';
|
'' // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
options.chiasson.home.desktop.screenshot.swiftshareApiKeyFile = lib.mkOption {
|
options.chiasson.home.desktop.screenshot.swiftshareApiKeyFile = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
default = null;
|
default = "/run/secrets/swiftshare/API_KEY";
|
||||||
description = ''
|
description = ''
|
||||||
File with SwiftShare API key (sops path is fine). Required when screenshot module is on.
|
File with SwiftShare API key (sops path is fine). Required when screenshot module is on.
|
||||||
'';
|
'';
|
||||||
@@ -33,171 +37,23 @@
|
|||||||
(lib.mkIf (root.enable && cfg.enable && keyOk) (
|
(lib.mkIf (root.enable && cfg.enable && keyOk) (
|
||||||
let
|
let
|
||||||
apiKeyFile = cfg.swiftshareApiKeyFile;
|
apiKeyFile = cfg.swiftshareApiKeyFile;
|
||||||
|
swiftshareUpload = pkgs.writeShellScriptBin "swiftshare-upload" (
|
||||||
|
builtins.replaceStrings [ "@API_KEY_FILE@" ] [ apiKeyFile ] uploadScript
|
||||||
|
);
|
||||||
|
swiftshareScreenshot = pkgs.writeShellScriptBin "swiftshare-screenshot" screenshotScript;
|
||||||
in
|
in
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
grim
|
grim
|
||||||
slurp
|
slurp
|
||||||
swappy
|
swappy
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
libnotify
|
libnotify
|
||||||
(writeShellScriptBin "swiftshare-upload" ''
|
curl
|
||||||
#!${pkgs.bash}/bin/bash
|
jq
|
||||||
set -euo pipefail
|
swiftshareUpload
|
||||||
|
swiftshareScreenshot
|
||||||
COPY_URL=0
|
|
||||||
if [ "$#" -ge 1 ] && [ "$1" = "--copy-url" ]; then
|
|
||||||
COPY_URL=1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
APP_NAME=""
|
|
||||||
if [ "$#" -ge 2 ] && [ "$1" = "--app-name" ]; then
|
|
||||||
APP_NAME="$2"
|
|
||||||
shift 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
API_KEY_FILE=${lib.escapeShellArg apiKeyFile}
|
|
||||||
if [ -r "$API_KEY_FILE" ]; then
|
|
||||||
SWIFTSHARE_API_KEY="$(tr -d '\n' < "$API_KEY_FILE")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "''${SWIFTSHARE_API_KEY:-}" ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare upload" "SwiftShare API key missing (expected readable: $API_KEY_FILE)"
|
|
||||||
echo "Error: SwiftShare API key missing (expected readable: $API_KEY_FILE)" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
IMAGE_FILE=""
|
|
||||||
RESPONSE_FILE=""
|
|
||||||
cleanup() {
|
|
||||||
if [ -n "$RESPONSE_FILE" ] && [ -f "$RESPONSE_FILE" ]; then
|
|
||||||
rm -f "$RESPONSE_FILE"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
if [ "$#" -ge 1 ] && [ "$1" != "-" ]; then
|
|
||||||
IMAGE_FILE="$1"
|
|
||||||
if [ "''${IMAGE_FILE#'/'}" = "''${IMAGE_FILE}" ]; then
|
|
||||||
IMAGE_FILE="$(${pkgs.coreutils}/bin/readlink -f "''${IMAGE_FILE}")"
|
|
||||||
fi
|
|
||||||
if [ ! -f "$IMAGE_FILE" ]; then
|
|
||||||
echo "Error: file not found: $IMAGE_FILE" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
APP_NAME="''${APP_NAME:-screenshot}"
|
|
||||||
APP_NAME="''${APP_NAME%% *}"
|
|
||||||
APP_NAME="''${APP_NAME//[^A-Za-z0-9]/}"
|
|
||||||
APP_NAME="''${APP_NAME,,}"
|
|
||||||
if [ -z "$APP_NAME" ]; then
|
|
||||||
APP_NAME="screenshot"
|
|
||||||
fi
|
|
||||||
|
|
||||||
IMAGE_FILE="$(${pkgs.coreutils}/bin/mktemp --suffix=.png "''${TMPDIR:-/tmp}/''${APP_NAME}_XXXXXX")"
|
|
||||||
cat > "$IMAGE_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -s "$IMAGE_FILE" ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare" "Empty capture (maybe canceled) – not uploading"
|
|
||||||
echo "Empty image file, not uploading." >&2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
RESPONSE_FILE="$(mktemp)"
|
|
||||||
set +e
|
|
||||||
HTTP_STATUS="$(${pkgs.curl}/bin/curl -sS -o "''${RESPONSE_FILE}" -w '%{http_code}' \
|
|
||||||
-X POST "https://swiftshare.cloud/api/upload/sharex" \
|
|
||||||
-F "upload=@''${IMAGE_FILE}" \
|
|
||||||
-F "apiKey=''${SWIFTSHARE_API_KEY}")"
|
|
||||||
CURL_EXIT=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
RESPONSE="$(cat "''${RESPONSE_FILE}")"
|
|
||||||
|
|
||||||
if [ "''${CURL_EXIT}" -ne 0 ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare upload failed" "Network or HTTP error (curl exit ''${CURL_EXIT})"
|
|
||||||
echo "SwiftShare upload failed (curl exit ''${CURL_EXIT})." >&2
|
|
||||||
echo "Response body:" >&2
|
|
||||||
echo "''${RESPONSE}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! echo "''${HTTP_STATUS}" | grep -qE '^2[0-9][0-9]$'; then
|
|
||||||
ERROR_MSG="$(${pkgs.jq}/bin/jq -r '.error // empty' <<< "''${RESPONSE}")"
|
|
||||||
if [ -z "''${ERROR_MSG}" ] || [ "''${ERROR_MSG}" = "null" ]; then
|
|
||||||
ERROR_MSG="Failed to upload file"
|
|
||||||
fi
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare upload failed (''${HTTP_STATUS})" "''${ERROR_MSG}"
|
|
||||||
echo "SwiftShare upload failed (HTTP ''${HTTP_STATUS}): ''${ERROR_MSG}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="$(${pkgs.jq}/bin/jq -r '.url // empty' <<< "''${RESPONSE}")"
|
|
||||||
THUMBNAIL="$(${pkgs.jq}/bin/jq -r '.thumbnail // empty' <<< "''${RESPONSE}")"
|
|
||||||
|
|
||||||
if [ -z "$URL" ] || [ "$URL" = "null" ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare upload failed" "Could not parse URL from response"
|
|
||||||
echo "Upload failed. Raw response:" >&2
|
|
||||||
echo "''${RESPONSE}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$URL"
|
|
||||||
if [ -n "$THUMBNAIL" ] && [ "$THUMBNAIL" != "null" ]; then
|
|
||||||
echo "$THUMBNAIL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$COPY_URL" = "1" ]; then
|
|
||||||
${pkgs.wl-clipboard}/bin/wl-copy <<< "$URL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$IMAGE_FILE" ] && [ -f "$IMAGE_FILE" ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send \
|
|
||||||
-a "SwiftShare" \
|
|
||||||
-i "$IMAGE_FILE" \
|
|
||||||
-h string:image-path:"$IMAGE_FILE" \
|
|
||||||
"SwiftShare upload" "Uploaded image: $URL"
|
|
||||||
else
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare upload" "Uploaded image: $URL"
|
|
||||||
fi
|
|
||||||
'')
|
|
||||||
|
|
||||||
(writeShellScriptBin "swiftshare-screenshot" ''
|
|
||||||
#!${pkgs.bash}/bin/bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
LOG_DIR="$HOME/.local/state/swiftshare"
|
|
||||||
mkdir -p "$LOG_DIR"
|
|
||||||
LOG_FILE="$LOG_DIR/screenshot.log"
|
|
||||||
|
|
||||||
APP_CLASS="$(${pkgs.hyprland}/bin/hyprctl activewindow -j 2>/dev/null | ${pkgs.jq}/bin/jq -r '.class // .initialClass // empty' 2>/dev/null || true)"
|
|
||||||
APP_CLASS="''${APP_CLASS%% *}"
|
|
||||||
APP_CLASS="''${APP_CLASS//[^A-Za-z0-9]/}"
|
|
||||||
APP_CLASS="''${APP_CLASS,,}"
|
|
||||||
if [ -z "$APP_CLASS" ]; then
|
|
||||||
APP_CLASS="screenshot"
|
|
||||||
fi
|
|
||||||
|
|
||||||
GEOM="$(${pkgs.slurp}/bin/slurp)"
|
|
||||||
SLURP_EXIT=$?
|
|
||||||
|
|
||||||
if [ "$SLURP_EXIT" -ne 0 ] || [ -z "$GEOM" ]; then
|
|
||||||
${pkgs.libnotify}/bin/notify-send "SwiftShare" "Capture canceled"
|
|
||||||
{
|
|
||||||
echo "==== $(date) ==== capture canceled (slurp exit $SLURP_EXIT, geom='$GEOM')"
|
|
||||||
} >>"$LOG_FILE" 2>&1
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "==== $(date) ===="
|
|
||||||
echo "Geometry: $GEOM"
|
|
||||||
${pkgs.grim}/bin/grim -g "$GEOM" - | ${pkgs.swappy}/bin/swappy -f - -o - | swiftshare-upload --copy-url --app-name "$APP_CLASS"
|
|
||||||
} >>"$LOG_FILE" 2>&1
|
|
||||||
'')
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf hyprlandHmEnabled {
|
(lib.mkIf hyprlandHmEnabled {
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
LOG_DIR="$HOME/.local/state/swiftshare"
|
||||||
|
mkdir -p "$LOG_DIR"
|
||||||
|
LOG_FILE="$LOG_DIR/screenshot.log"
|
||||||
|
|
||||||
|
APP_CLASS="$(hyprctl activewindow -j 2>/dev/null | jq -r '.class // .initialClass // empty' 2>/dev/null || true)"
|
||||||
|
APP_CLASS="${APP_CLASS%% *}"
|
||||||
|
APP_CLASS="${APP_CLASS//[^A-Za-z0-9]/}"
|
||||||
|
APP_CLASS="${APP_CLASS,,}"
|
||||||
|
if [ -z "$APP_CLASS" ]; then
|
||||||
|
APP_CLASS="screenshot"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GEOM="$(slurp)"
|
||||||
|
SLURP_EXIT=$?
|
||||||
|
|
||||||
|
if [ "$SLURP_EXIT" -ne 0 ] || [ -z "$GEOM" ]; then
|
||||||
|
notify-send "SwiftShare" "Capture canceled"
|
||||||
|
{
|
||||||
|
echo "==== $(date) ==== capture canceled (slurp exit $SLURP_EXIT, geom='$GEOM')"
|
||||||
|
} >>"$LOG_FILE" 2>&1
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "==== $(date) ===="
|
||||||
|
echo "Geometry: $GEOM"
|
||||||
|
grim -g "$GEOM" - | swappy -f - -o - | swiftshare-upload --copy-url --app-name "$APP_CLASS"
|
||||||
|
} >>"$LOG_FILE" 2>&1
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# API key path substituted at build time (@API_KEY_FILE@).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
COPY_URL=0
|
||||||
|
if [ "$#" -ge 1 ] && [ "$1" = "--copy-url" ]; then
|
||||||
|
COPY_URL=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
APP_NAME=""
|
||||||
|
if [ "$#" -ge 2 ] && [ "$1" = "--app-name" ]; then
|
||||||
|
APP_NAME="$2"
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
API_KEY_FILE=@API_KEY_FILE@
|
||||||
|
if [ -r "$API_KEY_FILE" ]; then
|
||||||
|
SWIFTSHARE_API_KEY="$(tr -d '\n' < "$API_KEY_FILE")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${SWIFTSHARE_API_KEY:-}" ]; then
|
||||||
|
notify-send "SwiftShare upload" "SwiftShare API key missing (expected readable: $API_KEY_FILE)"
|
||||||
|
echo "Error: SwiftShare API key missing (expected readable: $API_KEY_FILE)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
IMAGE_FILE=""
|
||||||
|
RESPONSE_FILE=""
|
||||||
|
cleanup() {
|
||||||
|
if [ -n "$RESPONSE_FILE" ] && [ -f "$RESPONSE_FILE" ]; then
|
||||||
|
rm -f "$RESPONSE_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
if [ "$#" -ge 1 ] && [ "$1" != "-" ]; then
|
||||||
|
IMAGE_FILE="$1"
|
||||||
|
if [ "${IMAGE_FILE#/}" = "${IMAGE_FILE}" ]; then
|
||||||
|
IMAGE_FILE="$(readlink -f "${IMAGE_FILE}")"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$IMAGE_FILE" ]; then
|
||||||
|
echo "Error: file not found: $IMAGE_FILE" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
APP_NAME="${APP_NAME:-screenshot}"
|
||||||
|
APP_NAME="${APP_NAME%% *}"
|
||||||
|
APP_NAME="${APP_NAME//[^A-Za-z0-9]/}"
|
||||||
|
APP_NAME="${APP_NAME,,}"
|
||||||
|
if [ -z "$APP_NAME" ]; then
|
||||||
|
APP_NAME="screenshot"
|
||||||
|
fi
|
||||||
|
|
||||||
|
IMAGE_FILE="$(mktemp --suffix=.png "${TMPDIR:-/tmp}/${APP_NAME}_XXXXXX")"
|
||||||
|
cat > "$IMAGE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -s "$IMAGE_FILE" ]; then
|
||||||
|
notify-send "SwiftShare" "Empty capture (maybe canceled) – not uploading"
|
||||||
|
echo "Empty image file, not uploading." >&2
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
RESPONSE_FILE="$(mktemp)"
|
||||||
|
set +e
|
||||||
|
HTTP_STATUS="$(curl -sS -o "${RESPONSE_FILE}" -w '%{http_code}' \
|
||||||
|
-X POST "https://swiftshare.cloud/api/upload/sharex" \
|
||||||
|
-F "upload=${IMAGE_FILE}" \
|
||||||
|
-F "apiKey=${SWIFTSHARE_API_KEY}")"
|
||||||
|
CURL_EXIT=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
RESPONSE="$(cat "${RESPONSE_FILE}")"
|
||||||
|
|
||||||
|
if [ "${CURL_EXIT}" -ne 0 ]; then
|
||||||
|
notify-send "SwiftShare upload failed" "Network or HTTP error (curl exit ${CURL_EXIT})"
|
||||||
|
echo "SwiftShare upload failed (curl exit ${CURL_EXIT})." >&2
|
||||||
|
echo "Response body:" >&2
|
||||||
|
echo "${RESPONSE}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! echo "${HTTP_STATUS}" | grep -qE '^2[0-9][0-9]$'; then
|
||||||
|
ERROR_MSG="$(jq -r '.error // empty' <<< "${RESPONSE}")"
|
||||||
|
if [ -z "${ERROR_MSG}" ] || [ "${ERROR_MSG}" = "null" ]; then
|
||||||
|
ERROR_MSG="Failed to upload file"
|
||||||
|
fi
|
||||||
|
notify-send "SwiftShare upload failed (${HTTP_STATUS})" "${ERROR_MSG}"
|
||||||
|
echo "SwiftShare upload failed (HTTP ${HTTP_STATUS}): ${ERROR_MSG}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
URL="$(jq -r '.url // empty' <<< "${RESPONSE}")"
|
||||||
|
THUMBNAIL="$(jq -r '.thumbnail // empty' <<< "${RESPONSE}")"
|
||||||
|
|
||||||
|
if [ -z "$URL" ] || [ "$URL" = "null" ]; then
|
||||||
|
notify-send "SwiftShare upload failed" "Could not parse URL from response"
|
||||||
|
echo "Upload failed. Raw response:" >&2
|
||||||
|
echo "${RESPONSE}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$URL"
|
||||||
|
if [ -n "$THUMBNAIL" ] && [ "$THUMBNAIL" != "null" ]; then
|
||||||
|
echo "$THUMBNAIL"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$COPY_URL" = "1" ]; then
|
||||||
|
wl-copy <<< "$URL"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$IMAGE_FILE" ] && [ -f "$IMAGE_FILE" ]; then
|
||||||
|
notify-send \
|
||||||
|
-a "SwiftShare" \
|
||||||
|
-i "$IMAGE_FILE" \
|
||||||
|
-h string:image-path:"$IMAGE_FILE" \
|
||||||
|
"SwiftShare upload" "Uploaded image: $URL"
|
||||||
|
else
|
||||||
|
notify-send "SwiftShare upload" "Uploaded image: $URL"
|
||||||
|
fi
|
||||||
@@ -33,7 +33,9 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.home.editors.cursor = {
|
options.chiasson.home.editors.cursor = {
|
||||||
enable = lib.mkEnableOption "Cursor editor from the `cursor` flake input.";
|
enable = lib.mkEnableOption "Cursor editor from the `cursor` flake input." // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
setAsDefaultEditor = lib.mkOption {
|
setAsDefaultEditor = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
|||||||
@@ -1,17 +1,8 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomEditorsKate =
|
flake.homeManagerModules.wisdomEditorsKate = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "editors.kate";
|
||||||
let
|
default = false;
|
||||||
root = config.chiasson.home;
|
description = "Kate.";
|
||||||
cfg = config.chiasson.home.editors.kate;
|
packages = pkgs: [ pkgs.kdePackages.kate ];
|
||||||
in
|
};
|
||||||
{
|
|
||||||
options.chiasson.home.editors.kate.enable = lib.mkEnableOption "Kate.";
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = lib.optional (
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kdePackages.kate
|
|
||||||
) pkgs.kdePackages.kate;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomEditorsObsidian =
|
flake.homeManagerModules.wisdomEditorsObsidian = self.lib.wisdomSlice {
|
||||||
{ config, lib, pkgs, ... }:
|
path = "editors.obsidian";
|
||||||
let
|
default = true;
|
||||||
root = config.chiasson.home;
|
description = "Obsidian (unfree); skipped if unavailable here.";
|
||||||
cfg = config.chiasson.home.editors.obsidian;
|
packages = pkgs: [ pkgs.obsidian ];
|
||||||
in
|
};
|
||||||
{
|
|
||||||
options.chiasson.home.editors.obsidian.enable = lib.mkEnableOption ''
|
|
||||||
Obsidian (unfree); skipped if unavailable here.
|
|
||||||
'';
|
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
|
||||||
home.packages = lib.optional (
|
|
||||||
lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.obsidian
|
|
||||||
) pkgs.obsidian;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
# Visual Studio Code (Microsoft build, unfree). Default extensions + settings shared by all
|
||||||
|
# hosts; per-host extras (peacock, comment-anchors, project-manager) go via
|
||||||
|
# `chiasson.home.editors.vscode.extensions`.
|
||||||
|
{ self, ... }: {
|
||||||
|
flake.homeManagerModules.wisdomEditorsVscode =
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
root = config.chiasson.home;
|
||||||
|
cfg = config.chiasson.home.editors.vscode;
|
||||||
|
|
||||||
|
defaultExtensions = with pkgs.vscode-extensions; [
|
||||||
|
jnoortheen.nix-ide
|
||||||
|
yzhang.markdown-all-in-one
|
||||||
|
esbenp.prettier-vscode
|
||||||
|
vscjava.vscode-java-pack
|
||||||
|
redhat.java
|
||||||
|
];
|
||||||
|
|
||||||
|
# Wrap VS Code so a JDK is on PATH — the Red Hat Java language server (and
|
||||||
|
# other extension-bundled JVMs) need `java` to run, independent of the
|
||||||
|
# per-project `java.configuration.runtimes` setting.
|
||||||
|
vscodeWithJdk = pkgs.symlinkJoin {
|
||||||
|
name = "vscode-with-jdk";
|
||||||
|
paths = [ pkgs.vscode ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram "$out/bin/code" \
|
||||||
|
--prefix PATH : "${pkgs.jdk25}/bin"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
coreSettings = {
|
||||||
|
"nix.enableLanguageServer" = true;
|
||||||
|
"nix.serverPath" = "nixd";
|
||||||
|
"nix.serverSettings" = {
|
||||||
|
nixd = {
|
||||||
|
formatting = {
|
||||||
|
command = "nixfmt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"diffEditor.ignoreTrimWhitespace" = false;
|
||||||
|
"chat.disableAIFeatures" = true;
|
||||||
|
|
||||||
|
"java.configuration.runtimes" = [
|
||||||
|
{
|
||||||
|
name = "JavaSE-21";
|
||||||
|
path = "${pkgs.jdk21}/lib/openjdk";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "JavaSE-25";
|
||||||
|
path = "${pkgs.jdk25}/lib/openjdk";
|
||||||
|
default = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Seed a *writable* settings.json (not a store symlink) so extensions like
|
||||||
|
# kilo-code can edit it at runtime. `force = false` in the config means HM
|
||||||
|
# only writes it when absent, preserving kilo's later edits across `switch`.
|
||||||
|
settingsJson = pkgs.writeText "vscode-user-settings" (
|
||||||
|
builtins.toJSON coreSettings
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.chiasson.home.editors.vscode = {
|
||||||
|
enable = lib.mkEnableOption ''
|
||||||
|
Visual Studio Code (Microsoft build; needs `nixpkgs.config.allowUnfree`). Core
|
||||||
|
extensions (nix-ide, markdown-all-in-one, prettier) + nixd/nixfmt settings are included.
|
||||||
|
'' // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
extensions = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [ ];
|
||||||
|
description = ''
|
||||||
|
Extra extensions not wanted on every host (e.g. peacock, comment-anchors,
|
||||||
|
project-manager). Per-host via `chiasson.users.extraModules`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
|
home.packages = [ ];
|
||||||
|
|
||||||
|
# Writable, seed-once user settings (kilo-code can append to it).
|
||||||
|
home.file.".config/Code/User/settings.json" = {
|
||||||
|
source = settingsJson;
|
||||||
|
force = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
package = vscodeWithJdk;
|
||||||
|
extensions = defaultExtensions ++ cfg.extensions;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -8,10 +8,12 @@
|
|||||||
{
|
{
|
||||||
options.chiasson.home.filebrowsers.nemo.enable = lib.mkEnableOption ''
|
options.chiasson.home.filebrowsers.nemo.enable = lib.mkEnableOption ''
|
||||||
Nemo file manager (GTK). Colors come from DMS matugen via GTK settings — no KDE/Qt bridge needed.
|
Nemo file manager (GTK). Colors come from DMS matugen via GTK settings — no KDE/Qt bridge needed.
|
||||||
'';
|
'' // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
home.packages = [pkgs.nemo];
|
home.packages = [ pkgs.nemo ];
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
{
|
{
|
||||||
options.chiasson.home.hardware.uconsoleGamepad.enable = lib.mkEnableOption ''
|
options.chiasson.home.hardware.uconsoleGamepad.enable = lib.mkEnableOption ''
|
||||||
uConsole gamepad antimicrox profile + Hyprland exec-once when HM Hyprland is on.
|
uConsole gamepad antimicrox profile + Hyprland exec-once when HM Hyprland is on.
|
||||||
'';
|
'' // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [
|
config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomShellBash =
|
flake.homeManagerModules.wisdomShellBash =
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
root = config.chiasson.home;
|
root = config.chiasson.home;
|
||||||
cfg = config.chiasson.home.shell.bash;
|
cfg = config.chiasson.home.shell.bash;
|
||||||
|
rbw = self.lib.rbwSshSocket;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.home.shell.bash.enable = lib.mkEnableOption "Bash + rbw SSH socket env in profile/init." // {
|
options.chiasson.home.shell.bash.enable = lib.mkEnableOption "Bash + rbw SSH socket env in profile/init." // {
|
||||||
@@ -13,24 +14,8 @@
|
|||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profileExtra = ''
|
profileExtra = rbw.bashSnippet;
|
||||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
initExtra = rbw.bashSnippet;
|
||||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
|
||||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
|
||||||
else
|
|
||||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
initExtra = ''
|
|
||||||
if [ -z "''${SSH_AUTH_SOCK:-}" ]; then
|
|
||||||
if [ -n "''${XDG_RUNTIME_DIR:-}" ]; then
|
|
||||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
|
||||||
else
|
|
||||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
{ ... }: {
|
{ self, ... }: {
|
||||||
flake.homeManagerModules.wisdomShellFish =
|
flake.homeManagerModules.wisdomShellFish =
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
root = config.chiasson.home;
|
root = config.chiasson.home;
|
||||||
cfg = config.chiasson.home.shell.fish;
|
cfg = config.chiasson.home.shell.fish;
|
||||||
|
rbw = self.lib.rbwSshSocket;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.chiasson.home.shell.fish = {
|
options.chiasson.home.shell.fish = {
|
||||||
enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults.";
|
enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults." // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
nixYourShell = {
|
nixYourShell = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption ''
|
||||||
@@ -19,21 +22,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (root.enable && cfg.enable) {
|
config = lib.mkIf (root.enable && cfg.enable) {
|
||||||
# `fishPlugins.grc` only installs the plugin; the wrapper invokes the `grc` binary.
|
|
||||||
home.packages = [ pkgs.grc ];
|
home.packages = [ pkgs.grc ];
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set fish_greeting ""
|
set fish_greeting ""
|
||||||
if test -z "$SSH_AUTH_SOCK"
|
${rbw.fishSnippet pkgs}
|
||||||
if test -n "$XDG_RUNTIME_DIR"
|
|
||||||
set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"
|
|
||||||
else
|
|
||||||
set -l _hm_uid (${pkgs.coreutils}/bin/id -u)
|
|
||||||
set -gx SSH_AUTH_SOCK "/run/user/$_hm_uid/rbw/ssh-agent-socket"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
'';
|
'';
|
||||||
plugins = [
|
plugins = [
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user