feat(colmena): set up Colmena as deploy tool for all NixOS hosts

- Add colmena flake input (nix-community >= 0.5.0) and CLI to devShell
- Extract shared nixosHosts module map consumed by BOTH
  nixosConfigurations (nixos-rebuild/nh) and the Colmena hive,
  so local rebuilds and remote deploys cannot drift apart
- Add colmenaHive output via colmena.lib.makeHive (direct flake
  evaluation, required on Nix >= 2.21) plus legacy colmena output
- Tags: m3-atlas/m3-helios/m3-hermes = server, m3-ares/m3-kratos =
  desktop with allowLocalDeployment; targetUser m3tam3re
- meta.allowApplyAll = false guards bare 'colmena apply'; use
  'colmena apply --on @server' or 'apply-local' instead
- Document deploy commands in AGENTS.md

Note: colmena builds render system.nixos.version as 26.11pre-git
(colmena's evaluator has no flake sourceInfo) - cosmetic only,
package closures are identical to nixos-rebuild.

Includes pending working-tree changes: hermes-agent bump v2026.9.24,
agent-lib input removal, m3ta-home switched to local path checkout,
m3-kratos monitor setup update, alejandra reformat of rofi-pass.nix.
This commit is contained in:
m3ta-chiron committed 2026-10-04 13:07:14 +02:00
1 parent 8a083656eb
commit db0bfbc707
5 files changed
+310 -182

No files matched your search

+4
View File
@@ -304,6 +304,10 @@ This provides the familiar shell/editor/CLI setup but with work git credentials
| **Enter dev shell** | `nix develop` | Includes alejandra, nixd, agenix, statix, deadnix | | **Enter dev shell** | `nix develop` | Includes alejandra, nixd, agenix, statix, deadnix |
| **Build host** | `sudo nixos-rebuild switch --flake .#m3-ares` | Replace hostname as needed | | **Build host** | `sudo nixos-rebuild switch --flake .#m3-ares` | Replace hostname as needed |
| **Dry run build** | `sudo nixos-rebuild dry-run --flake .#m3-ares` | Validate without applying | | **Dry run build** | `sudo nixos-rebuild dry-run --flake .#m3-ares` | Validate without applying |
| **Deploy servers** | `nix develop -c colmena apply --on @server` | Colmena: all hosts tagged `server` via SSH |
| **Deploy one host** | `nix develop -c colmena apply --on m3-atlas` | Colmena: single remote host |
| **Deploy this host** | `nix develop -c colmena apply-local` | Colmena: local desktop (uses sudo to activate) |
| **Preview deploy** | `nix develop -c colmena build --on m3-atlas` | Colmena: build closure without switching |
| **List hosts** | `nix flake show` | Shows all NixOS configurations | | **List hosts** | `nix flake show` | Shows all NixOS configurations |
| **Update flake** | `sudo nixos-rebuild switch --flake .#m3-ares --update-input nixpkgs` | Update specific input | | **Update flake** | `sudo nixos-rebuild switch --flake .#m3-ares --update-input nixpkgs` | Update specific input |
| **Format code** | `alejandra .` | Run before committing | | **Format code** | `alejandra .` | Run before committing |
Generated
+109 -57
View File
@@ -26,7 +26,7 @@
"darwin": "darwin_2", "darwin": "darwin_2",
"home-manager": "home-manager_4", "home-manager": "home-manager_4",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"systems": "systems_3" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1770165109, "lastModified": 1770165109,
@@ -42,26 +42,6 @@
"type": "github" "type": "github"
} }
}, },
"agent-lib": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1781348569,
"narHash": "sha256-1BJtmKSqtD0CD753ZE37RgxvCJK6Iw3iKLDDaS8trY4=",
"ref": "refs/heads/master",
"rev": "75a2ed2533b4d6d8e4a34acd37e83d98d81a5fb0",
"revCount": 30,
"type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/agent-lib-legacy"
},
"original": {
"type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/agent-lib-legacy"
}
},
"agents": { "agents": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
@@ -270,6 +250,29 @@
"type": "github" "type": "github"
} }
}, },
"colmena": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
],
"stable": "stable",
"systems": "systems_2"
},
"locked": {
"lastModified": 1790716853,
"narHash": "sha256-IT0OZW81jngocoxi9Gg2CTSGOC1O6qLioW17nevqIUk=",
"owner": "nix-community",
"repo": "colmena",
"rev": "524ddd89f62721a92e8629063d347e7a1ed390de",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "colmena",
"type": "github"
}
},
"dank-qml-common": { "dank-qml-common": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -441,11 +444,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1788450739, "lastModified": 1790898470,
"narHash": "sha256-glZLQlzIn1fXH6PazR2iUmTo7kzzyYSshrWhLS9TqCU=", "narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "31729ca8cbdb4fa927b34e5f4353e6a83f39e993", "rev": "024633cd702b10285db5cb19b40ad48d2399ba60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -530,16 +533,16 @@
"uv2nix": "uv2nix" "uv2nix": "uv2nix"
}, },
"locked": { "locked": {
"lastModified": 1788204567, "lastModified": 1790244527,
"narHash": "sha256-Ii9xP2fKUpvCcwWZuxJ0g3CZ+IL2UZH14pUNvBfdclc=", "narHash": "sha256-y6NaoG+HCeMPhxRsBXrRFef4hp3FF1svSPNKpI6Xz/E=",
"owner": "NousResearch", "owner": "NousResearch",
"repo": "hermes-agent", "repo": "hermes-agent",
"rev": "29112bef099274229cadff79cdff7bf7b99c4b77", "rev": "f97608f178d1ffeca59860195ab7da295f7c8e5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NousResearch", "owner": "NousResearch",
"ref": "v2026.8.31", "ref": "v2026.9.24",
"repo": "hermes-agent", "repo": "hermes-agent",
"type": "github" "type": "github"
} }
@@ -705,7 +708,7 @@
"rose-pine-hyprcursor", "rose-pine-hyprcursor",
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_4" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1709914708, "lastModified": 1709914708,
@@ -726,15 +729,15 @@
"bun2nix": "bun2nix", "bun2nix": "bun2nix",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"systems": "systems_2", "systems": "systems_3",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1790311386, "lastModified": 1791089625,
"narHash": "sha256-bOexMr1RcAS6PFcMnEfwe5apsEoaLmSUUxlqUftd2uU=", "narHash": "sha256-0MHqf09PIjbpfg7KhUN/r1vGJ9OS5A2TSMq99n+Y7XU=",
"owner": "numtide", "owner": "numtide",
"repo": "llm-agents.nix", "repo": "llm-agents.nix",
"rev": "1446b3cb242c8cd24619b58054112cc2d870e591", "rev": "372f0337e8170e55ff0c017cd43ab73b02a062ad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -759,17 +762,14 @@
"nur": "nur" "nur": "nur"
}, },
"locked": { "locked": {
"lastModified": 1790922417, "lastModified": 1790925342,
"narHash": "sha256-3scqz97Dg5eWH0ca7y2GHueROTuV2XGsPTSZSzKpOvE=", "narHash": "sha256-kqpTlAfyAaeSbEHpM9ASBVXBWzf2BQDAODu1WXw/LTc=",
"ref": "refs/heads/master", "path": "/home/m3tam3re/p/NIX/m3ta-home",
"rev": "dfe148dc6847b5feb638d8c0e11db8b226f29a41", "type": "path"
"revCount": 146,
"type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home"
}, },
"original": { "original": {
"type": "git", "path": "/home/m3tam3re/p/NIX/m3ta-home",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home" "type": "path"
} }
}, },
"m3ta-nixpkgs": { "m3ta-nixpkgs": {
@@ -810,11 +810,11 @@
"opencode": "opencode_2" "opencode": "opencode_2"
}, },
"locked": { "locked": {
"lastModified": 1789748631, "lastModified": 1791024865,
"narHash": "sha256-XKtTXBsCcou75U5TnqfxL63ujBAGWbettPdW0XaGB80=", "narHash": "sha256-Jq3dpGYIg31LJK/6xfXe87RpwiKp/ldEzR7oD9YAXLM=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "da3c58993388ad853a2276e72a13f6c38cdf8077", "rev": "dd9d43bffee197301f542ddc405e6db996dbd7b3",
"revCount": 392, "revCount": 395,
"type": "git", "type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs" "url": "ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs"
}, },
@@ -861,6 +861,27 @@
"type": "github" "type": "github"
} }
}, },
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"colmena",
"nixpkgs"
]
},
"locked": {
"lastModified": 1737420293,
"narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1736643958, "lastModified": 1736643958,
@@ -1055,11 +1076,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1790238896, "lastModified": 1790600678,
"narHash": "sha256-ym4BG18Pu2awiJIehla1Lo9xiB2QYRcCzW3SB74gEBY=", "narHash": "sha256-6k3n7X2UsZ6tAlWTz99RimiZab+17tMUrw9sRUcELiA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "34ca302a9572963c02e385c056be37c85ff51b77", "rev": "f45c6f04c2f013f004bf94e284e95d72898d9393",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1393,7 +1414,7 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"agent-lib": "agent-lib", "colmena": "colmena",
"disko": "disko", "disko": "disko",
"hermes-agent": "hermes-agent", "hermes-agent": "hermes-agent",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
@@ -1474,6 +1495,22 @@
"type": "github" "type": "github"
} }
}, },
"stable": {
"locked": {
"lastModified": 1790608446,
"narHash": "sha256-CYsYyk0zInkpQ6ojuCpvb9MahlhFXkeZpzjOU9Lxkpk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c619be20e3508300c88af8aeafeaa7017559313f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@@ -1491,16 +1528,16 @@
}, },
"systems_2": { "systems_2": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1776166891,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-bI8yrEGjrohR5hkQox7UrxDH7XqrYMwI8SL/LrJ1+S8=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "triplet",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "6de7bc09397911ce03636afbcf6118745ab2cda0",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "triplet",
"type": "github" "type": "github"
} }
}, },
@@ -1520,6 +1557,21 @@
} }
}, },
"systems_4": { "systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_5": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -1534,7 +1586,7 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": { "systems_6": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@@ -1617,7 +1669,7 @@
}, },
"utils": { "utils": {
"inputs": { "inputs": {
"systems": "systems_5" "systems": "systems_6"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
+130 -48
View File
@@ -30,10 +30,10 @@
# Nix library for rendering agent skill source selections into store # Nix library for rendering agent skill source selections into store
# dirs (mkHermesSkillsDir). Consumed directly by hosts/m3-hermes. # dirs (mkHermesSkillsDir). Consumed directly by hosts/m3-hermes.
agent-lib = { # agent-lib = {
url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/agent-lib-legacy"; # url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/agent-lib-legacy";
inputs.nixpkgs.follows = "nixpkgs"; # inputs.nixpkgs.follows = "nixpkgs";
}; # };
llm-agents.url = "github:numtide/llm-agents.nix"; llm-agents.url = "github:numtide/llm-agents.nix";
@@ -43,6 +43,13 @@
}; };
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
# Deployment tool (colmena >= 0.5.0 reads the colmenaHive output).
# Also provides colmena.lib.makeHive used by our flake outputs.
colmena = {
url = "github:nix-community/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -54,17 +61,18 @@
nix-colors.url = "github:misterio77/nix-colors"; nix-colors.url = "github:misterio77/nix-colors";
m3ta-home = { m3ta-home = {
url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home"; # url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home";
# url = "path:/home/m3tam3re/p/NIX/m3ta-home"; url = "path:/home/m3tam3re/p/NIX/m3ta-home";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hermes-agent.url = "github:NousResearch/hermes-agent/v2026.8.31"; hermes-agent.url = "github:NousResearch/hermes-agent/v2026.9.24";
}; };
outputs = { outputs = {
self, self,
agenix, agenix,
colmena,
home-manager, home-manager,
nixpkgs, nixpkgs,
m3ta-nixpkgs, m3ta-nixpkgs,
@@ -81,19 +89,13 @@
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
allOverlays = import ./overlays {inherit inputs outputs;}; allOverlays = import ./overlays {inherit inputs outputs;};
in {
packages =
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = allOverlays;
homeManagerModules = import ./modules/home-manager;
nixosConfigurations = { # Single source of truth for all NixOS hosts. Consumed by both
m3-ares = nixpkgs.lib.nixosSystem { # nixosConfigurations (nixos-rebuild/nh) and the Colmena hive below,
specialArgs = { # so local rebuilds and remote deploys can never drift apart.
inherit inputs outputs; nixosHosts = {
system = "x86_64-linux"; m3-ares = {
hostname = "m3-ares"; hostname = "m3-ares";
};
modules = [ modules = [
./hosts/m3-ares ./hosts/m3-ares
agenix.nixosModules.default agenix.nixosModules.default
@@ -101,11 +103,7 @@
inputs.hermes-agent.nixosModules.default inputs.hermes-agent.nixosModules.default
]; ];
}; };
m3-atlas = nixpkgs.lib.nixosSystem { m3-atlas = {
specialArgs = {
inherit inputs outputs;
system = "x86_64-linux";
};
modules = [ modules = [
./hosts/m3-atlas ./hosts/m3-atlas
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
@@ -113,12 +111,8 @@
m3ta-nixpkgs.nixosModules.default m3ta-nixpkgs.nixosModules.default
]; ];
}; };
m3-kratos = nixpkgs.lib.nixosSystem { m3-kratos = {
specialArgs = { hostname = "m3-kratos";
inherit inputs outputs;
system = "x86_64-linux";
hostname = "m3-kratos";
};
modules = [ modules = [
./hosts/m3-kratos ./hosts/m3-kratos
agenix.nixosModules.default agenix.nixosModules.default
@@ -127,11 +121,7 @@
inputs.hermes-agent.nixosModules.default inputs.hermes-agent.nixosModules.default
]; ];
}; };
m3-helios = nixpkgs.lib.nixosSystem { m3-helios = {
specialArgs = {
inherit inputs outputs;
system = "x86_64-linux";
};
modules = [ modules = [
./hosts/m3-helios ./hosts/m3-helios
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
@@ -139,11 +129,7 @@
m3ta-nixpkgs.nixosModules.default m3ta-nixpkgs.nixosModules.default
]; ];
}; };
m3-hermes = nixpkgs.lib.nixosSystem { m3-hermes = {
specialArgs = {
inherit inputs outputs;
system = "x86_64-linux";
};
modules = [ modules = [
./hosts/m3-hermes ./hosts/m3-hermes
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
@@ -153,6 +139,100 @@
]; ];
}; };
}; };
mkSpecialArgs = hostname:
{
inherit inputs outputs;
system = "x86_64-linux";
}
// nixpkgs.lib.optionalAttrs (hostname != null) {inherit hostname;};
# Colmena deployment hive (https://colmena.cli.rs):
# nix develop -c colmena apply --on @server # all servers via SSH
# nix develop -c colmena apply --on m3-atlas # single host
# nix develop -c colmena apply-local # this machine (desktops)
# meta.nixpkgs overlays/config are merged with mkBefore, so the overlays
# set in hosts/common/default.nix keep working unchanged.
rawHive = {
meta = {
# NOTE: Colmena imports nixpkgs without flake sourceInfo, so
# system.nixos.version renders as "26.11pre-git" instead of
# "26.11.<date>.<rev>" under `colmena` builds. Purely cosmetic
# (os-release) — package closure, overlays and options are identical
# to nixosConfigurations. Documented colmena behavior.
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [];
}; specialArgs = mkSpecialArgs null;
nodeSpecialArgs =
nixpkgs.lib.mapAttrs
(_: host: mkSpecialArgs host.hostname)
(nixpkgs.lib.filterAttrs (_: host: host ? hostname) nixosHosts);
# Guard against bare `colmena apply` hitting every node (including
# desktops in active use). Use --on filters or apply-local instead.
allowApplyAll = false;
};
defaults = {
deployment.targetUser = "m3tam3re";
};
m3-ares = {
imports = nixosHosts.m3-ares.modules;
deployment = {
targetHost = "m3-ares";
tags = ["desktop"];
allowLocalDeployment = true;
};
};
m3-atlas = {
imports = nixosHosts.m3-atlas.modules;
deployment = {
targetHost = "m3-atlas";
tags = ["server"];
};
};
m3-kratos = {
imports = nixosHosts.m3-kratos.modules;
deployment = {
targetHost = "m3-kratos";
tags = ["desktop"];
allowLocalDeployment = true;
};
};
m3-helios = {
imports = nixosHosts.m3-helios.modules;
deployment = {
targetHost = "m3-helios";
tags = ["server"];
};
};
m3-hermes = {
imports = nixosHosts.m3-hermes.modules;
deployment = {
targetHost = "m3-hermes";
tags = ["server"];
};
};
};
in {
packages =
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = allOverlays;
homeManagerModules = import ./modules/home-manager;
nixosConfigurations =
nixpkgs.lib.mapAttrs
(_: host:
nixpkgs.lib.nixosSystem {
specialArgs = mkSpecialArgs (host.hostname or null);
modules = host.modules;
})
nixosHosts;
# Colmena >= 0.5.0 (direct flake evaluation) and legacy CLIs alike.
colmenaHive = colmena.lib.makeHive rawHive;
colmena = rawHive;
homeConfigurations = { homeConfigurations = {
"m3tam3re@m3-daedalus" = home-manager.lib.homeManagerConfiguration { "m3tam3re@m3-daedalus" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux"; pkgs = nixpkgs.legacyPackages."x86_64-linux";
@@ -171,14 +251,16 @@
}; };
in { in {
default = pkgs.mkShell { default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs;
alejandra [
nixd alejandra
openssh nixd
agenix.packages.${system}.default openssh
statix agenix.packages.${system}.default
deadnix statix
]; deadnix
]
++ [colmena.packages.${system}.default];
}; };
}); });
}; };
-14
View File
@@ -53,20 +53,6 @@ in {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
settings = { settings = {
monitor = [
{
output = "DP-1";
mode = "2560x1440@144";
position = "0x0";
scale = 1;
}
{
output = "DP-2";
mode = "2560x1440@144";
position = "2560x0";
scale = 1;
}
];
workspace_rule = [ workspace_rule = [
{ {
workspace = "1"; workspace = "1";
+67 -63
View File
@@ -27,83 +27,87 @@
# backend selector # backend selector
backend ? "x11", backend ? "x11",
}: }:
assert lib.assertOneOf "backend" backend [ assert lib.assertOneOf "backend" backend [
"x11" "x11"
"wayland" "wayland"
]; ];
stdenv.mkDerivation {
pname = "rofi-pass";
version = "2.0.2-unstable-2024-06-16";
stdenv.mkDerivation { src = fetchFromGitHub {
pname = "rofi-pass"; owner = "carnager";
version = "2.0.2-unstable-2024-06-16"; repo = "rofi-pass";
rev = "37c4c862deb133a85b7d72989acfdbd2ef16b8ad";
hash = "sha256-1lPNj47vTPLBK7mVm+PngV8C/ZsjJ2EN4ffXGU2TlQo=";
};
src = fetchFromGitHub { nativeBuildInputs = [makeBinaryWrapper];
owner = "carnager";
repo = "rofi-pass";
rev = "37c4c862deb133a85b7d72989acfdbd2ef16b8ad";
hash = "sha256-1lPNj47vTPLBK7mVm+PngV8C/ZsjJ2EN4ffXGU2TlQo=";
};
nativeBuildInputs = [makeBinaryWrapper]; dontBuild = true;
dontBuild = true; installPhase = ''
runHook preInstall
installPhase = '' mkdir -p $out/bin
runHook preInstall cp -a rofi-pass $out/bin/rofi-pass
mkdir -p $out/bin mkdir -p $out/share/doc/rofi-pass/
cp -a rofi-pass $out/bin/rofi-pass cp -a config.example $out/share/doc/rofi-pass/config.example
mkdir -p $out/share/doc/rofi-pass/ runHook postInstall
cp -a config.example $out/share/doc/rofi-pass/config.example '';
runHook postInstall wrapperPath = lib.makeBinPath (
''; [
coreutils
findutils
gawk
gnugrep
gnused
libnotify
pwgen
rofi
util-linuxMinimal
]
++ lib.optionals (backend == "x11") [
(pass.withExtensions (ext: [ext.pass-otp]))
xclip
xdotool
]
++ lib.optionals (backend == "wayland") [
(pass-wayland.withExtensions (ext: [ext.pass-otp]))
wl-clipboard
wtype
]
);
wrapperPath = lib.makeBinPath ( fixupPhase = ''
[ runHook preFixup
coreutils
findutils
gawk
gnugrep
gnused
libnotify
pwgen
rofi
util-linuxMinimal
]
++ lib.optionals (backend == "x11") [
(pass.withExtensions (ext: [ext.pass-otp]))
xclip
xdotool
]
++ lib.optionals (backend == "wayland") [
(pass-wayland.withExtensions (ext: [ext.pass-otp]))
wl-clipboard
wtype
]
);
fixupPhase = '' patchShebangs $out/bin
runHook preFixup
patchShebangs $out/bin wrapProgram $out/bin/rofi-pass \
--prefix PATH : "$wrapperPath" \
--set-default ROFI_PASS_BACKEND ${
if backend == "wayland"
then "wtype"
else "xdotool"
} \
--set-default ROFI_PASS_CLIPBOARD_BACKEND ${
if backend == "wayland"
then "wl-clipboard"
else "xclip"
}
wrapProgram $out/bin/rofi-pass \ runHook postFixup
--prefix PATH : "$wrapperPath" \ '';
--set-default ROFI_PASS_BACKEND ${if backend == "wayland" then "wtype" else "xdotool"} \
--set-default ROFI_PASS_CLIPBOARD_BACKEND ${
if backend == "wayland" then "wl-clipboard" else "xclip"
}
runHook postFixup meta = {
''; description = "Script to make rofi work with password-store";
mainProgram = "rofi-pass";
meta = { homepage = "https://github.com/carnager/rofi-pass";
description = "Script to make rofi work with password-store"; license = lib.licenses.gpl3;
mainProgram = "rofi-pass"; platforms = with lib.platforms; linux;
homepage = "https://github.com/carnager/rofi-pass"; };
license = lib.licenses.gpl3; }
platforms = with lib.platforms; linux;
};
}