mirror of
https://github.com/lxstinthesky/matrix.git
synced 2025-11-02 00:42:48 +00:00
A simple flake setup with tests and VM support
This commit is contained in:
53
flake.nix
Normal file
53
flake.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
description = "Flake to setup server using matrix communication protocol";
|
||||
|
||||
inputs = {
|
||||
|
||||
# stable and unstable nixpkgs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
# partitioning and disk management
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# secret management
|
||||
sops = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, disko, sops, ... }@inputs: {
|
||||
nixosConfigurations = {
|
||||
# TODO replace hostname
|
||||
matrix = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
sops.nixosModules.sops
|
||||
./nix/configuration.nix
|
||||
./nix/disko.nix
|
||||
];
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
};
|
||||
|
||||
# Add this section
|
||||
checks.x86_64-linux = {
|
||||
test1 = import ./nix/tests/test1.nix {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
};
|
||||
|
||||
# Development shell for working with the configuration
|
||||
# execute: nix develop or use direnv
|
||||
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
||||
buildInputs = with nixpkgs.legacyPackages.x86_64-linux; [
|
||||
# git
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user