diff --git a/flake.lock b/flake.lock index 5194408..76bc1ed 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,31 @@ { "nodes": { + "colmena": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "stable": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739900653, + "narHash": "sha256-hPSLvw6AZQYrZyGI6Uq4XgST7benF/0zcCpugn/P0yM=", + "owner": "zhaofengli", + "repo": "colmena", + "rev": "2370d4336eda2a9ef29fce10fa7076ae011983ab", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "colmena", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1737563566, @@ -39,11 +65,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -55,11 +81,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -84,7 +110,38 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems" }, @@ -102,7 +159,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { "systems": "systems_2" }, @@ -122,8 +179,8 @@ }, "ghostty": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", "nixpkgs-stable": [ "nixpkgs" ], @@ -149,7 +206,7 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs-unstable" @@ -171,7 +228,7 @@ }, "git-hooks_2": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "gitignore": "gitignore_2", "nixpkgs": [ "slippi", @@ -254,7 +311,7 @@ "helix": { "inputs": { "crane": "crane", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs-unstable" ], @@ -332,6 +389,27 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "colmena", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1739357830, @@ -382,6 +460,7 @@ }, "root": { "inputs": { + "colmena": "colmena", "disko": "disko", "ghostty": "ghostty", "git-hooks": "git-hooks", diff --git a/flake.nix b/flake.nix index d2fb116..1d571e6 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,9 @@ formatter = uGenPkgs (p: p.nixfmt-rfc-style); + colmena = import ./lib/colmena inputs; + colmenaHive = inputs.colmena.lib.makeHive inputs.self.outputs.colmena; + /* TODO: nix-on-droid for phone terminal usage? mobile-nixos? TODO: nix-darwin for work? @@ -72,6 +75,10 @@ ghostty.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable"; ghostty.inputs.nixpkgs-stable.follows = "nixpkgs"; + colmena.url = "github:zhaofengli/colmena"; + colmena.inputs.nixpkgs.follows = "nixpkgs-unstable"; + colmena.inputs.stable.follows = "nixpkgs"; + # nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b"; mobile-nixos = { diff --git a/lib/colmena/default.nix b/lib/colmena/default.nix new file mode 100644 index 0000000..f80ca61 --- /dev/null +++ b/lib/colmena/default.nix @@ -0,0 +1,70 @@ +{ + home-manager, + nixpkgs-unstable, + self, + ... +}@inputs: +{ + meta = + let + nixpkgsSet = + nixpkgs: + (import nixpkgs { + system = "x86_64-linux"; + overlays = [ self.outputs.flakeLib.forSelfOverlay ]; + }); + nixpkgs = nixpkgsSet nixpkgs-unstable; + stable = nixpkgsSet nixpkgs; + in + { + inherit nixpkgs; + nodeNixpkgs = { + # router = stable; + beefcake = stable; + }; + specialArgs = { + inherit home-manager; + hardware = inputs.hardware.outputs.nixosModules; + diskoConfigurations = inputs.self.outputs.diskoConfigurations; + }; + }; + + # TODO: setup builders? + foxtrot = + { + # name, + # nodes, + # pkgs, + ... + }: + { + deployment = { + # Allow local deployment with `colmena apply-local` + allowLocalDeployment = true; + + # Disable SSH deployment. This node will be skipped in a + # normal`colmena apply`. + targetHost = null; + }; + + imports = [ + inputs.self.outputs.nixosModules.default + (import ./../../packages/hosts/foxtrot.nix) + ]; + + # boot.isContainer = true; + # time.timeZone = nodes.host-b.config.time.timeZone; + }; + beefcake = + { ... }: + { + deployment = { + buildOnTarget = true; + }; + + imports = [ + inputs.self.outputs.nixosModules.default + (import ./../../packages/hosts/beefcake.nix) + ]; + }; +} diff --git a/lib/modules/home/ghostty/config b/lib/modules/home/ghostty/config index 2adc6bf..a43c13c 100644 --- a/lib/modules/home/ghostty/config +++ b/lib/modules/home/ghostty/config @@ -996,6 +996,8 @@ keybind = ctrl+shift+plus=increase_font_size:0.5 keybind = ctrl+shift+zero=reset_font_size keybind = alt+enter=toggle_fullscreen keybind = ctrl+shift+z=toggle_split_zoom +keybind = performable:ctrl+shift+o=write_screen_file:paste +keybind = performable:ctrl+alt+shift+o=write_screen_file:open keybind = performable:ctrl+shift+h=new_split:left keybind = performable:ctrl+shift+l=new_split:right keybind = performable:ctrl+shift+j=new_split:down diff --git a/lib/overlays/default.nix b/lib/overlays/default.nix index 15cf358..e1736cc 100644 --- a/lib/overlays/default.nix +++ b/lib/overlays/default.nix @@ -1,5 +1,4 @@ { - self, nixpkgs, nixpkgs-unstable, ... @@ -21,11 +20,12 @@ rec { modifications = final: prev: let - inherit (inputs) helix ghostty; + inherit (inputs) helix ghostty colmena; in { ghostty = ghostty.outputs.packages.${prev.system}.default; helix = helix.outputs.packages.${prev.system}.default; + colmena = colmena.outputs.packages.${prev.system}.colmena; bitwarden = prev.bitwarden.overrideAttrs (old: { preBuild = '' diff --git a/packages/hosts/dragon.nix b/packages/hosts/dragon.nix index 8968d7f..3804ab4 100644 --- a/packages/hosts/dragon.nix +++ b/packages/hosts/dragon.nix @@ -46,6 +46,7 @@ username = "dragon.h"; }; + services.postgresql.enable = true; programs.steam.enable = true; lyte.desktop.enable = true; diff --git a/packages/shells/default.nix b/packages/shells/default.nix index 0b19bc8..b029884 100644 --- a/packages/shells/default.nix +++ b/packages/shells/default.nix @@ -4,6 +4,7 @@ default = pkgs.mkShell { inherit (self.outputs.checks.${pkgs.system}.git-hooks) shellHook; packages = with pkgs; [ + colmena nil nixd nixfmt-rfc-style