flake: refactor, use colmenaHive

This commit is contained in:
Guanran Wang 2024-09-01 12:19:53 +08:00
parent 602995c205
commit 19fdca07b1
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
4 changed files with 146 additions and 112 deletions

View file

@ -1,5 +1,34 @@
{ {
"nodes": { "nodes": {
"colmena": {
"inputs": {
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"stable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1711386353,
"narHash": "sha256-gWEpb8Hybnoqb4O4tmpohGZk6+aerAbJpywKcFIiMlg=",
"owner": "zhaofengli",
"repo": "colmena",
"rev": "cd65ef7a25cdc75052fbd04b120aeb066c3881db",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "colmena",
"type": "github"
}
},
"crane": { "crane": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -276,6 +305,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"colmena": "colmena",
"crane": "crane", "crane": "crane",
"disko": "disko", "disko": "disko",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",

View file

@ -10,6 +10,13 @@
nixpkgs.url = "github:NixOS/nixpkgs/c169763c3087b02a8308e2f8a9bba77c428dcca1"; # userborn nixpkgs.url = "github:NixOS/nixpkgs/c169763c3087b02a8308e2f8a9bba77c428dcca1"; # userborn
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
inputs.stable.follows = "nixpkgs";
};
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -49,7 +56,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs"; inputs.nixpkgs-stable.follows = "nixpkgs";
}; };
systems.url = "github:nix-systems/default"; systems = {
url = "github:nix-systems/default";
};
treefmt-nix = { treefmt-nix = {
url = "github:numtide/treefmt-nix"; url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -93,16 +102,16 @@
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in in
{ {
### nix fmt # nix fmt
formatter = treefmtEval.config.build.wrapper; formatter = treefmtEval.config.build.wrapper;
### nix flake check # nix flake check
checks.formatting = treefmtEval.config.build.check inputs.self; checks.formatting = treefmtEval.config.build.check inputs.self;
### nix {run,shell,build} # nix {run,shell,build}
legacyPackages = import ./pkgs pkgs; legacyPackages = import ./pkgs pkgs;
### nix develop # nix develop
devShells.default = pkgs.mkShellNoCC { devShells.default = pkgs.mkShellNoCC {
packages = with pkgs; [ packages = with pkgs; [
colmena colmena
@ -112,15 +121,11 @@
} }
) )
// { // {
### imports = [];
nixosModules.default = ./nixos/modules; nixosModules.default = ./nixos/modules;
homeManagerModules.default = ./home/modules; overlays.default = import ./overlays;
### nixpkgs.overlays = []; nixosConfigurations = {
overlays = import ./overlays; "dust" = inputs.nixpkgs.lib.nixosSystem {
### NixOS
nixosConfigurations."dust" = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./nixos/profiles/core ./nixos/profiles/core
@ -130,8 +135,9 @@
inherit inputs; inherit inputs;
}; };
}; };
} // inputs.self.colmenaHive.nodes;
colmena = { colmenaHive = inputs.colmena.lib.makeHive {
meta = { meta = {
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;

View file

@ -21,7 +21,7 @@
]); ]);
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.self.overlays.patches inputs.self.overlays.default
]; ];
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;

View file

@ -5,8 +5,7 @@ let
patches = (old.patches or [ ]) ++ patches; patches = (old.patches or [ ]) ++ patches;
}); });
in in
{ _final: prev: {
patches = _final: prev: {
# https://aur.archlinux.org/pkgbase/nautilus-typeahead # https://aur.archlinux.org/pkgbase/nautilus-typeahead
nautilus = prev.nautilus.overrideAttrs { nautilus = prev.nautilus.overrideAttrs {
src = prev.fetchFromGitLab { src = prev.fetchFromGitLab {
@ -97,5 +96,4 @@ in
hash = "sha256-+JJoHNOmDzqT1TaFM83DR3/BdCab240tfs21VNMv6wE="; hash = "sha256-+JJoHNOmDzqT1TaFM83DR3/BdCab240tfs21VNMv6wE=";
}) })
]; ];
};
} }