Skip to content

Commit

Permalink
Setup configuration for morse
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanJ-Brady committed Feb 28, 2025
1 parent b5ae53c commit 26672bc
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 18 deletions.
30 changes: 15 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@
modules = [
./hosts/morse/configuration.nix
./hosts/morse/hardware-configuration.nix
# ./modules/nixos
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.extraSpecialArgs = {
# inherit inputs;
# };
# home-manager.users.ethan = {
# imports = [
# ./hosts/morse/home.nix
# ./modules/home
# ];
# };
# }
./modules/nixos
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.ethan = {
imports = [
./hosts/morse/home.nix
./modules/home
];
};
}
];
};

Expand Down
33 changes: 33 additions & 0 deletions hosts/morse/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{pkgs, ...}: {
imports = [
./networking.nix # generated at runtime by nixos-infect
./host.nix
];

boot.loader.grub = {
enable = true;
device = "/dev/vda";
};

nix.settings.experimental-features = ["nix-command" "flakes"];

boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
networking.hostName = "morse";
networking.domain = "";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [''ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGq2C+guMbvTa7J23p3DicQiIGKRliDqgNw7O/L0ZS1ljFmi78tP/ihiHauuj06I2qFbYkJlVxmgcoSf/L7k150='' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICY/CZ3vpiviPratsI4ygYjPAQ42Tl5vrajEJfOiQcS8 [email protected]''];
system.stateVersion = "23.11";

programs.zsh.enable = true;

environment.systemPackages = with pkgs; [
ghostty
];

users.users.ethan = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.zsh;
};
}
32 changes: 32 additions & 0 deletions hosts/morse/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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_scsi" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/4640e7ac-ce2d-448f-999c-1735c8212d93";
fsType = "ext4";
};

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.eth0.useDHCP = lib.mkDefault true;
# networking.interfaces.eth1.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
6 changes: 3 additions & 3 deletions hosts/morse/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
catppuccin.enable = true;
eza.enable = true;
fzf.enable = true;
ghostty.enable = true;
# ghostty.enable = true;
git.enable = true;
nixvim.enable = true;
oh-my-posh.enable = true;
ssh.enable = true;
tmux.enable = true;
zettel.enable = true;
# tmux.enable = true;
# zettel.enable = true;
zoxide.enable = true;
zsh.enable = true;

Expand Down
4 changes: 4 additions & 0 deletions hosts/morse/host.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{pkgs, ...}:
{
environment.systemPackages = with pkgs; [ vim ];
}
40 changes: 40 additions & 0 deletions hosts/morse/networking.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ lib, ... }: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [ "8.8.8.8"
];
defaultGateway = "209.38.64.1";
defaultGateway6 = {
address = "";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{ address="209.38.73.18"; prefixLength=20; }
{ address="10.48.0.5"; prefixLength=16; }
];
ipv6.addresses = [
{ address="fe80::b0b7:d4ff:feda:2799"; prefixLength=64; }
];
ipv4.routes = [ { address = "209.38.64.1"; prefixLength = 32; } ];
ipv6.routes = [ { address = ""; prefixLength = 128; } ];
};
eth1 = {
ipv4.addresses = [
{ address="10.124.0.2"; prefixLength=20; }
];
ipv6.addresses = [
{ address="fe80::9c45:f5ff:fefc:b24c"; prefixLength=64; }
];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="b2:b7:d4:da:27:99", NAME="eth0"
ATTR{address}=="9e:45:f5:fc:b2:4c", NAME="eth1"
'';
}

0 comments on commit 26672bc

Please sign in to comment.