nix-config/flake.nix

137 lines
4.3 KiB
Nix
Raw Normal View History

2024-03-24 23:39:49 +01:00
{
description = "Nix config for both home-manager and nixos";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2024-05-15 19:00:33 +02:00
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
2024-05-24 22:23:56 +02:00
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
2024-05-15 19:00:33 +02:00
};
2024-03-24 23:39:49 +01:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-24 23:39:49 +01:00
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
2024-05-24 22:23:56 +02:00
inputs.flake-compat.follows = "flake-compat";
inputs.home-manager.follows = "home-manager";
2024-03-24 23:39:49 +01:00
};
2024-05-24 22:23:56 +02:00
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
#https://unmovedcentre.com/technology/2024/03/22/secrets-management.html
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-secrets = {
2024-07-30 05:07:02 +02:00
url = "git+ssh://forgejo@git.venberg.xyz/Gabe/nix-secrets.git?shallow=1";
# url = "git+https://git.venberg.xyz/Gabe/nix-secrets.git?shallow=1";
flake = false;
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# just for follows statements
2024-05-24 22:23:56 +02:00
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
2024-03-24 23:39:49 +01:00
};
outputs = {
self,
nixpkgs,
deploy-rs,
2024-03-24 23:39:49 +01:00
...
} @ inputs: let
2024-04-23 04:45:38 +02:00
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
inherit (nixpkgs) lib;
2024-06-03 22:15:52 +02:00
configLib = import ./lib {inherit lib;};
2024-03-24 23:39:49 +01:00
in {
2024-04-23 04:45:38 +02:00
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
packages = with pkgs; [
just
deploy-rs.packages.${system}.deploy-rs
2024-04-23 04:45:38 +02:00
];
};
}
);
2024-06-04 18:00:43 +02:00
lib = configLib;
2024-06-03 22:15:52 +02:00
homeManagerModules = import ./modules/home-manager;
2024-03-24 23:39:49 +01:00
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
archlaptop-vm = import ./hosts/archlaptop-vm {inherit inputs configLib;};
workstation-vm = import ./hosts/workstation-vm {inherit inputs configLib;};
gv-wsl = import ./hosts/wsl-workstation.nix {inherit inputs configLib;};
rockhole = import ./hosts/rockhole64 {inherit inputs configLib;};
2024-07-29 19:34:24 +02:00
cirrus = import ./hosts/cirrus {inherit inputs configLib;};
2024-07-30 22:25:53 +02:00
remotepi-karp = import ./hosts/remotepi-karp {inherit inputs configLib;};
};
2024-03-24 23:39:49 +01:00
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"gabe@archlaptop" = import ./hosts/home-laptop.nix {inherit inputs configLib;};
"gabe@linuxgamingrig" = import ./hosts/home-personal.nix {inherit inputs configLib;};
"gabe@gv-workstation" = import ./hosts/home-workstation.nix {inherit inputs configLib;};
"gabe@gv-ubuntu" = import ./hosts/home-workstation.nix {inherit inputs configLib;};
2024-03-24 23:39:49 +01:00
};
2024-05-22 22:07:45 +02:00
deploy = {
nodes = {
rockhole = {
hostname = "rockpro";
profiles.system.path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.rockhole;
remoteBuild = true;
};
2024-07-29 19:34:24 +02:00
cirrus = {
hostname = "cal.venberg.xyz";
2024-07-29 19:34:24 +02:00
profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cirrus;
};
};
sshUser = "root";
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
2024-06-05 19:28:10 +02:00
packages.x86_64-linux = {
proxmox = import ./packages/proxmox.nix {inherit inputs configLib;};
iso = import ./packages/iso.nix {inherit inputs configLib;};
aarch-64-iso = import ./packages/aarch64-iso.nix {inherit inputs configLib;};
2024-07-30 22:25:53 +02:00
rpi3-sd-image = import ./packages/rpi3-sd-image.nix {inherit inputs configLib;};
2024-06-05 19:28:10 +02:00
};
templates = import ./templates;
2024-03-24 23:39:49 +01:00
};
}