2023-11-18 02:57:07 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2023-12-10 15:56:40 +00:00
|
|
|
inputs,
|
2023-12-25 14:27:42 +00:00
|
|
|
pkgs,
|
2023-11-18 02:57:07 +00:00
|
|
|
...
|
|
|
|
}: {
|
2024-05-23 16:15:10 +00:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardening
|
|
|
|
./networking
|
|
|
|
./nix
|
2024-06-10 07:22:23 +00:00
|
|
|
./fun.nix
|
2024-05-23 16:15:10 +00:00
|
|
|
]
|
|
|
|
++ (with inputs; [
|
|
|
|
aagl.nixosModules.default
|
|
|
|
disko.nixosModules.disko
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
impermanence.nixosModules.impermanence
|
|
|
|
lanzaboote.nixosModules.lanzaboote
|
|
|
|
nixos-sensible.nixosModules.default
|
|
|
|
nur.nixosModules.nur
|
|
|
|
self.nixosModules.default
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
]);
|
2023-12-10 15:56:40 +00:00
|
|
|
|
2024-02-06 10:05:14 +00:00
|
|
|
nixpkgs.overlays = [
|
2024-05-01 00:18:54 +00:00
|
|
|
inputs.self.overlays.patches
|
2024-02-06 10:05:14 +00:00
|
|
|
];
|
|
|
|
|
2024-01-17 04:47:27 +00:00
|
|
|
### home-manager
|
2024-03-26 08:49:35 +00:00
|
|
|
home-manager.users.guanranwang = import ../../../../home;
|
2024-01-17 04:47:27 +00:00
|
|
|
|
2023-12-16 08:58:10 +00:00
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
|
|
|
extraSpecialArgs = {inherit inputs;}; # ??? isnt specialArgs imported by default ???
|
|
|
|
};
|
2023-10-16 08:26:06 +00:00
|
|
|
|
2024-04-22 14:34:20 +00:00
|
|
|
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_zen;
|
2023-11-20 12:21:34 +00:00
|
|
|
|
2023-12-16 08:58:10 +00:00
|
|
|
### Default Programs
|
2024-02-22 17:03:13 +00:00
|
|
|
# In addition of https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-path.nix
|
2023-12-25 14:27:42 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
unzip
|
|
|
|
wget
|
|
|
|
tree
|
|
|
|
file
|
|
|
|
htop
|
|
|
|
|
|
|
|
lsof
|
|
|
|
ltrace
|
2024-03-05 22:02:22 +00:00
|
|
|
strace
|
2023-12-25 14:27:42 +00:00
|
|
|
|
|
|
|
dnsutils
|
|
|
|
pciutils
|
|
|
|
usbutils
|
|
|
|
];
|
2024-03-05 22:02:22 +00:00
|
|
|
|
2023-12-16 08:58:10 +00:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2024-04-22 18:35:50 +00:00
|
|
|
settings.PermitRootLogin = lib.mkDefault "no"; # mkDefault for colmena
|
2023-12-16 08:58:10 +00:00
|
|
|
settings.PasswordAuthentication = false;
|
|
|
|
};
|
2024-03-05 22:02:22 +00:00
|
|
|
|
2024-06-05 09:50:46 +00:00
|
|
|
users.users = rec {
|
|
|
|
"guanranwang" = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "Guanran Wang";
|
|
|
|
hashedPasswordFile = config.sops.secrets."hashed-passwd".path;
|
|
|
|
shell = pkgs.fish;
|
|
|
|
extraGroups = [
|
|
|
|
"wheel"
|
|
|
|
"nix-access-tokens"
|
|
|
|
];
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
# same as git signing
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMmd/uqiBahzKcKMJ+gT3dkUIdrWQgudspsDchDlx1E/ guanran928@outlook.com"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
"root" = {
|
|
|
|
openssh.authorizedKeys.keys = guanranwang.openssh.authorizedKeys.keys;
|
|
|
|
};
|
2024-01-17 04:47:27 +00:00
|
|
|
};
|
|
|
|
|
2024-03-05 22:02:22 +00:00
|
|
|
programs.dconf.enable = true;
|
2024-01-17 04:47:27 +00:00
|
|
|
programs.fish.enable = true;
|
|
|
|
users.groups."nix-access-tokens" = {};
|
|
|
|
nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}";
|
|
|
|
|
|
|
|
### sops-nix
|
|
|
|
sops = {
|
|
|
|
defaultSopsFile = ../../../../secrets.yaml;
|
|
|
|
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
|
|
|
gnupg.sshKeyPaths = [];
|
|
|
|
secrets = {
|
|
|
|
"hashed-passwd" = {
|
|
|
|
neededForUsers = true;
|
|
|
|
};
|
|
|
|
"nix-access-tokens" = {
|
|
|
|
group = config.users.groups."nix-access-tokens".name;
|
|
|
|
mode = "0440";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-09-19 00:17:43 +00:00
|
|
|
}
|