config/flake.nix

309 lines
8.3 KiB
Nix
Raw Normal View History

2023-03-29 17:50:55 +03:00
{
2023-03-30 16:33:03 +03:00
description = "motiejus/config";
2023-03-29 17:50:55 +03:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
2024-09-28 20:57:59 +03:00
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
2023-04-05 14:46:57 +03:00
flake-utils.url = "github:numtide/flake-utils";
2023-10-01 22:45:00 +03:00
flake-compat.url = "github:nix-community/flake-compat";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2023-10-02 00:05:57 +03:00
nur.url = "github:nix-community/NUR";
2023-04-05 14:46:57 +03:00
home-manager.url = "github:nix-community/home-manager/release-24.11";
2023-08-18 13:47:27 +03:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2023-05-30 10:03:21 +03:00
2023-11-27 18:17:27 +02:00
agenix = {
url = "github:ryantm/agenix";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
darwin.follows = "";
};
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
utils.follows = "flake-utils";
};
};
2023-09-15 14:39:04 +03:00
2023-12-14 10:10:00 +02:00
nixgl = {
url = "github:guibou/nixGL";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
2024-11-19 22:31:08 +02:00
zig = {
url = "github:mitchellh/zig-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
};
};
2024-12-03 01:18:40 +02:00
kolide-launcher = {
url = "github:/kolide/nix-agent/main";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-09-21 06:06:10 +03:00
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
2023-10-02 00:05:57 +03:00
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
2023-11-27 18:17:27 +02:00
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
gitignore.follows = "gitignore";
};
};
2023-04-05 14:46:57 +03:00
};
2023-04-05 09:15:02 +03:00
2023-04-05 14:46:57 +03:00
nixConfig = {
trusted-substituters = "https://cache.nixos.org/";
trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
2023-11-30 16:44:11 +02:00
extra-experimental-features = "nix-command flakes";
2023-03-29 17:50:55 +03:00
};
2024-07-29 15:39:54 +03:00
outputs =
{
self,
nixpkgs,
nixpkgs-unstable,
agenix,
deploy-rs,
flake-utils,
home-manager,
nixos-hardware,
nix-index-database,
pre-commit-hooks,
nur,
2024-11-19 22:31:08 +02:00
zig,
2024-07-29 15:39:54 +03:00
nixgl,
2024-12-03 01:18:40 +02:00
kolide-launcher,
2024-07-29 15:39:54 +03:00
...
}@inputs:
let
myData = import ./data.nix;
overlays = [
nur.overlay
2024-11-19 22:31:08 +02:00
zig.overlays.default
2024-07-29 15:39:54 +03:00
nixgl.overlay
(_self: super: { deploy-rs-pkg = super.deploy-rs; })
deploy-rs.overlay
(_self: super: {
deploy-rs = {
deploy-rs = super.deploy-rs-pkg;
inherit (super.deploy-rs) lib;
};
deploy-rs-pkg = null;
})
(_: super: {
2024-09-15 07:36:17 +03:00
weather = super.callPackage ./pkgs/weather { };
2024-07-29 15:39:54 +03:00
nicer = super.callPackage ./pkgs/nicer.nix { };
tmuxbash = super.callPackage ./pkgs/tmuxbash.nix { };
vanta-agent = super.callPackage ./pkgs/vanta-agent.nix { };
2024-07-29 15:39:54 +03:00
pkgs-unstable = import nixpkgs-unstable {
inherit (super) system;
overlays = [
(_self: super: {
go = super.go_1_23;
buildGoModule = super.buildGo123Module;
buildGoPackage = super.buildGo123Package;
})
];
};
2024-07-29 15:39:54 +03:00
})
];
2024-12-02 19:47:05 +02:00
in
{
nixosConfigurations = {
vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2024-07-29 15:39:54 +03:00
modules = [
{ nixpkgs.overlays = overlays; }
./hosts/vm/configuration.nix
home-manager.nixosModules.home-manager
];
specialArgs = {
inherit myData;
} // inputs;
2024-07-07 20:22:27 +03:00
};
2024-02-04 16:18:47 +02:00
2024-03-12 21:26:31 +02:00
mtworx = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
2024-07-29 15:39:54 +03:00
{ nixpkgs.overlays = overlays; }
2024-03-12 21:26:31 +02:00
./hosts/mtworx/configuration.nix
home-manager.nixosModules.home-manager
nixos-hardware.nixosModules.lenovo-thinkpad-x1-11th-gen
2024-03-13 14:12:44 +02:00
nix-index-database.nixosModules.nix-index
2024-03-18 17:46:17 +02:00
agenix.nixosModules.default
2024-12-03 01:18:40 +02:00
kolide-launcher.nixosModules.kolide-launcher
2024-03-12 21:26:31 +02:00
];
2024-07-29 15:39:54 +03:00
specialArgs = {
inherit myData;
} // inputs;
2024-03-12 21:26:31 +02:00
};
2024-02-06 09:53:14 +02:00
fwminex = nixpkgs.lib.nixosSystem {
2023-11-27 18:17:27 +02:00
system = "x86_64-linux";
modules = [
2024-07-29 15:39:54 +03:00
{ nixpkgs.overlays = overlays; }
2023-11-27 18:17:27 +02:00
./hosts/fwminex/configuration.nix
home-manager.nixosModules.home-manager
nixos-hardware.nixosModules.framework-12th-gen-intel
2024-07-23 22:01:40 +03:00
agenix.nixosModules.default
2023-11-27 18:17:27 +02:00
];
2023-09-13 12:17:43 +03:00
2024-07-29 15:39:54 +03:00
specialArgs = {
inherit myData;
} // inputs;
2023-11-27 18:17:27 +02:00
};
2023-09-13 12:17:43 +03:00
2024-08-05 15:43:08 +03:00
vno1-gdrx = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{ nixpkgs.overlays = overlays; }
./hosts/vno1-gdrx/configuration.nix
home-manager.nixosModules.home-manager
nix-index-database.nixosModules.nix-index
2024-08-05 16:09:13 +03:00
agenix.nixosModules.default
2024-08-05 15:43:08 +03:00
];
specialArgs = {
inherit myData;
} // inputs;
};
2024-07-30 23:06:33 +03:00
fra1-b = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
{ nixpkgs.overlays = overlays; }
agenix.nixosModules.default
home-manager.nixosModules.home-manager
./hosts/fra1-b/configuration.nix
./modules
];
specialArgs = {
inherit myData;
} // inputs;
};
2023-08-26 07:18:27 +03:00
};
2023-11-27 18:17:27 +02:00
deploy.nodes = {
fwminex = {
2024-07-31 09:19:13 +03:00
hostname = myData.hosts."fwminex.servers.jakst".jakstIP;
2023-11-27 18:17:27 +02:00
profiles = {
system = {
sshUser = "motiejus";
2024-07-29 15:39:54 +03:00
path = self.nixosConfigurations.fwminex.pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.fwminex;
2023-11-27 18:17:27 +02:00
user = "root";
};
2023-09-15 15:05:25 +03:00
};
};
2024-04-04 19:54:51 +03:00
mtworx = {
hostname = myData.hosts."mtworx.motiejus.jakst".jakstIP;
profiles = {
system = {
sshUser = "motiejus";
2024-07-29 15:39:54 +03:00
path = self.nixosConfigurations.mtworx.pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.mtworx;
2024-04-04 19:54:51 +03:00
user = "root";
2024-08-05 16:41:24 +03:00
};
};
};
vno1-gdrx = {
hostname = myData.hosts."vno1-gdrx.motiejus.jakst".jakstIP;
profiles = {
system = {
sshUser = "motiejus";
path = self.nixosConfigurations.vno1-gdrx.pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.vno1-gdrx;
user = "root";
2024-04-04 19:54:51 +03:00
};
};
};
2024-07-31 00:18:48 +03:00
fra1-b = {
hostname = myData.hosts."fra1-b.servers.jakst".jakstIP;
profiles = {
system = {
sshUser = "motiejus";
path = self.nixosConfigurations.fra1-b.pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.fra1-b;
user = "root";
};
};
};
2023-08-26 07:18:27 +03:00
};
2024-07-29 15:39:54 +03:00
checks = builtins.mapAttrs (
system: deployLib:
deployLib.deployChecks self.deploy
// {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
statix.enable = true;
2024-09-06 09:40:42 +03:00
deadnix.enable = true;
nixfmt-rfc-style.enable = true;
2024-07-29 15:39:54 +03:00
};
};
}
) deploy-rs.lib;
2023-04-03 16:50:52 +03:00
}
2024-07-29 15:39:54 +03:00
// flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system overlays; };
in
{
devShells.default = pkgs.mkShellNoCC {
GIT_AUTHOR_EMAIL = "motiejus@jakstys.lt";
packages = [
pkgs.nix-output-monitor
pkgs.rage
pkgs.age-plugin-yubikey
pkgs.deploy-rs.deploy-rs
agenix.packages.${system}.agenix
];
inherit (self.checks.${system}.pre-commit-check) shellHook;
};
2023-04-03 16:50:52 +03:00
2024-07-29 15:39:54 +03:00
formatter = pkgs.nixfmt-rfc-style;
}
2024-08-21 17:16:56 +03:00
)
2024-09-15 07:36:17 +03:00
// (
let
pkgs = import nixpkgs {
inherit overlays;
system = "x86_64-linux";
};
in
{
packages.x86_64-linux.vanta-agent = pkgs.vanta-agent;
packages.x86_64-linux.weather = pkgs.weather;
}
);
2024-08-21 17:16:56 +03:00
2023-03-29 17:50:55 +03:00
}