#author("2025-03-23T20:48:22+00:00","","") #author("2025-03-23T20:50:04+00:00","","") *NixOS configuration.nix 初期状態 [#k8432c3b] **作り方 [#q0f6f21a] -ライブISOイメージ : # nixos-generate-config --root /mnt -稼働済み環境から : $ sudo nixos-generate-config **現在の初期ファイル一覧 [#rf4b85e3] -[[最新>Tips/Lin/Nix/Config/Current]] **BIOS/EFI [#we7ff754] -初期ファイル [[24.05>Tips/Lin/Nix/Config/Init/24.05]] / [[24.11>Tips/Lin/Nix/Config/Init/24.11]] に移動しました。 **日本語環境としての最小限のnixファイル [#l2dd7d93] ***コメントあり [#xc4992d7] #highlightjs(nix) { config, lib, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; ########## BIOS / MBR の場合 ########## # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only ########## EFI / GPT の場合 ########## # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "nixos"; # Define your hostname. # Pick only one of the below networking options. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. # Set your time zone. # time.timeZone = "Europe/Amsterdam"; time.timeZone = "Asia/Tokyo"; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; console = { # font = "Lat2-Terminus16"; keyMap = "jp106"; # useXkbConfig = true; # use xkb.options in tty. }; # Enable the X11 windowing system. # services.xserver.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.nixos = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. packages = with pkgs; [ # firefox # tree ]; }; # List packages installed in system profile. To search, run: # $ nix search wget # environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget # ]; # List services that you want to enable: # Enable the OpenSSH daemon. services.openssh.enable = true; # Open ports in the firewall. # Or disable the firewall altogether. # networking.firewall.enable = false; # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.11"; # Did you read the comment? } - 注 : git ならびにマージアプリ (diff とか WinMergeとか)に配慮して一部英語コメントは残したままにしています。 ***コメントなし (EFI) [#mce5038c] #highlightjs(nix) { config, lib, pkgs, ... }: { imports = [ ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "nixos"; networking.networkmanager.enable = true; time.timeZone = "Asia/Tokyo"; i18n.defaultLocale = "en_US.UTF-8"; console = { keyMap = "jp106"; }; users.users.nixos = { isNormalUser = true; extraGroups = [ "wheel" ]; packages = with pkgs; [ ]; }; services.openssh.enable = true; system.stateVersion = "24.05"; system.stateVersion = "24.11"; }