2023-12-17 13:33:15 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-23.11";
|
|
|
|
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
2024-04-06 12:00:33 +00:00
|
|
|
|
|
|
|
colmena = {
|
|
|
|
url = "github:zhaofengli/colmena";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-03-24 18:02:31 +00:00
|
|
|
|
2023-12-17 13:33:15 +00:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager/release-23.11";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-04-20 13:07:59 +00:00
|
|
|
|
2024-05-04 16:37:52 +00:00
|
|
|
|
2024-04-20 13:07:59 +00:00
|
|
|
cherrykitten-website = {
|
2024-04-21 19:00:58 +00:00
|
|
|
url = "git+https://git.cherrykitten.dev/sammy/cherrykitten.dev?ref=nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-12-17 13:33:15 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
};
|
2024-03-24 18:02:29 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
outputs = inputs @ { self, flake-parts, nixpkgs, nixpkgs-unstable, home-manager, colmena, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
imports = [
|
|
|
|
./hive.nix
|
|
|
|
];
|
2024-03-24 18:02:22 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
2024-03-24 18:02:25 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
perSystem = { config, pkgs, ... }: {
|
2024-03-24 18:02:32 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
|
|
devShells =
|
|
|
|
let
|
|
|
|
packages = [ pkgs.nix pkgs.colmena pkgs.just pkgs.git pkgs.home-manager pkgs.pass pkgs.nixos-rebuild ];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
nativeBuildInputs = packages;
|
|
|
|
shellHook = "exec $SHELL";
|
2024-04-15 17:04:08 +00:00
|
|
|
};
|
2024-04-21 19:00:58 +00:00
|
|
|
hcloud = pkgs.mkShell {
|
|
|
|
nativeBuildInputs = packages ++ [ pkgs.hcloud ];
|
|
|
|
shellHook = ''
|
|
|
|
export HCLOUD_TOKEN=$(pass services/hcloud/api_token)
|
|
|
|
exec $SHELL
|
|
|
|
'';
|
2024-04-06 12:00:33 +00:00
|
|
|
};
|
2024-03-24 18:02:32 +00:00
|
|
|
};
|
2024-04-21 19:00:58 +00:00
|
|
|
};
|
2024-03-24 18:02:32 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
flake =
|
|
|
|
{
|
2024-05-04 10:03:59 +00:00
|
|
|
|
|
|
|
nixosModules = builtins.listToAttrs (
|
|
|
|
map
|
|
|
|
(x: {
|
|
|
|
name = x;
|
|
|
|
value = import (./modules/nixos + "/${x}");
|
|
|
|
})
|
|
|
|
(builtins.attrNames (builtins.readDir ./modules/nixos))
|
|
|
|
);
|
|
|
|
|
|
|
|
homeManagerModules = builtins.listToAttrs (
|
|
|
|
map
|
|
|
|
(name: {
|
|
|
|
inherit name;
|
|
|
|
value = import (./modules/home + "/${name}");
|
|
|
|
})
|
|
|
|
(builtins.attrNames (builtins.readDir ./modules/home))
|
|
|
|
);
|
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
2024-03-24 18:02:30 +00:00
|
|
|
|
2024-04-21 19:00:58 +00:00
|
|
|
homeConfigurations =
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
|
|
|
in
|
|
|
|
nixpkgs.lib.genAttrs (builtins.attrNames (builtins.readDir ./users)) (name: home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules = [ ./users/${name}/home.nix ];
|
|
|
|
extraSpecialArgs = {
|
|
|
|
inherit inputs;
|
2024-05-04 10:03:59 +00:00
|
|
|
flake = self;
|
2024-04-21 19:00:58 +00:00
|
|
|
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
|
|
|
};
|
|
|
|
});
|
2024-04-20 08:31:22 +00:00
|
|
|
};
|
2023-12-17 13:33:15 +00:00
|
|
|
};
|
|
|
|
}
|