nixos-configs/flake.nix

161 lines
3.6 KiB
Nix
Raw Normal View History

2023-10-08 14:57:57 +00:00
{
description = "My NixOS configuration";
inputs = {
2024-06-04 19:21:38 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2023-10-09 09:25:17 +00:00
nur.url = "github:nix-community/NUR";
stylix.url = "github:pizzapim/stylix/release-24.05";
2024-10-26 18:32:37 +00:00
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
2024-10-30 20:18:18 +00:00
git-hooks = {
2024-10-28 11:19:36 +00:00
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-18 21:05:23 +00:00
2023-10-08 16:03:14 +00:00
home-manager = {
2024-06-04 19:21:38 +00:00
url = "github:nix-community/home-manager?ref=release-24.05";
2023-10-08 16:03:14 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-18 21:05:23 +00:00
2024-01-29 20:05:48 +00:00
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-artwork = {
type = "git";
url = "https://github.com/NixOS/nixos-artwork.git";
flake = false;
};
2024-06-15 14:20:03 +00:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-10-26 09:59:32 +00:00
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
2024-10-27 11:23:20 +00:00
inputs.nixpkgs-stable.follows = "nixpkgs-unstable";
2024-10-26 09:59:32 +00:00
};
2023-10-08 14:57:57 +00:00
};
2023-11-05 17:49:51 +00:00
2024-10-26 18:33:47 +00:00
outputs = {
self,
nixpkgs,
...
} @ inputs: let
supportedSystems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
forAllSystems' = nixpkgs.lib.genAttrs;
forAllSystems = forAllSystems' supportedSystems;
pkgsForSystem = system:
import nixpkgs {
inherit system;
};
2024-10-26 18:32:37 +00:00
2024-10-26 18:33:47 +00:00
treefmtEval = forAllSystems (
system: inputs.treefmt-nix.lib.evalModule (pkgsForSystem system) ./treefmt.nix
);
in {
formatter = forAllSystems (system: (treefmtEval.${system}.config.build.wrapper));
2024-10-27 11:23:20 +00:00
nixosConfigurations = nixpkgs.lib.mapAttrs (
2024-11-11 19:43:36 +00:00
name: nixosModule:
2024-10-27 11:23:20 +00:00
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
2024-11-11 19:43:36 +00:00
inherit inputs system self;
2024-10-26 18:33:47 +00:00
};
2024-05-16 16:48:46 +00:00
2024-10-27 11:23:20 +00:00
modules = [
nixosModule
./nixos
];
}
) (import ./machines);
2024-10-28 11:19:36 +00:00
checks = forAllSystems (system: {
2024-10-30 20:18:18 +00:00
pre-commit-check = inputs.git-hooks.lib.${system}.run {
2024-10-28 11:19:36 +00:00
src = ./.;
hooks = {
treefmt = {
enable = true;
package = treefmtEval.${system}.config.build.wrapper;
};
};
};
});
devShells = forAllSystems (system: {
default = nixpkgs.legacyPackages.${system}.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
};
});
2024-11-11 19:43:36 +00:00
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
specialArgs = {
inherit inputs self;
};
nodeSpecialArgs = {
sue = {};
};
};
sue = {
name,
nodes,
...
}: {
deployment = {
allowLocalDeployment = true;
targetHost = null;
};
imports = [
(import ./machines).sue
./nixos
];
};
gamepc = {
name,
nodes,
...
}: {
deployment = {
2024-11-11 20:00:51 +00:00
targetHost = "gamepc";
2024-11-11 19:43:36 +00:00
targetUser = "root";
};
imports = [
(import ./machines).gamepc
./nixos
];
};
};
2024-10-26 18:33:47 +00:00
};
2023-10-08 14:57:57 +00:00
}