eve-psr-nix0/flake.nix

132 lines
3.7 KiB
Nix
Raw Normal View History

2023-06-01 14:39:07 -05:00
{
inputs = {
2023-06-25 20:54:15 -05:00
nixpkgs.url = "nixpkgs/nixos-23.05";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "";
};
};
2023-06-26 14:57:56 -05:00
outputs = { self, nixpkgs, agenix, ... }@attrs:
let
containerDef = import ./containers.nix;
serviceContainers = containerDef.containers;
pkgs = import nixpkgs { inherit system; };
system = "x86_64-linux";
in {
devShell.x86_64-linux = pkgs.mkShell {
buildInputs = [
agenix.packages.x86_64-linux.default
(pkgs.nixos { }).nixos-rebuild
pkgs.terraform
];
shellHook = ''
alias deploy="nixos-rebuild switch --target-host root@matri.cx --build-host root@matri.cx --flake .#eve-psr-nix0"
'';
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
nixosConfigurations = {
eve-psr-nix0 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = [
({ modulesPath, ... }: {
2023-06-26 13:26:53 -05:00
imports = [
agenix.nixosModules.default
./hardware-configuration.nix
];
nix = {
buildMachines = [ ];
distributedBuilds = false;
2023-06-26 12:37:11 -05:00
settings = {
2023-06-26 12:43:25 -05:00
auto-optimise-store = false; # https://github.com/NixOS/nix/issues/7273
2023-06-26 12:37:11 -05:00
experimental-features = [ "nix-command" "flakes" ];
};
};
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};
time.timeZone = "America/Chicago";
networking = {
hostName = "eve-psr-nix0";
firewall = {
allowedTCPPorts = [ 22 80 443 3034 ];
allowedUDPPorts = [ 22 80 443 ];
};
};
environment.systemPackages = with pkgs; [ git pciutils vim wget ];
2023-06-01 14:39:07 -05:00
2023-06-21 19:33:22 -05:00
services = {
openssh = {
enable = true;
};
2023-06-21 19:33:22 -05:00
hydra = {
enable = true;
hydraURL = "https://hydra.matri.cx";
listenHost = "192.168.0.130";
port = 3034;
extraConfig = ''
using_frontend_proxy = 1
base_uri = "https://hydra.matri.cx"
'';
2023-06-21 19:33:22 -05:00
useSubstitutes = true;
notificationSender = "hydra@matri.cx";
buildMachinesFiles = [ ];
2023-06-21 19:33:22 -05:00
};
};
virtualisation = {
oci-containers = {
backend = "podman";
containers = serviceContainers;
};
};
security.sudo.wheelNeedsPassword = false;
users = {
users = {
sezycei = {
isNormalUser = true;
2023-06-26 13:26:53 -05:00
passwordFile = self.nixosConfigurations.eve-psr-nix0.config.age.secrets.sezycei.path;
extraGroups = [ "wheel" ];
2023-06-26 12:53:48 -05:00
packages = with pkgs; [
byobu
tmux
stack
];
};
torrent = {
isNormalUser = true;
};
};
};
2023-06-26 12:53:48 -05:00
age = {
secrets = {
keys.file = ./secrets/keys.age;
sezycei.file = ./secrets/sezycei.age;
};
};
system.stateVersion = "22.11";
})
];
};
2023-06-01 14:39:07 -05:00
};
};
}