From 745f5733e15a1864d9613a3d9c8a04b11ef5dd39 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 13 Apr 2026 15:55:19 +0200 Subject: [PATCH] Initialer Commit meiner lokalen Dateien --- configuration.nix | 223 ++++++++++++++++++++++++++++++++++++ flake.lock | 48 ++++++++ flake.nix | 28 +++++ gnome.nix | 35 ++++++ hardware-configuration.nix | 43 +++++++ home.nix | 160 ++++++++++++++++++++++++++ modules/shell/alacritty.nix | 32 ++++++ system/default.nix | 4 + 8 files changed, 573 insertions(+) create mode 100755 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100755 gnome.nix create mode 100644 hardware-configuration.nix create mode 100755 home.nix create mode 100644 modules/shell/alacritty.nix create mode 100644 system/default.nix diff --git a/configuration.nix b/configuration.nix new file mode 100755 index 0000000..6840e3b --- /dev/null +++ b/configuration.nix @@ -0,0 +1,223 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ./gnome.nix +# ./plasma.nix +# ./hyprland.nix + ]; + +# Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.enable = true; + + # LUKS Partition + boot.initrd.luks.devices = { + dukebook0 = { + device = "/dev/disk/by-uuid/92d94913-aad0-4a76-9466-c77e481693ba"; + preLVM = true; + }; + }; + + # LVM Volume Mounts + fileSystems."/home/martin/Nextcloud" = { + device = "dev/disk/by-uuid/5142d945-7948-4bc9-85ca-7f6dc760d17a"; + fsType = "ext4"; + }; + + networking.hostName = "dukebook"; # Define your hostname. + # Pick only one of the below networking options. + networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + #networking.wireless.iwd.enable = true; + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + i18n.defaultLocale = "de_DE.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "de"; + # useXkbConfig = true; # use xkb.options in tty. + }; + + # Enable Gnome3 Keyring + # services.gnome.gnome-keyring.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + # Enable sound. + # sound.enable = true; + services.pulseaudio.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + users.groups.martin.gid = 1001; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.martin = { + isNormalUser = true; + group = "martin"; + extraGroups = [ "libvirtd" "networkmanager" "wheel" ]; # Enable ‘sudo’ for the user. + uid = 1001; + packages = with pkgs; []; +}; + +# users.extraUsers.martin = { +# openssh.authorizedKeys.keys = [ +# " + + # Flatpaks + services.flatpak.enable = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + firefox + tree + nextcloud-client + keepassxc + fastfetch + wget + git + kitty + font-awesome + symbola + noto-fonts-color-emoji + material-icons + system-config-printer + ubuntu-classic + cascadia-code + virt-manager + starship + pfetch + neovim + gnome-software + ]; + + + programs.neovim = { + enable = true; + configure = { + customRC = '' + set number + set cc=80 + set list + set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:» + if &diff + colorscheme blue + endif + ''; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ ctrlp-vim ]; + }; + }; + }; + programs.neovim = { + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; + + # Virtualisation + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + + #fonts.packages = with pkgs; [ + # (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + #]; + + nix = { + settings.auto-optimise-store = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; + + nix.settings.experimental-features = [ + "nix-command" "flakes" + ]; + # Automatic Updates + #system.autoUpgrade = { + # enable = true; + # channel = "https://nixos.org/channels/nixos-24.11"; + #}; + + nixpkgs.config.allowUnfree = 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; + # }; + + + # nix.nixPath = [ "nixpkgs=/home/martin/Nextcloud/IT/mydotfiles/nixos" ]; + + # Enable Gnome dash-to-dock + nixpkgs.config.firefox.enableGnomeExtensions = true; +# services.gnome.chrome-gnome-shell.enable = true; + services.gnome.gnome-browser-connector.enable = 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; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.11"; # Did you read the comment? + +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9bad741 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775143651, + "narHash": "sha256-S0RqAyDPMTcv9vASMaE8eY1QexFysAOdnxUxFHIPOyE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d166a078541982a76f14d3e06e9665fa5c9ed85e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1775036866, + "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6201e203d09599479a3b3450ed24fa81537ebc4e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bcb1c20 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +# ~/nixos-config/flake.nix +{ + description = "Mein NixOS Konfiguration Flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, ... }: { + nixosConfigurations = { + dukebook = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.martin = import ./home.nix; + } + ]; + }; + }; + }; +} diff --git a/gnome.nix b/gnome.nix new file mode 100755 index 0000000..3a5dd14 --- /dev/null +++ b/gnome.nix @@ -0,0 +1,35 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ]; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb.layout = "de"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable gnome-settings-daemon udev rules + services.udev.packages = with pkgs; [ + gnome-settings-daemon + ]; + + environment.systemPackages = with pkgs; [ + gnome-tweaks + gnomeExtensions.appindicator + gnomeExtensions.dash-to-dock + ]; + +} + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..8c5df9f --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,43 @@ +# 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" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/dukebook0-root"; + fsType = "ext4"; + }; + + fileSystems."/home" = + { device = "/dev/mapper/dukebook0-home"; + fsType = "ext4"; + }; + + fileSystems."/var" = + { device = "/dev/mapper/dukebook0-var"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7A7F-078B"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/mapper/dukebook0-swap"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix new file mode 100755 index 0000000..ae5ad3d --- /dev/null +++ b/home.nix @@ -0,0 +1,160 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./modules/shell/alacritty.nix + ./system/default.nix + ]; + + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "martin"; + home.homeDirectory = "/home/martin"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "25.11"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + +# home.file.".alias" = { +# source = /home/martin/Nextcloud/IT/mydotfiles/.alias; +# recursive = true; +# }; + + # home.file.".bashrc" = { + # source = /home/martin/Nextcloud/IT/mydotfiles/.bashrc; + # recursive = true; + # }; + + #home.file.".config/kitty" = { + # source = /home/martin/Nextcloud/IT/mydotfiles/kitty; + # recursive = true; + #}; + + #home.file.".thunderbird" = { + # source = /home/martin/Nextcloud/IT/mydotfiles/.thunderbird; + # recursive = true; + #}; + +# home.file.".config/neofetch/config.conf" = { +# source = /home/martin/Nextcloud/IT/mydotfiles/neofetch/config.conf; +# recursive = true; +# }; + + #home.file.".config/hypr" = { + # source = /home/martin/Nextcloud/IT/mydotfiles/hypr; + # recursive = true; + #}; + + #home.file.".purple" = { + # source = /home/martin/Nextcloud/IT/mydotfiles/pidgin/.purple; + # recursive = true; + #}; + + home.packages = with pkgs; [ + htop + noto-fonts + fira-code + nerd-fonts.fira-code +# pkgs.pidgin + # pkgs.gnomeExtensions.user-themes + # pkgs.gnomeExtensions.tray-icons-reloaded + # pkgs.gnomeExtensions.vitals + # pkgs.gnomeExtensions.dash-to-panel + # pkgs.gnomeExtensions.sound-output-device-chooser + # pkgs.gnomeExtensions.space-bar + unzip + zip + # yazi + pkgs.p7zip + inetutils + signal-desktop + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + gtk = { + enable = true; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + + theme = { + name = "palenight"; + package = pkgs.palenight-theme; + }; + + cursorTheme = { + name = "Numix-Cursor"; + package = pkgs.numix-cursor-theme; + }; + + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + }; + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/martin/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + # EDITOR = "emacs"; + GTK_THEME = "palenight"; + }; + + # Let Home Manager install and manage itself. + fonts.fontconfig.enable = true; + programs.home-manager.enable = true; +} diff --git a/modules/shell/alacritty.nix b/modules/shell/alacritty.nix new file mode 100644 index 0000000..8dfc9e4 --- /dev/null +++ b/modules/shell/alacritty.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: + +{ + programs.alacritty = { + enable = true; + # Custom settings + settings = { + window = { + padding = { + x = 10; + y = 10; + }; + opacity = 0.9; + }; + font = { + size = 12.0; + normal = { + #family = "JetBrainsMono Nerd Font"; + family = "FiraCode"; + style = "Regular"; + }; + }; + colors = { + # You can define themes here or import them + primary = { + background = "#1a1b26"; + foreground = "#a9b1d6"; + }; + }; + }; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..883d160 --- /dev/null +++ b/system/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: + +{ + }