diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..4cd5115 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,73 @@ +{ config, lib, pkgs, ... }: +{ + nix.settings.substituters = + [ + "https://mirrors.ustc.edu.cn/nix-channels/store" + ]; + nix.settings.trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sdb"; + + networking.hostName = "kami"; + + time.timeZone = "Asia/Shanghai"; + + i18n.defaultLocale = "en_US.UTF-8"; + + systemd.tmpfiles.rules = [ + "d /docker-compose 0755 root root -" + "d /docker-compose/docker-root 0755 root root -" + ]; + + virtualisation.docker.enable = true; + + virtualisation.docker.daemon.settings = { + registry-mirrors = [ + "https://docker.m.daocloud.io" + "https://docker.1panel.live" + "https://hub.rat.dev" + "https://registry.docker.jp" + "https://kr.registry.ktcloud.com" + "https://docker.sg.mirror" + "https://my.mirror.docker.io" + "https://dockerhub.mirror.tw" + "https://docker.1ms.run" + ]; + + data-root = "/docker-compose/docker-root"; + }; + + users.users.kami = { + isNormalUser = true; + extraGroups = [ "wheel" "docker"]; + hashedPassword = "$6$K3dbe2DC/9mq7Y8h$0Uy/lNwnFTHAjC61imz1wWQvDo12BUtOsgbP4vRAgN9gR.RFV8ZHw/6ns16.QO1KoXNuPxxNSoYMDk1HSYq/O/"; + }; + + environment.systemPackages = with pkgs; [ + vim + curl + openssh + htop + git + neofetch + ]; + + services.openssh.enable = true; + services.openssh.settings.PasswordAuthentication = true; + + networking.firewall.enable = false; + + system.copySystemConfiguration = true; + + system.stateVersion = "25.05"; + +} + + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..f053870 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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" "floppy" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e711aad0-33cb-4635-be8c-f06e49889419"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}