2023-09-22 12:56:48 -05:00
|
|
|
{
|
2023-10-03 11:52:44 -05:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
inputs,
|
2024-01-04 17:20:02 -06:00
|
|
|
outputs,
|
2023-10-03 11:52:44 -05:00
|
|
|
system,
|
2023-10-06 01:11:27 -05:00
|
|
|
pkgs,
|
2024-01-04 17:20:02 -06:00
|
|
|
modulesPath,
|
2023-10-03 11:52:44 -05:00
|
|
|
...
|
2023-10-06 01:11:27 -05:00
|
|
|
}: {
|
2024-01-02 18:54:46 -06:00
|
|
|
networking.hostName = lib.mkDefault "nixoslyte";
|
|
|
|
|
2024-01-04 17:20:02 -06:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
2024-01-04 18:55:30 -06:00
|
|
|
inputs.sops-nix.nixosModules.sops
|
2024-01-04 17:20:02 -06:00
|
|
|
inputs.disko.nixosModules.disko
|
|
|
|
inputs.home-manager.nixosModules.home-manager
|
|
|
|
]
|
|
|
|
++ (with outputs.nixosModules; [
|
2024-01-09 16:46:31 -06:00
|
|
|
# avahi
|
2024-01-04 22:29:12 -06:00
|
|
|
daniel
|
2024-01-04 17:20:02 -06:00
|
|
|
]);
|
2023-10-03 14:50:00 -05:00
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
2023-09-06 01:20:43 -05:00
|
|
|
services.journald.extraConfig = "SystemMaxUse=1G";
|
2023-09-05 23:11:14 -05:00
|
|
|
|
|
|
|
environment = {
|
|
|
|
variables = {
|
|
|
|
EDITOR = "hx";
|
|
|
|
VISUAL = "hx";
|
|
|
|
PAGER = "less";
|
|
|
|
MANPAGER = "less";
|
|
|
|
};
|
|
|
|
|
2024-01-09 16:46:31 -06:00
|
|
|
systemPackages = with pkgs; [
|
|
|
|
# age
|
|
|
|
# bat
|
|
|
|
# bc
|
|
|
|
# bind
|
|
|
|
# bottom
|
|
|
|
# btrfs-progs
|
|
|
|
# cue
|
|
|
|
curl
|
|
|
|
# dogdns
|
|
|
|
dua
|
|
|
|
eza
|
|
|
|
fd
|
|
|
|
file
|
|
|
|
fzf
|
|
|
|
gnumake
|
|
|
|
# gron
|
|
|
|
# hexyl
|
|
|
|
iputils
|
|
|
|
# jq
|
|
|
|
killall
|
|
|
|
less
|
|
|
|
mosh
|
|
|
|
# nmap
|
|
|
|
nettools
|
|
|
|
openssl
|
|
|
|
# pciutils
|
|
|
|
# pv
|
|
|
|
# rclone
|
|
|
|
# restic
|
|
|
|
ripgrep
|
|
|
|
rsync
|
|
|
|
# rtx
|
|
|
|
sd
|
|
|
|
# sops
|
|
|
|
smartmontools
|
|
|
|
# sqlite
|
|
|
|
# skim
|
|
|
|
# sysstat
|
|
|
|
unzip
|
|
|
|
# usbutils
|
|
|
|
# watchexec
|
|
|
|
wget
|
|
|
|
# xh
|
|
|
|
zellij
|
|
|
|
inputs.home-manager.packages.${system}.home-manager
|
|
|
|
inputs.helix.packages.${system}.helix
|
|
|
|
# zstd
|
|
|
|
];
|
2023-09-05 23:11:14 -05:00
|
|
|
};
|
|
|
|
|
2023-10-18 09:14:19 -05:00
|
|
|
users.groups.daniel = {};
|
|
|
|
|
2023-09-05 22:39:17 -05:00
|
|
|
users.users = {
|
|
|
|
daniel = {
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/daniel/.home";
|
2023-12-04 09:15:37 -06:00
|
|
|
createHome = true;
|
2023-09-05 22:39:17 -05:00
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
|
|
|
|
];
|
2023-09-06 00:57:08 -05:00
|
|
|
group = "daniel";
|
2023-10-27 21:46:38 -05:00
|
|
|
extraGroups = ["users" "wheel" "video" "dialout" "uucp"];
|
2023-10-03 11:52:44 -05:00
|
|
|
packages = [];
|
2023-09-05 22:39:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
root = {
|
|
|
|
openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
i18n = {
|
|
|
|
defaultLocale = "en_US.UTF-8";
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
xserver = {
|
|
|
|
layout = "us";
|
|
|
|
xkbOptions = "ctrl:nocaps";
|
|
|
|
};
|
|
|
|
|
|
|
|
openssh = {
|
|
|
|
enable = true;
|
2023-09-05 23:11:14 -05:00
|
|
|
|
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
};
|
|
|
|
|
2023-10-05 10:41:31 -05:00
|
|
|
openFirewall = lib.mkDefault false;
|
2023-09-05 23:11:14 -05:00
|
|
|
|
|
|
|
# listenAddresses = [
|
|
|
|
# { addr = "0.0.0.0"; port = 22; }
|
|
|
|
# ];
|
|
|
|
};
|
|
|
|
|
|
|
|
tailscale = {
|
|
|
|
enable = true;
|
|
|
|
useRoutingFeatures = lib.mkDefault "client";
|
2023-09-05 22:39:17 -05:00
|
|
|
};
|
2023-09-05 23:51:32 -05:00
|
|
|
|
|
|
|
fwupd.enable = true;
|
|
|
|
smartd.enable = true;
|
2023-09-05 22:39:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
console = {
|
|
|
|
font = "Lat2-Terminus16";
|
|
|
|
useXkbConfig = true;
|
|
|
|
earlySetup = true;
|
|
|
|
|
2024-01-04 22:29:12 -06:00
|
|
|
colors = with outputs.colors; [
|
2023-10-05 10:41:31 -05:00
|
|
|
bg
|
|
|
|
red
|
|
|
|
green
|
|
|
|
orange
|
|
|
|
blue
|
|
|
|
purple
|
|
|
|
yellow
|
|
|
|
fg3
|
|
|
|
fgdim
|
|
|
|
red
|
|
|
|
green
|
|
|
|
orange
|
|
|
|
blue
|
|
|
|
purple
|
|
|
|
yellow
|
|
|
|
fg
|
2023-09-19 20:56:24 -05:00
|
|
|
];
|
2023-09-05 22:39:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
useDHCP = lib.mkDefault true;
|
2023-09-05 23:11:14 -05:00
|
|
|
|
|
|
|
firewall = {
|
|
|
|
enable = lib.mkDefault true;
|
|
|
|
allowPing = lib.mkDefault true;
|
2023-10-05 10:41:31 -05:00
|
|
|
allowedTCPPorts = lib.mkDefault [];
|
2023-10-03 11:52:44 -05:00
|
|
|
allowedUDPPorts = lib.mkDefault [];
|
2023-09-05 23:11:14 -05:00
|
|
|
};
|
2023-10-10 14:29:31 -05:00
|
|
|
|
2024-01-02 18:54:46 -06:00
|
|
|
# TODO: podman equivalent?
|
2023-10-10 14:29:31 -05:00
|
|
|
extraHosts = ''
|
|
|
|
::1 host.docker.internal
|
|
|
|
127.0.0.1 host.docker.internal
|
|
|
|
'';
|
2023-09-05 22:39:17 -05:00
|
|
|
};
|
|
|
|
|
2023-09-05 23:51:32 -05:00
|
|
|
programs = {
|
|
|
|
fish = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
tmux = {
|
|
|
|
enable = true;
|
|
|
|
clock24 = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
traceroute.enable = true;
|
|
|
|
|
|
|
|
git = {
|
|
|
|
enable = true;
|
2023-11-07 17:09:05 -06:00
|
|
|
package = pkgs.gitFull;
|
2023-09-05 23:51:32 -05:00
|
|
|
|
|
|
|
lfs = {
|
2023-09-05 22:39:17 -05:00
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
2023-09-28 12:29:21 -05:00
|
|
|
|
|
|
|
# https://github.com/nix-community/home-manager/issues/3113
|
|
|
|
dconf.enable = true;
|
2023-09-05 23:51:32 -05:00
|
|
|
};
|
2023-09-05 22:39:17 -05:00
|
|
|
|
|
|
|
time = {
|
|
|
|
timeZone = "America/Chicago";
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
defaultUserShell = pkgs.fish;
|
|
|
|
};
|
2023-10-27 21:46:38 -05:00
|
|
|
|
2024-01-02 18:54:46 -06:00
|
|
|
# TODO: should not be in common?
|
|
|
|
# services.udev.extraRules = ''
|
|
|
|
# # https://betaflight.com/docs/wiki/archive/Installing-Betaflight#step-1
|
|
|
|
# # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"
|
|
|
|
# # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"'
|
|
|
|
# '';
|
2024-01-04 17:20:02 -06:00
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
# You can add overlays here
|
|
|
|
overlays = [
|
|
|
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
|
|
|
outputs.overlays.additions
|
|
|
|
outputs.overlays.modifications
|
|
|
|
outputs.overlays.unstable-packages
|
|
|
|
|
|
|
|
# You can also add overlays exported from other flakes:
|
|
|
|
# neovim-nightly-overlay.overlays.default
|
|
|
|
|
|
|
|
# Or define it inline, for example:
|
|
|
|
# (final: prev: {
|
|
|
|
# hi = final.hello.overrideAttrs (oldAttrs: {
|
|
|
|
# patches = [ ./change-hello-to-hi.patch ];
|
|
|
|
# });
|
|
|
|
# })
|
|
|
|
];
|
|
|
|
# Configure your nixpkgs instance
|
|
|
|
config = {
|
|
|
|
# Disable if you don't want unfree packages
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
# This will add each flake input as a registry
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
|
|
|
|
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
trusted-users = ["root" "daniel"];
|
|
|
|
experimental-features = lib.mkDefault ["nix-command" "flakes"];
|
|
|
|
substituters = [
|
|
|
|
"https://cache.nixos.org/"
|
|
|
|
"https://helix.cachix.org"
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://nix.h.lyte.dev"
|
|
|
|
];
|
|
|
|
trusted-public-keys = [
|
|
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
|
|
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
|
|
|
|
];
|
|
|
|
auto-optimise-store = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# registry = {
|
|
|
|
# self.flake = inputs.self;
|
|
|
|
|
|
|
|
# nixpkgs = {
|
|
|
|
# from = {
|
|
|
|
# id = "nixpkgs";
|
|
|
|
# type = "indirect";
|
|
|
|
# };
|
|
|
|
# flake = inputs.nixpkgs;
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = lib.mkDefault "23.11";
|
2023-09-05 22:39:17 -05:00
|
|
|
}
|