Aktuelle Version |
Dein Text |
Zeile 6: |
Zeile 6: |
|
| |
|
| * https://florianfranke.dev/posts/2020/03/installing-nixos-with-encrypted-zfs-on-a-netcup.de-root-server/ | | * https://florianfranke.dev/posts/2020/03/installing-nixos-with-encrypted-zfs-on-a-netcup.de-root-server/ |
| * https://nixos.wiki/wiki/ZFS
| |
| * https://gist.github.com/byrongibson/1578914d03a5c0a01a13f9ec53ee0b0a
| |
| * https://www.reddit.com/r/NixOS/comments/o1er2p/comment/h22f1b9/
| |
|
| |
| == SnowflakeOS ==
| |
|
| |
| ; 2023-02-13:
| |
|
| |
| ==== SnowflakeOS hardware-configuration.nix ====
| |
|
| |
| : <code>less /etc/nixos/hardware-configuration.nix</code>
| |
| <pre></pre>
| |
| <pre>
| |
| { config, lib, pkgs, modulesPath, ... }:
| |
|
| |
| {
| |
| imports =
| |
| [ (modulesPath + "/installer/scan/not-detected.nix")
| |
| ];
| |
| </pre>
| |
| <pre>
| |
| boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
| |
| boot.initrd.kernelModules = [ ];
| |
| boot.kernelModules = [ "kvm-intel" ];
| |
| boot.extraModulePackages = [ ];
| |
| </pre>
| |
| <pre>
| |
| fileSystems."/" =
| |
| { device = "/dev/disk/by-uuid/5273542a-08f3-4012-abc0-517ca8a0c5c7";
| |
| fsType = "ext4";
| |
| };
| |
|
| |
| fileSystems."/boot/efi" =
| |
| { device = "/dev/disk/by-uuid/0F19-DD1A";
| |
| fsType = "vfat";
| |
| };
| |
| </pre>
| |
| <pre>
| |
| swapDevices = [ ];
| |
| </pre>
| |
| <pre>
| |
| networking.useDHCP = lib.mkDefault true;
| |
| # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
| |
| </pre>
| |
| <pre>
| |
| nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
| |
| </pre>
| |
| <pre>
| |
| powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
| |
| </pre>
| |
| <pre>
| |
| hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
| |
| </pre>
| |
| <pre>
| |
| }
| |
| </pre>
| |
|
| |
| ==== SnowflakeOS configuration.nix ====
| |
|
| |
| : <code>less /etc/nixos/configuration.nix</code>
| |
| <pre></pre>
| |
| <pre>
| |
| { config, pkgs, ... }:
| |
|
| |
| {
| |
| imports =
| |
| [ # Include the results of the hardware scan.
| |
| ./hardware-configuration.nix
| |
| ];
| |
| </pre>
| |
| <pre>
| |
| system.stateVersion = "23.05"; # Did you read the comment?
| |
| </pre>
| |
| <pre>
| |
| nix.extraOptions = ''
| |
| experimental-features = nix-command flakes
| |
| '';
| |
| </pre>
| |
| <pre>
| |
| # Bootloader.
| |
| boot.loader.systemd-boot.enable = true;
| |
| boot.loader.efi.canTouchEfiVariables = true;
| |
| boot.loader.efi.efiSysMountPoint = "/boot/efi";
| |
| </pre>
| |
| <pre>
| |
| # Define your hostname.
| |
| networking.hostName = "snowflakeos";
| |
| </pre>
| |
| <pre>
| |
| # Enable networking
| |
| networking.networkmanager.enable = true;
| |
| </pre>
| |
| <pre>
| |
| # Set your time zone.
| |
| time.timeZone = "Europe/Berlin";
| |
| </pre>
| |
| <pre>
| |
| # Select internationalisation properties.
| |
| i18n.defaultLocale = "en_US.UTF-8";
| |
| </pre>
| |
| <pre>
| |
| # Set the keyboard layout.
| |
| services.xserver.layout = "de";
| |
| console.useXkbConfig = true;
| |
| </pre>
| |
| <pre>
| |
| # Enable the X11 windowing system.
| |
| services.xserver.enable = true;
| |
| </pre>
| |
| <pre>
| |
| # Enable the GNOME Desktop Environment.
| |
| services.xserver.displayManager.gdm.enable = true;
| |
| services.xserver.desktopManager.gnome.enable = true;
| |
| </pre>
| |
| <pre>
| |
| # Enable CUPS to print documents.
| |
| services.printing.enable = true;
| |
| </pre>
| |
| <pre>
| |
| # Enable sound with pipewire.
| |
| sound.enable = true;
| |
| hardware.pulseaudio.enable = false;
| |
| security.rtkit.enable = true;
| |
| services.pipewire = {
| |
| enable = true;
| |
| alsa.enable = true;
| |
| alsa.support32Bit = true;
| |
| pulse.enable = true;
| |
| };
| |
| </pre>
| |
| <pre>
| |
| # Enable automatic login for the user.
| |
| services.xserver.displayManager.autoLogin.enable = true;
| |
| services.xserver.displayManager.autoLogin.user = "k";
| |
| # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
| |
| systemd.services."getty@tty1".enable = false;
| |
| systemd.services."autovt@tty1".enable = false;
| |
| </pre>
| |
| <pre>
| |
| # Allow unfree packages
| |
| nixpkgs.config.allowUnfree = true;
| |
| environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = "1";
| |
| environment.enableAllTerminfo = true;
| |
| </pre>
| |
| <pre>
| |
| # List packages installed in system profile.
| |
| environment.systemPackages = with pkgs; [
| |
| ddate
| |
| ];
| |
| </pre>
| |
| <pre>
| |
| powerManagement.enable = true;
| |
| </pre>
| |
| <pre>
| |
| # Define a user account. Don't forget to set a password with ‘passwd’.
| |
| users.users."k" = {
| |
| isNormalUser = true;
| |
| description = "k-ot";
| |
| extraGroups = [ "wheel" "networkmanager" "dialout" ];
| |
| };
| |
| </pre>
| |
| <pre>
| |
| }
| |
| </pre>
| |
| <!--
| |
| <pre>
| |
| </pre>
| |
| <pre>
| |
| </pre>
| |
| <pre>
| |
| </pre>
| |
| <pre>
| |
| </pre>
| |
| <pre>
| |
| </pre>
| |
| <pre>
| |
| </pre>
| |
| -->
| |
|
| |
| ==== SnowflakeOS snowflake.nix ====
| |
|
| |
| : <code>less /etc/nixos/snowflake.nix</code>
| |
| <pre>
| |
| { config, pkgs, inputs, system, ... }:
| |
| {
| |
| environment.systemPackages = [
| |
| inputs.nix-software-center.packages.${system}.nix-software-center
| |
| inputs.nixos-conf-editor.packages.${system}.nixos-conf-editor
| |
| inputs.snow.packages.${system}.snow
| |
| pkgs.git # For rebuiling with github flakes
| |
| ];
| |
| programs.nix-data = {
| |
| systemconfig = "/etc/nixos/configuration.nix";
| |
| flake = "/etc/nixos/flake.nix";
| |
| flakearg = "snowflakeos";
| |
| };
| |
| snowflakeos.gnome.enable = true;
| |
| snowflakeos.osInfo.enable = true;
| |
| }
| |
| </pre>
| |
|
| |
| ==== SnowflakeOS flake.nix ====
| |
|
| |
| : <code>less /etc/nixos/flake.nix</code>
| |
| <pre>
| |
| {
| |
| inputs = {
| |
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
| |
| snowflake.url = "github:snowflakelinux/snowflake-modules";
| |
| nix-data.url = "github:snowflakelinux/nix-data";
| |
| nix-software-center.url = "github:vlinkz/nix-software-center";
| |
| nixos-conf-editor.url = "github:vlinkz/nixos-conf-editor";
| |
| snow.url = "github:snowflakelinux/snow";
| |
| };
| |
| outputs = { self, nixpkgs, ... }@inputs:
| |
| let
| |
| system = "x86_64-linux";
| |
| in
| |
| {
| |
| nixosConfigurations."snowflakeos" = nixpkgs.lib.nixosSystem {
| |
| inherit system;
| |
| modules = [
| |
| ./configuration.nix
| |
| ./snowflake.nix
| |
| inputs.snowflake.nixosModules.snowflake
| |
| inputs.nix-data.nixosModules.${system}.nix-data
| |
| ];
| |
| specialArgs = { inherit inputs; inherit system; };
| |
| };
| |
| };
| |
| }
| |
| </pre>
| |
|
| |
| == Umstellung auf [https://www.freedesktop.org/software/systemd/man/systemd.network.html systemd.network] ==
| |
|
| |
| <pre>
| |
| systemd.network.enable = true;
| |
| </pre>
| |
|
| |
| <pre>
| |
| networking.useNetworkd
| |
| </pre>
| |
|
| |
| (erst) ab 23.05 verfügbar
| |
| <pre>
| |
| systemd.network.wait-online.enable
| |
| </pre>
| |
|
| |
| == Infrastruktur für Gruppen ==
| |
|
| |
| * https://gitea.c3d2.de/c3d2/nix-config
| |
| * https://github.com/dd-ix/nix-config
| |
| * https://git.infra4future.de/hacc/haccfiles
| |
|
| |
| == flakeify asap ==
| |
|
| |
| https://nixos.asia/en/nixos-install-flake
| |
|
| |
| https://oblivious.observer/posts/nixos-configuration-using-flakes/
| |