From e9446a170c2ba249a268e0c6b76442ce8cac214b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:04:04 +0400 Subject: [PATCH] setup colmena --- flake.lock | 141 ++++++++++++++++++++++++++++++++++++++++++++++------- flake.nix | 7 ++- hive.nix | 19 ++++++++ 3 files changed, 149 insertions(+), 18 deletions(-) create mode 100644 hive.nix diff --git a/flake.lock b/flake.lock index 9176c012..c642bc8b 100644 --- a/flake.lock +++ b/flake.lock @@ -120,6 +120,28 @@ "type": "github" } }, + "colmena": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs", + "stable": "stable" + }, + "locked": { + "lastModified": 1734897875, + "narHash": "sha256-LLpiqfOGBippRax9F33kSJ/Imt8gJXb6o0JwSBiNHCk=", + "owner": "zhaofengli", + "repo": "colmena", + "rev": "a6b51f5feae9bfb145daa37fd0220595acb7871e", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "colmena", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -144,7 +166,7 @@ }, "emacs-overlay": { "inputs": { - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -178,6 +200,22 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -230,6 +268,21 @@ } }, "flake-utils_2": { + "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_3": { "inputs": { "systems": "systems_5" }, @@ -407,7 +460,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_3", "xdph": "xdph" @@ -566,7 +619,7 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "systems": "systems_4" }, "locked": { @@ -746,13 +799,34 @@ "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": 1734424634, - "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", + "lastModified": 1734119587, + "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", "type": "github" }, "original": { @@ -823,6 +897,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1734424634, + "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1734119587, "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", @@ -838,7 +928,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1733940404, "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", @@ -854,7 +944,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1734424634, "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", @@ -870,7 +960,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1733024928, "narHash": "sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw=", @@ -886,7 +976,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1656753965, "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", @@ -902,7 +992,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1710272261, "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", @@ -937,10 +1027,10 @@ "nvf": { "inputs": { "flake-parts": "flake-parts", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "mnw": "mnw", "nil": "nil", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nmd": "nmd", "plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-base16": "plugin-base16", @@ -2969,7 +3059,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "gitignore": "gitignore", "nixpkgs": [ "hyprland", @@ -2994,7 +3084,7 @@ "rnix-lsp": { "inputs": { "naersk": "naersk", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "utils": "utils" }, "locked": { @@ -3016,11 +3106,12 @@ "NixOS-WSL": "NixOS-WSL", "agenix": "agenix", "ags": "ags", + "colmena": "colmena", "emacs-overlay": "emacs-overlay", "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable_3", "nvf": "nvf", "rose-pine-hyprcursor": "rose-pine-hyprcursor", @@ -3030,7 +3121,7 @@ "rose-pine-hyprcursor": { "inputs": { "hyprlang": "hyprlang_3", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "utils": "utils_2" }, "locked": { @@ -3089,6 +3180,22 @@ "type": "github" } }, + "stable": { + "locked": { + "lastModified": 1730883749, + "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index c7f9b363..470fab56 100644 --- a/flake.nix +++ b/flake.nix @@ -35,12 +35,14 @@ hyprpaper.url = "github:hyprwm/hyprpaper"; rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor"; nvf.url = "github:notashelf/nvf"; + colmena.url = "github:zhaofengli/colmena/"; }; outputs = { self, nixpkgs, home-manager, NixOS-WSL, agenix, emacs-overlay - , hyprland, hyprpaper, ags, nvf, ... }@inputs: + , hyprland, hyprpaper, ags, nvf, colmena, ... }@inputs: let inherit (self) outputs; + inherit (colmena.lib) makeHive; forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; in rec { # custom packages @@ -58,6 +60,9 @@ # modules :D nixosModules = import ./modules; + colmenaHive = makeHive (import ./hive.nix { inherit inputs outputs; }); + colmena = import ./hive.nix { inherit inputs outputs; }; + nixosConfigurations = { sakotop = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; }; diff --git a/hive.nix b/hive.nix new file mode 100644 index 00000000..1ef5a858 --- /dev/null +++ b/hive.nix @@ -0,0 +1,19 @@ +{ inputs, outputs }: +let + inherit (inputs) nixpkgs; + inherit (inputs.nixpkgs) lib; +in { + meta = { + nixpkgs = nixpkgs.legacyPackages.x86_64-linux; + specialArgs = { inherit inputs; }; + }; + + sakotop = { names, nodes, ... }: { + deployment = { + allowLocalDeployment = true; + targetHost = null; + }; + specialArgs = { inherit inputs outputs; }; + imports = [ ./default.nix ./hosts/sakotop/configuration.nix ]; + }; +}