Skip to content

Commit

Permalink
add haystack config
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Sawyer committed Aug 27, 2024
1 parent 7cd3c2c commit 44ccb31
Show file tree
Hide file tree
Showing 4 changed files with 1,203 additions and 0 deletions.
73 changes: 73 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,79 @@

# linux
nixosConfigurations = {
"haystack" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./hardware/haystack.nix
./modules/nixos.nix
({ pkgs, ... }: import ./modules/k3s {
inherit pkgs;
listenerURL = "https://0.0.0.0:6443";
})
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.sawyer = ({ config, lib, pkgs, ... }:
import ./home/haystack.nix {
inherit config lib pkgs;
username = "sawyer";
});
}
({ pkgs, ... }: {
system.stateVersion = "22.11";
users.users.sawyer = {
isNormalUser = true;
home = "/home/sawyer";
description = "Matt Sawyer";
extraGroups = [ "wheel" "networkmanager" "docker" ];
shell = pkgs.zsh;
};
users.users.sawyer.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1g1AytlaSn6IgGptJI41eQ66yi4hXYMLNRk3GBxWVE m.sawyer@KD21QWDKW7"
];
networking = {
networkmanager.enable = true;
hostName = "haystack";
nameservers = [ "172.27.1.1" "1.0.0.1" "8.8.4.4" ];
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
22 # ssh
2022 # et
6443 # k3s
];
};
};
i18n.defaultLocale = "en_US.UTF-8";
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
settings = {
allowed-users = [ "sawyer" "@wheel" ];
trusted-users = [ "sawyer" "@wheel" ];
};
};
programs.ssh = {
startAgent = true;
agentTimeout = "1h";
};
#programs.tmux.enable = true;
programs.zsh.enable = true;
services.eternal-terminal.enable = true;
services.openssh.enable = true;
time.timeZone = "America/Los_Angeles";
virtualisation.docker.enable = true;
virtualisation.docker.extraOptions = "--bip 192.168.10.1/24";
})
]; # modules
}; # haystack

"sawyer-dev" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
Expand Down
36 changes: 36 additions & 0 deletions hardware/haystack.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];

boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f";
fsType = "ext4";
};

fileSystems."/boot" =
{ device = "systemd-1";
fsType = "autofs";
};

swapDevices = [ ];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
Loading

0 comments on commit 44ccb31

Please sign in to comment.