From 42dc737dc38d987e2ac47b707beb1571d59e7c89 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 25 Jul 2026 22:56:20 +0200 Subject: [PATCH] init --- flake.lock | 86 +++++++++++++++++ flake.nix | 40 ++++++++ modules/configuration.nix | 148 +++++++++++++++++++++++++++++ modules/hardware-configuration.nix | 26 +++++ modules/home.nix | 31 ++++++ 5 files changed, 331 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 modules/configuration.nix create mode 100644 modules/hardware-configuration.nix create mode 100644 modules/home.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..516da5e --- /dev/null +++ b/flake.lock @@ -0,0 +1,86 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1784913159, + "narHash": "sha256-JWq0BfjO4ktpH5USfQNQzdvHpIDT8fSKD5K7LvdMRFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "079a3b5d1aa6a719920a51316253b7d6dd22738d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "lazyvim": { + "flake": false, + "locked": { + "lastModified": 1733936199, + "narHash": "sha256-QrpnlDD4r1X4C8PqBhQ+S3ar5C+qDrU1Jm/lPqyMIFM=", + "owner": "LazyVim", + "repo": "starter", + "rev": "803bc181d7c0d6d5eeba9274d9be49b287294d99", + "type": "github" + }, + "original": { + "owner": "LazyVim", + "repo": "starter", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1784796856, + "narHash": "sha256-wWFrV5/Qbm+lyt5x20E/bSbfJiGKMo4RCxZV8cl/WZI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e2587caef70cea85dd97d7daab492899902dbf5d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "noctalia": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1784987374, + "narHash": "sha256-RfO7GURPZZr30LSRrNJAr7ruyLK11rHnWMntENSKT34=", + "owner": "noctalia-dev", + "repo": "noctalia", + "rev": "9de30388c0df8bc1e8db7405331a3598fc3a8015", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "lazyvim": "lazyvim", + "nixpkgs": "nixpkgs", + "noctalia": "noctalia" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cf3d7aa --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "Noctalica test"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + noctalia = { + url = "github:noctalia-dev/noctalia"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + lazyvim = { + url = "github:LazyVim/starter"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, noctalia, home-manager, lazyvim, ...}@inputs: { + nixosConfigurations.vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + modules = [ + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.extraSpecialArgs = { + inherit inputs; + }; + + home-manager.users.peter = import ./modules/home.nix; + } + ./modules/configuration.nix + + ]; + }; + }; +} diff --git a/modules/configuration.nix b/modules/configuration.nix new file mode 100644 index 0000000..0fe77c4 --- /dev/null +++ b/modules/configuration.nix @@ -0,0 +1,148 @@ +# 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, home-manager, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.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.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "de_DE.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."peter" = { + isNormalUser = true; + description = "peter"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + programs.niri.enable = true; + + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${config.programs.niri.package}/bin/niri-session"; + user = "peter"; + }; + }; + }; + + fonts.fontconfig.enable = true; + + fonts.packages = with pkgs; [ + nerd-fonts.fira-code + nerd-fonts.caskaydia-mono + ]; + + xdg.portal.enable = true; + + home-manager.users.peter = { pkgs, ... }: { + home.packages = [ pkgs.atool pkgs.httpie ]; + programs.bash.enable = true; + + programs.alacritty.enable = true; # Super+T in the default setting (terminal) + programs.fuzzel.enable = true; # Super+D in the default setting (app launcher) + programs.swaylock.enable = true; # Super+Alt+L in the default setting (screen locker) + programs.waybar.enable = true; # launch on startup in the default setting (bar) + + services.mako.enable = true; # notification daemon + services.swayidle.enable = true; # idle management daemon + services.polkit-gnome.enable = true; # polkit + + home.stateVersion = "26.05"; # Please read the comment before changing. + +}; + + systemd.user.services.niri.enableDefaultPath = false; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # 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 + neovim + xwayland-satellite + git + ]; + programs.xwayland.enable = true; + + # 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; + + # 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 = "26.05"; # Did you read the comment? + + nix.settings.experimental-features = [ "nix-command" "flakes"]; +} diff --git a/modules/hardware-configuration.nix b/modules/hardware-configuration.nix new file mode 100644 index 0000000..46d205f --- /dev/null +++ b/modules/hardware-configuration.nix @@ -0,0 +1,26 @@ +# 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-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/7885bde4-b0b0-4e96-a18a-58ef505e5ed4"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + services.xserver.videoDrivers = [ "modesetting" ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/modules/home.nix b/modules/home.nix new file mode 100644 index 0000000..a2c3ebd --- /dev/null +++ b/modules/home.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lazyvim, lib, inputs, ... }: +let + lazyvim-config = pkgs.runCommand "lazyvim-config" {} '' + cp -r ${inputs.lazyvim} $out + rm -rf $out/.git + ''; +in { + + # Dein Benutzername und Home‑Verzeichnis + home.username = "peter"; + home.homeDirectory = "/home/peter"; + + # Pakete, die nur für diesen Benutzer installiert werden + home.packages = with pkgs; [ + ]; + + # Beispiel: Git‑Konfiguration + programs.git.settings.user = { + enable = true; + userName = "peter"; + userEmail = "peter@email"; + }; + + home.file.".config/nvim" = { + source = lazyvim-config; + recursive = true; + }; + + # Wichtig: State‑Version (an deine NixOS‑Version anpassen) + # home.stateVersion = "23.11"; +}