nix-configs/flake.nix

164 lines
5.4 KiB
Nix
Raw Normal View History

2024-04-05 22:04:41 -04:00
{
description = "Chris's system configuration";
inputs = {
2024-05-30 20:39:54 -04:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
2024-08-19 21:54:43 -04:00
nixunstable.url = "github:NixOS/nixpkgs/nixos-unstable";
2024-09-19 20:46:32 -04:00
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
2024-09-05 19:39:30 -04:00
flake-compat = {
url = "github:edolstra/flake-compat";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-10 19:26:16 -04:00
deploy-rs = {
2024-05-30 20:39:54 -04:00
url = "github:serokell/deploy-rs";
2024-05-10 19:26:16 -04:00
inputs.nixpkgs.follows = "nixpkgs";
2024-09-05 19:39:30 -04:00
inputs.flake-compat.follows = "flake-compat";
2024-05-10 19:26:16 -04:00
};
2024-04-05 22:04:41 -04:00
home-manager = {
2024-05-30 20:39:54 -04:00
url = "github:nix-community/home-manager/release-24.05";
2024-04-05 22:04:41 -04:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-26 14:14:50 -04:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
2024-09-05 19:39:30 -04:00
inputs.nixpkgs-stable.follows = "nixpkgs";
2024-04-26 14:14:50 -04:00
};
2024-08-21 21:11:53 -04:00
impermanence.url = "github:nix-community/impermanence";
2024-05-27 21:02:31 -04:00
stylix = {
2024-06-12 11:23:30 -04:00
url = "github:danth/stylix/release-24.05";
2024-05-27 21:02:31 -04:00
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
2024-09-05 19:39:30 -04:00
flake-compat.follows = "flake-compat";
2024-05-27 21:02:31 -04:00
};
};
2024-07-29 22:13:52 -04:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2024-09-19 20:46:32 -04:00
ez-configs = {
url = "github:ehllie/ez-configs";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
};
};
2024-04-05 22:04:41 -04:00
};
2024-09-05 19:08:29 -04:00
outputs =
2024-09-19 20:46:32 -04:00
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
2024-09-05 19:08:29 -04:00
{ withSystem, self, ... }:
{
2024-09-19 20:46:32 -04:00
imports = [
inputs.devshell.flakeModule
inputs.ez-configs.flakeModule
];
2024-09-05 19:08:29 -04:00
systems = [
"x86_64-linux"
"aarch64-linux"
];
2024-09-19 20:46:32 -04:00
ezConfigs = {
root = ./.;
globalArgs = {
inherit inputs;
};
};
2024-09-05 19:08:29 -04:00
flake = {
deploy = {
sshUser = "root";
fastConnection = true;
nodes =
withSystem "x86_64-linux" (
{ pkgs, ... }:
{
smolboi = {
hostname = "smolboi";
profiles.system.path = pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.smolboi;
};
zeus = {
hostname = "zeus";
profiles.system.path = pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.zeus;
};
}
)
// withSystem "aarch64-linux" (
{ pkgs, ... }:
{
orangepihole = {
hostname = "orangepihole";
profiles.system.path = pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.orangepihole;
};
}
);
};
nixosConfigurations = {
smolboi = inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
2024-09-10 18:46:53 -04:00
pkgs-unstable = inputs.nixunstable.legacyPackages.x86_64-linux;
2024-09-05 19:08:29 -04:00
};
modules = [
./systems/smolboi/configuration.nix
inputs.stylix.nixosModules.stylix
inputs.impermanence.nixosModules.impermanence
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
inputs.nixos-hardware.nixosModules.common-gpu-amd
inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.gigabyte-b550
inputs.home-manager.nixosModules.home-manager
{
2024-09-10 18:46:53 -04:00
home-manager.extraSpecialArgs = {
pkgs-unstable = inputs.nixunstable.legacyPackages.x86_64-linux;
};
2024-09-05 19:08:29 -04:00
home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ./systems/smolboi/home.nix;
}
];
2024-09-05 09:46:36 -04:00
};
2024-09-05 19:08:29 -04:00
orangepihole = inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
2024-09-10 18:46:53 -04:00
pkgs-unstable = inputs.nixunstable.legacyPackages.aarch64-linux;
2024-09-05 19:08:29 -04:00
};
modules = [
./systems/orangepihole/configuration.nix
inputs.impermanence.nixosModules.impermanence
];
2024-09-05 09:46:36 -04:00
};
2024-09-05 19:08:29 -04:00
};
2024-09-05 09:46:36 -04:00
};
2024-09-05 19:08:29 -04:00
perSystem =
{ pkgs, system, ... }:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.deploy-rs.overlay
(final: prev: {
deploy-rs = {
inherit (inputs.nixpkgs.legacyPackages.${system}) deploy-rs;
2024-09-19 20:46:32 -04:00
inherit (prev.deploy-rs) lib;
2024-09-05 19:08:29 -04:00
};
})
];
config = { };
2024-05-30 20:39:54 -04:00
};
2024-09-05 19:08:29 -04:00
devshells.default = {
packages = with pkgs; [
deploy-rs.deploy-rs
sops
];
2024-09-04 22:22:26 -04:00
};
2024-09-19 20:46:32 -04:00
packages.zwave-js-ui = pkgs.callPackage ./pkgs/zwave-js-ui.nix { };
2024-09-05 19:08:29 -04:00
checks = inputs.deploy-rs.lib.${system}.deployChecks self.deploy;
formatter = pkgs.nixfmt-rfc-style;
2024-05-30 20:39:54 -04:00
};
2024-09-05 19:08:29 -04:00
}
);
2024-04-05 22:04:41 -04:00
}