nix-infra/flake.nix

87 lines
2.3 KiB
Nix
Raw Normal View History

2023-12-17 13:33:15 +00:00
{
inputs = {
2024-06-01 17:55:28 +00:00
nixpkgs.url = "nixpkgs/nixos-24.05";
2023-12-17 13:33:15 +00:00
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-17 13:33:15 +00:00
home-manager = {
2024-06-01 17:55:28 +00:00
url = "github:nix-community/home-manager/release-24.05";
2023-12-17 13:33:15 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
cherrykitten-website = {
2024-06-07 09:18:40 +00:00
url = "git+https://git.cherrykitten.dev/sammy/cherrykitten.dev";
2024-04-21 19:00:58 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-17 13:33:15 +00:00
2024-06-05 16:16:21 +00:00
impermanence.url = "github:nix-community/impermanence";
2024-06-06 08:27:57 +00:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
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-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-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-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;
};
2023-12-17 13:33:15 +00:00
};
}