diff --git a/flake.nix b/flake.nix index 56566e5..6088c89 100644 --- a/flake.nix +++ b/flake.nix @@ -4,8 +4,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixos-hardware.url = "github:NixOS/nixos-hardware"; #To Provide Framework13 hardware modules - + nixos-hardware.url = "github:NixOS/nixos-hardware"; #To Provide Framework13 hardware modules + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -14,19 +14,19 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; - + zen-browser.url = "github:0xc000022070/zen-browser-flake"; zen-browser.inputs.nixpkgs.follows = "nixpkgs"; #stylix.url = "github:nix-community/stylix/"; - stylix.url = "github:nix-community/stylix/master"; #Had to use branch or it would not build corrently + stylix.url = "github:nix-community/stylix/master"; #Had to use branch or it would not build corrently stylix.inputs.nixpkgs.follows = "nixpkgs"; - + quickshell = { url = "github:outfoxxed/quickshell"; inputs.nixpkgs.follows = "nixpkgs"; }; - + niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; @@ -43,28 +43,38 @@ }; nix-flatpak.url = "github:gmodena/nix-flatpak"; - + grub2-themes.url = "github:vinceliuice/grub2-themes"; }; - - outputs = inputs@{ nixpkgs, alejandra, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }: - let + + outputs = inputs @ { + nixpkgs, + alejandra, + home-manager, + plasma-manager, + nixos-hardware, + stylix, + niri, + zen-browser, + grub2-themes, + nix-flatpak, + ... + }: let username = "cookiez"; hostname = "nixos"; project = "NixOS"; - version = "26.05"; #DO NOT change to "unstable" as it is not a valid option for all cascading uses of this variable + version = "26.05"; #DO NOT change to "unstable" as it is not a valid option for all cascading uses of this variable system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs {inherit system;}; - framework13 = true; - in - { + framework13 = true; + in { formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; - + nixosConfigurations = { ${hostname} = nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { + specialArgs = { inherit inputs; inherit username; inherit version; @@ -73,11 +83,18 @@ inherit alejandra; host = hostname; }; - modules = [ - ./modules - #Conditional Modules! - ] ++ (if framework13 then [ nixos-hardware.nixosModules.framework-13-7040-amd ] else [ ]) ++ [ - ]; + modules = + [ + ./modules + #Conditional Modules! + ] + ++ ( + if framework13 + then [nixos-hardware.nixosModules.framework-13-7040-amd] + else [] + ) + ++ [ + ]; }; }; }; diff --git a/modules/boot-splash.nix b/modules/boot-splash.nix index b112014..cbc477b 100644 --- a/modules/boot-splash.nix +++ b/modules/boot-splash.nix @@ -1,22 +1,26 @@ -{ config, lib, pkgs, ... }: { + config, + lib, + pkgs, + ... +}: { boot = { - # silence first boot output - consoleLogLevel = 3; - initrd.verbose = false; - initrd.systemd.enable = true; - kernelParams = [ - "quiet" - "splash" - "intremap=on" - "boot.shell_on_fail" - "udev.log_priority=3" - "rd.systemd.show_status=auto" - ]; + # silence first boot output + consoleLogLevel = 3; + initrd.verbose = false; + initrd.systemd.enable = true; + kernelParams = [ + "quiet" + "splash" + "intremap=on" + "boot.shell_on_fail" + "udev.log_priority=3" + "rd.systemd.show_status=auto" + ]; - # plymouth, showing after LUKS unlock - plymouth.enable = true; - plymouth.font = "${pkgs.hack-font}/share/fonts/truetype/Hack-Regular.ttf"; - plymouth.logo = "${pkgs.nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png"; + # plymouth, showing after LUKS unlock + plymouth.enable = true; + plymouth.font = "${pkgs.hack-font}/share/fonts/truetype/Hack-Regular.ttf"; + plymouth.logo = "${pkgs.nixos-icons}/share/icons/hicolor/128x128/apps/nix-snowflake.png"; }; } diff --git a/modules/configuration.nix b/modules/configuration.nix index 7a38621..2bd06ba 100644 --- a/modules/configuration.nix +++ b/modules/configuration.nix @@ -3,17 +3,25 @@ #nmcli device wifi connect password # or if no password (open wifi) #nmcli device wifi connect - -{ inputs, config, pkgs, lib, username, project, host, version, system, ... }: { + inputs, + config, + pkgs, + lib, + username, + project, + host, + version, + system, + ... +}: { #Assign Swap to the PC #swapDevices = [{ # device = "/swapfile"; # size = 16 * 1024; # 16GB #}]; - imports = - [ + imports = [ inputs.home-manager.nixosModules.home-manager inputs.grub2-themes.nixosModules.default inputs.nix-flatpak.nixosModules.nix-flatpak @@ -28,10 +36,10 @@ # Bootloader. boot = { - kernelParams = [ "quiet" "splash" ]; + kernelParams = ["quiet" "splash"]; initrd = { verbose = false; - kernelModules = [ "amdgpu" ]; + kernelModules = ["amdgpu"]; }; loader = { systemd-boot.enable = false; @@ -40,7 +48,7 @@ grub = { enable = true; - device = "/dev/nvme0n1"; #Needs to be changed when using a new computer! (Make grub partition - look below!) + device = "/dev/nvme0n1"; #Needs to be changed when using a new computer! (Make grub partition - look below!) #devices = [ "nodev" ]; efiSupport = true; useOSProber = true; @@ -48,22 +56,21 @@ }; grub2-theme = { - enable = true; - theme = "whitesur"; - footer = true; + enable = true; + theme = "whitesur"; + footer = true; }; timeout = 10; }; }; - + #Ensure there is a grub_bios partition: (gparted) #Create a new parititon. File System: Unformatted - Size: ~5 Mib #Apply #Manage flags -> Add bios_grub networking = { - # Enable networking networkmanager.enable = true; @@ -90,9 +97,9 @@ useGlobalPkgs = true; useUserPackages = true; users.${username} = ./home.nix; - backupFileExtension = "backup"; # Automatically backs up conflicting files during activation - extraSpecialArgs = { inherit inputs username project version system host; }; - sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ]; + backupFileExtension = "backup"; # Automatically backs up conflicting files during activation + extraSpecialArgs = {inherit inputs username project version system host;}; + sharedModules = [inputs.plasma-manager.homeModules.plasma-manager]; }; # Set your time zone. @@ -112,7 +119,7 @@ LC_TELEPHONE = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8"; }; - + # List services that you want to enable: services = { ollama = { @@ -134,8 +141,8 @@ fprintd.enable = true; fprintd.tod.enable = true; fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix; - - fwupd.enable = true; #Allows BIOS updates + + fwupd.enable = true; #Allows BIOS updates locate = { enable = true; @@ -146,8 +153,8 @@ enable = true; useRoutingFeatures = "client"; extraSetFlags = [ - "--operator=${username}" - "--accept-routes" + "--operator=${username}" + "--accept-routes" ]; }; @@ -165,8 +172,8 @@ "10-bluez-monitor.properties" = { "bluez5.msbc-support" = false; "bluez5.hfphsp-support" = false; - "bluez5.hfphsp-backend" = "none"; # Key addition: no backend - "bluez5.roles" = [ "a2dp_sink" ]; + "bluez5.hfphsp-backend" = "none"; # Key addition: no backend + "bluez5.roles" = ["a2dp_sink"]; }; "11-bluetooth-policy" = { "wireplumber.settings" = { @@ -175,16 +182,16 @@ }; }; }; - + #Enable CUPS to print documents. printing.enable = true; - + # Enable the OpenSSH daemon. openssh.enable = true; }; systemd.services.fprintd = { - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig.Type = "simple"; }; @@ -201,11 +208,11 @@ fontconfig = { enable = true; - + defaultFonts = { - monospace = [ "JetBrainsMono Nerd Font" "MesloLGS NF" ]; - sansSerif = [ "Inter" "Noto Sans" ]; - serif = [ "Noto Serif" ]; + monospace = ["JetBrainsMono Nerd Font" "MesloLGS NF"]; + sansSerif = ["Inter" "Noto Sans"]; + serif = ["Noto Serif"]; }; }; }; @@ -267,7 +274,7 @@ users.users.${username} = { isNormalUser = true; description = "Cookiez"; - extraGroups = [ "networkmanager" "wheel" "docker" ]; + extraGroups = ["networkmanager" "wheel" "docker"]; packages = with pkgs; [ #User Packages Here ]; @@ -296,7 +303,7 @@ }; sessionVariables = { - NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) + NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) TERMINAL = "kitty"; }; }; @@ -306,20 +313,20 @@ sudo.wheelNeedsPassword = false; pam.services = { - sddm.fprintAuth = false; #Because of the bug with 30 seconds on sddm login - sddm-autologin.fprintAuth = false; #Same as above + sddm.fprintAuth = false; #Because of the bug with 30 seconds on sddm login + sddm-autologin.fprintAuth = false; #Same as above login.fprintAuth = false; - sudo.fprintAuth = false; #Disabled because of security risk: https://nvd.nist.gov/vuln/detail/cve-2024-37408 + sudo.fprintAuth = false; #Disabled because of security risk: https://nvd.nist.gov/vuln/detail/cve-2024-37408 kscreenlocker.fprintAuth = true; - polkit-1.fprintAuth = false; #Disabled because of security risk: https://nvd.nist.gov/vuln/detail/cve-2024-37408 + polkit-1.fprintAuth = false; #Disabled because of security risk: https://nvd.nist.gov/vuln/detail/cve-2024-37408 kde.fprintAuth = false; hyprlock = {}; }; }; #Allow Nix Commands - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - + nix.settings.experimental-features = ["nix-command" "flakes"]; + # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/modules/default.nix b/modules/default.nix index 1d92b9a..3fdb505 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{config, ...}: { imports = [ ./configuration.nix @@ -21,16 +20,16 @@ }; }; -# "minimal" = { -# inheritParentConfig = false; -# configuration = { -# imports = [ -# ./minimal.nix -# ]; -# -# environment.etc."nixos-tags".text = "minimal"; -# }; -# }; + # "minimal" = { + # inheritParentConfig = false; + # configuration = { + # imports = [ + # ./minimal.nix + # ]; + # + # environment.etc."nixos-tags".text = "minimal"; + # }; + # }; "niri" = { inheritParentConfig = false; @@ -43,6 +42,5 @@ environment.etc."nixos-tags".text = "niri"; }; }; - - }; + }; } diff --git a/modules/desktop-entries.nix b/modules/desktop-entries.nix index 574efeb..77758f2 100644 --- a/modules/desktop-entries.nix +++ b/modules/desktop-entries.nix @@ -1,5 +1,9 @@ -{ pkgs, username, project, ...}: { + pkgs, + username, + project, + ... +}: { xdg = { desktopEntries.youtube = { name = "YouTube"; @@ -7,16 +11,16 @@ terminal = false; type = "Application"; icon = "applications-multimedia"; - categories = [ "AudioVideo" "Player" "Network" ]; + categories = ["AudioVideo" "Player" "Network"]; }; desktopEntries."org.kde.konsole" = { name = "Konsole"; noDisplay = true; }; - + desktopEntries."discord" = { - categories = [ "Network" "InstantMessaging" "Chat" ]; + categories = ["Network" "InstantMessaging" "Chat"]; exec = "vesktop %U"; genericName = "Internet Messenger"; icon = "/home/${username}/${project}/other/discord.app.png"; @@ -26,7 +30,7 @@ desktopEntries."vesktop" = { noDisplay = true; - categories = [ "Network" "InstantMessaging" "Chat" ]; + categories = ["Network" "InstantMessaging" "Chat"]; exec = "vesktop %U"; genericName = "Internet Messenger"; name = "Vesktop"; @@ -39,7 +43,7 @@ comment = "Fast, feature-rich, GPU based terminal"; exec = "kitty"; terminal = false; - categories = [ "System" "TerminalEmulator" ]; + categories = ["System" "TerminalEmulator"]; icon = "/home/${username}/${project}/other/kitty.app.png"; }; @@ -107,6 +111,5 @@ name = "Discover"; noDisplay = true; }; - }; } diff --git a/modules/firefox-home.nix b/modules/firefox-home.nix index 55a979c..1d33c01 100644 --- a/modules/firefox-home.nix +++ b/modules/firefox-home.nix @@ -1,11 +1,10 @@ -{ username, ... }: -{ +{username, ...}: { programs.firefox = { enable = true; profiles = { "${username}" = { - extensions.force = true; - }; + extensions.force = true; + }; }; }; diff --git a/modules/firefox.nix b/modules/firefox.nix index b98a324..cf8b934 100644 --- a/modules/firefox.nix +++ b/modules/firefox.nix @@ -1,17 +1,17 @@ -{ config, pkgs, ... }: - - let - lock-false = { - Value = false; - Status = "locked"; - }; - lock-true = { - Value = true; - Status = "locked"; - }; - in - { + config, + pkgs, + ... +}: let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; +in { home-manager.sharedModules = [ ./firefox-home.nix ]; @@ -19,16 +19,18 @@ programs = { firefox = { enable = true; - languagePacks = [ "de" "en-US" ]; + languagePacks = ["de" "en-US"]; - /* ---- POLICIES ---- */ + /* + ---- POLICIES ---- + */ # Check about:policies#documentation for options. policies = { PasswordManagerEnabled = false; DisableTelemetry = true; DisableFirefoxStudies = true; EnableTrackingProtection = { - Value= true; + Value = true; Locked = true; Cryptomining = true; Fingerprinting = true; @@ -44,23 +46,23 @@ DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" SearchBar = "unified"; # alternative: "separate" - /* ---- EXTENSIONS ---- */ + /* + ---- EXTENSIONS ---- + */ # Check about:support for extension/add-on ID strings. # Valid strings for installation_mode are "allowed", "blocked", # "force_installed" and "normal_installed". # How to: https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265 - ExtensionSettings = - with builtins; - let - extension = shortId: uuid: { - name = uuid; - value = { - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; - installation_mode = "normal_installed"; - }; + ExtensionSettings = with builtins; let + extension = shortId: uuid: { + name = uuid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "normal_installed"; }; - in + }; + in listToAttrs [ (extension "ublock-origin" "uBlock0@raymondhill.net") (extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}") @@ -76,11 +78,16 @@ (extension "redditUntranslate" "reddit-url-redirector@kichkoupi.com") (extension "darkreader" "addon@darkreader.org") ]; - - /* ---- PREFERENCES ---- */ + + /* + ---- PREFERENCES ---- + */ # Check about:config for options. - Preferences = { - "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + Preferences = { + "browser.contentblocking.category" = { + Value = "strict"; + Status = "locked"; + }; "extensions.pocket.enabled" = lock-false; "extensions.screenshots.disabled" = lock-true; "browser.topsites.contile.enabled" = lock-false; diff --git a/modules/hardware-configuration.nix b/modules/hardware-configuration.nix index 989a9c6..0e16505 100644 --- a/modules/hardware-configuration.nix +++ b/modules/hardware-configuration.nix @@ -1,30 +1,34 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "uas" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "uas" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/af8fdb25-74d8-4b33-8413-bdcb66e0d22a"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/af8fdb25-74d8-4b33-8413-bdcb66e0d22a"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/58D5-0C06"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/58D5-0C06"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = [ ]; + swapDevices = []; # 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 diff --git a/modules/home.nix b/modules/home.nix index 80c9474..54e31f1 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,25 +1,37 @@ -{ lib, inputs, config, pkgs, username, project, host, version, ... }: { + lib, + inputs, + config, + pkgs, + username, + project, + host, + version, + ... +}: { # Home Manager needs a bit of information about you and the # paths it should manage. home.username = username; home.homeDirectory = "/home/${username}"; home.packages = [ - (import ./ncli.nix { inherit pkgs host project; backupFiles = [ - ".gtkrc-2.0.backup" - ".config/gtk-3.0/gtk.css.backup" - ".config/gtk-3.0/settings.ini.backup" - ".config/gtk-4.0/gtk.css.backup" - ".config/gtk-4.0/settings.ini.backup" - ".config/niri/config.kdl" - ]; }) + (import ./ncli.nix { + inherit pkgs host project; + backupFiles = [ + ".gtkrc-2.0.backup" + ".config/gtk-3.0/gtk.css.backup" + ".config/gtk-3.0/settings.ini.backup" + ".config/gtk-4.0/gtk.css.backup" + ".config/gtk-4.0/settings.ini.backup" + ".config/niri/config.kdl" + ]; + }) ]; imports = [ inputs.zen-browser.homeModules.beta # or inputs.zen-browser.homeModules.twilight # or inputs.zen-browser.homeModules.twilight-official - #./neovim-home.nix + #./neovim-home.nix ./desktop-entries.nix ]; @@ -35,9 +47,8 @@ # Let Home Manager install and manage itself. programs = { - home-manager = { enable = true; }; + home-manager = {enable = true;}; - zoxide = { enable = true; #enableZshIntegration = true; @@ -56,9 +67,8 @@ }; }; - - git = { - enable = true; + git = { + enable = true; settings = { user = { name = "Cookiez"; @@ -69,9 +79,9 @@ }; }; - zen-browser = { - enable = false; - #package = inputs.zen-browser.packages.${pkgs.system}.default; + zen-browser = { + enable = false; + #package = inputs.zen-browser.packages.${pkgs.system}.default; profiles = { ${username} = { id = 0; @@ -80,7 +90,6 @@ path = "${username}.default"; isDefault = true; settings = { - }; }; }; @@ -100,18 +109,16 @@ }; OfferToSaveLogins = false; DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" - - ExtensionSettings = - with builtins; - let - extension = shortId: uuid: { - name = uuid; - value = { - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; - installation_mode = "force_installed"; - }; + + ExtensionSettings = with builtins; let + extension = shortId: uuid: { + name = uuid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "force_installed"; }; - in + }; + in listToAttrs [ (extension "ublock-origin" "uBlock0@raymondhill.net") (extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}") @@ -132,11 +139,11 @@ # run `jq .browser_specific_settings.gecko.id manifest.json` or # `jq .applications.gecko.id manifest.json` to get the UUID Preferences = { - #"browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; - "browser.urlbar.showSearchSuggestionsFirst" = false; - "browser.sessionstore.resume_session_once" = false; + #"browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.sessionstore.resume_session_once" = false; }; }; - }; + }; }; #End of programs = {}; } diff --git a/modules/hyprlock/default.nix b/modules/hyprlock/default.nix index f939de5..0034537 100644 --- a/modules/hyprlock/default.nix +++ b/modules/hyprlock/default.nix @@ -1,14 +1,17 @@ -{ config, inputs, pkgs, ... }: { + config, + inputs, + pkgs, + ... +}: { imports = [ ]; home-manager.sharedModules = [ ./home.nix ]; - - environment.systemPackages = with pkgs; - [ + + environment.systemPackages = with pkgs; [ hyprlock ]; } diff --git a/modules/hyprlock/home.nix b/modules/hyprlock/home.nix index 22d5652..cd66b73 100644 --- a/modules/hyprlock/home.nix +++ b/modules/hyprlock/home.nix @@ -1,10 +1,13 @@ -{pkgs, inputs, username, ...}: { - + pkgs, + inputs, + username, + ... +}: { imports = [ ]; programs = { - hyprlock.enable = true; + hyprlock.enable = true; }; } diff --git a/modules/hyprpaper/default.nix b/modules/hyprpaper/default.nix index e938a11..03a5ddb 100644 --- a/modules/hyprpaper/default.nix +++ b/modules/hyprpaper/default.nix @@ -1,14 +1,17 @@ -{ config, inputs, pkgs, ... }: { + config, + inputs, + pkgs, + ... +}: { imports = [ ]; home-manager.sharedModules = [ ./home.nix ]; - - environment.systemPackages = with pkgs; - [ + + environment.systemPackages = with pkgs; [ hyprpaper ]; } diff --git a/modules/hyprpaper/home.nix b/modules/hyprpaper/home.nix index 337f6df..70bb58f 100644 --- a/modules/hyprpaper/home.nix +++ b/modules/hyprpaper/home.nix @@ -1,13 +1,17 @@ -{pkgs, inputs, username, project, ...}: { - + pkgs, + inputs, + username, + project, + ... +}: { imports = [ ]; services = { hyprpaper = { enable = false; - + settings = { preload = [ #"/home/${username}/${project}/other/wallpaper1.png" diff --git a/modules/minimal.nix b/modules/minimal.nix index 045276b..e4535e4 100644 --- a/modules/minimal.nix +++ b/modules/minimal.nix @@ -3,17 +3,21 @@ #nmcli device wifi connect password # or if no password (open wifi) #nmcli device wifi connect - -{ config, pkgs, lib, username, version, ... }: { - imports = - [ - ./hardware-configuration.nix - ./zsh.nix - #./ncli.nix - #./neovim.nix - ./packages.nix - ]; + config, + pkgs, + lib, + username, + version, + ... +}: { + imports = [ + ./hardware-configuration.nix + ./zsh.nix + #./ncli.nix + #./neovim.nix + ./packages.nix + ]; #networking.hostName = "nixos"; # Define your hostname. @@ -38,7 +42,7 @@ LC_TELEPHONE = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8"; }; - + services = { # Enable the OpenSSH daemon. openssh.enable = true; @@ -51,7 +55,7 @@ users.users.cookiez = { isNormalUser = true; description = "Cookiez"; - extraGroups = [ "networkmanager" "wheel" "docker" ]; + extraGroups = ["networkmanager" "wheel" "docker"]; packages = with pkgs; [ #User Packages Here ]; @@ -60,21 +64,21 @@ virtualisation.docker.enable = true; #So no user in the group Wheel has to input the password in order to use sudo - security.sudo.wheelNeedsPassword = false; + security.sudo.wheelNeedsPassword = false; #Allow Nix Commands - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - + nix.settings.experimental-features = ["nix-command" "flakes"]; + # Allow unfree packages nixpkgs.config.allowUnfree = true; - + environment.variables = { - EDITOR = "nvim"; - # XKB_DEFAULT_LAYOUT = "de"; + EDITOR = "nvim"; + # XKB_DEFAULT_LAYOUT = "de"; }; environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) + NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) TERMINAL = "kitty"; }; diff --git a/modules/ncli.nix b/modules/ncli.nix index 0c08a6b..e7a84b1 100644 --- a/modules/ncli.nix +++ b/modules/ncli.nix @@ -1,7 +1,7 @@ { pkgs, host, - backupFiles ? [ ".config/mimeapps.list.backup" ], + backupFiles ? [".config/mimeapps.list.backup"], project, ... }: let @@ -146,7 +146,7 @@ in else echo "No specialization tag found, staying on default system." fi - + genn=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}') echo -e "Running on new generation: $YELLOW $geno $NOCOLOR-> $GREEN$genn$NOCOLOR" @@ -261,6 +261,9 @@ in cd "$HOME/$PROJECT" || { echo "Error: Could not change to $HOME/$PROJECT"; exit 1; } git status ;; + format) + nix fmt . + ;; trim) echo "Running 'sudo fstrim -v /' may take a few minutes and impact system performance." read -p "Enter to run now or enter to exit (y/N): " -n 1 -r diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 08740a6..622584e 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -1,20 +1,23 @@ -{ inputs, config, lib, pkgs, ... }: { - environment.systemPackages = with pkgs; - [ - neovim - vimPlugins.LazyVim - vimPlugins.lazygit-nvim - wl-clipboard - xclip + inputs, + config, + lib, + pkgs, + ... +}: { + environment.systemPackages = with pkgs; [ + neovim + vimPlugins.LazyVim + vimPlugins.lazygit-nvim + wl-clipboard + xclip ]; home-manager.sharedModules = [ ./home.nix ]; - -# programs.neovim = { -# enable = true; -#}; + # programs.neovim = { + # enable = true; + #}; } diff --git a/modules/neovim/home.nix b/modules/neovim/home.nix index db7d593..06f4483 100644 --- a/modules/neovim/home.nix +++ b/modules/neovim/home.nix @@ -1,34 +1,39 @@ -{ inputs, config, lib, pkgs, ... }: { + inputs, + config, + lib, + pkgs, + ... +}: { imports = [ inputs.nixvim.homeModules.nixvim ]; programs.nixvim = { enable = true; - + waylandSupport = true; - + # Basic options opts = { - autoindent = true; + autoindent = true; clipboard = "unnamedplus"; shiftwidth = 2; mousescroll = "ver:0,hor:0"; - - expandtab = true; # Always insert spaces, never hard tab characters - tabstop = 2; # Make hard tabs display as 2 columns (matches shiftwidth) - softtabstop = 2; # Backspace deletes 2 spaces at a time + + expandtab = true; # Always insert spaces, never hard tab characters + tabstop = 2; # Make hard tabs display as 2 columns (matches shiftwidth) + softtabstop = 2; # Backspace deletes 2 spaces at a time number = true; relativenumber = true; - cursorline = true; # Highlights the entire current line - cursorlineopt = "both"; # Highlights both the line AND the line number + cursorline = true; # Highlights the entire current line + cursorlineopt = "both"; # Highlights both the line AND the line number termguicolors = true; }; - + colorschemes.catppuccin = { enable = true; settings = { @@ -36,29 +41,29 @@ term_colors = true; styles = { - booleans = [ "bold" "italic" ]; - conditionals = [ "bold" ]; - functions = [ "bold" ]; - keywords = [ "italic" ]; + booleans = ["bold" "italic"]; + conditionals = ["bold"]; + functions = ["bold"]; + keywords = ["italic"]; }; }; }; - - keymaps = [ - { - mode = "v"; - key = ">"; - action = ">gv"; - options.desc = "Indent and keep selection"; - } - { - mode = "v"; - key = "<"; - action = "