2022-09-18 19:42:30 +00:00
|
|
|
{
|
|
|
|
description = "My Nix Configuration";
|
|
|
|
|
|
|
|
inputs = {
|
2022-09-25 18:01:06 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2023-03-12 03:59:11 +00:00
|
|
|
|
2022-11-01 00:18:11 +00:00
|
|
|
home-manager.url = "github:nix-community/home-manager/master";
|
2022-09-18 19:42:30 +00:00
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2023-03-12 03:59:11 +00:00
|
|
|
nixos-generators.url = "github:nix-community/nixos-generators";
|
|
|
|
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
|
2022-11-01 00:18:11 +00:00
|
|
|
|
2024-05-27 04:56:59 +00:00
|
|
|
# For some reason updating causes an error saying /nix/store/secrets can't
|
|
|
|
# be access in pure mode (doesn't play nice with agenix)
|
|
|
|
snowfall-lib.url = "github:snowfallorg/lib/92803a029b5314d4436a8d9311d8707b71d9f0b6";
|
2023-03-12 03:59:11 +00:00
|
|
|
snowfall-lib.inputs.nixpkgs.follows = "nixpkgs";
|
2023-04-16 17:07:42 +00:00
|
|
|
|
|
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
|
|
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
2023-07-09 15:24:54 +00:00
|
|
|
|
|
|
|
agenix.url = "github:ryantm/agenix";
|
|
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
agenix.inputs.home-manager.follows = "home-manager";
|
|
|
|
agenix.inputs.darwin.follows = "";
|
2023-09-03 00:12:21 +00:00
|
|
|
|
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
2023-03-12 03:59:11 +00:00
|
|
|
};
|
2022-09-18 19:42:30 +00:00
|
|
|
|
2023-09-17 15:57:41 +00:00
|
|
|
outputs = inputs:
|
|
|
|
inputs.snowfall-lib.mkFlake {
|
2023-03-12 03:59:11 +00:00
|
|
|
inherit inputs;
|
|
|
|
src = ./.;
|
2023-09-17 15:57:41 +00:00
|
|
|
|
2023-10-05 03:36:21 +00:00
|
|
|
# overlay-package-namespace = "aa";
|
|
|
|
snowfall.namespace = "aa";
|
2023-03-12 03:59:11 +00:00
|
|
|
|
|
|
|
channels-config.allowUnfree = true;
|
2024-01-13 18:00:15 +00:00
|
|
|
# TODO: This should be temporary.
|
|
|
|
# See here:
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/269713
|
|
|
|
# https://github.com/project-chip/connectedhomeip/issues/25688
|
|
|
|
channels-config.permittedInsecurePackages = [
|
|
|
|
"openssl-1.1.1w"
|
|
|
|
];
|
2023-03-12 03:59:11 +00:00
|
|
|
|
2023-10-05 03:36:21 +00:00
|
|
|
systems.modules.nixos = with inputs; [
|
2023-07-09 15:24:54 +00:00
|
|
|
agenix.nixosModules.default
|
2023-09-03 00:12:21 +00:00
|
|
|
home-manager.nixosModules.home-manager
|
2023-03-12 03:59:11 +00:00
|
|
|
];
|
|
|
|
|
2023-09-03 00:12:21 +00:00
|
|
|
deploy.nodes = {
|
|
|
|
node = {
|
|
|
|
hostname = "node";
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
|
|
|
sshUser = "alejandro";
|
|
|
|
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos inputs.self.nixosConfigurations.node;
|
|
|
|
sshOpts = ["-A"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pi4 = let
|
|
|
|
system = "aarch64-linux";
|
|
|
|
pkgs = import inputs.nixpkgs {inherit system;};
|
|
|
|
deployPkgs = import inputs.nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
inputs.deploy-rs.overlay
|
|
|
|
(self: super: {
|
|
|
|
deploy-rs = {
|
|
|
|
inherit (pkgs) deploy-rs;
|
|
|
|
lib = inputs.deploy-rs.lib;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
hostname = "pi4";
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
|
|
|
sshUser = "alejandro";
|
|
|
|
path = deployPkgs.deploy-rs.lib.aarch64-linux.activate.nixos inputs.self.nixosConfigurations.pi4;
|
2023-09-10 16:20:11 +00:00
|
|
|
# Usually deploy from an x86_64 machine and don't want to bother
|
|
|
|
# trying to build an aarch64 derivation
|
|
|
|
remoteBuild = true;
|
2023-09-03 00:12:21 +00:00
|
|
|
};
|
2023-03-12 03:59:11 +00:00
|
|
|
};
|
2022-09-18 19:42:30 +00:00
|
|
|
};
|
2023-04-16 17:07:42 +00:00
|
|
|
|
2023-09-03 00:12:21 +00:00
|
|
|
# TODO: Re-enable this when I figure out how to prevent needing to build
|
|
|
|
# dependencies for architectures other than the host machine
|
|
|
|
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;
|
2024-03-02 18:06:18 +00:00
|
|
|
|
2024-03-03 01:48:28 +00:00
|
|
|
hydraJobs = let
|
|
|
|
systems_to_build = [
|
|
|
|
"gospel"
|
|
|
|
"node"
|
|
|
|
"carbon"
|
|
|
|
];
|
|
|
|
in {
|
2024-03-03 02:09:43 +00:00
|
|
|
# Only have a builder for x86_64-linux atm
|
|
|
|
packages = inputs.self.packages.x86_64-linux;
|
2024-03-03 01:17:04 +00:00
|
|
|
|
2024-03-03 01:48:28 +00:00
|
|
|
systems = inputs.nixpkgs.lib.attrsets.genAttrs systems_to_build (
|
|
|
|
name:
|
|
|
|
inputs.self.nixosConfigurations."${name}".config.system.build.toplevel
|
|
|
|
);
|
2024-05-27 15:29:51 +00:00
|
|
|
|
|
|
|
droplets.proxy = inputs.self.doConfigurations.proxy;
|
2024-03-02 18:06:18 +00:00
|
|
|
};
|
2022-09-18 19:42:30 +00:00
|
|
|
};
|
|
|
|
}
|