From 3dbfc323e6ecb6cbddeb971eca9b9c77f7b743a1 Mon Sep 17 00:00:00 2001 From: RootHost-Stormwind Date: Mon, 13 Jan 2025 00:46:22 +0100 Subject: [PATCH] initial commit --- bootloader.nix | 8 ++++++++ configuration.nix | 31 +++++++++++++++++++++++++++++ hardware-configuration.nix | 40 ++++++++++++++++++++++++++++++++++++++ misc.nix | 31 +++++++++++++++++++++++++++++ networking.nix | 9 +++++++++ packages.nix | 13 +++++++++++++ sshd.nix | 9 +++++++++ user/stormwind/git.nix | 15 ++++++++++++++ user/stormwind/user.nix | 32 ++++++++++++++++++++++++++++++ 9 files changed, 188 insertions(+) create mode 100644 bootloader.nix create mode 100644 configuration.nix create mode 100644 hardware-configuration.nix create mode 100644 misc.nix create mode 100644 networking.nix create mode 100644 packages.nix create mode 100644 sshd.nix create mode 100644 user/stormwind/git.nix create mode 100644 user/stormwind/user.nix diff --git a/bootloader.nix b/bootloader.nix new file mode 100644 index 0000000..42d28e8 --- /dev/null +++ b/bootloader.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} + diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..fbe9fcb --- /dev/null +++ b/configuration.nix @@ -0,0 +1,31 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz"; +in + +{ + imports = [ + ./hardware-configuration.nix + ./bootloader.nix + ./networking.nix + ./misc.nix + ./packages.nix + (import "${home-manager}/nixos") + ./user/stormwind/user.nix + ./sshd.nix + ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..68c3d78 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f8ce741e-1a4d-469d-bc6c-0777c1c84423"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/802B-4F26"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/7e34cdc3-bd48-435a-8ea2-e1fe43926262"; } + ]; + + # 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.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/misc.nix b/misc.nix new file mode 100644 index 0000000..47af878 --- /dev/null +++ b/misc.nix @@ -0,0 +1,31 @@ +{ config, ... }: + +{ + # 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"; +} + diff --git a/networking.nix b/networking.nix new file mode 100644 index 0000000..a16515e --- /dev/null +++ b/networking.nix @@ -0,0 +1,9 @@ +{ config, ... }: + +{ + networking = { + hostName = "Stormwind"; + networkmanager.enable = true; + }; +} + diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..ccccfab --- /dev/null +++ b/packages.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + neovim + ]; +} + diff --git a/sshd.nix b/sshd.nix new file mode 100644 index 0000000..bd049c2 --- /dev/null +++ b/sshd.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + services.openssh = { + enable = true; + passwordAuthentication = true; + }; +} + diff --git a/user/stormwind/git.nix b/user/stormwind/git.nix new file mode 100644 index 0000000..84ea877 --- /dev/null +++ b/user/stormwind/git.nix @@ -0,0 +1,15 @@ +{ config, ... }: + +{ + programs.git = { + enable = true; + userName = "RootHost-Stormwind"; + userEmail = "RootHost-Stormwind@ze.mawtrixx.net"; + extraConfig = { + init = { + defaultBranch = "master"; + }; + }; + }; +} + diff --git a/user/stormwind/user.nix b/user/stormwind/user.nix new file mode 100644 index 0000000..e3c8939 --- /dev/null +++ b/user/stormwind/user.nix @@ -0,0 +1,32 @@ +{ config, pkgs, ... }: + +{ + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.stormwind = { + isNormalUser = true; + description = "stormwind"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; []; + + openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsZZ1qSy+cu1QMlPoZZ2ovv8G+4OIyI07/di68F7NtZ leon macbook'' + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCtoTBVNYtsmDLM6vB2PjWIsJ+8gzzTe+j/uFT6usF/rudJN7SU9iSvoQkJhximjcK7ZWbRKJyX84aOv4b/S5ZD5vduxkb+oJlp2dGUagNYkhVTTRhkfgVKmTceD2jlauAIELlCQEm1Y3REEGZHkatc6Hy8yHtqYLixClF3fvO8NAE9NyC7ntgiKkFNhC7UjmCVAA0T97mYAvd5Q7kAeBzcU6Hcz7WsASwHoTxwUcTdqMjZXghxPgN8R+4zNr5P9PYNI2i+F2OzFxqr7Ipg9QbTSgDU+wtTWEvwxeUmZMJTf4xmjF/WmU9NxP61bbtC8U1k31hOqbKXar//oACa/XKLtaqyWiN/iEwWeiGD2WcJizRq+y8Y6mfgXHbogB7Ro7/vSlSkccSs+Ibeu4u8/wjVWQTu7cO3ZG/R4HYsW/tFLdMCzeYWFim19m3EuGpZfKFv7fzlG4Xm9XZFjpROEZPGdYPN0gI4zzVe1Xh/y5oxM1/gQwolRSnT8sFrQpv0x04dZbmV8ub+AygGNfXN8UlYkBjEZVKRzDwbSCvIikNh18V7cvTlD1wCludIwL6XCGWiOuGBE797qkr3Wy+wS5yDp+9CQeqWnqz6k6A4j6oBKZzwxfhMBauZCBnAcI5K9BwxzAG24EgpdjJ9vk7kOq41qdxj5esiC58nFdZB0MaE6Q== leon-macbook-key'' + ]; + }; + + home-manager.users.stormwind = { pkgs, ... }: { + imports = + [ + ./git.nix + ]; + + home.stateVersion = "24.11"; + }; + + # Enable automatic login for the user. + services.getty.autologinUser = "stormwind"; +} +