dotfiles/nix-conf/system/configuration.nix

62 lines
1.7 KiB
Nix
Raw Permalink Normal View History

{ lib, pkgs, config, modulesPath, specialArgs, ... }:
let
hostname = specialArgs.hostname;
enableSSH = specialArgs.enableSSH or true;
_networking = lib.recursiveUpdate { hostName = hostname; } (specialArgs._networking or { });
_boot = specialArgs._boot or { };
_services = specialArgs._services or { };
includeHardware = specialArgs.includeHardware or true;
proj_root = builtins.toString ./../..;
in
2022-08-30 14:29:44 +00:00
with lib;
{
imports = (if includeHardware then [
"${proj_root}/hosts/${hostname}/hardware-configuration.nix"
2022-11-15 22:44:56 +00:00
] else [ ]) ++ [
"${modulesPath}/profiles/minimal.nix"
"${proj_root}/modules/tailscale.sys.nix"
"${proj_root}/modules/mosh.sys.nix"
2022-08-30 14:29:44 +00:00
];
boot = _boot;
2022-08-30 14:29:44 +00:00
2022-12-21 10:37:03 +00:00
# prune old builds
nix.settings.auto-optimise-store = true;
2022-08-30 14:29:44 +00:00
# Enable nix flakes
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
2022-11-14 22:10:46 +00:00
users.users.hungtr = {
2022-11-15 22:44:56 +00:00
isNormalUser = true;
home = "/home/hungtr";
description = "pegasust/hungtr";
2023-01-13 06:42:21 +00:00
extraGroups = [ "wheel" "networkmanager" "audio" ];
};
users.users.root = {
# openssh runs in root, no? This is because port < 1024 requires root.
2022-12-27 04:22:07 +00:00
openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile "${proj_root}/native_configs/ssh/authorized_keys");
2022-11-14 18:01:39 +00:00
};
2022-08-30 14:29:44 +00:00
2022-11-06 20:23:10 +00:00
# Some basic programs
2022-08-30 14:29:44 +00:00
programs.neovim = {
2022-11-15 22:44:56 +00:00
enable = true;
defaultEditor = true;
2022-08-30 14:29:44 +00:00
};
2022-11-14 18:01:39 +00:00
2022-08-30 14:29:44 +00:00
programs.git = {
2022-11-15 22:44:56 +00:00
enable = true;
# more information should be configured under user level
# See other config at @/home-nix
2022-08-30 14:29:44 +00:00
};
2022-11-14 18:01:39 +00:00
2022-08-30 14:29:44 +00:00
environment.systemPackages = [
2022-11-15 22:44:56 +00:00
pkgs.gnumake
pkgs.wget
pkgs.inetutils # network diag
2022-11-24 02:14:25 +00:00
pkgs.mtr # network diag
pkgs.sysstat # sys diag
2022-08-30 14:29:44 +00:00
];
2022-11-15 22:44:56 +00:00
}
2022-11-14 18:01:39 +00:00