nix-configurations/flake.nix

90 lines
3.0 KiB
Nix
Raw Normal View History

2022-12-30 12:05:46 +00:00
{
description = ''
This i my basic NixOS system configuration. Feel free to reuse anything you find useful.
'';
inputs = {
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
2023-04-12 17:30:43 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2022-12-30 12:05:46 +00:00
deploy-rs.url = "github:serokell/deploy-rs";
};
2023-04-29 04:47:39 +00:00
outputs = { self, nixpkgs, home-manager, agenix, deploy-rs, ... }@inputs:
2022-12-30 12:05:46 +00:00
let
inherit (self) outputs;
lib = nixpkgs.lib;
2023-02-05 13:36:38 +00:00
allowUnfree = { nixpkgs.config.allowUnfree = true; };
2023-04-17 16:37:10 +00:00
forEachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
forEachPkgs = f: forEachSystem (sys: f nixpkgs.legacyPackages.${sys});
2022-12-30 12:05:46 +00:00
in {
2023-04-21 03:18:13 +00:00
packages = forEachPkgs (pkgs: (import ./pkgs { inherit pkgs; }));
2023-02-05 13:36:38 +00:00
nixosConfigurations = {
2022-12-30 12:05:46 +00:00
lkk-nix-1 = lib.nixosSystem {
specialArgs = { inherit inputs; };
2023-04-16 15:07:24 +00:00
modules =
[ allowUnfree ./hosts/lkk-nix-1 agenix.nixosModules.default ];
2022-12-30 12:05:46 +00:00
};
2023-02-28 14:26:31 +00:00
lkk-prod-1 = lib.nixosSystem {
specialArgs = { inherit inputs; };
2023-04-16 15:07:24 +00:00
modules =
[ allowUnfree ./hosts/lkk-prod-1 agenix.nixosModules.default ];
2023-02-28 14:26:31 +00:00
};
2023-03-14 12:22:16 +00:00
lkk-prod-2 = lib.nixosSystem {
specialArgs = { inherit inputs; };
2023-04-16 15:07:24 +00:00
modules =
[ allowUnfree ./hosts/lkk-prod-2 agenix.nixosModules.default ];
2023-03-14 12:22:16 +00:00
};
2023-04-06 15:12:19 +00:00
m3-nix = lib.nixosSystem {
2023-04-09 09:12:23 +00:00
specialArgs = { inherit inputs outputs; };
2023-04-16 15:07:24 +00:00
modules = [ allowUnfree ./hosts/m3-nix agenix.nixosModules.default ];
2023-04-06 15:12:19 +00:00
};
2023-02-05 13:36:38 +00:00
};
homeConfigurations = {
2022-12-30 12:05:46 +00:00
# Laptop
2023-04-29 04:47:39 +00:00
"m3tam3re@m3-nix" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs = { inherit inputs outputs; };
modules = [ ./home/users/m3tam3re/m3-nix.nix allowUnfree ];
};
"m3tam3re@lkk-nix-1" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
2023-04-06 15:12:19 +00:00
extraSpecialArgs = { # pass things to t
2022-12-30 12:05:46 +00:00
};
2023-02-05 13:36:38 +00:00
modules = [ ./home/users/m3tam3re/lkk-nix-1.nix ];
2022-12-30 12:05:46 +00:00
};
};
deploy.nodes.lkk-nix-1 = {
hostname = "lkk-nix-1";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.lkk-nix-1;
};
};
2023-02-28 14:26:31 +00:00
deploy.nodes.lkk-prod-1 = {
hostname = "lkk-prod-1";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.lkk-prod-1;
};
};
2023-03-14 12:22:16 +00:00
deploy.nodes.lkk-prod-2 = {
hostname = "lkk-prod-2";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.lkk-prod-2;
};
};
2022-12-30 12:05:46 +00:00
deploy.remoteBuild = true;
};
}