From fd0b19afba4e675477d070398fb9c2f5a5f669e5 Mon Sep 17 00:00:00 2001 From: Nicole Dresselhaus Date: Tue, 10 Jun 2025 21:21:57 +0200 Subject: [PATCH] Fix: use nixpkgs.lib.nixosSystem; add minimal config --- configuration.nix | 27 ++++++++++++++++++++++++++- flake.nix | 19 ++++++++++++------- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/configuration.nix b/configuration.nix index fdffa2a..1eb986d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1 +1,26 @@ -# placeholder +{ config, pkgs, ... }: + +{ + imports = [ ./hardware ]; # bindet die auto-generierte HW-Datei ein + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nix-nas"; + + users.users.nicole = { + isNormalUser = true; + extraGroups = [ "wheel" "docker" "libvirtd" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAsiKDWCwyf1usprg3K6Zk0xE9S4DX6+Bc4+nIOZGmf drezil@Manticore" + ]; + }; + + services.openssh.enable = true; + services.zfs.autoScrub.enable = true; # Snapshots & Details kommen später + + # Wir pinnen den Kernel, bis ZFS 2.3.x für 6.13 bereit ist + boot.kernelPackages = pkgs.linuxPackages_6_12; + + environment.systemPackages = with pkgs; [ git vim ]; +} diff --git a/flake.nix b/flake.nix index b4e1dc1..acbac3b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,23 @@ { description = "NAS on NixOS – root on ZFS"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-25.05"; + inputs = { + # stabiler Release-Zweig + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + # optional: Hardware-Tuning (z. B. SSD-Defaults) + nixos-hardware.url = "github:NixOS/nixos-hardware"; + }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, nixos-hardware, ... }@inputs: let system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; in { - nixosConfigurations.host = pkgs.lib.nixosSystem { - inherit system; + nixosConfigurations.host = nixpkgs.lib.nixosSystem { + inherit system; # ← Pflichtfeld modules = [ - ./hardware - ./configuration + ./hardware # dein generiertes hardware-configuration.nix + ./configuration.nix # deine eigentliche Config + nixos-hardware.nixosModules.common-pc-ssd ]; }; };