2024-04-04 00:50:53 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-04-05 01:44:59 +02:00
|
|
|
inputs,
|
2024-06-05 06:33:32 +02:00
|
|
|
lib,
|
2024-04-04 00:50:53 +02:00
|
|
|
...
|
2024-06-12 21:40:04 +02:00
|
|
|
}: let
|
|
|
|
# hash for "nixos"
|
|
|
|
defaultPasswordHash = "$y$j9T$u0O3PELyRv3GOemCReQhA0$Qb4Sl6dXnafYwZeDYrJGwS4xp3v6vGriWFMYomHH2w3";
|
|
|
|
in {
|
2024-04-04 00:50:53 +02:00
|
|
|
nix = {
|
2024-11-06 14:00:50 +01:00
|
|
|
package = pkgs.nixVersions.stable;
|
2024-04-04 00:50:53 +02:00
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
2024-05-07 02:05:40 +02:00
|
|
|
optimise.automatic = true;
|
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
2024-06-06 21:38:39 +02:00
|
|
|
trusted-users = ["root" "gabe"];
|
2024-05-07 02:05:40 +02:00
|
|
|
};
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
};
|
2024-04-04 00:50:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Allow unfree packages
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
2024-10-01 16:58:28 +02:00
|
|
|
time.timeZone = lib.mkDefault "Europe/Berlin";
|
2024-06-05 06:33:32 +02:00
|
|
|
# Select internationalisation properties.
|
|
|
|
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
|
|
|
|
|
|
|
|
# Configure keymap in X11
|
|
|
|
services.xserver = {
|
|
|
|
xkb.layout = lib.mkDefault "us";
|
|
|
|
xkb.variant = lib.mkDefault "";
|
|
|
|
};
|
|
|
|
|
2024-04-04 00:50:53 +02:00
|
|
|
# packages that should be on every system.
|
2024-09-30 16:06:17 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
neovim
|
|
|
|
rsync
|
|
|
|
];
|
2024-06-05 20:39:25 +02:00
|
|
|
|
|
|
|
programs.zsh.enable = lib.mkDefault true;
|
|
|
|
environment.shells = lib.mkDefault [pkgs.zsh];
|
2024-06-12 21:40:04 +02:00
|
|
|
# if we arent setting our password from nix secrets, we need to allow changing it.
|
|
|
|
users.mutableUsers = !inputs ? nix-secrets;
|
2024-06-05 20:39:25 +02:00
|
|
|
users.users.${config.host.user} = {
|
|
|
|
isNormalUser = true;
|
2024-06-12 21:40:04 +02:00
|
|
|
hashedPassword =
|
|
|
|
if inputs ? nix-secrets
|
|
|
|
then (lib.removeSuffix "\n" (builtins.readFile "${inputs.nix-secrets}/password-hash"))
|
|
|
|
else defaultPasswordHash;
|
2024-06-05 20:39:25 +02:00
|
|
|
description = config.host.fullName;
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
extraGroups = ["wheel"];
|
|
|
|
};
|
2024-06-12 21:40:04 +02:00
|
|
|
users.users.root.password =
|
|
|
|
if inputs ? nix-secrets
|
|
|
|
then (lib.removeSuffix "\n" (builtins.readFile "${inputs.nix-secrets}/password-hash"))
|
|
|
|
else defaultPasswordHash;
|
2024-04-05 01:44:59 +02:00
|
|
|
|
2024-05-31 19:01:32 +02:00
|
|
|
imports = [
|
2024-08-07 05:21:41 +02:00
|
|
|
../../modules/nixos
|
2024-05-31 19:01:32 +02:00
|
|
|
];
|
|
|
|
|
2024-04-05 01:44:59 +02:00
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2024-06-10 23:19:36 +02:00
|
|
|
home-manager.extraSpecialArgs = {inherit inputs;};
|
2024-04-04 00:50:53 +02:00
|
|
|
}
|