diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..1b30ea0 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,88 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./modules/users/users.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + boot.loader.grub.useOSProber = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + # Networking + networking.hostName = "testVM"; # Define your hostname. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.cerberus = { + # isNormalUser = true; + # description = "cerberus"; + # extraGroups = [ "networkmanager" "wheel" ]; + # packages = with pkgs; []; + # }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + wget + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + system.stateVersion = "25.05"; # Did you read the comment? + +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..c8a132c --- /dev/null +++ b/nixos/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 = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/d8739aa2-bc9a-400b-a2ac-81b102ae311d"; + 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/nixos/modules/system/locale.nix b/nixos/modules/system/locale.nix new file mode 100644 index 0000000..e69de29 diff --git a/nixos/modules/system/networking.nix b/nixos/modules/system/networking.nix new file mode 100644 index 0000000..e69de29 diff --git a/nixos/modules/users/packages.nix b/nixos/modules/users/packages.nix new file mode 100644 index 0000000..36da781 --- /dev/null +++ b/nixos/modules/users/packages.nix @@ -0,0 +1,12 @@ +{config, pkgs, ...}: + +{ + users.users.users.packages = with pkgs; [ + btop + ncdu + tmux + curl + bat + nethogs + ] +} diff --git a/nixos/modules/users/users.nix b/nixos/modules/users/users.nix new file mode 100644 index 0000000..d35d777 --- /dev/null +++ b/nixos/modules/users/users.nix @@ -0,0 +1,14 @@ +{config, pkgs, ...}: + +{ + imports = [ + ./zsh.nix + ]; + # Define user account and dont forget to set a password with 'passwd' + users.users.cerberus = { + isNormalUser = true; + description = "cerberus"; + extraGroups = [ "networkmanager" "wheel" ]; + shell = pkgs.zsh; + }; +} diff --git a/nixos/modules/users/zsh.nix b/nixos/modules/users/zsh.nix new file mode 100644 index 0000000..2dd2f98 --- /dev/null +++ b/nixos/modules/users/zsh.nix @@ -0,0 +1,36 @@ +{config, pkgs, ...}: + +{ + users.users.cerberus.packages = with pkgs; [ + zoxide + fzf + ]; + # ZSH configuration + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + histSize = 10000; + histFile = "$HOME/.zsh_history"; + setOptions = [ + "HIST_IGNORE_ALL_DUPS" + "APPEND_HISTORY" + "SHARE_HISTORY" + "HIST_IGNORE_SPACE" + "EXTENDED_GLOB" + "CORRECT" + ]; + shellInit = '' + eval "$(zoxide init zsh)" + eval "$(fzf --zsh)" + ''; + }; + + # Setting aliases + environment.shellAliases = { + ls = "ls -l --color --hyperlink=auto"; + # ".." = "cd .."; + # "..." = "cd ../.." + }; +}